Osman Goni Ridwan

VASP cheat sheet · Applications

VASP relaxation workflow

How to take a structure from its starting guess to a converged geometry and a trustworthy energy: which optimizer and ISIF to use, when the relaxation really is finished, why the cutoff matters for the cell, and the static and DOS runs that follow.

Checked against VASP 6.6.1 · Updated

The short version

  1. Relax with IBRION = 2, ISIF = 3 (bulk) or ISIF = 2 (slabs, defects), and a force criterion such as EDIFFG = -0.02.
  2. When the cell changes, use ENCUT ≥ 1.3 × the largest ENMAX and relax again from CONTCAR until the volume stops changing (Pulay stress).
  3. Relax metals with ISMEAR = 1 ; SIGMA = 0.2, insulators with ISMEAR = 0 ; SIGMA = 0.05; keep ISMEAR = -5 for the final static run.
  4. Take the energy you report from a static run at the relaxed geometry, not from the relaxation.
  5. A relaxation keeps the symmetry of its starting structure. To reach a lower-symmetry minimum, displace atoms in POSCAR.

The workflow, step by step

  1. Pre-relax (optional). A machine-learned potential (MACE, CHGNet, VASP's own MLFF) or a coarse VASP run (PREC = Normal, fewer k-points, EDIFFG = −0.1) gets the structure close cheaply.
  2. Relax atoms and cell with the INCAR below.
  3. Relax again from CONTCAR (cp CONTCAR POSCAR), with a fresh basis set (a new run, or ISTART = 1), until the volume changes by less than about 1%. For magnets, seed MAGMOM with the final moments.
  4. Static run at the final geometry: the energy you report, and CHGCAR for the next step.
  5. DOS and band structure from that CHGCAR (see the INCAR recipes and the KPOINTS sheet).
Step 2-3: relax atoms and cell
PREC   = Accurate
ENCUT  = 520            ! at least 1.3 x the largest ENMAX; keep it fixed for the whole project
EDIFF  = 1E-6
IBRION = 2              ! conjugate gradient
ISIF   = 3              ! atoms, cell shape and volume
NSW    = 99
EDIFFG = -0.02          ! every force below 0.02 eV/A
NELMIN = 4
ISMEAR = 1 ; SIGMA = 0.2        ! metal; insulator: ISMEAR = 0 ; SIGMA = 0.05
ISPIN  = 2 ; MAGMOM = 2*4.0 ; LORBIT = 11   ! magnets: high-spin start, one value per atom
LASPH  = .TRUE. ; LMAXMIX = 4
LWAVE  = .FALSE. ; LCHARG = .FALSE.
Step 4: static run at the relaxed geometry
PREC    = Accurate
ENCUT   = 520           ! the same as the relaxation
EDIFF   = 1E-6
NSW     = 0 ; IBRION = -1
ISMEAR  = -5            ! tetrahedron: Gamma-centred mesh, at least 4 k-points
ISPIN   = 2 ; MAGMOM = 2*2.2 ; LORBIT = 11   ! relaxed moments; keep MAGMOM in every later run
LASPH   = .TRUE. ; LMAXMIX = 4
LCHARG  = .TRUE.        ! CHGCAR for the DOS and band runs
LWAVE   = .FALSE.

What moves: ISIF

ISIFAtomsCell shapeVolumeUse for
0yesnonoNo stress computed (the default for MD and hybrids).
1yesnonoOnly the pressure (trace of the stress) is valid.
2yesnonoSlabs, defects, molecules: the default otherwise.
3yesyesyesFull relaxation of bulk crystals.
4yesyesnoFixed-volume points of an energy–volume curve.
5noyesnoCell shape only.
6noyesyesCell only, atoms fixed in fractional coordinates.
7nonoyesVolume only.
8yesnoyesAtoms and volume, shape fixed (VASP 6.4.1 and later).

The stress tensor is computed for ISIF 2 to 8. In OUTCAR a positive diagonal stress means the cell is compressed and wants to expand. VASP's own volume-relaxation guide recommends relaxing one degree of freedom at a time (its example uses ISIF = 7); ISIF = 3 in one go is the common practice.

Which optimizer

IBRIONMethodWhen
2Conjugate gradientThe robust default, also far from the minimum. Fine-tune the step: optimal POTIM ≈ POTIM × the trialstep printed in the output. VASP advice
1RMM-DIIS (quasi-Newton)Close to the minimum and with more than about 20 degrees of freedom; needs accurate forces (NELMIN 4 for bulk, 8 for surfaces) and is sensitive to POTIM. NFREE 10–20 for complex cases. VASP advice
3Damped molecular dynamicsFar from the minimum or for soft systems; start with SMASS ≈ 0.4 and a POTIM about twice the smallest conjugate-gradient step. VASP advice

Without IBRION, NSW > 0 runs molecular dynamics and stops at once (no default time step). With IBRION = −1 and NSW > 0 the same structure is computed NSW times.

When it stops: EDIFFG

  • A negative EDIFFG stops when every force is below |EDIFFG| (eV/Å): -0.02 for most work, -0.01 or tighter before phonons.
  • A positive value (and the default, 10 × EDIFF) stops on the energy change between ionic steps, which can leave large forces.
  • For ISIF = 3, VASP's developers state that the test also includes the stress; the documentation does not spell this out.
  • EDIFF must be much tighter than the forces you ask for: 1E-6 or smaller, otherwise the forces are noise.
  • Hitting NSW is not convergence: OUTCAR must say reached required accuracy.

Pulay stress and the cutoff

VASP keeps the number of plane waves fixed while the cell changes, so the effective cutoff drifts with the volume and the stress comes out too negative; volumes then end up too small. Two remedies:

  • Use ENCUT ≥ 1.3 × the largest ENMAX for any relaxation that changes the cell; VASP calls this the lower recommended limit. VASP advice
  • Restart from CONTCAR with a fresh basis set (a new run, or ISTART = 1) until the cell stops changing. ISTART = 2 keeps the old basis and therefore the error. VASP advice

An energy–volume curve at fixed volumes avoids the problem and works with the default cutoff. PSTRESS can absorb a measured Pulay stress, but VASP's PSTRESS and Volume-relaxation pages give opposite signs for that correction; a higher cutoff is the safer route.

Slabs, 2D sheets, E–V curves and magnets

CaseHow
Slab with vacuumISIF = 2 with the bottom layers fixed by selective dynamics (F F F). Never ISIF = 3: the vacuum collapses.
2D sheetISIF = 3 with LATTICE_CONSTRAINTS = .TRUE. .TRUE. .FALSE., the vacuum along a3 parallel to z (VASP 6.5.0 or later in practice).
Energy–volume curve5–10 volumes spanning about ±5–10% in volume, each with ISIF = 4 (atoms and shape relax at fixed volume; a negative POSCAR scale sets the volume), then fit an equation of state.
MagnetStart high-spin; reseed MAGMOM from the final moments for the next run, and keep MAGMOM in every restart so the magnetic symmetry is not lost.
r²SCANPre-relax with PBE or PBEsol and start from its WAVECAR. Use VASP 6.6.1, not 6.6.0, for spin-polarized r²SCAN.

Check it worked

Relaxation checks
grep -c "reached required accuracy" OUTCAR    # 1 = EDIFFG met
grep -c " F= " OSZICAR                        # ionic steps used: must be below NSW
grep "volume of cell" OUTCAR | awk 'NR==1{v0=$5} END{printf "start %s  end %s  change %.2f %%\n", v0, $5, 100*($5-v0)/v0}'
grep "external pressure" OUTCAR | tail -1     # near 0 kB after a converged ISIF = 3 run

Also check that the last SCF converged, that the largest force is below |EDIFFG| (command), that the moments did not collapse, and that CONTCAR has the space group you expect (spglib or pymatgen).

How Materials Project does it

Materials Project relaxes every structure twice in a row (cell and atoms, starting high-spin ferromagnetic), then runs a static calculation on a finer mesh. Its newest r²SCAN workflow first relaxes with PBEsol, which gives a cheap starting structure and density, then relaxes with r²SCAN. Workflow packages such as atomate2 also offer a machine-learned pre-relaxation before the VASP relaxation.

The relaxation tags

TagWhat it doesDefaultWhat to useWatch out
IBRIONHow the atoms move.−1 if NSW = −1 or 0, otherwise 0 (molecular dynamics)2 (conjugate gradient) far from the minimum; 1 (RMM-DIIS) close to it; 0 for MD; 6 or 8 for phonons.NSW > 0 without IBRION gives IBRION = 0, molecular dynamics with no time step, and VASP stops at once.
ISIFWhich of atoms, cell shape and volume relax, and whether the stress is computed.0 for molecular dynamics (IBRION = 0) or hybrid functionals (LHFCALC = .TRUE.), otherwise 22: atoms only. 3: atoms, shape and volume. 4: atoms and shape at fixed volume. 7: volume only. 8: atoms and volume (VASP 6.4.1 and later).Changing the cell gives Pulay stress: use ENCUT ≥ 1.3 × ENMAX and re-run from CONTCAR. Hybrids default to ISIF = 0, so no stress unless you set it.
NSWMaximum number of ionic steps.00 for static runs; about 100 for relaxations.With NSW > 0, always set IBRION too.
EDIFFGWhen a relaxation stops.EDIFF × 10Negative = force criterion in eV/Å: −0.02 is a common choice; tighten it before phonon calculations.Positive values (including the default) stop on an energy change, not on the forces.
POTIMStep size: the time step in fs for MD, a step scaling for relaxations, the displacement in Å for finite differences.0.5 for IBRION = 1, 2 and 3; 0.015 Å for IBRION = 5 and 6; none for molecular dynamics (must be set)Keep 0.5 for relaxations. MD: it must be set, and light atoms such as H need a smaller step.IBRION = 1 is especially sensitive to POTIM.
NFREEIBRION = 1: how many previous steps the quasi-Newton optimizer remembers; IBRION = 5, 6: displacements per direction.2 for IBRION = 5 and 6, otherwise 010 to 20 for complex relaxations with IBRION = 1.Very large values rarely help.
PSTRESSAn external pressure in kB (1 kB = 0.1 GPa) that relaxations and NpT runs target.0Relax under pressure. It can also absorb the Pulay stress, but a higher ENCUT is the cleaner fix.The VASP Wiki's PSTRESS and Volume relaxation pages give opposite signs for the Pulay correction: test it on your system.

Common mistakes

  • NSW set and IBRION forgotten: molecular dynamics, stopping at once.
  • One ISIF = 3 run at the default ENCUT, and its energy reported.
  • Restarting a cell relaxation with ISTART = 2.
  • ISIF = 3 on a slab; ISMEAR = −5 in a metal relaxation; ISMEAR > 0 for an insulator.
  • EDIFF too loose for the EDIFFG asked for.
  • Expecting a symmetry-lowering distortion without breaking the symmetry in POSCAR.
  • Dropping MAGMOM, or changing ENCUT, between the relaxation, static and DOS runs.

The physics behind this sheet

  • Lecture 21: Forces, stress and structural relaxation (in preparation)
  • Lecture 22: Equations of state and elastic constants (in preparation)

Further reading

  1. VASP Wiki, “Structure optimization” (choosing IBRION, POTIM and NELMIN, and the symmetry caveat). · vasp.at/wiki
  2. VASP Wiki, “ISIF” (which degrees of freedom relax, and the stress). · www.vasp.at
  3. VASP Wiki, “Volume relaxation” (Pulay stress, the 1.3 × cutoff rule and the restart protocol). · vasp.at/wiki
  4. VASP Wiki, “Pulay stress”. · www.vasp.at