Osman Goni Ridwan

VASP cheat sheet · Applications

VASP magnetism cheat sheet

Everything about magnetic VASP runs: setting the starting moments, finding the magnetic ground state, reading the moments, spin–orbit coupling and anisotropy energies, constrained moments and DFT+U, with notes for rare-earth magnets. The builder writes MAGMOM from your POSCAR.

Checked against VASP 6.6.1 · Updated

The short version

  1. ISPIN = 2 switches spin polarization on; without it MAGMOM does nothing for the moments.
  2. MAGMOM is one value per atom in POSCAR order. Start above the expected moments (1.2–1.5 ×): a high-spin start can relax down to low spin, but not the other way.
  3. An antiferromagnet needs opposite signs on its sublattices and a cell that holds them all, often a supercell.
  4. MAGMOM also sets the magnetic symmetry: keep it in every restart, or the order can be symmetrized away.
  5. Site moments need LORBIT ≥ 10 (LORBIT = 11 is the usual choice); they are integrated in spheres and do not add up to the cell moment mag=.
  6. Spin–orbit coupling and noncollinear runs use vasp_ncl, three MAGMOM numbers per atom and GGA_COMPAT = .FALSE.

Build MAGMOM from your POSCAR

Paste a POSCAR, give each species a starting moment, and choose a pattern: ferromagnetic, or antiferromagnetic planes alternating along one lattice vector. Flip any site by hand. The builder writes MAGMOM in the POSCAR order, compressed with N*value.

Spin on, moments set

TagWhat it doesDefaultWhat to useWatch out
ISPINSpin polarization: 1 off, 2 collinear spin-polarized.12 for anything that may be magnetic.Noncollinear runs ignore it; delete it there.
MAGMOMStarting magnetic moment of each atom in μB, in POSCAR order.1.0 per atom for ISPIN = 2; 3 × 1.0 per atom for noncollinear runsStart 1.2–1.5 × the expected moment; give antiferromagnetic sublattices opposite signs; use N*value shorthand, e.g. 4*5.0 4*-5.0.It also lowers the symmetry. Keep it on restarts, or the magnetization can be symmetrized away. The final state depends on the start.
NUPDOWNFixes the difference between spin-up and spin-down electrons, i.e. the total moment.not set (free)Only to impose a total moment, as in fixed-spin-moment scans.A wrong value forces a wrong moment: leave it unset in normal runs.
  • A new magnetic run (ISTART = 0) drops every symmetry operation that the MAGMOM pattern breaks, so different starting patterns can converge to different states.
  • The default, 1 μB on every atom, is a ferromagnetic start: it will not find an antiferromagnet.
  • Not magnetic is not paramagnetic: ISPIN = 1 removes the local moments altogether. Paramagnets above TC are modelled with disordered local moments, for example a magnetic special quasirandom structure.
  • NUPDOWN fixes the total moment (fixed-spin-moment scans of E(M)). With it set, the Fermi energy in OUTCAR belongs to one spin channel only.

Finding the magnetic ground state

  1. Start high-spin ferromagnetic and relax. If every moment ends below about 0.02 μB per site, the material is probably not magnetic in DFT.
  2. Enumerate collinear orderings (ferro-, antiferro-, ferrimagnetic) in supercells; pymatgen's MagneticStructureEnumerator does this, keeping the most symmetric candidates.
  3. Relax each ordering with the same ENCUT, POTCARs and k-point density, then run a static calculation on a finer mesh.
  4. Compare energies per formula unit. Such workflows find a non-ferromagnetic ground state correctly in most cases and the exact experimental ordering in a majority, and are less reliable for rare-earth compounds.
Ferromagnetic and antiferromagnetic starts
ISPIN  = 2
MAGMOM = 2*4.0 4*0.0          ! ferromagnetic: two magnetic atoms, then four others
# MAGMOM = 4.0 -4.0 4*0.0     ! antiferromagnetic: opposite signs on the two sublattices
LORBIT = 11                   ! site moments in OUTCAR
LASPH  = .TRUE.
LMAXMIX = 4                   ! 6 if f electrons are in the valence

An antiferromagnet whose magnetic cell is larger than the crystallographic one needs a supercell: bcc Cr needs the 2-atom cubic cell, rocksalt NiO a rhombohedral cell doubled along [111].

Reading the moments

Moments after a run
grep " F= " OSZICAR | tail -1 | grep -o "mag= *[-0-9.E+]*"   # total moment of the cell
grep -A 9 "magnetization (x)" OUTCAR | tail -10             # site moments, last block: for N atoms use -A N+5 and tail -(N+6)
  • The site table is printed with LORBIT ≥ 10 (or RWIGS). It is labelled “magnetization (x)” even in collinear runs, where moments have no direction.
  • Site moments are spin moments inside spheres; the space between the spheres is missing, so they do not sum to mag=.
  • Spin–orbit runs print the orbital moments separately with LORBMOM = .TRUE.; noncollinear runs add (y) and (z) tables.

Spin–orbit coupling and magnetic anisotropy

TagWhat it doesDefaultWhat to useWatch out
LNONCOLLINEARNoncollinear magnetism: each moment can point anywhere..FALSE. (.TRUE. if LSORBIT = .TRUE.)Needs vasp_ncl; MAGMOM then takes three numbers per atom.
LSORBITSpin–orbit coupling..FALSE.Magnetic anisotropy and heavy elements. Needs vasp_ncl and switches on LNONCOLLINEAR.Set LMAXMIX (4 for d, 6 for f elements).
SAXISSpin quantization axis of noncollinear runs: MAGMOM and the printed moments refer to it.0 0 1For anisotropy runs keep MAGMOM along z (0 0 m) and point SAXIS along the direction you test.With a non-default SAXIS, MAGMOM is given in the rotated (spinor) frame, not in Cartesian x, y, z.
GGA_COMPAT.FALSE. restores the full lattice symmetry of the gradient terms of GGA and meta-GGA functionals..TRUE..FALSE. for magnetic anisotropy and other noncollinear runs, where the small symmetry error matters.Its effect (about 0.1 meV) is as large as a typical anisotropy energy.
LORBMOMWrite the orbital moments to OUTCAR (spin–orbit runs only)..FALSE..TRUE. with LSORBIT to see the orbital moment of each site.

The magnetic anisotropy energy (MAE) is the energy difference between magnetization directions, often micro-eV to meV. The usual route freezes a collinear density and adds spin–orbit coupling for each direction:

MAE step 1: collinear run with vasp_std, writes CHGCAR
ISPIN      = 2
MAGMOM     = 2*3.0
PREC       = Accurate
ENCUT      = 520          ! keep it for every direction
LREAL      = .FALSE.
EDIFF      = 1E-7
ISYM       = -1           ! the same k-point set for every direction
GGA_COMPAT = .FALSE.
LASPH      = .TRUE.
LMAXMIX    = 4            ! 6 with f electrons
ISMEAR     = -5
LCHARG     = .TRUE.
LWAVE      = .FALSE.
MAE step 2: one vasp_ncl run per direction, from that CHGCAR
ICHARG     = 11           ! density fixed from step 1; do not copy WAVECAR
LSORBIT    = .TRUE.
MAGMOM     = 0 0 3.0  0 0 3.0   ! three numbers per atom, along the spin axis
SAXIS      = 1 0 0        ! the direction tested: 0 0 1, 1 0 0, 1 1 0 ...
NBANDS     = 64           ! twice the collinear NBANDS
ENCUT      = 520
ISYM       = -1
GGA_COMPAT = .FALSE.
LASPH      = .TRUE.
LMAXMIX    = 4
ISMEAR     = -5
LORBMOM    = .TRUE.
LORBIT     = 11
LCHARG     = .FALSE.

The MAE is E(direction) − E(easy axis), from the free energies of the step-2 runs. Converge the MAE itself, not just the total energy, with respect to the k-points; it usually needs far denser meshes than the energy. Where spin–orbit coupling is strong (open 4f shells), compare with self-consistent spin–orbit runs.

Constrained moments, spirals and exchange constants

TagWhat it doesDefaultWhat to useWatch out
I_CONSTRAINED_MConstrain local moments: 1 direction, 2 size and direction, 4 direction and sign (VASP 6.4.0 and later).not setPin moments while scanning directions or stabilizing a state; raise LAMBDA step by step.Adds a penalty energy E_p to the total energy: check that it is small before using the energy.
LAMBDAWeight of the penalty term for constrained moments.0Start small and increase it run by run, restarting each time.Raising it in one jump makes the SCF unstable.
M_CONSTRTarget moment direction (or vector) of each atom for constrained runs, three numbers per atom.3*NIONS*0.0Set MAGMOM along the same directions, equal or slightly larger.
RWIGSRadius of the sphere around each species (Å) used to integrate local quantities.−1 (from the POTCAR when LORBIT ≥ 10)Needed for LORBIT below 10 and for constrained moments.The spheres do not fill the cell, so local moments do not add up to the total.
LSPIRALSpin spirals with the generalized Bloch theorem..FALSE.With LNONCOLLINEAR = .TRUE., ISYM = −1 and the spiral vector in QSPIRAL.Cannot be combined with spin–orbit coupling.
QSPIRALPropagation vector of a spin spiral, in units of the reciprocal lattice vectors.0 0 0Scan q to map E(q).Use the same k-mesh and cutoffs for every q.
Constrain moment directions (vasp_ncl)
LNONCOLLINEAR   = .TRUE.
ISYM            = 0
MAGMOM          = 0 0 3  0 0 3
M_CONSTR        = 0 0 1  0 0 1
I_CONSTRAINED_M = 1        ! constrain the direction
RWIGS           = 1.0      ! one value per species
LAMBDA          = 1        ! then 5, 10, 25 ... restarting each time

The penalty energy (E_p in OSZICAR) must end up small before the energy means anything.

Exchange constants J come from mapping the energies of several orderings onto a Heisenberg model, E = E0 − Σ Jij ei · ej, and solving (or least-squares fitting) for the J. State the convention you used: unit vectors or spins S, each pair counted once or twice, and which sign means ferromagnetic. Each configuration must be converged in k-points on its own.

DFT+U

TagWhat it doesDefaultWhat to useWatch out
LDAUSwitch on DFT+U..FALSE..TRUE. together with the other LDAU tags.
LDAUTYPEDFT+U flavour: 1 Liechtenstein (U and J), 2 Dudarev (only U − J matters), 4 like 1 without exchange splitting.22 for most work and for Materials Project compatibility.Energies computed with different U (or U − J) cannot be compared.
LDAULThe l quantum number that gets U, one value per species: 2 for d, 3 for f, −1 for none.2 for each speciese.g. LDAUL = 2 -1 for an Fe oxide (Fe first in POSCAR).One l per species only.
LDAUUU in eV, one value per species.0 for each speciesFrom the literature or linear response; Materials Project uses e.g. Fe 5.3, Mn 3.9, Ni 6.2, Co 3.32 eV in oxides.The order follows the POSCAR species line.
LDAUJJ in eV, one value per species.0 for each species0 with LDAUTYPE = 2, where only U − J enters.
LDAUPRINTHow much of the occupation matrices to print.01 to print the on-site occupation matrices and occupancies.
DFT+U on Fe d states (Dudarev), Fe first in POSCAR
LDAU      = .TRUE.
LDAUTYPE  = 2            ! only U - J matters
LDAUL     = 2 -1         ! d on Fe, nothing on the second species
LDAUU     = 5.3 0        ! eV, one value per species
LDAUJ     = 0 0
LMAXMIX   = 4            ! 6 for f states
LDAUPRINT = 1            ! print the occupation matrices
ISPIN     = 2
MAGMOM    = 2*5.0 2*0.0
  • DFT+U has many self-consistent solutions, which can differ by hundreds of meV per atom. Ramping U up gradually, or trying several starts, helps find the lowest.
  • For a hard magnetic DFT+U case, VASP's recipe runs three steps from the previous WAVECAR: ICHARG = 12 with ALGO = Normal and no U; then ALGO = All with TIME = 0.05; then the U tags.
  • Energies with different U values cannot be compared; formation energies mixing +U and plain GGA need a correction scheme.

Rare-earth magnets

  • With f-in-core potentials (Nd_3, Sm_3) the 4f moment and the 4f single-ion anisotropy, the dominant part of the MAE in Nd₂Fe₁₄B or SmCo₅, are absent; the result is essentially the transition-metal part.
  • Studies that need the 4f contribution put the f electrons in the valence (potpaw.64 Nd or Nd_h), add U on the 4f states and spin–orbit coupling, and handle the many metastable 4f occupations explicitly.
  • Use LMAXMIX = 6 and LASPH = .TRUE. with valence f electrons. The POTCAR sheet covers the choice.

Version notes

VASPChange
6.4.0I_CONSTRAINED_M = 4: constrain direction and sign.
6.4.3Noncollinear site moments (LORBIT = 11) printed every few SCF steps, for every algorithm.
6.5ISPIN = 2 combined with LNONCOLLINEAR: rejected in 6.5.0, LNONCOLLINEAR takes precedence from 6.5.1. Simply leave ISPIN out of noncollinear runs.
6.6.0Default NBANDS uses the size of each MAGMOM; more stable noncollinear GGA and meta-GGA runs.
6.6.1Correct forces for spin-polarized meta-GGA (r²SCAN) runs, wrong in 6.6.0.

Common mistakes

  • MAGMOM without ISPIN = 2; MAGMOM count or order not matching POSCAR after building a supercell.
  • An antiferromagnet in a cell too small to hold its order.
  • Dropping MAGMOM on a restart or in the DOS run.
  • Reading the “tot” row of the site table as the cell moment.
  • Comparing energies with different U, POTCARs, ENCUT or k-point density.
  • MAE runs with the default GGA_COMPAT, LMAXMIX = 2, symmetry on, a copied WAVECAR, or NBANDS not doubled.
  • Writing MAGMOM in Cartesian x, y, z when SAXIS is not 0 0 1.
  • Expecting a 4f moment or rare-earth anisotropy from _3 potentials.
  • Taking the Fermi energy from a NUPDOWN run as the Fermi level of the material.

The physics behind this sheet

  • Lecture 23: Spin-polarized DFT and magnetism (in preparation)
  • Lecture 24: Spin–orbit coupling and magnetic anisotropy (in preparation)
  • Lecture 25: DFT+U and the Hubbard U (in preparation)

Further reading

  1. VASP Wiki, “MAGMOM” (starting moments, symmetry, restarts). · www.vasp.at
  2. VASP Wiki, “Determining the magnetic anisotropy”. · www.vasp.at
  3. VASP Wiki, “Constraining the local magnetic moments”. · www.vasp.at
  4. VASP tutorials, “Magnetism” (antiferromagnets, exchange constants, anisotropy, worked step by step). · www.vasp.at
  5. M. K. Horton, J. H. Montoya, M. Liu and K. A. Persson, “High-throughput prediction of the ground-state collinear magnetic order of inorganic materials using density functional theory”, npj Comput. Mater. 5, 64 (2019). · doi.org