Osman Goni Ridwan

Lecture 3 · Part I: Quantum mechanics you need

The variational principle and basis sets

How does an unsolvable differential equation become a finite calculation?

You will be able to explain

  • why the energy of any trial wavefunction is an upper bound to the ground-state energy
  • how a basis expansion turns the problem into Hc = ESc
  • why a larger nested basis can only lower the energy, and what it costs
  • how ENCUT sets the size of VASP's plane-wave basis
  • why numerical convergence is different from physical accuracy

Before this

Wavefunctions, operators and eigenvalues

Time

About 55 minutes

DFT & VASP Course · Lecture 31 / 19

Lecture 2 ended with a recipe: expand ψ\psi in a basis and H^ψ=Eψ\hat H\psi = E\psi becomes a matrix problem. This lecture asks the two questions that recipe raises. If the basis cannot represent the exact state, what does the answer mean? And how do you know the basis is big enough? The answers, the variational principle and basis convergence, are why VASP has a tag called ENCUT.

Press P to present one slide at a time, S for speaker notes.

Why can't we just solve Ĥψ = Eψ exactly?

A few idealized Hamiltonians have closed-form solutions; realistic many-electron systems need approximations.

  • Solved exactlyA particle in a box, the harmonic oscillator, the hydrogen atom.
  • Not solvable exactlyHelium, with just two electrons, and everything larger: molecules and solids.
  1. Variational principle: a rule
  2. Trial functions: one parameter
  3. Basis sets: many parameters
  4. Hc = ESc: a matrix problem
  5. Convergence and ENCUT

DFT & VASP Course · Lecture 32 / 19

Once Schrödinger had solved the hydrogen atom in 1926, people expected helium to follow quickly. It did not yield a hydrogen-like closed-form solution; highly accurate numerical helium solutions do exist. With two electrons, the repulsion 1/∣r1−r2∣1/|\mathbf r_1 - \mathbf r_2| couples their motions, the equation no longer separates into one-electron pieces, and no closed-form solution exists. The same is true of every molecule and every solid. Electronic structure is therefore the art of approximating well, and of knowing how good the approximation is. This lecture gives the rule that makes approximation systematic, then the machinery that turns it into a computer program.

What does the variational principle say?

No trial wavefunction can have an energy below the true ground-state energy.

E[ϕ]=⟨ϕ∣H^∣ϕ⟩⟨ϕ∣ϕ⟩  ≥  E0\eqterm{E}{E[\phi]} = \eqterm{num}{\frac{\langle \phi | \hat H | \phi \rangle}{\langle \phi | \phi \rangle}} \;\eqterm{ge}{\ge}\; \eqterm{E0}{E_0}
  • Trial energy of any allowed function ϕ\phi, the trial wavefunction.
  • Rayleigh quotient: the energy expectation value; the denominator removes the normalization.
  • Never below: equal only if ϕ\phi is an exact ground state.
  • Exact ground-state energy of the same Hamiltonian.

DFT & VASP Course · Lecture 33 / 19

Make a guess ϕ\phi, the trial wavefunction, and compute its average energy. The variational principle says this average is never below the exact ground-state energy E0E_0, whatever ϕ\phi you choose, provided it has finite energy and obeys the same boundary and particle-symmetry conditions as the true states. Dividing by ⟨ϕ∣ϕ⟩\langle\phi|\phi\rangle means ϕ\phi need not even be normalized.

That one inequality makes approximation a practical tool, in two ways:

  • Ranking. Of two trial functions, the one with the lower energy gives the better estimate of the ground-state energy.
  • Optimizing. If ϕ\phi contains adjustable parameters, minimizing the energy over them gives the best function of that form, and the minimum is still an upper bound to E0E_0.

Why can no trial energy fall below E₀?

A trial state is a mixture of exact states, so its energy is their weighted average.

E[ϕ]=∑n∣cn∣2En⟹E[ϕ]−E0=∑n>0∣cn∣2 (En−E0)  ≥  0E[\phi] = \eqterm{avg}{\sum_n |c_n|^2 E_n} \quad\Longrightarrow\quad E[\phi] - E_0 = \eqterm{exc}{\sum_{n>0} |c_n|^2 \,(E_n - E_0)} \;\ge\; 0
  • Weighted average of exact energies, with weights ∣cn∣2|c_n|^2 that add up to 1 (Lecture 2).
  • Excited-state admixture: every term is positive or zero, so the trial energy sits above E0E_0.

Expand the normalized trial state in the exact eigenstates: ϕ=∑ncnψn\phi = \sum_n c_n \psi_n.

DFT & VASP Course · Lecture 34 / 19

The proof uses only Lecture 2. Any normalized trial function can be expanded in the exact eigenstates of H^\hat H, ϕ=∑ncnψn\phi = \sum_n c_n\psi_n, even though we do not know them. Its energy is then the weighted average ∑n∣cn∣2En\sum_n |c_n|^2 E_n, with weights that add up to one. An average of numbers that are all at least E0E_0 is itself at least E0E_0.

Subtracting E0E_0, using ∑n∣cn∣2=1\sum_n|c_n|^2 = 1, shows exactly what raises the energy: every bit of excited state mixed in, weighted by how far above the ground state it lies. The equality holds only when all coefficients of higher-energy states vanish, that is when ϕ\phi is the ground state. A useful corollary: if the trial function is wrong by a small amount δ\delta, so that the excited-state coefficients are of size δ\delta, the energy is wrong only by an amount of size δ2\delta^2. Energies converge faster than wavefunctions, which is why a variational energy can be good while the wavefunction is still visibly off.

How do you use the variational principle?

Choose a family of trial functions and lower the energy by varying its parameters.

0.10.31300.751.52.253 exact E₀ = 0.5 ħω width parameter α (log scale) E(α) (ħω) — exact ground state — trial, this α x (oscillator length)
ModelGaussian trial functions with one width parameter α. For the oscillator the family contains the exact ground state; for hydrogen it does not.

DFT & VASP Course · Lecture 35 / 19

A Gaussian is a bell-shaped function, here e−αx2/2e^{-\alpha x^2/2}; increasing the positive width parameter α makes it narrower. A harmonic oscillator is a particle in a spring-like quadratic well V(x)=mω2x2/2V(x)=m\omega^2x^2/2, with angular frequency ω. The figure rescales oscillator length and energy to use dimensionless α and energies in units of ℏω\hbar\omega. For hydrogen, r is distance from the nucleus in bohr and energies are in hartree. A cusp is a nonzero radial slope at the nucleus; a Gaussian has zero slope there.

The harmonic oscillator. Take a Gaussian, ϕ=e−αx2/2\phi = e^{-\alpha x^2/2}, for H^=−ℏ22md2dx2+12mω2x2\hat H = -\frac{\hbar^2}{2m}\frac{d^2}{dx^2} + \frac12 m\omega^2x^2. Its probability density e−αx2e^{-\alpha x^2} has ⟨x2⟩=1/2α\langle x^2\rangle = 1/2\alpha, so the potential energy is 12mω2⟨x2⟩=mω2/4α\tfrac12 m\omega^2\langle x^2\rangle = m\omega^2/4\alpha. Its slope is ϕ′=−αxϕ\phi' = -\alpha x\phi, so the kinetic energy is ℏ22m⟨(αx)2⟩=ℏ2α/4m\frac{\hbar^2}{2m}\langle(\alpha x)^2\rangle = \hbar^2\alpha/4m. Together,

E(α)=ℏ2α4m+mω24α.E(\alpha) = \frac{\hbar^2\alpha}{4m} + \frac{m\omega^2}{4\alpha}.

A narrow Gaussian (large α\alpha) curves sharply and has high kinetic energy; a broad one reaches into high potential energy. Setting dE/dα=0dE/d\alpha = 0 gives α=mω/ℏ\alpha = m\omega/\hbar and E=12ℏωE = \tfrac12\hbar\omega: the exact ground-state energy, because this family happens to contain the exact ground state.

The hydrogen atom. Now try ϕ=e−αr2\phi = e^{-\alpha r^2} for the electron of hydrogen. The same kind of calculation in atomic units gives

E(α)=32 α−22α/π,E(\alpha) = \tfrac32\,\alpha - 2\sqrt{2\alpha/\pi},

kinetic energy minus nuclear attraction. Setting dE/dα=32−2/πα=0dE/d\alpha = \tfrac32 - \sqrt{2/\pi\alpha} = 0 gives α=8/9π≈0.283\alpha = 8/9\pi \approx 0.283 bohr−2^{-2} and E=−4/3π=−0.4244E = -4/3\pi = -0.4244 hartree, 15% above the exact −0.5-0.5 hartree (for an infinitely heavy nucleus). The bound holds, but no width fixes the error. The exact 1s orbital, e−re^{-r}, has a sharp cusp at the nucleus and decays as a simple exponential far away; a Gaussian is flat at the nucleus and decays much faster. Use the switch to compare the two families.

What does a low variational energy prove?

Only that it is an upper bound. It does not prove the wavefunction, or the physics, is good.

  • GuaranteedThe trial energy is never below E0E_0.
  • GuaranteedA bigger family that contains the smaller one can reach an equal or lower energy.
  • Not guaranteedThat the family is flexible enough: hydrogen's Gaussian stops 15% too high.
  • Not guaranteedThat a minimizer found the lowest minimum, or that the Hamiltonian itself is right.

DFT & VASP Course · Lecture 36 / 19

The variational principle is a one-sided guarantee. It tells you which of two approximations is better for the ground-state energy, but not how far the better one is from the truth. It says nothing about other properties: because energies converge faster than wavefunctions (the δ2\delta^2 of the earlier slide), a wavefunction with a good energy can still give a poor dipole moment or a poor density far from the nucleus.

It also applies only to the Hamiltonian you wrote down. If that Hamiltonian, or later the exchange–correlation functional, is wrong, minimizing it carefully gives a precise answer to the wrong problem. And bounds for excited states need extra conditions, such as orthogonality to the states below.

How do you give a trial function many parameters?

Write it as a sum of fixed basis functions; only the coefficients are unknown.

ψ(r)≈∑i=1Mci ϕi(r)⟷v=vxx^+vyy^+vzz^\psi(\mathbf r) \approx \sum_{i=1}^{M} \eqterm{c}{c_i}\, \eqterm{phi}{\phi_i(\mathbf r)} \qquad \longleftrightarrow \qquad \mathbf v = v_x \hat{\mathbf x} + v_y \hat{\mathbf y} + v_z \hat{\mathbf z}
  • Basis functions: chosen in advance, like the unit vectors x̂, ŷ, ẑ.
  • Coefficients: the MM numbers the calculation determines.
  • A basis function is not an orbitalAn optimized orbital is a combination of many basis functions.
  • The gainAn unknown function becomes a list of MM unknown numbers.

DFT & VASP Course · Lecture 37 / 19

One parameter is rarely enough. The general method chooses a basis set of known functions and lets the coefficients vary. The analogy with ordinary vectors is close: a vector is a sum of unit vectors weighted by its components, and a wavefunction is a sum of basis functions weighted by its coefficients. With MM basis functions the trial family has MM parameters, and the variational principle tells us how to choose them: make the energy as low as possible.

Unlike the Gaussian width of the last slide, the coefficients enter linearly. That makes the minimization much easier: it does not need trial and error, as the next slide shows.

How does the minimization become a matrix problem?

Minimizing the energy over the coefficients gives Hc = ESc, a generalized eigenvalue problem.

∑j⟨ϕi∣H^∣ϕj⟩ cj=E∑j⟨ϕi∣ϕj⟩ cj⟺Hc=E S c\sum_j \eqterm{H}{\langle \phi_i | \hat H | \phi_j \rangle}\, c_j = E \sum_j \eqterm{S}{\langle \phi_i | \phi_j \rangle}\, c_j \quad\Longleftrightarrow\quad \mathbf H\mathbf c = E\, \eqterm{Sm}{\mathbf S}\, \mathbf c
  • Hamiltonian matrix element HijH_{ij}, as in Lecture 2.
  • Overlap matrix element SijS_{ij}: how much two basis functions overlap.
  • Orthonormal basis: S\mathbf S is the identity, and the problem is Hc=Ec\mathbf H\mathbf c = E\mathbf c.

DFT & VASP Course · Lecture 38 / 19

Insert ψ=∑jcjϕj\psi = \sum_j c_j\phi_j into the Rayleigh quotient. Numerator and denominator become sums over pairs of basis functions:

The star in ci∗c_i^* means complex conjugation. A dagger, c†\mathbf c^\dagger, means transpose the coefficient column into a row and conjugate each entry. An identity matrix has 1 on its diagonal and 0 elsewhere; multiplying by it leaves a vector unchanged. In a nonorthogonal basis, c†Sc\mathbf c^\dagger\mathbf S\mathbf c is the wavefunction's norm, so coefficients alone need not have squared magnitudes adding to one.

E(c)=∑ijci∗Hij cj∑ijci∗Sij cj=c†Hcc†Sc.E(\mathbf c) = \frac{\sum_{ij} c_i^* H_{ij}\, c_j}{\sum_{ij} c_i^* S_{ij}\, c_j} = \frac{\mathbf c^\dagger \mathbf H \mathbf c}{\mathbf c^\dagger \mathbf S \mathbf c}.

At the minimum the energy is stationary with respect to every coefficient. Multiply out, c†Hc=E c†Sc\mathbf c^\dagger\mathbf H\mathbf c = E\,\mathbf c^\dagger\mathbf S\mathbf c, and differentiate with respect to ci∗c_i^*, keeping ∂E/∂ci∗=0\partial E/\partial c_i^* = 0: the result is ∑jHijcj=E∑jSijcj\sum_j H_{ij}c_j = E\sum_j S_{ij}c_j for every ii, the equation on the slide. It is called a generalized eigenvalue problem because of the matrix S\mathbf S on the right. In an orthonormal basis the overlap matrix is the identity and it becomes the ordinary eigenvalue problem of Lecture 2.

An M×MM \times M problem has MM solutions. The lowest eigenvalue is the best ground-state energy available in this basis, and its eigenvector holds the best coefficients. The higher eigenvalues are upper bounds to the excited-state energies, one by one; this is the Hylleraas–Undheim–MacDonald theorem. This turns minimization over functions into a finite matrix calculation.

The basis must be linearly independent: no function should be an exact combination of the others. For example, adding ϕ3=ϕ1+ϕ2\phi_3=\phi_1+\phi_2 supplies no new freedom. Near duplication makes the overlap matrix nearly singular, meaning it has an eigenvalue close to zero and cannot be inverted reliably. This is a numerical issue in some large atom-centered basis sets. In VASP, orthogonal plane waves still lead to a generalized equation because PAW introduces an overlap operator; that has a different origin from overlapping Gaussians.

What happens when two basis functions couple?

They mix, and the two levels repel: the lower one drops below both starting energies.

012300.51 coupling H₁₂ (eV) energy (eV) levels at this H₁₂ H₁₁H₂₂E₋E₊
ModelAn orthonormal two-function basis with H11=1H_{11} = 1 eV and H22=2H_{22} = 2 eV. Slide the coupling H12H_{12}.

DFT & VASP Course · Lecture 39 / 19

The diagonal element H11H_{11} is the energy expectation of basis function 1. The off-diagonal element H12H_{12} measures how the Hamiltonian connects functions 1 and 2: this is the coupling being varied. It is an energy, rather than a probability or an extra interaction added to the Hamiltonian. For this real symmetric example H21=H12H_{21}=H_{12}. The determinant of a 2×2 matrix (abcd)\begin{pmatrix}a&b\\c&d\end{pmatrix} is ad − bc; setting it to zero is the condition for a nonzero eigenvector.

With two orthonormal basis functions, Hc=Ec\mathbf H\mathbf c = E\mathbf c has a solution only if det⁡(H−EI)=0\det(\mathbf H - E\mathbf I) = 0, that is (H11−E)(H22−E)−H122=0(H_{11} - E)(H_{22} - E) - H_{12}^2 = 0. This quadratic gives two energies,

E±=H11+H222±(H22−H112)2+H122.E_\pm = \frac{H_{11} + H_{22}}{2} \pm \sqrt{\Big(\frac{H_{22} - H_{11}}{2}\Big)^2 + H_{12}^2}.

Without coupling they are just H11H_{11} and H22H_{22}. Any coupling pushes them apart, symmetrically about their mean: the lower one falls below H11H_{11} and the upper one rises above H22H_{22} by the same amount. With H12=0.2H_{12} = 0.2 eV the levels are 0.9615 and 2.0385 eV. Two limits are worth remembering. If the coupling is weak compared with the gap, the shift is about H122/(H22−H11)H_{12}^2/(H_{22} - H_{11}), small. If the two starting energies are equal, the shift is the full ±H12\pm H_{12} and the two functions mix half and half.

The same mathematics describes a chemical bond forming from two atomic orbitals, the lower level being the bonding orbital and the upper the antibonding one, and, in Lecture 14, gaps opening in band structures.

Why does a bigger basis give a better answer?

A bigger basis contains the smaller one, so the lowest energy can never go up.

10⁻¹⁰10⁻⁶10⁻²10²1481216 M = 1: E₀ − E_exact = 2.97e+1 E₁M = 2: E₀ − E_exact = 7.95e+0 E₁M = 3: E₀ − E_exact = 7.02e+0 E₁M = 4: E₀ − E_exact = 1.00e+0 E₁M = 5: E₀ − E_exact = 6.13e-1 E₁M = 6: E₀ − E_exact = 2.14e-1 E₁M = 7: E₀ − E_exact = 1.07e-2 E₁M = 8: E₀ − E_exact = 1.05e-2 E₁M = 9: E₀ − E_exact = 6.76e-4 E₁M = 10: E₀ − E_exact = 5.79e-5 E₁M = 11: E₀ − E_exact = 1.47e-5 E₁M = 12: E₀ − E_exact = 1.56e-7 E₁M = 13: E₀ − E_exact = 1.46e-7 E₁M = 14: E₀ − E_exact = 4.25e-8 E₁M = 15: E₀ − E_exact = 2.34e-8 E₁M = 16: E₀ − E_exact = 1.72e-8 E₁ number of basis functions M E₀(M) − E₀(exact) (E₁) — converged ψ₀ — with M = 2 box, with the well V(x) in grey
ModelA particle in a box with an off-centre well, V=800 E1(x/L−0.38)2V = 800\,E_1 (x/L - 0.38)^2, where E1E_1 is the ground-state energy of the empty box (Lecture 2), solved in the first M box states. Each point is one diagonalization.

DFT & VASP Course · Lecture 310 / 19

Here the basis functions are the box states of Lecture 2, sin⁡(nπx/L)\sin(n\pi x/L), and the Hamiltonian adds a harmonic well that none of them describes on its own. With one function the energy is far too high. Each added function brings new freedom while keeping all the old trial states available (set the new coefficient to zero), so the lowest energy never rises:

E(1)≥E(2)≥E(3)≥⋯≥E0.E^{(1)} \ge E^{(2)} \ge E^{(3)} \ge \dots \ge E_0 .

Ten functions get within 10−4 E110^{-4}\,E_1 of the converged value, and the approximate wavefunction becomes indistinguishable from the converged one. The figure plots the error on a logarithmic scale, so you can watch it fall by orders of magnitude as functions are added.

On a logarithmic scale, equal steps represent equal ratios: 10⁻² → 10⁻³ → 10⁻⁴ means the error is divided by ten each time. Nested bases keep all earlier functions and add new ones. Swapping one small basis for an unrelated basis does not supply the same monotonic guarantee. One diagonalization means solving the finite matrix for its eigenvalues and eigenvectors.

Two cautions for real calculations. This steady decrease holds for the ground-state energy of a fixed Hamiltonian in nested bases; other quantities, such as forces or band gaps, need not converge steadily. And in a self-consistent calculation other settings change with the basis, so test the quantity you will report (Lecture 19).

What does a bigger basis cost?

Bigger vectors and matrices: more memory and time for every orbital.

  • Per orbitalMM coefficients to store and update.
  • Per matrixM2M^2 elements; diagonalizing it fully takes of order M3M^3 operations.
  • What VASP doesBy default, iterative diagonalization finds only the NBANDS lowest states (Lecture 12).

DFT & VASP Course · Lecture 311 / 19

The useful question is never “how big can I make the basis?” but “what is the smallest basis for which my result no longer changes, to the tolerance I need?” A larger basis means longer coefficient vectors, a larger Hamiltonian to apply, more orthogonalization and, in parallel runs, more communication.

Plane-wave codes have so many basis functions, often thousands to hundreds of thousands per k-point, that they avoid building and diagonalizing the full matrix. Instead they need only the lowest few eigenvectors, and find them iteratively: start from guesses, apply H^\hat H to them, and improve them step by step. By default VASP uses such a method, the blocked-Davidson algorithm (ALGO = Normal), and computes only the NBANDS lowest orbitals. Full diagonalization (ALGO = Exact) is kept for special cases.

Which basis sets do electronic-structure codes use?

Plane waves suit periodic solids; atom-centred functions suit molecules.

BasisStrengthWeaknessExamples
Plane waves eiG⋅re^{i\mathbf G\cdot\mathbf r}Natural for periodic cells; improved by one number, the cutoffNeed very many plane waves for the rapid oscillations near nucleiVASP, Quantum ESPRESSO
Gaussian orbitals e−αr2e^{-\alpha r^2}Compact; integrals are fastNo cusp, wrong tail: many are neededQuantum-chemistry codes
Real-space gridsDirect, flexible resolutionAccuracy set by the grid spacingGPAW (finite-difference mode)

DFT & VASP Course · Lecture 312 / 19

Gaussian orbitals are popular in molecular codes because the integrals between them, including the four-centre integrals of electron repulsion, can be evaluated in closed form. A single Gaussian looks little like an atomic orbital, as the hydrogen example showed, but sums of several reproduce one well, and with enough Gaussians you can expand any smooth function.

Plane waves have the opposite strengths. They are orthonormal, they do not depend on where the atoms are, and their quality is controlled by a single number, the cutoff, which makes convergence tests simple. Their weakness is the region near each nucleus, where orbitals oscillate rapidly. VASP handles that region with PAW, whose smooth pseudo-orbitals a moderate plane-wave basis can represent (Lecture 17, Lecture 18).

How are a k-point and a basis wave different?

k fixes the cell-to-cell phase; many reciprocal-lattice vectors G supply the detail inside that orbital.

−k hl −505 Blue: admitted GGray: excluded G
2D reciprocal-space sliceFor a 5 Å square cell, each dot is an integer reciprocal-lattice vector G. Blue dots satisfy ℏ2∣k+G∣2/(2me)<Ecut\hbar^2|\mathbf k+\mathbf G|^2/(2m_e)<E_{\mathrm{cut}}. Counts describe this slice, not a full VASP basis.

DFT & VASP Course · Lecture 313 / 19

Lecture 2 wrote a Bloch orbital as eik⋅runk(r)e^{i\mathbf k\cdot\mathbf r}u_{n\mathbf k}(\mathbf r), with u periodic inside the crystal cell. Expand that periodic part in waves eiG⋅re^{i\mathbf G\cdot\mathbf r}, where G=hb1+lb2+mb3\mathbf G=h\mathbf b_1+l\mathbf b_2+m\mathbf b_3 and h, l, m are integers. The complete orbital then contains waves with wavevectors k+G\mathbf k+\mathbf G. Adding G preserves the translation phase, since eiG⋅R=1e^{i\mathbf G\cdot\mathbf R}=1 for a lattice translation R.

The plot holds one k-point fixed and varies the cutoff. In G coordinates, the allowed disk is centered at −k; in full three-dimensional space it is a sphere. Larger cutoff admits shorter-wavelength components, giving each orbital more coefficients. Switching k shifts the disk relative to the reciprocal lattice. This is different from adding more sampling k-points across the Brillouin zone.

ENCUT controls the plane waves available to describe each orbital. NBANDS controls how many orbitals are solved at each k-point. A k-mesh controls where in the zone those separate problems are sampled. These three controls change different parts of a calculation.

What does ENCUT control?

ENCUT keeps every plane wave below a kinetic-energy cutoff, so it sets the size of the basis.

ψnk(r)=∑Gcnk(G) ei(k+G)⋅r,ℏ22m ∣k+G∣2<Ecut\psi_{n\mathbf k}(\mathbf r) = \sum_{\mathbf G} c_{n\mathbf k}(\mathbf G)\, e^{i(\mathbf k + \mathbf G)\cdot \mathbf r}, \qquad \eqterm{cut}{\frac{\hbar^2}{2m}\,|\mathbf k + \mathbf G|^2 < E_{\mathrm{cut}}}
  • The cutoff: only plane waves with kinetic energy below EcutE_{\mathrm{cut}} = ENCUT are kept.
  • DefaultThe largest ENMAX in the POTCARs. Never go below it.
  • RecommendedSet ENCUT explicitly, and test the quantity you report.
  • NotA cutoff on the band energies.

DFT & VASP Course · Lecture 314 / 19

In a periodic cell, each orbital is a sum of plane waves labelled by reciprocal-lattice vectors G\mathbf G (Lecture 13, Lecture 14). Each plane wave ei(k+G)⋅re^{i(\mathbf k + \mathbf G)\cdot\mathbf r} is an eigenfunction of the kinetic-energy operator, with eigenvalue ℏ2∣k+G∣2/2m\hbar^2|\mathbf k + \mathbf G|^2/2m (Lecture 2), and higher kinetic energy means shorter wavelength. ENCUT keeps all plane waves with kinetic energy below it. Raising it adds shorter wavelengths, finer detail, to a bigger nested basis, so the variational principle applies.

The default is the largest ENMAX among the POTCARs, the cutoff each PAW dataset was designed for. Values below it give large errors and should never be used. Set ENCUT explicitly, so that calculations you want to compare use the same cutoff, and check the convergence of the quantity you report.

ENCUT limits the basis, not the eigenvalues: the band energies VASP reports are not limited by ENCUT. And because the set of plane waves depends on the cell, changing the cell during a relaxation changes the basis, a subtlety called Pulay stress that returns in Lecture 22.

Pulay stress is an artificial contribution to the calculated stress caused by the incomplete basis changing as the cell changes. An FFT, or fast Fourier transform, converts arrays between position-space and plane-wave representations. VASP also needs sufficiently fine FFT grids, so real calculations involve more numerical settings than the ideal fixed-Hamiltonian variational example.

Does a converged basis give the right answer?

No: convergence removes numerical error, not the errors of the physical model.

QuestionKind of errorHow to test it
Is the basis large enough?NumericalRaise ENCUT
Is the k-point mesh dense enough?NumericalCompare denser meshes (Lecture 15)
Is the SCF loop converged?NumericalTighten EDIFF (Lecture 12)
Is PBE suitable here?PhysicalKnown failures; other functionals (Lecture 11)
Does spin–orbit coupling matter?PhysicalRun with it (Lecture 24)

DFT & VASP Course · Lecture 315 / 19

Keep two questions apart. Did we solve the chosen model accurately? That is numerical convergence, and the variational principle and basis tests answer it. Was the model appropriate? That is physics: Born–Oppenheimer, the exchange–correlation functional, the PAW datasets, spin–orbit coupling. A calculation can be perfectly converged and physically wrong, and no ENCUT repairs an unsuitable functional, a missing magnetic state or a poor structure. Lecture 35 returns to this distinction for the whole course.

Lab 3: how does ENCUT change the silicon energy?

Rerun Lab 0 at six cutoffs; predict the basis size and the energy before you look.

Run

  1. Copy Lab 0. Change only ENCUT: 250, 300, 350, 400, 450, 500 eV.
  2. Record E0 (last line of OSZICAR) and grep "maximum number of plane-waves" OUTCAR.

Predict first

  1. Basis size grows as ENCUT3/2: about 2.8 times more plane waves at 500 eV than at 250 eV.
  2. E0 should fall as ENCUT rises, and level off.
  3. Its total change says little; energy differences usually converge much faster.

DFT & VASP Course · Lecture 316 / 19

Why ENCUT3/2? The plane waves kept are the reciprocal-lattice points inside a sphere of radius GcutG_{\mathrm{cut}}, with Ecut=ℏ2Gcut2/2mE_{\mathrm{cut}} = \hbar^2G_{\mathrm{cut}}^2/2m. Their number grows with the sphere's volume, Gcut3∝Ecut3/2G_{\mathrm{cut}}^3 \propto E_{\mathrm{cut}}^{3/2}, and 23/2≈2.832^{3/2} \approx 2.83. OUTCAR reports the count as “maximum number of plane-waves”; it varies slightly between k-points, because the sphere is centred on each k\mathbf k in turn.

Why should E0 fall? More plane waves form a bigger nested basis. VASP also sets its FFT grids from ENCUT and the precision setting PREC, so small deviations from a smooth decrease are possible; note any you see.

Why does that matter less than it seems? Total-energy differences, between two structures or two phases computed with the same settings, usually converge much faster than total energies, because most of the basis error comes from the region near the nuclei and is the same in both. That is why Lecture 19 converges the quantity you report, not the raw total energy. Bring back your table of ENCUT, number of plane waves and E0.

Which misconceptions should you drop now?

Five beliefs about variational methods and basis sets. Click a card to turn it over.

“The variational principle makes any approximation accurate.”

It gives an upper bound. A poor trial family gives a poor energy, as hydrogen's single Gaussian shows.

“The lowest energy I found is the ground state.”

Only if the trial space is flexible enough and the optimizer found its global minimum.

“Every quantity improves steadily with basis size.”

The ground-state energy in nested bases does. Forces, gaps and other properties need not.

“ENCUT is a cutoff on the band energies.”

It limits the kinetic energy of the plane waves in the basis, not the eigenvalues VASP reports.

“A converged calculation agrees with experiment.”

Convergence removes numerical error only. The functional and the model can still be wrong.

DFT & VASP Course · Lecture 317 / 19

Check yourself

One question per outcome. Answer aloud, then click to compare.

Why can a trial energy never fall below E₀?

It is a weighted average of exact energies, Σ|c_n|²E_n, and all of them are at least E₀.

What do H_ij and S_ij mean, and when is S the identity?

H_ij = ⟨φ_i|Ĥ|φ_j⟩ is a Hamiltonian matrix element, S_ij = ⟨φ_i|φ_j⟩ an overlap. S = I for an orthonormal basis.

Why can a bigger nested basis only lower the ground-state energy?

It keeps every old trial state and adds new ones, so the minimum can stay or drop, never rise. It costs more.

What exactly does ENCUT truncate?

The plane waves: only those with ħ²|k+G|²/2m below ENCUT are in the basis.

Name one numerical and one physical approximation in a VASP run.

Numerical: a finite ENCUT or k-mesh. Physical: the exchange–correlation functional, or no spin–orbit coupling.

DFT & VASP Course · Lecture 318 / 19

What should you remember?

Minimize the energy over a trial space, then enlarge the space until the answer stops changing.

  • Variational principle: ⟨ϕ∣H^∣ϕ⟩/⟨ϕ∣ϕ⟩≥E0\langle\phi|\hat H|\phi\rangle / \langle\phi|\phi\rangle \ge E_0 for every trial function; equal only for the ground state.
  • A basis turns the unknown function into coefficients and the problem into Hc=ESc\mathbf H\mathbf c = E\mathbf S\mathbf c.
  • Nested bases lower the energy monotonically, at increasing cost; coupling makes levels repel.
  • ENCUT sets VASP's plane-wave basis: set it explicitly, never below the largest ENMAX, and test what you report.
  • Numerical convergence is not physical accuracy.

Next: Lecture 4 uses these tools on atoms: where s, p and d orbitals, and “core” and “valence”, come from.

DFT & VASP Course · Lecture 319 / 19

Key terms

Trial wavefunction
An approximate wavefunction with adjustable parameters, such as a width or basis-set coefficients, chosen to minimize the energy. It must be allowed: normalizable, with the right boundary conditions and symmetry, and antisymmetric for electrons.
Variational principle
For any allowed trial function ϕ\phi, ⟨ϕ∣H^∣ϕ⟩/⟨ϕ∣ϕ⟩≥E0\langle\phi|\hat H|\phi\rangle/\langle\phi|\phi\rangle \ge E_0, the exact ground-state energy; equality only for the ground state. Lowering the energy over a trial family therefore improves the estimate of the ground-state energy.
Gaussian function
A bell-shaped function such as e−αx2e^{-\alpha x^2}, with positive width parameter α. Increasing α makes it narrower. Sums of Gaussians form useful atomic and molecular basis sets.
Basis set
A set of known functions ϕj\phi_j in which an unknown state is expanded, ψ=∑jcjϕj\psi = \sum_j c_j\phi_j. It turns H^ψ=Eψ\hat H\psi = E\psi into a matrix problem for the coefficients; a finite basis gives an approximate answer. VASP's basis is plane waves.

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

Further reading

  1. R. W. Field, 5.61 Physical Chemistry, Lecture 24: “Molecular orbital theory, matrix mechanics and variational principle”, MIT OpenCourseWare (Fall 2017), CC BY-NC-SA. · MIT OCW
  2. 5.61 Physical Chemistry, Lectures 28–29: “Modern electronic structure theory: basis sets” (Fall 2017, instructor R. W. Field; notes by T. Van Voorhis, used with permission), MIT OpenCourseWare, CC BY-NC-SA. · MIT OCW