The gadolinium post showed why Ouro DFT (ABACUS) returned wrong moments for every lanthanide, and how we built a matched basis for Gd. This post covers neodymium and samarium, the two rare earths that permanent magnets actually depend on. The bases were the easy part. The hard part is that Nd and Sm have a partly filled 4f shell, and density functional theory has trouble with that.
Both use the recipe that worked for Gd: fit ABACUS-CSW-NAO orbitals to dimer and monomer reference calculations with the same 4f-in-valence pseudopotential, at 150 Ry, keeping the 4s3p3d3f level. Each was then checked against plane waves, which don't depend on any orbital basis, on a 2-atom hcp cell at the metal's experimental atomic volume:
Plane waves | Shipped 4s3p3d3f | Moment error | |
|---|---|---|---|
Sm: V₀ / B₀ | 39.72 ų / 15.7 GPa | 39.50 ų (−0.5%) / 16.5 GPa (+5%) | ≤ 0.014 μB at every volume |
Nd: V₀ / B₀ | 32.04 ų / 18.4 GPa |
Sm is the cleanest of the three elements: the new basis traces the plane-wave energy curve across the whole range, and the offset between them drifts only 8 meV/atom.
Nd comes with a caveat that turns out to be the theme of this post. The two curves agree around the minimum. At expanded volumes, though, plane waves and orbitals land in different 4f³ solutions that are close in energy, and both methods hop between them. The basis jumps to a higher solution at 40.8 and 44.3 ų, and plane waves do the same at 48.1 ų. So the Nd numbers above use the volumes where both land in the same state.
Separately, plain PBE puts Sm's volume about 20% above experiment in both methods. That's the physics of treating 4f as band electrons, not a basis error. Nd and Sm are now accepted by the service. Other lanthanides are still refused until each has its own validated basis.
For a light rare earth like Sm, Hund's third rule says the 4f spin points against the transition-metal spin. The larger orbital moment then lines up with Co. So a collinear calculation should prefer Sm's spin antiparallel to Co.
The first try at default settings (mixing 0.2, smearing 0.05 eV) converged only for the parallel arrangement. The antiparallel run never converged: its moment wandered between 4.8 and 8.3 μB, and its energy sat 5 eV high (run). With gentler mixing (0.1) and wider smearing (0.1 eV), both converged:
SmCo₅, PBE, 150 Ry |
|---|
The antiparallel state is the ground state, as Hund's rules predict. It also restores the crystal symmetry that the metastable parallel state broke. The 1.90 μB net is spin-only. Sm's orbital moment is about 5 μB and points against its spin, which puts it with Co. It needs spin–orbit coupling to appear, and adding it should bring the total toward the measured ~8 μB/f.u.
What changed in the service: open-4f-shell lanthanides (every one except La, Gd and Lu) now default to mixing 0.1, smearing 0.1 eV and at least 500 iterations, unless you set them yourself. Magnetic-moment files are now named after the order the calculation actually converged to, for example SmCo5 FiM magnetic moments, rather than SmCo5 magnetic moments 2.
The anisotropy of Nd and Sm magnets comes from the 4f orbital state. Calculating it properly needs DFT+U: an extra energy term that splits the 4f shell into distinct filled and empty levels, as in the real ion. On SmCo₅, +U at U = 6 eV didn't converge in either spin arrangement (example).
The standard fix is occupation-matrix control (ABACUS omc). An open 4f shell has many ways to arrange its electrons, and many of them are local minima. omc lets you seed a specific arrangement, hold it while the rest of the calculation settles, then release it. We checked the file format against the ABACUS source and tested it:
Gd works. GdCo₅ with Gd's half-filled 4f⁷ seeded converged in 27 iterations to the correct ferrimagnet.
The seed is read exactly for Sm too. Step 1 prints the 5 seeded f electrons, and the real occupation follows them for four steps.
Then Sm's 4f charge sloshes. At step 5 the whole 4f level drops more than 3 eV and fills the orbitals held empty. From then on the shell swings between empty and full. The 4f level sits near the Fermi level and moves strongly with its own occupation, and holding the +U term fixed doesn't hold that electrostatics. Gentler mixing (0.03) and starting from the converged PBE density both failed.
Mixing the density matrix (mixing_dmr) is required, and so is the seed. Without a seed, a run with mixing_dmr wandered off and flipped Sm's spin. With both, 2 of 6 runs converged, to antiparallel states with symmetric Co moments. Those two states differ by 1.1 eV depending on the seed.
Two of six isn't a default we can ship. So +U on an open 4f shell now returns a lanthanide_note telling you it's experimental, and damped plain PBE is the validated path. The omc tool and its record of findings are in omc_probe.py in the ouro-dft repo. Also note that collinear occupation matrices are real numbers, so they can't carry a 4f orbital moment. A true Hund's-rule seed needs spin–orbit coupling, and that's where the anisotropy work picks this up.
Supported: Gd, Nd and Sm, with matched 4f-in-valence bases validated against plane waves, run at 150 Ry by default. Open-shell cells are damped automatically.
Reliable: spin moments and spin ordering. GdCo₅ and SmCo₅ both come out ferrimagnetic, with the rare-earth spin against Co, as observed.
Not yet: 4f orbital moments and 4f anisotropy. These need spin–orbit coupling plus a DFT+U recipe that converges on open shells. The +U and MAE work is building on this.
Generating the Nd and Sm bases ran 12 reference calculations at once on 64-core containers. Along the way we hit preemptions, a Modal workspace that was disabled mid-run, and a local client crash that cancelled a detached job. The fixes:
Orchestration now runs inside Modal, not on a laptop.
Every stage resumes from checkpoints on a persistent volume, and only reuses finished work if it actually converged.
Results are written to the volume, so nothing depends on the machine that launched them.
Generating a new element's basis now takes about 1.5 hours end to end, with no babysitting.
32.38 ų (+1.1%) / 18.3 GPa (−0.5%) |
≤ 0.011 μB |
E(V), moment and Mulliken 4f occupation on 2-atom hcp models of Nd and Sm at 150 Ry, plane waves against the shipped CSW-NAO 4s3p3d3f bases, all with the jingslaw PseudoDojo FR pseudopotentials (4f in valence), PBE, collinear FM. The Sm plane-wave point at 1.09 failed and is omitted. For Nd, PW and LCAO land in different near-degenerate 4f^3 states at 1.06-1.09; compare 0.94-1.03.
E(V), moment and Mulliken 4f occupation on 2-atom hcp models of Nd and Sm at 150 Ry, plane waves against the shipped CSW-NAO 4s3p3d3f bases, all with the jingslaw PseudoDojo FR pseudopotentials (4f in valence), PBE, collinear FM. The Sm plane-wave point at 1.09 failed and is omitted. For Nd, PW and LCAO land in different near-degenerate 4f^3 states at 1.06-1.09; compare 0.94-1.03.
Energy | −24108.310 eV | −24109.023 eV (0.71 eV/f.u. lower) |
Sm spin (4f) | +4.84 (+5.28) μB | −6.37 (−5.62) μB |
Co moments | 1.43–1.78 μB, lopsided | 1.665 × 2, 1.648 × 3: the correct 2c/3g pattern |
Net spin moment | 13.06 μB/f.u. | 1.90 μB/f.u. |
Neodymium and samarium now have validated 4f-in-valence bases on Ouro DFT. SmCo₅ converges to the Hund's-rule state, with Sm spin against Co and 0.71 eV/f.u. lower, once the SCF is damped. DFT+U on an open 4f shell still wanders between states; this post covers what occupation-matrix control fixed and what it didn't.