A solid-state “atomic channel” for separating rare earth elements