Lecture 0 · Start here
Introduction to density functional theory
What does a DFT calculation compute, and what does VASP do when you press run?
You will be able to explain
- what a DFT calculation takes in and what it gives back
- why DFT works with the electron density instead of the many-electron wavefunction
- where DFT's one approximation sits, and the errors it is known for
- what VASP does with its four input files, from the first SCF step to the outputs
- how to convert between the energy units of theory papers and of VASP
Before this
Nothing beyond calculus and first-year physics.
Time
About 40 minutes
By Osman Goni Ridwan · Last reviewed
DFT & VASP Course · Lecture 01 / 19
This first lecture is a map of the subject. It answers three questions: what a DFT calculation computes, why the method can work at all, and what VASP does with your input files when you press run. Every idea here returns later in a lecture of its own; the links show where.
Press P to present one slide at a time, S for speaker notes.
What kind of question does DFT answer?
Is a new structure more stable than the known ones? DFT answers with energies.
DFT & VASP Course · Lecture 02 / 19
Here is a real question from my own research. My co-authors and I used an AI method to generate over 1,700 frameworks of sp² carbon, then ranked 100 of those whose graphene-like sheets curve everywhere like a saddle. The ranking uses one number per structure: its energy per atom, measured from graphite, the most stable form of carbon. The two lowest are new, at 0.197 and 0.201 eV per atom above graphite. The lowest such structure reported before, mct-cI192, sits at 0.211 eV per atom, so the new ones are 0.014 and 0.010 eV per atom lower.
Two choices in that ranking are worth noticing. Energies are compared per atom, because the structures have different numbers of atoms in their cells. And they are measured from graphite, because the total energy a DFT code prints has no absolute meaning on its own; only differences between calculations done the same way do (the outputs slide explains why).
The question "is it more stable?" has become a question about energies, and the differences that decide the ranking are about a hundredth of an electronvolt per atom. By the end of this course you should be able to judge whether a calculation is precise enough to resolve a difference that small. This lecture starts with where such energies come from.
Why not solve the Schrödinger equation exactly?
The exact many-electron wavefunction is too big: its size grows exponentially with the number of electrons.
DFT & VASP Course · Lecture 03 / 19
The energy of a structure is decided by its electrons: how they arrange themselves around the nuclei. Electrons obey quantum mechanics, so in principle we solve the Schrödinger equation for all of them at once. Its solution, the many-electron wavefunction Ψ(r1,…,rN), is one function of the positions of all N electrons: 3N coordinates. (Spin adds a label to each electron but no new coordinates.)
How much information is that? Describe the function along each coordinate by p numbers, for example its values at p points. A function of one coordinate then needs p numbers, a function of two needs p×p, and a function of 3N coordinates needs
M=p3N.Walter Kohn made this estimate in his 1998 Nobel lecture, with p between 3 and 10. Take a computer that can handle M=109 numbers and the most modest p=3. Then 3Nlog103≤9, so N≤6: six electrons. For N=100, M=3300≈10143. Only the order of magnitude of such estimates means anything, but no improvement in computers closes a gap of a hundred orders of magnitude. Kohn called it the exponential wall: wavefunction methods of chemical accuracy are limited to molecules with about ten chemically active electrons. Move the slider to see where the wall stands for other values of p.
The orange line shows the way out. A function of three coordinates needs p3 numbers, whatever the number of electrons. DFT is built on such a function, the electron density. It does not make the calculation free: Kohn–Sham DFT still uses one orbital per electron, so its cost grows as a power of the system size, roughly the square to the cube of the number of atoms. But it grows as a power, not exponentially. Lecture 5 returns to the wall.
What does DFT use instead?
The electron density: a function of only three coordinates that fixes the ground state.
- In: the atomic number ZI and position RI of every nucleus (and the cell, for a crystal).
- Out: the ground-state total energy for those nuclei. Forces, structures and stabilities follow from it.
- Out: the ground-state electron density, electrons per unit volume at each point r.
Click a term or a line of the legend.
- WavefunctionΨ(r1,…,rN): 3N coordinates. Its size grows exponentially with N.
- Densityn(r): 3 coordinates, for any number of electrons.
DFT & VASP Course · Lecture 04 / 19
Density functional theory (DFT) replaces the wavefunction by the electron density n(r), the number of electrons per unit volume near the point r. It follows from Ψ by integrating out all electrons but one,
n(r)=N∫∣Ψ(r,r2,…,rN)∣2dr2⋯drN,∫n(r)dr=N,with the spins summed over. However many electrons there are, it is a function of three coordinates.
Why should three coordinates be enough? In 1964 Pierre Hohenberg and Walter Kohn proved that the ground-state density determines the external potential v(r), the attraction of the nuclei, up to a constant. The rest of the Hamiltonian, the kinetic energy and the repulsion between electrons, is the same for every system. So the density fixes the Hamiltonian, and with it the ground-state energy and every other property. Lecture 8 proves the theorem.
For atoms, molecules and solids there is a simple way to see it, an argument due to E. Bright Wilson. The density has a sharp peak, a cusp, at every nucleus, which gives the positions RI. How steeply it falls away from the cusp gives the nuclear charge: averaged over directions, dn/dr=−2ZIn right at the nucleus. And the integral of n gives N. Positions, charges and the number of electrons are all the Hamiltonian contains. The Hohenberg–Kohn theorem proves the same for any external potential, not only that of point nuclei.
A DFT calculation therefore takes the atomic numbers and positions of the nuclei and returns the ground-state energy and density. The energy E0 is the total energy for those fixed nuclei: the energy of the electrons plus the repulsion between the nuclei.
If DFT is exact, why do results depend on the functional?
Only one piece of the energy, exchange–correlation, is unknown and must be approximated.
- Kinetic energy of non-interacting electrons with the same density, computed exactly from the Kohn–Sham orbitals.
- Hartree energy: the classical repulsion of the density with itself. Exact.
- Attraction to the nuclei, through their potential v(r). Exact.
- Exchange–correlation energy: everything the other terms leave out. Unknown, so it is approximated: LDA, PBE, SCAN, HSE…
The Kohn–Sham form of the energy of the electrons; the repulsion between the nuclei is added to it.
DFT & VASP Course · Lecture 05 / 19
The Hohenberg–Kohn theorem says the energy is a functional of the density, E[n], but not what that functional is. Kohn and Sham made it usable in 1965. They imagined a stand-in system of non-interacting electrons with the same density as the real one, described by orbitals φi with n=∑i∣φi∣2, and split the energy into the four pieces on the slide:
Ts=i∑⟨φi−21∇2φi⟩,U=21∬∣r−r′∣n(r)n(r′)drdr′,∫vndr,Exc.(Atomic units: energies in hartree, lengths in bohr.) The first three are known exactly in terms of the orbitals or the density: the kinetic energy of the stand-in electrons, the classical electrostatic energy of the density with itself, and the attraction to the nuclei. The fourth, the exchange–correlation energy, is defined as everything else. It contains the energy lowering from the Pauli principle (exchange, Lecture 6), the way electrons avoid each other (correlation), and the part of the true kinetic energy that the stand-in system misses. It must also cancel the spurious repulsion of each electron with its own charge, which U contains.
The exact form of Exc is unknown, and it is the only piece that must be approximated. So DFT is exact in principle and approximate in practice, and the approximation has a name: the exchange–correlation functional. Choosing it is the main physical choice you make in a DFT calculation (Lecture 10, Lecture 11).
The Kohn–Sham equations: what VASP actually solves
Minimizing E[n] over the orbitals, while keeping them orthonormal, gives one-electron equations, the Kohn–Sham equations:
[−21∇2+v(r)+vH(r)+vxc(r)]φi(r)=εiφi(r),vH(r)=∫∣r−r′∣n(r′)dr′,vxc(r)=δn(r)δExc.Each electron moves in the attraction of the nuclei, the electrostatic potential of the whole density (the Hartree potential vH), and the exchange–correlation potential. The N orbitals with the lowest εi are occupied. Because vH and vxc depend on the density, and the density on the orbitals, the equations are solved by the self-consistent loop of the run slide. Lecture 9 derives them.
What does an exchange–correlation functional look like?
Functionals form a ladder: higher rungs use more ingredients, are generally more accurate, and cost more.
- Rung 4 · hybridadds a fraction of exact exchange (short-range only in HSE06) · PBE0, HSE06
- Rung 3 · meta-GGAadds the kinetic-energy density of the orbitals · SCAN, r²SCAN
- Rung 2 · GGAadds the gradient of the density, ∇n · PBE
- Rung 1 · local (LSDA)uses the density at each point, n(r) · LDA
- Energy per electron at each point, built from local ingredients: the density, its gradient, and the orbitals' kinetic-energy density τ. Each rung allows one more.
DFT & VASP Course · Lecture 06 / 19
Most approximations share one form, the formula on the slide: Exc is an integral over space of the density times an exchange–correlation energy per electron, εxc, which depends on ingredients evaluated at each point. John Perdew named the resulting hierarchy Jacob's ladder. The rungs differ in which ingredients εxc may use.
- LDA uses only n(r). It takes εxc from the uniform electron gas, a model metal of constant density. Its exchange part is known exactly, εx=−43(3n/π)1/3 hartree with n in electrons per bohr³; its correlation part comes from accurate quantum Monte Carlo calculations. Each point of a real material is treated as if it were a piece of uniform gas with the local density.
- GGA adds the gradient ∇n, which tells εxc how fast the density changes nearby. PBE, published in 1996, is the GGA most used for solids.
- Meta-GGA adds the kinetic-energy density of the occupied orbitals, τ=21∑i∣∇φi∣2. It lets the functional recognize regions dominated by a single orbital, such as a covalent bond, which look nothing like a uniform gas. SCAN and r²SCAN are meta-GGAs.
- Hybrids replace a fraction of the approximate exchange by exact Hartree–Fock exchange computed from the orbitals (Lecture 6): 25% in PBE0, and 25% at short range only in HSE06. Exact exchange is not of the integral form on the slide; it is nonlocal, which is why hybrids cost much more in a plane-wave code.
Higher rungs are generally more accurate, and always more expensive. In this course we use PBE most of the time, r²SCAN in places, and hybrids such as HSE06 where band gaps matter (Lecture 26, Lecture 27).
Is DFT really “first principles”?
“First principles” describes the inputs: no experimental data on the system being studied. It does not guarantee accuracy. Perdew's group built PBE and SCAN without fitting to experiment, by requiring the approximation to obey exact properties of the true functional, for instance the exact limit of a uniform gas and known scaling laws. Other functionals, such as B3LYP in chemistry, contain parameters fitted to experimental data for a set of molecules. They can be excellent for systems like the ones they were fitted to, and should be used with caution for systems of a different kind, such as metals.
What can a DFT calculation predict?
Most properties follow from one map: the energy as a function of the atomic positions.
| What you want | What DFT provides | Lecture |
|---|---|---|
| Equilibrium structure, lattice constants | Minimum of the energy; forces and stress | Lecture 21, Lecture 22 |
| Which phase or compound is stable | Energy differences between structures | Lecture 20 |
| Vibrations, dynamical stability | Second derivatives of the energy | Lecture 31 |
| Migration and reaction barriers | Saddle points of the energy | Lecture 32 |
| Behaviour at finite temperature | Forces along a trajectory | Lecture 33 |
| Magnetic moments and ordering | Spin-resolved densities | Lecture 23, Lecture 24 |
| Band structure, density of states | Kohn–Sham eigenvalues, read with care | Lecture 29, Lecture 30 |
DFT & VASP Course · Lecture 07 / 19
Because DFT gives the energy for any arrangement of the nuclei, it gives the whole potential-energy surface E({RI}). Most properties are features of that surface. Structures are its minima. The force on a nucleus is minus its slope, FI=−∂E/∂RI, which VASP computes directly from the converged density without extra calculations (Lecture 21). Vibrational frequencies come from its curvature, and barriers from its saddle points: the lowest passes between two minima. None of this needs experimental input on the material.
The last two rows are different. Magnetism and band structures come from the electronic structure itself, not from the shape of the energy surface, and band structures in particular must be read with care, as the next slide explains.
Where does DFT struggle?
Its known weaknesses are not numerical, so no convergence setting removes them.
Self-interaction
An electron spuriously interacts with itself, clearest in a one-electron system. Lecture 10, Lecture 25
Band gaps
Kohn–Sham gaps underestimate measured gaps: silicon about 0.6 eV with PBE, 1.17 eV measured. Lecture 30, Lecture 27
Dispersion
LDA and GGAs miss the long-range attraction between separated atoms or molecules. Lecture 28
Strong correlation
Some transition-metal and rare-earth compounds are described poorly; a Hubbard U is a common fix. Lecture 25
DFT & VASP Course · Lecture 08 / 19
The common approximations have known, systematic weaknesses. Each has a physical cause.
- Self-interaction. A hydrogen atom has one electron, so there is no repulsion between electrons at all. But the Hartree energy U of its density is not zero: for the 1s density it is 5/16 hartree, 8.5 eV, the electron repelling its own charge cloud. The exact Exc cancels this exactly. Approximate functionals cancel most of it but not all, and what remains pushes electrons to spread out too much over too many atoms.
- Band gaps. The gap between the highest occupied and lowest empty Kohn–Sham eigenvalue is not the measured gap, even with the exact functional, and with LDA or PBE it is much smaller: about 0.6 eV for silicon, against 1.17 eV measured at low temperature.
- Dispersion. The van der Waals attraction between separated atoms comes from correlated fluctuations of their electrons far apart. A functional that looks only at the density near each point cannot see it. PBE, for example, barely binds the layers of graphite.
- Strong correlation. In some compounds of transition metals and rare earths, localized d or f electrons are poorly described. LDA gives nickel oxide a gap of a few tenths of an electronvolt; the measured gap is about 4 eV.
None of these errors goes away with a larger basis or more k-points. They belong to the approximate functional, and for band gaps partly to reading Kohn–Sham eigenvalues as excitation energies. That is why this course asks two separate questions about every number: is it converged, and is the approximation right for this system?
What is VASP?
A DFT code for periodic cells that expands the orbitals in plane waves and uses PAW.
- Kohn–Sham DFT
Solves the Kohn–Sham equations
for a cell that repeats in all three directions.
- Basis
Plane waves
The number of plane waves is set by the cutoff ENCUT. Lecture 17
- Near the nuclei
PAW and a frozen core
Smooth pseudo-orbitals; the core electrons are fixed by the POTCAR. Lecture 18
DFT & VASP Course · Lecture 09 / 19
VASP, the Vienna Ab initio Simulation Package, is developed at the University of Vienna. It solves the Kohn–Sham equations for a cell that repeats periodically in all three directions, which is how it describes a crystal. It expands each orbital in a plane-wave basis, a sum of waves ei(k+G)⋅r that fit the periodic cell. Only waves whose kinetic energy ℏ2∣k+G∣2/2m lies below a cutoff are kept, and that cutoff is ENCUT: raising it adds shorter wavelengths and makes the basis more complete.
Near each nucleus the orbitals oscillate rapidly, and representing those wiggles would take an enormous number of plane waves. VASP avoids this with the projector augmented-wave method (PAW). The calculation works with smooth pseudo-orbitals, which a moderate number of plane waves can represent, and reconstructs the true orbitals near each atom from atomic functions when needed. The innermost electrons are not computed at all: they are held in the configuration of the isolated atom used to generate the PAW dataset, the frozen-core approximation. Which electrons count as core is decided by the POTCAR you choose.
VASP is licensed software: academic licences go to research groups, whose users must be registered. If you publish VASP results, cite the method papers it asks for, among them Kresse and Furthmüller (1996) and Kresse and Joubert (1999). Other DFT codes include Quantum ESPRESSO, ABINIT, CASTEP and GPAW. The physics in this course applies to all of them; only the input tags are VASP's. When 15 solid-state codes were compared on the PBE equations of state of 71 elemental crystals, the recent codes agreed with each other about as well as high-precision experiments agree with each other. That is why this course spends its time on approximations and settings rather than on the choice of code.
What goes into a VASP calculation?
Four files: where the atoms are, what they are, which method, and which k-points.
- Where the atoms are
POSCARLattice vectors, the species and number of atoms, and their positions (fractional or Cartesian).
- What they are
POTCAROne PAW dataset per species, in POSCAR's order. Its header gives the valence electrons (ZVAL) and a suggested cutoff (ENMAX).
- Which method
INCARLines of
TAG = valuechoosing the method and its settings. Tags you leave out take default values. - Which k-points
KPOINTSHow the Brillouin zone is sampled. Optional: without it, VASP builds a mesh from KSPACING.
DFT & VASP Course · Lecture 010 / 19
These four files define the calculation. In INCAR, text after # or ! is a comment. POSCAR starts with a scaling factor that converts the lattice vectors to ångströms. KPOINTS lists the k-points: in a crystal the orbitals are labelled by a wavevector k, and the density is an average over all of them, which VASP approximates by a finite mesh of sample points. Lecture 15 explains how to choose it.
The roles overlap more than the file names suggest. The POTCAR also fixes which electrons are frozen in the core and, unless INCAR sets GGA or METAGGA, the exchange–correlation functional: a PBE POTCAR gives a PBE calculation. INCAR can set physical choices too, such as spin polarization. Lab 0 opens all four files for silicon.
What happens when you press run?
An electronic loop finds the ground state; an ionic loop around it moves the nuclei.
DFT & VASP Course · Lecture 011 / 19
A VASP run is two nested loops. The electronic loop, the self-consistent field (SCF) loop, finds the ground-state density for fixed nuclei. It is a loop because the Kohn–Sham potential depends on the density, which depends on the orbitals, which depend on the potential. The ionic loop around it moves the nuclei and runs the electronic loop again. In a static run such as Lab 0 the ionic loop is skipped. In the figure, click a box or step through a static run or a relaxation; the number of electronic steps it shows is illustrative. Step by step, with VASP's defaults:
1. Read the inputs.
VASP reads INCAR, POSCAR, POTCAR and KPOINTS (or uses KSPACING), then sets up the plane-wave basis and the k-point mesh.
2. Make a starting guess.
With no WAVECAR present, ISTART = 0: the orbitals start from random numbers (INIWAV = 1) and the density from a superposition of atomic charge densities (ICHARG = 2). For the first few steps (NELMDL) the Hamiltonian built from this density is held fixed while the orbitals settle.
3. Solve the Kohn–Sham equations.
With the potential held fixed, VASP improves the orbitals and their energies, the eigenvalues, at every k-point (Lecture 12).
4. Build a new density.
The occupied orbitals give a new density, which is mixed with the previous one to form the input of the next step (Lecture 12).
5. Converged?
Each electronic step writes one line to OSZICAR. The loop stops when the changes in both the free energy and the band-structure energy fall below EDIFF, or after NELM steps.
6. Energy and forces.
From the converged density VASP evaluates the total energy and the forces on the nuclei and, depending on the settings, the stress on the cell (Lecture 21).
7. Move the nuclei?
If NSW > 0, the nuclei are moved as IBRION prescribes and the electronic loop runs again. Unless you set IBRION, it defaults to 0, molecular dynamics, which always takes NSW steps and needs a time step, POTIM. A relaxation (IBRION = 1, 2 or 3) stops when EDIFFG is satisfied or after NSW steps. With the default NSW = 0 the nuclei stay put: a single-point calculation.
8. Write the outputs.
OSZICAR, OUTCAR, CONTCAR and vasprun.xml, and by default CHGCAR and WAVECAR (LCHARG, LWAVE).
What comes out of a VASP run?
Read OSZICAR to follow the run, OUTCAR for the details, CONTCAR to continue.
| File | What it holds | Open it to |
|---|---|---|
OSZICAR | One line per electronic step, a summary line per ionic step | See whether the loops converge |
OUTCAR | Detailed, human-readable output of the whole run | Find energies, forces, stress, warnings |
CONTCAR | The last structure, in POSCAR format | Continue from where the run stopped |
vasprun.xml | Machine-readable output of the run | Post-process with pymatgen or ASE |
CHGCAR | The structure, the charge density and the PAW occupancies | Restart (ICHARG = 1), band structures |
WAVECAR | Binary file of orbitals, eigenvalues, occupations | Restart from converged orbitals (ISTART = 1) |
DFT & VASP Course · Lecture 012 / 19
Six files cover almost everything you will look at. OSZICAR is short enough to read in full, and it is the first file to open after any run.
Reading one line of OSZICAR
The electronic steps are printed under the header N E dE d eps ncg rms rms(c): the step number, the current free energy, its change since the previous step, the change in the band-structure energy, the number of Hamiltonian evaluations on a wavefunction, the norm of the residual of the trial orbitals (their approximate error), and the difference between input and output charge density. At the end of each ionic step a line gives F, the total free energy, and E0, the energy extrapolated to zero smearing.
Both are measured not from zero but from the isolated reference atoms for which the POTCAR files were made. That is why the energy of a crystal comes out as a few eV per atom, not the thousands of eV that all its electrons would have, and why only differences between calculations with the same POTCARs mean anything (Lecture 20). Lecture 12 reads every column in detail.
Lab 0: what will you run?
One static calculation of silicon: two atoms in the cell, four short input files.
POSCAR
Si, diamond structure 5.431 0.0 0.5 0.5 0.5 0.0 0.5 0.5 0.5 0.0 Si 2 Direct 0.00 0.00 0.00 0.25 0.25 0.25
KPOINTS
Gamma-centred 8x8x8 0 Gamma 8 8 8
POTCAR
The PBE PAW dataset Si from your group's licensed VASP installation.
Crystalline silicon in the diamond structure, primitive cell. The point is to watch the loop of the run figure happen, not yet to get a converged number.
DFT & VASP Course · Lecture 013 / 19
INCAR. Set the plane-wave cutoff explicitly, so that every calculation you want to compare uses the same basis; 300 eV is above the 245.345 eV ENMAX of the silicon POTCAR. ISMEAR = 0 with SIGMA = 0.05 eV selects Gaussian smearing with a small width. Silicon has a band gap, so every state should be either full or empty. VASP's default smearing (ISMEAR = 1) is designed for metals and can give unphysical occupations in a material with a gap; small Gaussian smearing is the safe choice (Lecture 16). EDIFF = 1E-6 stops the SCF loop when the energy and the eigenvalue sum change by less than 10−6 eV. No functional is set, so VASP takes PBE from the POTCAR.
POSCAR. Line 1 is a comment. Line 2 is the scaling factor in Å, here the measured lattice parameter of silicon at room temperature, 5.431 Å. Lines 3–5 are the primitive vectors of the face-centred cubic lattice in units of the scaling factor. Lines 6–7 give one species and two atoms. The last lines are fractional coordinates: the second atom sits a quarter of the way along the cube diagonal.
KPOINTS. The 0 on line 2 asks VASP to generate the mesh; line 3 makes it Γ-centred; line 4 asks for 8 subdivisions along each reciprocal lattice vector.
POTCAR. The silicon dataset treats 4 electrons per atom as valence, the 3s² 3p² shell, and freezes the 10 core electrons. Its ENMAX is 245.345 eV in the potpaw.64 set. This site never shows POTCAR contents, which are part of the licensed VASP distribution.
Lab 0: what should you look for?
Watch the SCF loop converge, then record the energy and everything that produced it.
- OSZICAR: count the electronic steps. Watch
dEandd epsshrink until both fall below EDIFF. - Last line of OSZICAR: note
FandE0, the free energy and the energy extrapolated to zero smearing. - Reproducibility: note the VASP version and the first line of the POTCAR.
Bring back
OSZICAR, OUTCAR, the VASP version and the POTCAR's first line. We read your OSZICAR line by line in Lecture 12.
None of these settings is converged yet: Lecture 19 tests ENCUT and the k-mesh properly.
DFT & VASP Course · Lecture 014 / 19
Lab outputs on this site always come from real runs, never invented ones. The first line of a POTCAR names the dataset and its date, which is what another person needs to reproduce your number. The OSZICAR columns are explained in the “Reading one line of OSZICAR” panel on the outputs slide.
Before you run, predict: the first few electronic steps (five, by default) change the energy by large amounts, because the Hamiltonian is held fixed while random orbitals settle. After that, each step should shrink the change by a roughly constant factor. Check both predictions against your OSZICAR.
Which units does DFT use?
VASP speaks electronvolts and ångströms; theory papers speak hartrees and bohrs.
| Quantity | Value | Status |
|---|---|---|
| 1 hartree, Eh | 27.211386245981 eV | measured |
| 1 rydberg, Eh/2 | 13.605693122990 eV | measured |
| 1 bohr, a0 | 0.529177210544 Å | measured |
| 1 eV per particle | 96.4853321233 kJ/mol | exact |
| 1 eV ÷ kB | 11604.5181216 K | exact |
| 1 eV ÷ hc | 8065.54393735 cm−1 | exact |
DFT & VASP Course · Lecture 015 / 19
Theory papers use Hartree atomic units, in which ℏ=me=e=4πε0=1. In these units the hydrogen atom's ground-state energy is exactly −½ hartree and its Bohr radius is 1 bohr, which is why equations look uncluttered. VASP reads and writes electronvolts and ångströms, and gives pressures in kilobar (kB, the unit of PSTRESS; 1 kB = 0.1 GPa).
The "exact" conversions follow from e, NA, kB, h and c, which have fixed values in the SI since 2019. For example, 1 eV per particle is e×NA = 96.485 kJ/mol. The hartree, rydberg and bohr depend on measured constants, such as the electron mass, and carry tiny uncertainties.
Back to the opening slide: the 0.010–0.014 eV/atom that separated the carbon frameworks is 0.96–1.35 kJ/mol, or kB times 116–162 K. Type a value into the converter to check.
How is this course organized?
Ten parts, from the Schrödinger equation to calculations you can defend.
- Quantum mechanics you need: Born–Oppenheimer to Hartree–Fock
- Density functional theory: Hohenberg–Kohn, Kohn–Sham, SCF
- Electrons in crystals: Bloch's theorem, k-points, smearing
- How VASP represents electrons: plane waves, PAW, convergence
- Energies, forces, structures: formation energies, relaxations
- Spin and correlation: magnetism, spin–orbit, DFT+U
- Beyond semilocal functionals: meta-GGAs, hybrids, vdW
- Reading electronic structure: bands, DOS, the gap problem
- Properties: phonons, barriers, MD, ML potentials
- Doing DFT responsibly: errors, methods, a capstone audit
DFT & VASP Course · Lecture 016 / 19
Each part is made necessary by the one before. How to use these pages:
- A dotted underline marks a key term and a blue chip such as ENCUT a VASP tag. Click either for a short explanation.
- The text under each slide explains the slide in full, like a textbook section; you should not need another source to follow it. “Going deeper” panels hold derivations you can skip on a first reading.
- Press P to present one slide at a time and S to open these notes in a second window. Printing a lecture gives a handout with the notes.
Which misconceptions should you drop now?
Four beliefs that cause most beginners' mistakes. Click a card to turn it over.
“DFT is exact.”
Only in principle, and only for the ground state. Every practical calculation approximates the exchange–correlation energy, often the largest error.
“DFT is just fitting to experiment.”
PBE and SCAN are built from exact constraints without experimental input. Some functionals do contain fitted parameters, so it matters which one you use.
“VASP finished without errors, so the answer is right.”
It only means the loops stopped: by meeting EDIFF or EDIFFG, or by running out of NELM or NSW steps. Check which, then check the settings and the functional.
“The band gap in my output is the measured gap.”
Kohn–Sham gaps underestimate measured gaps: about 0.6 eV for silicon with PBE, against 1.17 eV. Lecture 30 explains why.
DFT & VASP Course · Lecture 017 / 19
Check yourself
One question per outcome. Answer aloud, then click to compare.
What does a DFT calculation take in, and what does it give back?
The atomic numbers and positions of the nuclei (and the cell). It returns the ground-state energy and density; forces and structures follow from the energy.
Why does DFT work with the density rather than the wavefunction?
Ψ depends on 3N coordinates, so its size grows like p3N. The density depends on 3 for any N, and the ground-state density fixes the energy.
DFT is exact in principle. Why can a converged calculation still be wrong?
The exchange–correlation energy is approximated. Its errors, such as missing dispersion or self-interaction, do not shrink with more k-points or a higher cutoff.
With no WAVECAR, how does VASP start, and when does the SCF loop stop?
From random orbitals and overlapping atomic densities. It stops when the energy changes fall below EDIFF, or after NELM steps.
Convert 0.010 eV/atom to kJ/mol and to a temperature.
0.010 × 96.485 = 0.965 kJ/mol. Divided by kB: 0.010 × 11604.5 K = 116 K.
DFT & VASP Course · Lecture 018 / 19
What should you remember?
DFT trades the wavefunction for the density, and puts its one approximation in Exc.
- A DFT calculation turns the nuclei, {ZI,RI}, into a ground-state energy and density. Forces, structures and stabilities follow from the energy.
- The wavefunction hits the exponential wall; the density has three coordinates for any number of electrons.
- Exact in principle, approximate in practice: band gaps, dispersion, self-interaction and strong correlation are physical errors, not numerical ones.
- VASP: four input files; an electronic loop inside an ionic loop; read OSZICAR first.
- 1 hartree = 27.211 eV, and 0.01 eV/atom ≈ 1 kJ/mol ≈ kB × 116 K.
Next: Lecture 1 asks what physical problem lies underneath POSCAR, POTCAR and INCAR.
DFT & VASP Course · Lecture 019 / 19
Key terms
- Exponential wall
- The exponential growth of a direct many-electron wavefunction representation with electron number: a grid of g points per spatial coordinate needs g^(3N) amplitudes. Structured wavefunction methods can avoid this direct storage; this count is not a universal modern system-size limit.
- Density functional theory (DFT)
- A formulation of quantum mechanics in which the ground-state energy of interacting electrons is written as a functional of the electron density n(r) instead of the many-electron wavefunction. It is exact in principle; in practice the exchange–correlation energy must be approximated.
- Electron density
- n(r), the number of electrons per unit volume at the point r. Integrated over all space it gives the total number of electrons, ∫n(r)d3r=N.
- Ground state
- The lowest-energy state of a system. Ordinary DFT is a theory of the ground state; excited states need extensions of the theory or other methods.
- Exchange–correlation energy
- The part of the DFT energy that carries the many-electron effects of the Pauli principle (exchange), of electrons avoiding one another (correlation), and the part of the kinetic energy that the non-interacting Kohn–Sham system misses. Its exact form is unknown, so every practical calculation uses an approximation such as LDA, PBE or r²SCAN.
- Jacob's ladder
- Perdew and Schmidt's hierarchy of exchange–correlation approximations. Each rung adds an ingredient: the local density (LDA), its gradient (GGA), the kinetic-energy density of the orbitals (meta-GGA), a fraction of exact exchange (hybrids). Accuracy generally improves, and cost rises, as one climbs.
- First principles (ab initio)
- Starting from the laws of quantum mechanics, with only the atomic numbers and positions as input, and without fitting to experimental data on the system being studied.
- Potential-energy surface
- The energy E({RI}) as a function of the positions of all nuclei. Its minima are stable or metastable structures; its first-order saddle points are the transition states, whose energies set the barriers between them.
- Self-interaction error
- The spurious interaction of an electron with its own charge that remains in approximate functionals, because their exchange–correlation energy does not exactly cancel the electron's Coulomb energy with itself.
- Dispersion (van der Waals) interaction
- The weak attraction between atoms and molecules that are not chemically bonded to each other. Local and semilocal approximations miss its long-range part.
- Strongly correlated materials
- Materials, often containing transition-metal d or rare-earth f electrons, in which the electrons' mutual repulsion can dominate their kinetic energy. Standard local approximations often describe them poorly.
- Kohn–Sham equations
- One-electron, Schrödinger-like equations for fictitious non-interacting electrons in an effective potential, constructed so that they reproduce the density of the real interacting electrons. They are the equations VASP solves.
- Plane-wave basis
- Functions ei(k+G)⋅r used to expand the orbitals of a periodic system. The basis is truncated at a kinetic-energy cutoff, which VASP sets with ENCUT.
- Projector augmented-wave (PAW) method
- A method that works with smooth auxiliary orbitals, which a moderate plane-wave basis can represent, and recovers the all-electron orbitals inside spheres around the atoms by a linear transformation.
- Frozen-core approximation
- The approximation that the core electrons keep the configuration of the isolated atom used to generate the PAW dataset.
- k-points
- Wavevectors labelling the phase change of an electronic wave under a crystal translation: ψnk(r+R)=eik⋅Rψnk(r). Each k-point has many band states; a weighted mesh samples these states across the Brillouin zone.
- Self-consistent field (SCF)
- The iterative loop in which the density determines the potential, the potential determines the orbitals, and the orbitals give a new density, repeated until input and output agree.
- Hartree atomic units
- Units in which ℏ=me=e=4πε0=1. Energy is measured in hartree, Eh = 27.211386245981 eV, and length in bohr, a0 = 0.529177210544 Å (CODATA 2022).
VASP tags in this lecture
ENCUT- Cutoff energy of the plane-wave basis set, in eV. The VASP Wiki strongly recommends setting it explicitly in every INCAR, and checking the convergence of the quantity you report.Default: the largest ENMAX among the POTCAR files · VASP Wiki: ENCUT
KSPACING- Smallest allowed spacing between k-points, in Å−1. When there is no KPOINTS file, VASP builds the k-point mesh from it.Default: 0.5 (Γ-centred while KGAMMA = .TRUE., its default) · VASP Wiki: KSPACING
GGA- Selects the exchange–correlation functional of the GGA family; GGA = PE is PBE.Default: the functional given by LEXCH in the POTCAR, if METAGGA and XC are not set either · VASP Wiki: GGA
ISTART- Whether the run starts from scratch (0) or reads the orbitals from an existing WAVECAR (1 or higher).Default: 1 if a WAVECAR file exists, otherwise 0 · VASP Wiki: ISTART
INIWAV- How the orbitals are initialized when no WAVECAR is read. INIWAV = 1 fills them with random numbers.Default: 1 · VASP Wiki: INIWAV
ICHARG- How the initial charge density is built: 2 takes a superposition of atomic charge densities, 1 reads CHGCAR, 0 computes it from the initial orbitals, and 11 keeps a CHGCAR density fixed to obtain band structures or densities of states.Default: 2 if ISTART = 0, otherwise 0 · VASP Wiki: ICHARG
NELMDL- Number of non-self-consistent steps at the start, during which the Hamiltonian built from the initial density is kept fixed while the orbitals settle. A negative value applies the delay only in the first ionic step.Default: −12 if ISTART = 0, INIWAV = 1 and IALGO = 48 or 50; 0 if a WAVECAR is present; −5 otherwise · VASP Wiki: NELMDL
EDIFF- Stopping criterion of the electronic self-consistency loop, in eV. The loop stops when both the change of the free energy and the change of the band-structure energy between two steps fall below EDIFF.Default: 10−4 eV · VASP Wiki: EDIFF
NELM- Maximum number of electronic self-consistency steps.Default: 60 · VASP Wiki: NELM
NSW- Maximum number of ionic steps. With NSW = 0 the nuclei are not moved: a single-point (static) calculation.Default: 0 · VASP Wiki: NSW
IBRION- How the nuclei are moved between ionic steps: −1 not at all, 0 molecular dynamics, 1 relaxation with RMM-DIIS, 2 relaxation with conjugate gradients, 3 relaxation with damped molecular dynamics.Default: −1 if NSW = −1 or 0, otherwise 0 (molecular dynamics) · VASP Wiki: IBRION
POTIM- In ionic relaxations (IBRION = 1, 2, 3), a scaling constant for the step widths; in molecular dynamics, the time step in fs.Default: 0.5 for IBRION = 1, 2 and 3; 0.015 Å for IBRION = 5 and 6; none for molecular dynamics (must be set) · VASP Wiki: POTIM
EDIFFG- Stopping criterion of an ionic relaxation. A positive value stops when the total energy changes by less than EDIFFG between ionic steps; a negative value stops when the norms of all forces are below |EDIFFG|. It is not used in molecular dynamics.Default: EDIFF × 10 · VASP Wiki: EDIFFG
LCHARG- Whether the charge density is written to CHGCAR at the end of the run.Default: .TRUE. (VASP 6.0–6.4.2: .NOT. LH5) · VASP Wiki: LCHARG
LWAVE- Whether the orbitals are written to WAVECAR at the end of the run.Default: .TRUE. · VASP Wiki: LWAVE
ISMEAR- How partial occupancies are assigned to the electronic states. ISMEAR = 0 is Gaussian smearing; ISMEAR = N > 0 is Methfessel–Paxton smearing of order N, which can give erroneous results for insulators.Default: 1 · VASP Wiki: ISMEAR
SIGMA- Width of the smearing, in eV. With Gaussian smearing (ISMEAR = 0) values of 0.03–0.1 are typical; for metals with Methfessel–Paxton smearing, SIGMA can be as large as keeps the entropy term below about 1 meV per atom.Default: 0.2 · VASP Wiki: SIGMA
PSTRESS- A pressure added in relaxations that change the cell. Its unit is kB (kilobar); 1 kB = 0.1 GPa.Default: 0 · VASP Wiki: PSTRESS
Further reading
- W. Kohn, “Nobel Lecture: Electronic structure of matter—wave functions and density functionals”, Rev. Mod. Phys. 71, 1253–1266 (1999). · doi:10.1103/RevModPhys.71.1253 · Nobel lecture PDF
- R. O. Jones, “Density functional theory for the sceptical”, in E. Pavarini, E. Koch, A. Lichtenstein and D. Vollhardt (eds.), Understanding Correlated Materials with DMFT, Modeling and Simulation Vol. 15 (Forschungszentrum Jülich, 2025), ISBN 978-3-95806-813-1. · PDF
- O. G. Ridwan, S. Pitié, M. Soundar Raj, D. Dai, G. Frapper, H. Xue and Q. Zhu, “AI-assisted rapid crystal structure generation towards a target local environment”, npj Comput. Mater. 12, 64 (2026). · doi:10.1038/s41524-025-01931-9 · arXiv:2506.08224