Kohn–Sham DFT on one page
The chain of ideas behind a DFT calculation, from Born–Oppenheimer and the Hohenberg–Kohn theorems to the Kohn–Sham equations, functionals and basis sets.
Density functional theory (DFT) is the method behind most electronic-structure calculations on molecules and solids today, from a geometry optimisation in Gaussian to a band structure in Quantum ESPRESSO. This page lays out the chain of ideas in order, with each equation written out, so that the input keywords of either program have a clear meaning. A longer version, chapter by chapter with runnable Python, is in my DFT notes.
The problem DFT solves
A molecule is a set of nuclei and electrons. A proton is about 1836 times heavier than an electron, so the electrons adjust almost instantly to any motion of the nuclei. The Born–Oppenheimer approximation [1] uses this to separate the two: fix the nuclei at positions , solve for the electrons, and treat the resulting electronic energy as the potential energy surface on which the nuclei move. In atomic units the electronic Hamiltonian for electrons is
The three terms are the kinetic energy, the attraction to the nuclei, and the electron–electron repulsion. The last term couples every electron to every other, so the wavefunction cannot be split into one-electron pieces and depends on all spatial coordinates at once (plus spins). Storing it on even a coarse grid of 10 points per coordinate would take numbers, which for the 10 electrons of a water molecule is already .
The electron density
is a function of only three variables, whatever is. DFT is the statement that this much smaller object is enough.
The Hohenberg–Kohn theorems (1964)
Hohenberg and Kohn proved two results [2].
First theorem. For a non-degenerate ground state, the density determines the external potential up to an additive constant. The proof is short. Suppose two potentials that differ by more than a constant had the same ground-state density , with ground states , and energies , . Using as a trial function for gives , and the same argument the other way round gives . Adding the two gives , a contradiction. Since and fix the Hamiltonian, the ground-state density fixes everything about the system, including its energy.
Second theorem. There is a universal functional , the same for every molecule, such that
for any admissible density, with equality at the true ground-state density. The ground state can therefore be found by minimising over densities instead of wavefunctions. Levy's constrained search [3] later gave a definition that works for any density coming from an -electron wavefunction, including degenerate ground states.
The theorems prove that exists. They do not say what it is, and the kinetic-energy part in particular is very hard to write directly in terms of .
The Kohn–Sham construction (1965)
Kohn and Sham's idea [4] was to borrow the kinetic energy from a system that is easy to solve. Imagine non-interacting electrons moving in some effective potential , chosen so that their ground-state density equals the density of the real, interacting system. Their wavefunction is a single Slater determinant of orbitals , and
(summing over occupied spin orbitals). The total energy is split into four pieces, three of which are known exactly:
is the kinetic energy of the non-interacting electrons, the attraction to the nuclei, and the Hartree energy, the classical repulsion of the density with itself. Everything else goes into the exchange–correlation energy, defined as the remainder:
It contains exchange, correlation, the part of the true kinetic energy that misses, and the correction for the self-repulsion that wrongly includes. It is a modest fraction of the total energy, but chemical bonding depends on it sensitively, and it is where all the approximation in practical DFT lives.
Minimising with respect to the orbitals, keeping them orthonormal, gives the Kohn–Sham equations:
These look like one-electron Schrödinger equations, and with the exact they would give the exact ground-state density and energy. The total energy is not simply the sum of the eigenvalues, because counts the Hartree energy twice and includes instead of :
where is the repulsion between the fixed nuclei.
For comparison, Hückel theory also solves a one-electron eigenvalue problem, but its Hamiltonian is fixed in advance by two parameters. In Kohn–Sham theory the Hamiltonian depends on the density it produces, which is why the equations have to be solved iteratively.
The self-consistent field loop
- Guess a density, for example a superposition of atomic densities.
- Build the effective potential .
- Solve the Kohn–Sham equations for the lowest orbitals. In a basis set this becomes a matrix eigenvalue problem.
- Build a new density from the occupied orbitals.
- Mix the new density with the old one rather than replacing it outright, which damps oscillations. Simple linear mixing works for easy cases; codes use extrapolation schemes such as Pulay's DIIS (common in molecular codes, applied to the Kohn–Sham matrix) or Broyden-type density mixing (used in Quantum ESPRESSO).
- Repeat from step 2 until the energy and density stop changing within a set threshold.
A geometry optimisation wraps a second loop around this one: converge the SCF, compute forces on the nuclei, move them, and converge again.
Jacob's ladder of functionals
Perdew and Schmidt arranged approximations to as the rungs of a ladder [5]. Each rung adds one more ingredient, and with it more physics and more cost.
| Rung | Ingredients | Examples |
|---|---|---|
| Local density approximation (LDA) | Slater exchange with VWN correlation | |
| Generalised gradient approximation (GGA) | , | PBE, BLYP |
| Meta-GGA | , , kinetic energy density | TPSS, SCAN |
| Hybrid | a GGA or meta-GGA plus a fraction of exact exchange from occupied orbitals | B3LYP, PBE0 |
| Fifth rung | unoccupied orbitals as well | double hybrids, random-phase approximation |
LDA
The LDA treats each point of the molecule as if it were a uniform electron gas at the local density:
The exchange part is known exactly, , where the constant is 0.7386 for a spin-unpolarised density. The correlation part comes from quantum Monte Carlo calculations on the uniform gas [6], fitted to analytic forms such as that of Vosko, Wilk and Nusair [7]. LDA works surprisingly well for solids with slowly varying densities but overbinds molecules.
GGA, for example PBE
A GGA also uses the gradient of the density. Exchange is written as the LDA value times an enhancement factor that depends on the reduced gradient , with . In PBE [8]
Neither constant is fitted to molecular data. is set by the Lieb–Oxford bound on the exchange energy, which caps at , and is chosen so that for slowly varying densities the gradient terms of exchange and correlation cancel, keeping the LDA's correct linear response. PBE is the usual default for solids in plane-wave codes.
Hybrids, for example B3LYP
Hartree–Fock exchange, evaluated with the Kohn–Sham orbitals, is exact for exchange but pairs badly with approximate correlation. Becke showed that mixing a fraction of it into a GGA improves thermochemistry, and proposed a three-parameter form fitted to the atomisation energies, ionisation potentials, proton affinities and total atomic energies of a standard test set [9]:
with , and . Here is Becke's 1988 gradient correction to exchange [10]. B3LYP keeps the same three numbers but replaces the PW91 correlation with that of Lee, Yang and Parr (LYP) [11, 12]. LYP is a complete correlation functional rather than a correction to the local one, so the local part is mixed in separately. As Gaussian implements it [13],
Gaussian uses Vosko–Wilk–Nusair functional III for the local correlation, while some other programs use functional V, so B3LYP energies from different codes can differ slightly. The exact-exchange term depends on the orbitals, not just the density, so it is a non-local operator and costs more than a GGA.
Basis sets and plane waves
The Kohn–Sham orbitals have to be expanded in some set of functions, and the two programs I use make different choices.
Gaussian: atom-centred Gaussian basis sets. Each orbital is a combination of Gaussian functions centred on the atoms. The functions follow the molecule, so a small number of them describes a molecule well, all electrons can be treated explicitly for light atoms (with effective core potentials available for heavy ones), and the integrals needed for exact exchange have closed forms, which makes hybrid functionals routine. The quality is improved by moving to larger basis sets, and because each atom's functions also help describe its neighbours, interaction energies carry a basis-set superposition error that has to be checked.
Quantum ESPRESSO: plane waves with pseudopotentials. For a periodic crystal, Bloch's theorem writes each orbital as times a function with the period of the lattice, and that function is expanded in plane waves over the reciprocal lattice vectors . All plane waves with are kept, so a single number controls the quality of the basis and there is no superposition error [14]. The price is that the sharp orbitals near a nucleus would need an enormous cutoff. Pseudopotentials (norm-conserving or ultrasoft) and the closely related projector augmented-wave (PAW) method remove the core electrons and smooth the valence orbitals inside a core radius, which brings the cutoff down to something practical. The Brillouin zone has to be sampled with a grid of points, molecules have to be placed in a box with enough vacuum to separate them from their periodic images, and exact exchange is much more expensive than with Gaussian functions, which is one reason GGAs such as PBE dominate plane-wave work.
Where this meets my own work
I used B3LYP in Gaussian for a DFT study of the vanadium complex [VO(SALIEP)(DTP)] as a water-reducing catalyst, with Dr. Soumyajit Roy. The work is in preparation, so there are no results to report here. A single molecular complex is the case that atom-centred basis sets and hybrid functionals suit well, while periodic solids belong to the plane-wave side. Longer derivations of these steps, including the Hartree–Fock background that the hybrids borrow from, are in the DFT notes.
References
- M. Born and R. Oppenheimer, "Zur Quantentheorie der Molekeln", Annalen der Physik 389, 457–484 (1927). https://doi.org/10.1002/andp.19273892002
- P. Hohenberg and W. Kohn, "Inhomogeneous Electron Gas", Physical Review 136, B864–B871 (1964). https://doi.org/10.1103/PhysRev.136.B864
- M. Levy, "Universal variational functionals of electron densities, first-order density matrices, and natural spin-orbitals and solution of the v-representability problem", Proceedings of the National Academy of Sciences USA 76, 6062–6065 (1979). https://doi.org/10.1073/pnas.76.12.6062
- W. Kohn and L. J. Sham, "Self-Consistent Equations Including Exchange and Correlation Effects", Physical Review 140, A1133–A1138 (1965). https://doi.org/10.1103/PhysRev.140.A1133
- J. P. Perdew and K. Schmidt, "Jacob's ladder of density functional approximations for the exchange-correlation energy", AIP Conference Proceedings 577, 1–20 (2001). https://doi.org/10.1063/1.1390175
- D. M. Ceperley and B. J. Alder, "Ground State of the Electron Gas by a Stochastic Method", Physical Review Letters 45, 566–569 (1980). https://doi.org/10.1103/PhysRevLett.45.566
- S. H. Vosko, L. Wilk and M. Nusair, "Accurate spin-dependent electron liquid correlation energies for local spin density calculations: a critical analysis", Canadian Journal of Physics 58, 1200–1211 (1980). https://doi.org/10.1139/p80-159
- J. P. Perdew, K. Burke and M. Ernzerhof, "Generalized Gradient Approximation Made Simple", Physical Review Letters 77, 3865–3868 (1996). https://doi.org/10.1103/PhysRevLett.77.3865
- A. D. Becke, "Density-functional thermochemistry. III. The role of exact exchange", Journal of Chemical Physics 98, 5648–5652 (1993). https://doi.org/10.1063/1.464913
- A. D. Becke, "Density-functional exchange-energy approximation with correct asymptotic behavior", Physical Review A 38, 3098–3100 (1988). https://doi.org/10.1103/PhysRevA.38.3098
- C. Lee, W. Yang and R. G. Parr, "Development of the Colle-Salvetti correlation-energy formula into a functional of the electron density", Physical Review B 37, 785–789 (1988). https://doi.org/10.1103/PhysRevB.37.785
- P. J. Stephens, F. J. Devlin, C. F. Chabalowski and M. J. Frisch, "Ab Initio Calculation of Vibrational Absorption and Circular Dichroism Spectra Using Density Functional Force Fields", Journal of Physical Chemistry 98, 11623–11627 (1994). https://doi.org/10.1021/j100096a001
- Gaussian, Inc., "Density Functional (DFT) Methods", Gaussian 16 user's reference. https://gaussian.com/dft/
- P. Giannozzi et al., "QUANTUM ESPRESSO: a modular and open-source software project for quantum simulations of materials", Journal of Physics: Condensed Matter 21, 395502 (2009). https://doi.org/10.1088/0953-8984/21/39/395502