Chapter 5
18 min read
Section 46 of 70

Magnetic Ordering and Spin

Electronic Structure and Properties

Learning Objectives

Magnetism is the place where the abstract ideas of Chapter 4 (Pauli exclusion, exchange–correlation) finally show up as a number you can measure with a SQUID. By the end of this section you should be able to:

  1. Explain in one sentence why magnetism is fundamentally quantum-mechanical — and why the Bohr–van Leeuwen theorem says no classical solid can be magnetic.
  2. Translate between three vocabularies that describe the same physics: atomic spin Si\mathbf{S}_i, magnetic moment mi=gμBSi/\mathbf{m}_i = -g\mu_B\,\mathbf{S}_i/\hbar, and the spin density m(r)=n(r)n(r)m(\mathbf{r}) = n_{\uparrow}(\mathbf{r}) - n_{\downarrow}(\mathbf{r}).
  3. Recognise the four canonical magnetic orderings — paramagnetic, ferromagnetic (FM), antiferromagnetic (AFM), and ferrimagnetic (FiM) — by inspection of a unit cell, and predict which one a Heisenberg Hamiltonian H^=ijJijSi ⁣ ⁣Sj\hat{H} = -\sum_{\langle ij\rangle} J_{ij}\,\mathbf{S}_i\!\cdot\!\mathbf{S}_j will favour from the sign of JijJ_{ij}.
  4. Read a spin-polarised band structure or DOS plot fluently: identify the exchange splitting Δex\Delta_{\text{ex}}, compute the net moment as μ=EF ⁣[n(E)n(E)]dE\mu = \int_{-\infty}^{E_F}\!\bigl[n_{\uparrow}(E) - n_{\downarrow}(E)\bigr]\,dE, and apply the Stoner criterion Ig(EF)>1I\,g(E_F) > 1 to predict ferromagnetism in a metal.
  5. Set up a spin-polarised VASP calculation correctly: the meaning of ISPIN, MAGMOM, NUPDOWN, LORBIT, and LMAXMIX; and how to seed an AFM unit cell so the SCF does not collapse to FM.
One-line preview: a magnetic crystal is what happens when the Pauli exclusion principle, the Coulomb interaction, and the translation symmetry of a lattice conspire to make it cheaper for some electrons to align their spins than to antialign them. Everything else — Heisenberg JJ, exchange splitting, Stoner enhancement, MAGMOM in VASP — is bookkeeping on top of that one idea.

Where Magnetism Comes From

It is worth pausing on a deep and counterintuitive fact: classical physics has no room for permanent magnetism in a solid. The Bohr–van Leeuwen theorem (1911, 1921) shows that any ensemble of classical charged particles in thermal equilibrium has zero average magnetic moment, no matter what magnetic field you apply. Lorentz forces do no work, the partition function is independent of the vector potential, and the magnetic susceptibility is identically zero. Yet a refrigerator magnet sticks. Where does the moment come from?

It comes from quantum mechanics, in two distinct steps. First, every electron carries an intrinsic magnetic moment μe=gsμBS/\boldsymbol{\mu}_e = -g_s\,\mu_B\,\mathbf{S}/\hbar with gs2.0023g_s \approx 2.0023 and μB=e/(2me)9.27×1024J/T\mu_B = e\hbar/(2 m_e) \approx 9.27\times10^{-24}\,\text{J/T}. That is a relativistic effect; it does not exist in the classical world. Second, when you put many electrons into the same crystal, the Pauli exclusion principle forbids two of them from occupying the same spatial orbital with the same spin. This forces the wavefunction to be antisymmetric, which in turn lowers the Coulomb repulsion between same-spin electrons (they cannot get close to each other). Aligning spins becomes energetically favourable — even though the magnetic dipole–dipole interaction is far too weak to do that on its own.

The energy scales tell the story

Magnetic dipole–dipole interaction between two electrons one ångström apart: Eddμ0μB2/(4πa3)5×105eVE_{\text{dd}} \sim \mu_0 \mu_B^2 / (4\pi a^3) \approx 5\times 10^{-5}\,\text{eV} (sub-Kelvin). Coulomb repulsion between those same electrons: ECe2/(4πε0a)14eVE_C \sim e^2/(4\pi\varepsilon_0 a) \approx 14\,\text{eV}. The exchange interaction — the part of ECE_C that depends on whether the spins are parallel or antiparallel — is typically 10210^{-2}10010^{0} eV, giving Curie temperatures of 100–1000 K. Magnetism is Coulomb physics in disguise, brokered by Pauli.

This is why the Heisenberg Hamiltonian we will write down in a moment looks like a spin-spin interaction even though there is no such fundamental force. The JSi ⁣ ⁣SjJ\,\mathbf{S}_i\!\cdot\!\mathbf{S}_j term is an effective description of the spin-dependent part of the Coulomb energy, integrated out from the underlying many-electron wavefunction. The number JJ is what survives.


Spin as a Second Quantum Label

Section 5.1 introduced the band index nn and the Brillouin-zone wavevector k\mathbf{k} as the two labels of a Bloch state. There is a third label, hidden in plain sight: spin. A complete Bloch state is n,k,σ|n,\mathbf{k},\sigma\rangle with σ{,}\sigma \in \{\uparrow, \downarrow\}. Inside a non-magnetic, non-relativistic crystal the two spin channels are degenerate by time-reversal symmetry — every band carries two electrons, one up and one down, and we can ignore the label. The moment we break that degeneracy, by either spontaneous magnetism or an external field, the third label comes alive.

For collinear magnetism (every spin pointing along a single global axis, conventionally z^\hat{z}) the bookkeeping simplifies dramatically: the Hamiltonian decomposes into two independent blocks, one for each spin channel, and we have two Kohn–Sham equations instead of one,

[22m2+vσKS(r)]ψn,k,σ(r)  =  εn,k,σψn,k,σ(r)\Bigl[-\tfrac{\hbar^2}{2m}\nabla^2 + v_{\sigma}^{\text{KS}}(\mathbf{r})\Bigr] \,\psi_{n,\mathbf{k},\sigma}(\mathbf{r}) \;=\; \varepsilon_{n,\mathbf{k},\sigma}\,\psi_{n,\mathbf{k},\sigma}(\mathbf{r})

with two distinct effective potentials vKSv_{\uparrow}^{\text{KS}} and vKSv_{\downarrow}^{\text{KS}}. The whole magnetic story is contained in the fact that, in a magnetic ground state, those two potentials are not equal. They differ by precisely the exchange–correlation field Bxc(r)B_{\text{xc}}(\mathbf{r}):

vKSvKS  =  2μBBxc(r)  =  δExc[n,n]δn(r)δExc[n,n]δn(r)v_{\uparrow}^{\text{KS}} - v_{\downarrow}^{\text{KS}} \;=\; -2\,\mu_B\,B_{\text{xc}}(\mathbf{r}) \;=\; \frac{\delta E_{\text{xc}}[n_{\uparrow},n_{\downarrow}]}{\delta n_{\uparrow}(\mathbf{r})} - \frac{\delta E_{\text{xc}}[n_{\uparrow},n_{\downarrow}]}{\delta n_{\downarrow}(\mathbf{r})}

That is the entire content of spin-density-functional theory: promote the density n(r)n(\mathbf{r}) to a pair (n(r),n(r))(n_{\uparrow}(\mathbf{r}), n_{\downarrow}(\mathbf{r})), let the exchange–correlation functional depend on both, and you automatically get spin-split Kohn–Sham potentials. The local magnetisation is then the difference,

m(r)  =  n(r)n(r)m(\mathbf{r}) \;=\; n_{\uparrow}(\mathbf{r}) - n_{\downarrow}(\mathbf{r})

and the total moment per unit cell is the integral

μcell  =  μB ⁣Ω ⁣m(r)d3r  =  μB(NN)\mu_{\text{cell}} \;=\; \mu_B\!\int_{\Omega}\! m(\mathbf{r})\,d^3r \;=\; \mu_B\,(N_{\uparrow} - N_{\downarrow})

where NσN_{\sigma} is the total number of electrons in spin channel σ\sigma per unit cell. The headline number a VASP calculation prints — "total moment = 2.20 μ_B/cell" — is exactly this integral.

QuantitySymbolWhere it lives in DFTWhere in VASP
Spin-up densityn↑(r)First density channelCHGCAR (channel 1)
Spin-down densityn↓(r)Second density channelCHGCAR (channel 2)
Spin density / magnetisationm(r) = n↑ − n↓Difference of channelsCHGCAR.spin (post-processed)
Total moment per cellμ = μ_B (N↑ − N↓)Integral of m(r)OUTCAR — 'tot' column
Per-atom momentμ_i = ∫_PAW-sphere m(r) drProjected onto atomic spheresOUTCAR — 'magnetization (x)' table
Exchange-correlation fieldB_xc(r)Functional derivative of E_xcInternal — not written

A useful mental anchor

For a textbook ferromagnet, both bands and density of states come in two colours. Imagine the non-magnetic DOS coloured grey; turning on spin polarisation draws two copies — one shifted Δex/2\Delta_{\text{ex}}/2 down (majority spin) and one shifted Δex/2\Delta_{\text{ex}}/2 up (minority spin). The integrated occupied-state difference between the two copies is the moment. We will see this exactly in the interactive a few sections down.


The Exchange Interaction and the Heisenberg Model

Take two electrons, one in orbital ϕa\phi_a on site A and one in ϕb\phi_b on site B. Pauli forbids them from occupying the same spin-orbital, so the two-electron wavefunction must be antisymmetric. There are two ways to achieve that:

  • Singlet (antiparallel spins). Symmetric spatial part, antisymmetric spin part. The electrons can sit on the same atom for an instant (virtual hopping is allowed), which costs a Coulomb-repulsion penalty UU but lowers the kinetic energy by t2/U\sim t^2/U through second-order perturbation theory.
  • Triplet (parallel spins). Antisymmetric spatial part, symmetric spin part. The two electrons cannot occupy the same orbital — the wavefunction vanishes when r1=r2\mathbf{r}_1 = \mathbf{r}_2 (the "Fermi hole"). No virtual hopping, no kinetic-energy gain from UU, but also no Coulomb penalty — parallel spins effectively avoid each other, which lowers the direct Coulomb integral by an amount called the exchange integral KabK_{ab}.

The energy difference between the two configurations defines the exchange coupling Jab=EsingletEtripletJ_{ab} = E_{\text{singlet}} - E_{\text{triplet}}. Through the Heitler–London or Hubbard analyses one finds the compact result

Jab2Kab4tab2UJ_{ab} \approx 2 K_{ab} - \frac{4\,t_{ab}^2}{U}

which is a beautiful little equation. The first term 2Kab>02K_{ab} > 0 is the direct exchange — it favours parallel spins (FM tendency). The second term 4t2/U-4t^2/U is the kinetic exchange — it favours antiparallel spins (AFM tendency). For most insulating magnets the kinetic term wins and the ground state is AFM; for many metallic 3d ferromagnets (Fe, Co, Ni) the direct term wins. The sign and magnitude of JJ tell you which ordering will appear.

Once you have computed the per-bond JijJ_{ij} (in DFT this is done by mapping total-energy differences between magnetic configurations onto a model — see "Energy Comparison" below), the magnetic crystal is described by the Heisenberg Hamiltonian:

H^Heis  =  ij ⁣JijSi ⁣ ⁣Sj    gμBB ⁣ ⁣iSi\hat{H}_{\text{Heis}} \;=\; -\sum_{\langle i j \rangle}\! J_{ij}\,\mathbf{S}_i\!\cdot\!\mathbf{S}_j \;-\; g\mu_B\,\mathbf{B}\!\cdot\!\sum_i\mathbf{S}_i

with a sign convention where Jij>0J_{ij} > 0 favours parallel spins (FM) and Jij<0J_{ij} < 0 favours antiparallel (AFM). The sum runs over neighbour pairs ij\langle ij\rangle. Despite its appearance, this is not a fundamental Hamiltonian — it is the effective low-energy description of the same Coulomb-plus-Pauli physics we just derived.

What this earns you

Once you have JijJ_{ij}, you can throw the electrons away. The Curie temperature TC23kBzJS(S+1)T_C \approx \tfrac{2}{3 k_B}\,z\,J\,S(S+1) (mean-field), the spin-wave dispersion ω(q)=2S[J(0)J(q)]\hbar\omega(\mathbf{q}) = 2 S\bigl[J(0) - J(\mathbf{q})\bigr], and the magnetic ground-state structure all fall out of the Heisenberg model alone. This is why fitting JJ from DFT total energies and then handing it to a Monte-Carlo or spin-wave code is the standard recipe for magnetic phase diagrams.


Interactive — The Four (and a Half) Magnetic Orderings

Below is a 3×3×3 simple-cubic lattice of magnetic atoms. Each atom carries a spin arrow. Click the buttons across the top to switch between paramagnetic (PM), ferromagnetic (FM), G-type and A-type antiferromagnetic (AFM-G, AFM-A), ferrimagnetic (FiM), and a non-collinear (NC) helical state. The footer reports the live net moment Σm=imi\boldsymbol{\Sigma}\,\mathbf{m} = \sum_i \mathbf{m}_i so you can verify by hand that AFM cancels and FM saturates.

Loading 3D magnetic-ordering viewer…

Three things to do with the controls, in order:

  1. Switch to AFM-G. Every atom is anti-aligned with all six of its nearest neighbours along x, y, and z — a 3-D checkerboard. The net moment ΣM is essentially zero. This is the ground state of MnO, NiO, and most of the antiferromagnetic rock-salt oxides. Note that the magnetic unit cell (period 2 along each axis) is twice as large as the chemical unit cell — a fact that will bite us when we set up VASP supercells.
  2. Switch to AFM-A. Within each (xy)-layer the spins are FM; between layers they alternate. This shows up in the perovskite manganites and in CrI₃-type 2D magnets. The magnetic unit cell is doubled along z but not along x/y.
  3. Switch to FiM with the amplitude slider. The two sublattices have unequal magnitudes and opposite signs. The net moment is the difference, not zero. This is the structure of magnetite Fe₃O₄ (the original ‘lodestone’): two Fe sites with opposite spins, one with twice the moment of the other, giving a residual macroscopic magnetisation.

Why the netMoment readout is exact

The number ΣM in the footer is the literal sum imi\sum_i \mathbf{m}_i over the 27 sites, with each mi\mathbf{m}_i set by the ordering. For FM with amplitude 0.7 you should read ΣMz=27×0.7=18.9\Sigma M_z = 27 \times 0.7 = 18.9; for AFM-G the parity of (i+j+k) gives 14 up and 13 down → net 0.70.7. The single-site asymmetry only disappears in the thermodynamic limit; this is exactly the boundary effect that forces real AFM calculations to use even-sized supercells.


Spin-Polarized DFT — Two Densities, One Crystal

We are now ready to plug magnetism into the Kohn–Sham machinery from Section 4.6. The promotion is mechanical: instead of one density-functional Lagrangian we have two, one for each spin channel, coupled only through the exchange–correlation functional. The total energy becomes a functional of the two densities,

E[n,n]  =  Ts[n,n]+Vext[n]+EH[n]+Exc[n,n]E[n_{\uparrow},n_{\downarrow}] \;=\; T_s[n_{\uparrow},n_{\downarrow}] + V_{\text{ext}}[n] + E_H[n] + E_{\text{xc}}[n_{\uparrow},n_{\downarrow}]

with n=n+nn = n_{\uparrow} + n_{\downarrow}. Functional differentiation gives one Kohn–Sham equation per spin channel, with potentials

vσKS(r)  =  vext(r)+vH(r)+δExc[n,n]δnσ(r)v_{\sigma}^{\text{KS}}(\mathbf{r}) \;=\; v_{\text{ext}}(\mathbf{r}) + v_H(\mathbf{r}) + \frac{\delta E_{\text{xc}}[n_{\uparrow},n_{\downarrow}]}{\delta n_{\sigma}(\mathbf{r})}

The first two terms (external potential and Hartree term) are spin-blind — they depend only on the total density. The exchange–correlation term is where spin polarisation enters. In the local spin-density approximation (LSDA), we evaluate the spin-polarised homogeneous electron-gas functional at the local densities,

ExcLSDA[n,n]  =   ⁣n(r)εxc(n(r),ζ(r))d3rE_{\text{xc}}^{\text{LSDA}}[n_{\uparrow}, n_{\downarrow}] \;=\; \int \! n(\mathbf{r}) \,\varepsilon_{\text{xc}}\bigl(n(\mathbf{r}),\, \zeta(\mathbf{r})\bigr)\, d^3r

where ζ=(nn)/n[1,1]\zeta = (n_{\uparrow}-n_{\downarrow})/n \in [-1, 1] is the relative spin polarisation. GGA functionals (PBE, PW91) generalise this by also depending on nσ\nabla n_{\sigma}. The point is that εxc\varepsilon_{\text{xc}} is a different function of ζ\zeta; for ζ0\zeta \neq 0 the energy density is lower than the spin-balanced result. That difference is the driving force for magnetism in DFT.

LSDA vs GGA for magnets — a practical caveat

LSDA underestimates the moment of Fe (≈ 2.15 μ_B vs experimental 2.22) and gets the BCC ground state wrong in some other 3d metals. PBE-GGA is the modern default — it gets BCC-Fe, FCC-Ni, and HCP-Co all in their correct ferromagnetic ground states with near-experimental moments. For strongly correlated oxides (NiO, MnO, CoO) you need on top a Hubbard UU correction (DFT+U) or a hybrid functional — see Chapter 6.

The price for magnetism is computational: ISPIN = 2 doubles the size of the eigenvalue problem (two channels of bands) and roughly doubles the wall time. The pay-off is that every electronic property now comes with a spin label: bands split into majority and minority, DOS becomes two curves, and the per-atom moment is a number you can read off OUTCAR.


Interactive — Exchange Splitting and the Net Moment

The cleanest way to see magnetism in DFT output is the spin-resolved DOS. We plot n(E)n_{\uparrow}(E) on one side of the energy axis and n(E)n_{\downarrow}(E) on the other, with a horizontal Fermi-level line. The net moment per cell is the integrated difference of occupied states,

μ  =  EF ⁣[n(E)n(E)]dE\mu \;=\; \int_{-\infty}^{E_F}\!\bigl[n_{\uparrow}(E) - n_{\downarrow}(E)\bigr]\,dE

which is reported live in the bottom strip of the figure. Drag Δex to control how strongly the two channels split apart — physically this is set by the exchange–correlation field — and drag EF to control the band filling.

Spin-resolved density of states — exchange splitting and net moment
↑ spin DOS↓ spin DOS
-6-4-2024E (eV)E_F = 0.00 eVΔ_ex = 1.60 eVn↑(E)n↓(E)
Δ_ex (eV)1.60
E_F (eV)0.00
N↑ = 3.464N↓ = 1.724μ = N↑ − N↓ = 1.740 μ_B / cellferromagnetic (↑ majority)

Two limits to feel out:

  1. Δex = 0. The two curves coincide. Every state below EF is doubly occupied (one ↑, one ↓), so N=NN_{\uparrow} = N_{\downarrow} and the moment is zero. This is the non-magnetic, paramagnetic ISPIN = 1 picture.
  2. Δex ≈ 1.5 eV, EF in the gap between the two ↓ peaks. The majority channel is mostly filled, the minority channel is partly emptied, and the moment opens up to ~1–2 μ_B per atom. This is the band-theory picture of the BCC-Fe ground state — a so-called weak ferromagnet, where both channels still cross EF. Push Δex higher and the minority channel can be pushed entirely above EF: this is a half-metal (NiMnSb, CrO₂) — gapped in one channel and metallic in the other, the ideal source for spintronic devices.

Numerical sanity check

For most 3d ferromagnets, exchange splitting is empirically ΔexIμ\Delta_{\text{ex}} \approx I\,\mu where II is the Stoner parameter (≈ 1 eV/μ_B for Fe, Co, Ni). Read off the splitting in your DOS, divide by the moment from OUTCAR, and check that it lands near 1 eV/μ_B. If it does, your calculation is in the textbook regime; if not, suspect either a non-converged k-grid or correlations beyond DFT.


When Does a Metal Become Ferromagnetic? The Stoner Criterion

Why do Fe, Co, and Ni order ferromagnetically while their neighbours Cu, Pd, and Pt do not? The exchange parameter II is similar across the 3d row, so it must be something about the band structure itself. Stoner's 1938 argument is one of the most elegant criteria in solid-state physics.

Imagine starting from a non-magnetic metal and infinitesimally moving a tiny number of electrons δn\delta n from the ↓ channel just below EF to the ↑ channel just above. The cost in kinetic energy is δT=δn/g(EF)\delta T = \delta n / g(E_F) per electron moved (the inverse density of states sets the energy gap you have to span). The reward in exchange energy is δEex=Iδn\delta E_{\text{ex}} = -I\,\delta n (each spin flip lowers the energy by II times the imbalance you just created). The total energy change is therefore

δE  =  δn[1g(EF)I]\delta E \;=\; \delta n\,\Bigl[\,\frac{1}{g(E_F)} - I\,\Bigr]

and ferromagnetism is the spontaneous winner whenever the bracket is negative — that is, the Stoner criterion:

I  g(EF)  >  1I\;g(E_F) \;>\; 1

A high density of states at the Fermi level is the lever; the exchange parameter II is the prize.

Elementg(E_F) (states/eV·atom)I (eV)I·g(E_F)Outcome
Fe (BCC)≈ 2.40.93≈ 2.2Ferromagnet (μ ≈ 2.2 μ_B)
Co (HCP)≈ 2.00.99≈ 2.0Ferromagnet (μ ≈ 1.7 μ_B)
Ni (FCC)≈ 2.71.01≈ 2.7Ferromagnet (μ ≈ 0.6 μ_B)
Pd (FCC)≈ 1.60.71≈ 1.1Borderline, paramagnetic but enhanced
Cu (FCC)≈ 0.30.73≈ 0.2Non-magnetic (filled d-shell)
Al (FCC)≈ 0.20.66≈ 0.1Non-magnetic

Pd is the famous near-miss: Ig(EF)1.1I\,g(E_F) \approx 1.1, almost satisfying the criterion but not quite. Its susceptibility is enhanced by an order of magnitude over the Pauli value, and a tiny amount of Co or Ni doping pushes it over the threshold. Cu, with its full d-shell, has tiny g(EF)g(E_F) from the s-band only and the criterion fails by an order of magnitude.

The Stoner criterion is what your DFT actually solves

When you turn on ISPIN = 2 with a non-zero MAGMOM seed, VASP minimises the spin-polarised energy. If Ig(EF)>1I g(E_F) > 1 the SCF flows downhill into a ferromagnetic state and the moment grows iteration by iteration. If Ig(EF)<1I g(E_F) < 1 the moment decays back to zero and the answer is paramagnetic regardless of how large you set the initial moment. This is why setting MAGMOM correctly is necessary but not sufficient — the underlying band structure has the final say.


Picking the Ground State by Total-Energy Comparison

For most magnetic materials there is no analytical shortcut for deciding which ordering is the ground state. The standard recipe is embarrassingly direct: compute the total energy of every candidate ordering and pick the smallest. For a binary transition-metal oxide like NiO this means at minimum:

  1. A non-magnetic (ISPIN = 1) reference run.
  2. A ferromagnetic (FM) run on the chemical unit cell.
  3. A G-type AFM run on a doubled magnetic unit cell (e.g. a 2×2×2 supercell of the rock-salt cell).
  4. Optionally, A-type, C-type, and other AFM patterns if the lattice allows them.

Order the resulting energies. The lowest is the predicted ground state. The differences also let you fit the Heisenberg JijJ_{ij}: writing

EFMEAFM  =  2zJS2  +  (equal terms that cancel)E_{\text{FM}} - E_{\text{AFM}} \;=\; -2\,z\,J\,S^2 \;+\; (\text{equal terms that cancel})

gives you JJ from a single energy difference, with zz the coordination number and SS the local spin. Repeat with second- and third-neighbour AFM patterns to extract J2J_2, J3J_3, etc. This is the workhorse "four-state mapping" method used in modern magnetic first-principles studies.

A worked baseline: NiO

DFT-PBE+U total energies for NiO (per Ni atom): ENM=0E_{\text{NM}} = 0 (reference), EFM1.95eVE_{\text{FM}} \approx -1.95\,\text{eV}, EAFM-II1.99eVE_{\text{AFM-II}} \approx -1.99\,\text{eV}. The 40-meV preference for AFM-II is small but reproducible across codes and pseudopotentials. The corresponding nearest-neighbour J11.4meVJ_1 \approx -1.4\,\text{meV} (negative, AFM) and second-neighbour J219meVJ_2 \approx -19\,\text{meV} via super-exchange through the bridging O — an order of magnitude larger and the actual driver of NiO's 523-K Néel temperature.


VASP — Spin-Polarized Calculations from INCAR to OUTCAR

Setting up a magnetic VASP calculation requires four INCAR tags (ISPIN, MAGMOM, LORBIT, LMAXMIX) and a discipline about reading the output. Here is the canonical template for BCC iron — the simplest interesting ferromagnet — followed by a line-by-line walkthrough.

📝POSCAR
1bcc Fe (a = 2.866 Å, conventional cell of 2 atoms)
21.0
3   2.866   0.000   0.000
4   0.000   2.866   0.000
5   0.000   0.000   2.866
6Fe
72
8Direct
9   0.0   0.0   0.0
10   0.5   0.5   0.5
📝KPOINTS
1Automatic mesh
20
3Gamma
415 15 15
5 0  0  0

The INCAR — annotated below

INCAR walkthrough — every magnetic tag explained
INCAR (BCC Fe — ferromagnetic)
1# INCAR — BCC Fe, ferromagnetic ground state

VASP's master input file. Comments begin with '#'. Each non-comment line sets one tag that the executable reads at startup. The order of tags does not matter; spelling does (case-insensitive but typo-sensitive).

2SYSTEM = bcc Fe (ferromagnetic)

A free-form label written into OUTCAR for the analyst's benefit. VASP itself ignores this string — but you will be grateful for it three months from now when you have 50 OUTCARs in a folder.

3PREC = Accurate

Sets the default plane-wave cutoff and FFT grid density. Accurate ≈ ENMAX of the hardest POTCAR × 1.3, plus a fine FFT grid. Use it whenever you compare total energies between two structures (FM vs AFM, doped vs pristine) — sloppy presets cost meV that decide which phase wins.

4ENCUT = 400

Plane-wave kinetic-energy cutoff in eV. A converged value for Fe-PAW-PBE is ≈ 400 eV. Lower cutoffs miss high-frequency features of the d-orbital tails and can change the Fe magnetic moment by 0.1 mu_B — enough to flip the ordering.

EXECUTION STATE
ENCUT vs basis size = N_pw ∝ ENCUT^{3/2}. Doubling ENCUT roughly triples the number of plane waves. Always converge ENCUT before MAGMOM matters.
5EDIFF = 1E-6

Self-consistency tolerance: stop the SCF loop when the total-energy change between two iterations drops below 10⁻⁶ eV per cell. For magnetic energy differences (FM − AFM is often ≈ 1 meV/atom for weak magnets), tighten to 1E-7 or 1E-8.

6ISMEAR = 1

Methfessel-Paxton smearing of order 1 — the cleanest choice for metals because it preserves the right thermodynamic limit and converges total energies quickly. For semiconductors use ISMEAR = 0 (Gaussian) instead. Smearing is needed because Fe is a metal: the Fermi surface cuts the bands and the integration needs a smooth occupation function.

EXECUTION STATE
ISMEAR menu = 0 = Gaussian, 1/2 = Methfessel-Paxton (use for metals), -5 = tetrahedron with Blöchl corrections (use for DOS, not relax). Don't mix tetrahedron with structural relaxation — it gives wrong forces.
7SIGMA = 0.2

Smearing width in eV. With ISMEAR = 1 the rule of thumb is SIGMA = 0.1–0.2 eV; the entropy contribution T·S in OUTCAR should be ≈ 1 meV/atom or smaller. Too-small SIGMA on a coarse k-grid causes non-converging SCF; too-large SIGMA over-broadens the Fermi level and washes out the moment.

8(blank line — separator only)

Blank lines are optional and ignored by VASP. They are kept here to group magnetism-relevant tags visually.

9ISPIN = 2

The single most important magnetic tag. ISPIN = 1 (default) treats every electron with the same density n(r) — the calculation is force-symmetric in spin and cannot find a magnetic state. ISPIN = 2 splits the density into two channels n↑(r) and n↓(r), each with its own Kohn-Sham equations. This is what 'LSDA' means in VASP.

EXECUTION STATE
ISPIN = 1 (paramagnetic) = n↑(r) = n↓(r) = n(r)/2 forced by symmetry. Cannot describe FM, AFM, or FiM.
ISPIN = 2 (spin-polarised, collinear) = Two independent density channels with z-quantised moments. Costs ~2× the wall time. Required for any magnetic study.
Non-collinear → LNONCOLLINEAR = .TRUE. = Different tag entirely (Section 5.7) — required only for spin spirals, skyrmions, or when SOC tilts moments off axis.
10MAGMOM = 2*2.5

Initial guess for the magnetic moment of every atom in the order they appear in POSCAR. The notation 'N*x' is shorthand for 'N copies of x'. Here both BCC-Fe atoms start at +2.5 μ_B (positive = up). VASP relaxes these during the SCF; the final value can be smaller, larger, or even flip — but the initial guess decides which local minimum the SCF lands in.

EXECUTION STATE
Why an initial guess matters = DFT with ISPIN = 2 has multiple self-consistent solutions: PM (m=0), FM, AFM. Each is a local minimum of the energy. MAGMOM is your seed. Bad seed → SCF converges to a local min that is not the ground state.
Typical seeds = Fe: ±2.5 · Co: ±1.7 · Ni: ±0.6 · Mn: ±4.0 · Cr: ±3.0. Use the experimental moment if you know it; otherwise overshoot — too-large is forgiven, too-small often collapses to PM.
AFM example: 4*2.5 4*-2.5 = 8-atom Fe supercell with 4 up + 4 down — this is what you write to seed an antiferromagnetic search.
11LORBIT = 11

Project the wavefunction onto atomic spheres so that you can decompose the moment per atom and per orbital (s/p/d/f). Without this you only get the total magnetisation; with it you can read 'Fe-1 d_{x²−y²}: +0.45 μ_B' off OUTCAR. This is the value experimentalists compare to neutron-diffraction refinements.

EXECUTION STATE
LORBIT = 11 = Use atomic-sphere radii from the PAW file (RWIGS not needed). Writes the full per-atom, per-orbital, per-spin breakdown to OUTCAR and PROCAR.
LORBIT = 10 = Total moments only (per atom, no l-decomposition).
12LMAXMIX = 4

Maximum angular-momentum channel mixed by the charge-density mixer. Default 2 mixes only s and p. For transition metals (d-electrons) use 4; for actinides/rare earths (f-electrons) use 6. Wrong LMAXMIX is a famous cause of slow SCF convergence on magnetic systems — symptom: total energy oscillates by 0.1 eV every iteration.

EXECUTION STATE
Cheat sheet = Main-group only: 2 (default). Transition metals (Fe, Co, Ni, Mn, Cr, Cu, …): 4. Lanthanides & actinides (f-shell): 6.
13(blank line)

Visual grouping only.

14LREAL = .FALSE.

Use exact reciprocal-space projectors. For unit cells of a few atoms (here 2 BCC-Fe) FALSE is fastest and most accurate. For supercells with > ~30 atoms switch to LREAL = Auto, which projects in real space with negligible loss in precision.

15LWAVE = .FALSE.

Don't write WAVECAR. The wavefunction file is large (~hundreds of MB to GB) and unnecessary unless you continue with hybrid functionals, GW, or band-unfolding from this run.

16LCHARG = .TRUE.

Write CHGCAR — the spin-resolved self-consistent charge density. Required if you plan a non-SCF band-structure run (Section 5.1) or want to plot a magnetisation isosurface in VESTA. CHGCAR for ISPIN = 2 contains both n↑ + n↓ (total) AND n↑ − n↓ (spin density).

1# INCAR — BCC Fe, ferromagnetic ground state
2SYSTEM  = bcc Fe (ferromagnetic)
3PREC    = Accurate
4ENCUT   = 400         # plane-wave cutoff (eV)
5EDIFF   = 1E-6        # SCF tolerance per cell (eV)
6ISMEAR  = 1           # Methfessel-Paxton — best for metals
7SIGMA   = 0.2         # smearing width (eV)
8
9ISPIN   = 2           # turn on spin polarisation (2 channels)
10MAGMOM  = 2*2.5       # initial moment: +2.5 mu_B on each of 2 atoms
11LORBIT  = 11          # write per-atom moments to OUTCAR/PROCAR
12LMAXMIX = 4           # higher l-mixing — needed for transition metals
13
14LREAL   = .FALSE.     # exact projectors (small cell)
15LWAVE   = .FALSE.
16LCHARG  = .TRUE.

Code Walkthrough — Reading the Magnetic Output

After the SCF converges, all the magnetic information you need is scattered through OUTCAR and (for plotting) vasprun.xml. The following pymatgen snippet pulls it out in a few lines.

Reading magnetic data from VASP output
🐍read_magnetic_state.py
1# read_magnetic_state.py — extract moments and DOS

Header comment. Lists what the script does so a future reader (or you, in three months) understands its purpose without diving into the code. VASP runs produce many files; this one focuses on the magnetic signatures.

2from pymatgen.io.vasp import Outcar, Vasprun

pymatgen is the Python Materials Genome library — the de-facto standard for parsing VASP output. The two parsers we need: Outcar (plain-text log) and Vasprun (rich XML with DOS, bands, eigenvalues).

EXECUTION STATE
📚 pymatgen.io.vasp.Outcar = Parses OUTCAR. Exposes .magnetization (per-atom moments), .total_mag (cell total), .efermi (Fermi level), .total_energy, plus per-step convergence info.
📚 pymatgen.io.vasp.Vasprun = Parses vasprun.xml. Richer: full band structure, full DOS on a fine energy grid, k-point coords, every INCAR tag actually used by the run (not what was requested but what was applied).
3import numpy as np

NumPy provides the array math (trapezoidal integration, boolean masking) used below. Aliased to np by universal convention.

4(blank line)

Visual separator.

5oc = Outcar("OUTCAR")

Parse OUTCAR in the current directory. The constructor reads the entire file (typically a few MB), runs regex searches for magnetic-block tables, and exposes them as attributes. For very large OUTCARs (long molecular dynamics) consider using the lazy parser.

EXECUTION STATE
⬇ arg: 'OUTCAR' = Path to the file. Relative path resolves against the script's working directory. Pass an absolute path if the script lives elsewhere.
⬆ result: oc = An Outcar object. Most useful attributes for magnetism: oc.magnetization — list of dicts, one per atom oc.total_mag — float, sum of per-atom moments oc.efermi — float, Fermi energy (eV)
6vr = Vasprun("vasprun.xml")

Parse vasprun.xml (the canonical machine-readable VASP output). Slightly slower than Outcar parsing because XML is large, but exposes the full band/DOS data we need for the integration.

EXECUTION STATE
⬆ result: vr = A Vasprun object. For magnetism we use: vr.complete_dos — full DOS object (n↑, n↓, projections) vr.efermi — Fermi energy vr.final_energy — converged total energy
7(blank line)

Separator.

8mags = [s["tot"] for s in oc.magnetization]

List comprehension: for each atom in the OUTCAR magnetisation table, pull out the 'tot' (total) moment. The table also has 's', 'p', 'd' columns — the orbital-resolved decomposition turned on by LORBIT = 11.

EXECUTION STATE
📚 oc.magnetization = List of dicts of length N_atoms. Each entry is {'s': float, 'p': float, 'd': float, 'tot': float} — moments per spherical-harmonic channel inside the PAW sphere of that atom, in μ_B.
→ Example for BCC Fe = oc.magnetization = [ {'s': -0.013, 'p': -0.026, 'd': 2.241, 'tot': 2.202}, {'s': -0.013, 'p': -0.026, 'd': 2.241, 'tot': 2.202}, ] → mags = [2.202, 2.202]
⬆ result: mags = [2.202, 2.202] for BCC Fe — both atoms equivalent, 2.20 μ_B each, mostly d-electron in origin (≈ 2.24 of the 2.20 from d).
9mu_cell = sum(mags)

Total moment per unit cell — the headline number a magnetism paper reports. For BCC-Fe (two atoms per conventional cell) you get 2 × 2.20 = 4.40 μ_B/cell.

EXECUTION STATE
⬆ result: mu_cell = 4.404 μ_B per 2-atom unit cell (≈ 2.20 μ_B/atom)
→ Sanity check vs experiment = Experimental BCC-Fe: 2.22 μ_B/atom. PBE-GGA gives 2.20. Within 1% — typical accuracy for ferromagnetic 3d metals.
10(blank line)

Separator.

11dos = vr.complete_dos

Pymatgen's CompleteDos object — holds the total DOS plus all projected DOS (per atom, per orbital, per spin). For our purposes we just need the spin-resolved totals.

12spin_up = dos.densities[1]

Pymatgen indexes spin channels by Spin enum: Spin.up = 1, Spin.down = -1. spin_up is a 1-D NumPy array — n_↑(E) sampled on the energy grid dos.energies.

EXECUTION STATE
📚 dos.densities = Dict-like: {Spin.up: ndarray, Spin.down: ndarray}. Each ndarray has the same length as dos.energies — typically 3000 to 5000 points across the band range. Units: states/eV/cell.
→ Example shape = dos.energies.shape = (3001,) spin_up.shape = (3001,) spin_down.shape = (3001,)
13spin_down = dos.densities[-1]

The minority channel. Note: pymatgen does NOT negate the spin-down DOS internally; the array values are positive. Some plotting conventions (and VASP itself!) flip the sign so n_↓ is plotted below the axis. Be careful when comparing across tools.

EXECUTION STATE
→ integer key -1 = Equivalent to Spin.down. The IntEnum class makes -1 and 'down' interchangeable; in pymatgen code you will see both forms.
14(blank line)

Separator.

15E_F = vr.efermi

Fermi energy in eV, on the same absolute scale as dos.energies. VASP defines E_F as the energy at which the integrated DOS equals the number of valence electrons, with smearing applied. For BCC-Fe with PBE this typically lands around 8.7 eV in the absolute scale (or 0.0 if energies were referenced).

16mask = dos.energies <= E_F

Boolean array marking which DOS samples lie at or below the Fermi level — i.e. the occupied states. NumPy lets us use this directly to slice arrays.

EXECUTION STATE
📚 NumPy boolean masking = dos.energies <= E_F returns an array of the same shape with True/False. Using it as an index — array[mask] — keeps only the True positions.
→ Example = If dos.energies has 3001 points and E_F = 8.71 eV, mask might be True for the first 1834 entries. dos.energies[mask].shape = (1834,)
17N_up_occ = np.trapz(spin_up[mask], dos.energies[mask])

Trapezoidal-rule integration of the spin-up DOS up to the Fermi level. The result is the number of occupied spin-up states per cell.

EXECUTION STATE
📚 np.trapz(y, x) = NumPy's trapezoidal-rule integrator. Approximates ∫ y dx by summing the area of trapezoids between consecutive (x, y) pairs. For a smooth DOS on a fine grid it is accurate to a few parts in 10⁴.
⬇ arg 1: spin_up[mask] = n_↑(E) values at the energies below E_F
⬇ arg 2: dos.energies[mask] = Energy grid points below E_F (eV) — must match arg 1 length
⬆ result: N_up_occ = ≈ 5.10 for BCC-Fe per atom (8 valence electrons total, ≈ 5.10 in ↑ channel, ≈ 2.90 in ↓ channel)
18N_down_occ = np.trapz(spin_down[mask], dos.energies[mask])

Same integration for the spin-down DOS. Together with N_up_occ this completes the moment computation: μ = (N↑ − N↓) μ_B.

EXECUTION STATE
⬆ result: N_down_occ = ≈ 2.90 per atom for BCC-Fe
→ Net moment = N_up_occ − N_down_occ = 5.10 − 2.90 = 2.20 μ_B/atom — exactly the OUTCAR value. Consistency check passed.
19(blank line)

Separator.

20print(f"per-atom moments: {mags}")

f-string interpolation prints the list of per-atom moments. For BCC-Fe → 'per-atom moments: [2.202, 2.202]'. If your AFM seed worked, you would see alternating signs here.

21print(f"total moment: {mu_cell:.3f} mu_B / cell")

Formatted to 3 decimals. The :.3f spec rounds and pads. Output: 'total moment: 4.404 mu_B / cell'.

22print(f"moment from DOS integration: ...")

Cross-validates the OUTCAR per-atom number against an independent integration of the DOS. The two should agree to within a few × 10⁻³ μ_B; larger discrepancies usually mean the DOS k-grid was too coarse or smearing was too wide.

EXECUTION STATE
→ Sample output = moment from DOS integration: 2.198 mu_B / cell
→ Why the tiny mismatch = DOS integration uses smeared occupations; OUTCAR's per-atom moment uses the actual self-consistent density. The 0.001–0.01 μ_B difference is harmless and is the standard sanity check.
1# read_magnetic_state.py — extract moments and DOS from a VASP run
2from pymatgen.io.vasp import Outcar, Vasprun
3import numpy as np
4
5oc = Outcar("OUTCAR")
6vr = Vasprun("vasprun.xml")
7
8mags    = [s["tot"] for s in oc.magnetization]   # per-atom total moments
9mu_cell = sum(mags)                              # total moment per cell
10
11dos = vr.complete_dos
12spin_up   = dos.densities[1]                     # n_up(E) on dos.energies grid
13spin_down = dos.densities[-1]                    # n_down(E) — note negative sign
14
15E_F = vr.efermi                                  # Fermi energy in eV
16mask = dos.energies <= E_F
17N_up_occ   = np.trapz(spin_up[mask],   dos.energies[mask])
18N_down_occ = np.trapz(spin_down[mask], dos.energies[mask])
19
20print(f"per-atom moments: {mags}")
21print(f"total moment: {mu_cell:.3f} mu_B / cell")
22print(f"moment from DOS integration: {N_up_occ - N_down_occ:.3f} mu_B / cell")

Pitfalls You Will Hit On Your First Try

Spin-polarised calculations have a small zoo of failure modes. Each of these will eat half a day from a new student; recognising them in advance saves the day.

SymptomProbable causeFix
Total moment converges to 0 even with MAGMOM = 2*2.5SCF fell into the non-magnetic local minimumIncrease MAGMOM (try 4.0), tighten EDIFF, set NUPDOWN to fix the moment for the first 30 steps
AFM run converges to FMMAGMOM seed has the wrong pattern OR the cell is not large enough to accommodate AFMDouble the cell along the broken-symmetry axis; write MAGMOM as '4*2.5 4*-2.5' explicitly; never use 'N*x' for AFM
SCF energy oscillates by 0.1 eV every stepMixing parameters wrong for transition metalsSet LMAXMIX = 4 (3d) or 6 (4f); reduce AMIX_MAG to 0.4; AMIX = 0.2
Per-atom moments don't sum to total moment in OUTCARMagnetisation outside the PAW spheres (interstitial)Normal — the difference is the interstitial moment. To match exactly, use larger RWIGS or analyse via Bader
Moments wander between SCF iterationsMAGMOM seed too small or too far from a stable solutionUse a stronger seed; run a brief NUPDOWN-constrained warm-up; or apply DFT+U for narrow-band oxides
DOS plot shows tiny moment but VASP reports large momentWrong sign convention on n_↓VASP plots n_↓ as negative; pymatgen returns it positive — flip in your script when plotting

The single most useful diagnostic

Look at Δμ\Delta\mu — the change in total moment between successive SCF iterations — printed in OSZICAR. A well-converged magnetic SCF has Δμ<104μB|\Delta\mu| < 10^{-4}\,\mu_B in the last few steps. Oscillations or monotone drift mean you should tighten EDIFF, lower mixing, or seed differently.


Looking Ahead — Spin-Orbit Coupling

Everything in this section assumed the spin axis is global — every moment is along z^\hat{z} (collinear). That is exact in a non-relativistic Hamiltonian, where the spin-rotation symmetry of the kinetic and Coulomb operators makes the choice of axis arbitrary. The world is not non-relativistic. The spin-orbit interaction

H^SOC  =  12me2c21rdVdrL^ ⁣ ⁣S^\hat{H}_{\text{SOC}} \;=\; \frac{1}{2 m_e^2 c^2}\,\frac{1}{r}\,\frac{dV}{dr}\,\hat{\mathbf{L}}\!\cdot\!\hat{\mathbf{S}}

couples the spin to the spatial wavefunction and breaks the rotational invariance of the spin space. The consequences for a magnetic crystal are dramatic: the moments now point in a definite crystallographic direction (magnetocrystalline anisotropy), bands split by a few hundred meV in heavy elements, and entirely new phenomena emerge — Rashba splitting, Dirac semimetals, topological insulators. This is the subject of Section 5.7 — Spin–Orbit Coupling, where we will turn on the LSORBIT tag in VASP and see exactly how the band structure of CdSe (a near-textbook material for our chapter-6 case study) splits at the valence-band maximum.


Summary

  • Magnetism is quantum. The Bohr–van Leeuwen theorem rules out classical magnetism; permanent moments come from electron spin combined with the Pauli exclusion principle, which turns Coulomb repulsion into a spin-dependent exchange interaction.
  • Spin is a third Bloch label. A complete state is n,k,σ|n,\mathbf{k},\sigma\rangle. In a magnetic crystal the two spin channels have different Kohn–Sham potentials, differing by the exchange–correlation field BxcB_{\text{xc}}.
  • The four canonical orderings — PM, FM, AFM, FiM — together with non-collinear states cover essentially every magnetic crystal you will meet. Jij>0J_{ij} > 0 in a Heisenberg model favours FM, Jij<0J_{ij} < 0 favours AFM.
  • Spin-polarised DFT (LSDA / GGA with Exc[n,n]E_{\text{xc}}[n_{\uparrow}, n_{\downarrow}]) gives every electronic property a spin label. The exchange splitting Δex\Delta_{\text{ex}} separates majority and minority bands; the integrated occupied difference is the moment.
  • The Stoner criterion Ig(EF)>1I\,g(E_F) > 1 says ferromagnetism appears in a metal whenever the band exchange parameter times the Fermi-level density of states exceeds unity. Fe/Co/Ni satisfy it; Cu/Pd do not.
  • In VASP: ISPIN = 2 turns on spin polarisation, MAGMOM seeds the SCF (must be set explicitly for AFM cells), LORBIT = 11 writes per-atom orbital-resolved moments, and LMAXMIX = 4 stabilises the SCF for 3d transition metals. The ground-state ordering is decided by total-energy comparison across candidate magnetic configurations.
Section 5.6 Core Insight
"Magnetism is the spin-dependent piece of the Coulomb energy, given a name. Set ISPIN = 2, hand VASP an honest MAGMOM seed, and you will see that piece written into every band, every DOS curve, and every per-atom moment in OUTCAR."
Coming next: Section 5.7 — Spin–Orbit Coupling — where we let the spin axis tilt off z^\hat{z}, watch new band splittings open, and turn on the LSORBIT tag in VASP for the CdSe case study.
Loading comments...