Quantum chemistry codes, explained from zero
This article was created using artificial intelligence. Please check the cited sources before relying on it.
Gaussian, ORCA, Quantum ESPRESSO, VASP, and CP2K all do the same basic job, yet their inputs read like different languages. An ORCA input asks for B3LYP D3BJ def2-TZVP. A Quantum ESPRESSO input asks for ecutwfc, degauss, and K_POINTS. The papers that use them assume you already know why. This post builds that vocabulary from zero. It assumes high-school chemistry and nothing more, and it is long on purpose: the key terms are explained as we go.
The central idea: every one of these programs answers the same question approximately: given where the atoms are, where do the electrons go, and what energy results? They differ in three choices: how rough the approximation is (the method), how the electrons are written down for the computer (the basis set), and whether the system is a lone molecule or a pattern that repeats forever (the boundary conditions). Almost every term below belongs to one of those three choices.
In this post
The one problem every program solves
An atom is a tiny, heavy, positively charged nucleus surrounded by much lighter, negatively charged electrons. Chemistry is mostly about the electrons: bonds form, break, and rearrange because electrons move between and around nuclei.
Electrons obey quantum mechanics, and its central equation is the Schrödinger equation. Solving it exactly would give everything: energies, bond lengths, spectra. The catch is that it can be solved exactly only in the simplest cases, such as a hydrogen atom with its single electron. With two or more electrons, every electron repels every other one, so the motion of each depends on all the others at once.
The size of the problem also grows explosively. The full description of the electrons, the wavefunction, depends on three coordinates for every electron. Benzene has 42 electrons, so its wavefunction is a function of 126 variables. Storing it on a coarse grid of only 10 points per variable would take 10126 numbers, far more than the roughly 1080 atoms in the observable universe. Every program therefore solves the problem approximately, and most of the vocabulary in this post names the approximations.
Fixed nuclei, moving electrons
One approximation is so universal that programs rarely mention it. A proton is about 1,836 times heavier than an electron, so nuclei move far more slowly than electrons. Programs therefore hold the nuclei still, solve for the electrons around them, and only then consider moving the nuclei. This is the Born–Oppenheimer approximation. In practice it means every calculation starts from a list of atom positions, called the geometry or structure.
What comes out: energy, forces, properties
For a given geometry, a program returns:
- Energy: one number for that arrangement of atoms. For the same set of atoms, lower energy generally means more stable.
- Forces: for each atom, the direction and strength of the push it feels. A force is the downhill slope of the energy: if moving an atom to the left lowers the energy, the force on that atom points left. Forces are what let a program move atoms, either to find a stable structure or to run molecular dynamics.
- Properties: everything else that follows from the electrons, such as atomic charges, dipole moments, vibrational frequencies, spectra, magnetism, and band structures.
It helps to picture the energy as a landscape. Each possible arrangement of the atoms is a location, and the energy is the height. Stable molecules sit in valleys. A reaction is a path from one valley to another, and the highest point along the easiest path is the transition state. Its height above the starting valley is the barrier, which controls how fast the reaction goes. This landscape is called the potential energy surface, and most calculation types are different ways of exploring it.
Only differences matter
The total energy a program prints is usually a large number, but chemistry comes from energy differences. An all-electron calculation on a single water molecule gives a total energy of roughly −76 hartree, about −2,070 eV, while many chemical changes involve differences of tenths to several electronvolts. Useful quantities are differences between calculations: product minus reactant, adsorbed minus separated, transition state minus reactant.
That has a consequence that is easy to miss. Do not mix total energies from different methods or settings in one energy difference. Different pseudopotentials can shift the zero of energy, while different functionals change the approximation itself. Two programs can agree if they use equivalent, converged settings, but using one consistent setup is the safest starting point. Errors then partly cancel, which is a large part of why approximate methods work as well as they do.
Units you will meet
Gaussian, ORCA, and CP2K report energies in hartree, Quantum ESPRESSO in rydberg, and VASP in electronvolts. Chemistry papers often use kcal/mol or kJ/mol.
| Unit | In eV | In kcal/mol | Where you see it |
|---|---|---|---|
| 1 hartree (Ha) | 27.211 | 627.5 | Gaussian, ORCA, CP2K output |
| 1 rydberg (Ry) = 0.5 Ha | 13.606 | 313.8 | Quantum ESPRESSO input and output |
| 1 eV | 1 | 23.06 | VASP, most physics papers |
| 1 kcal/mol = 4.184 kJ/mol | 0.0434 | 1 | Chemistry papers |
Some reference points: “chemical accuracy” usually means errors below 1 kcal/mol (about 0.04 eV). Thermal energy at room temperature is about 0.6 kcal/mol (0.026 eV). Breaking the O–H bond of phenol, the kind of bond a phenolic antioxidant gives up, takes about 87 kcal/mol (3.8 eV).
Three choices that separate the programs
With the problem defined, the differences between programs come down to three choices:
- Method: which approximation to the electron problem is used, for example DFT with a particular functional, or a wavefunction method such as CCSD(T).
- Basis set: how the electrons’ orbitals are written down as numbers the computer can store, either as Gaussian functions centered on atoms or as plane waves filling a box.
- Boundary conditions: whether the system is a single molecule in empty space, or a box that repeats forever in every direction, like a crystal.
The next three sections take these in order. The rest of the post covers what you ask a program to do and the programs themselves.
Choice 1: the method
Density functional theory (DFT)
DFT rests on a theorem proved by Hohenberg and Kohn in 1964: the lowest-energy state of a set of electrons is completely determined by the electron density, a map of how many electrons there are at each point in space.[1] The density depends on only three coordinates (x, y, z), however many electrons there are. Benzene’s 126-variable wavefunction is replaced by a 3-variable density.
The theorem says the energy can be computed from the density, but not how. Kohn and Sham supplied the practical recipe in 1965.[2] They replaced the real, interacting electrons with a model of electrons that do not interact with one another but are constructed to have the same density. This lets them calculate most of the energy directly. The remaining unknown part is collected into one term, the exchange-correlation energy:
- Exchange comes from the Pauli principle: two electrons with the same spin avoid each other.
- Correlation is the remaining way electrons dodge one another because they repel.
The exchange-correlation energy is a small part of the total, but it is crucial for chemistry, and its exact form is unknown. It must be approximated, and that approximation is the main difference between the many flavors of DFT. Conventional DFT calculations often grow in cost roughly as the cube of the system size, which makes calculations on hundreds of atoms practical.
What a “functional” is
A function takes a number and returns a number: f(x) = x². A functional takes an entire function and returns a number. The area under a curve is a familiar example: give it the whole curve and get back one number. The exchange-correlation functional takes the whole electron density and returns one energy. “Which functional?” therefore means “which approximation to the exchange-correlation energy?”
The functional ladder
Perdew pictured the families of functionals as rungs of a ladder, “Jacob’s ladder”, from simpler to more detailed approximations.[3] Each rung uses more information and usually costs more. A higher rung does not guarantee a better answer.
| Rung | Extra information used | Examples | Typical use |
|---|---|---|---|
| LDA (local density approximation) | The density at each point | LDA | Still used for some solids |
| GGA (generalized gradient approximation) | + how quickly the density changes (its gradient) | PBE | Solids, metals, surfaces |
| meta-GGA | + the kinetic energy density | SCAN, r²SCAN | A step above GGA, similar cost |
| Hybrid | + a fraction of exact (Hartree–Fock) exchange | B3LYP, PBE0, ωB97X | Molecules, reaction energies, barriers |
| Double hybrid | + a correlation term from wavefunction theory | B2PLYP | High-accuracy molecular work |
GGA, such as PBE. PBE is a common choice for solids, metals, and surfaces.[4] It is cheap and often gives good structures. A major weakness is self-interaction error: in an approximate functional, an electron partly repels itself, so electrons tend to spread out too much. In practice, reaction barriers often come out too low, band gaps too small, and localized electrons, such as those in radicals or transition-metal oxides, can be described poorly.
meta-GGA, such as r²SCAN. The kinetic energy density lets a functional recognize what kind of region it is in, for example a single bond or a metal. SCAN improved accuracy for many systems but was numerically delicate. r²SCAN keeps most of that accuracy, is numerically stable, and costs about the same as a GGA.[5]
Hybrid, such as B3LYP, PBE0, or ωB97X. Hartree–Fock theory (below) treats exchange exactly and has no self-interaction error. Hybrids mix a fraction of that exact exchange into a GGA: 20% in B3LYP and 25% in PBE0.[6] [7] Range-separated hybrids such as ωB97X vary the mixture with the distance between electrons and use more exact exchange at long range.[8] Hybrids give better barriers and reaction energies, which is why they are the default for molecular chemistry. Their cost depends on the basis set (next section). In Gaussian-basis programs such as ORCA and Gaussian, hybrids are routine for molecules of a hundred atoms or more. In plane-wave programs such as Quantum ESPRESSO and VASP, they are often ten or more times more expensive than a GGA, so periodic studies mostly use GGA or meta-GGA functionals.
Dispersion corrections: D3 and D4
Even neutral, nonpolar molecules attract one another weakly. The electron cloud of a molecule fluctuates, creating momentary dipoles that induce matching dipoles in its neighbors. The result is a weak, always-attractive force called London dispersion, one kind of van der Waals interaction. Dispersion is what holds the hydrocarbon molecules of a base oil together as a liquid.
Many common GGAs and hybrids miss most of it. They do not capture the long-range correlation between fluctuations in two separate electron clouds. For nonpolar molecules a few ångströms apart (1 Å = 10⁻¹⁰ m), this can mean badly underestimating the attraction.
The usual fix adds an attraction between pairs of atoms. Its energy falls roughly as 1/r⁶ at long distances, where r is the distance between atoms, and it is weakened at short distances to avoid counting the same effects twice. Grimme’s D3 is a widely used version,[9] often with Becke–Johnson damping, written D3(BJ).[10] D4 also makes the attraction depend on each atom’s charge.[11] The added cost is small, and the method is then written, for example, as PBE-D3(BJ) or B3LYP-D4. Use a correction matched to the functional; some functionals already include dispersion. Dispersion matters most for liquids, adsorption on surfaces, molecular crystals, and molecules associating with one another. It can also matter within large molecules, where distant parts fold together.
DFT+U
In transition-metal oxides such as hematite (Fe₂O₃), the metal’s d electrons are fairly localized on individual metal atoms. Self-interaction error in a GGA smears them out, which can give band gaps that are far too small, wrong magnetic moments, and poor oxidation energies. DFT+U adds an energy penalty, named after the Hubbard model, that favors each d orbital of a given spin being fully occupied or empty, which encourages electrons to stay on individual atoms.[12] The size of the penalty, U, is usually a few electronvolts. It depends on the element, its chemical environment, and the calculation setup, and is either fitted to experimental data or computed from first principles.
Two cautions. Do not casually mix energies computed with different U values; comparisons need a consistent choice or a justified correction scheme. Also, U is common for localized electrons in oxides but is not normally needed for metallic iron, which is often modeled with plain spin-polarized PBE. Comparing metallic Fe with iron oxide therefore needs extra care.
Wavefunction methods: HF, MP2, and CCSD(T)
The alternative to DFT is to approximate the wavefunction itself, through a series of methods of increasing accuracy and cost.
- Hartree–Fock (HF) lets each electron move in the average field of all the others. Exchange is exact, but correlation is missing entirely, so HF energies are not accurate enough for most chemistry. HF is the starting point for the methods below and the source of the “exact exchange” in hybrid functionals.
- MP2 (second-order Møller–Plesset perturbation theory) adds an estimate of correlation on top of HF. It is a real improvement and captures dispersion, though it can overestimate it.
- CCSD(T) (coupled cluster with single, double, and perturbative triple excitations) is often called the “gold standard” of quantum chemistry.[13] For many ordinary molecules with a large enough basis set, it can reach chemical accuracy. It is less reliable for stretched bonds and some transition-metal systems. Its cost grows as the seventh power of system size: doubling the molecule multiplies the cost by about 128. Conventional CCSD(T) is therefore limited to small molecules.
DLPNO-CCSD(T) makes coupled cluster affordable for larger molecules.[14] It uses the fact that correlation between distant electrons is weak and can be compressed or neglected, so the cost can grow almost linearly with size. With tight settings it often closely reproduces conventional CCSD(T), and can handle molecules of roughly 50–150 atoms or more, depending on hardware and settings. These methods are mainly used in molecular programs such as ORCA, although some periodic programs also support wavefunction methods.
A common strategy combines the two families: optimize the geometry with DFT, then compute a more accurate energy at that fixed geometry with DLPNO-CCSD(T).
Choice 2: the basis set
What a basis set is
An orbital describes where an electron is likely to be found. Mathematically it is a smooth function in three dimensions. A computer cannot store an arbitrary smooth function, so programs build each orbital from a fixed set of simpler building blocks, the basis functions, and store only how much of each block to use. It is like mixing any color from a fixed set of paints, or building any sound from pure tones. More building blocks describe orbitals more accurately and cost more. The collection of building blocks is the basis set, and there are two main families.
Gaussian-type orbitals
Molecular programs build orbitals from Gaussian functions: bell-shaped bumps of the form exp(−αr²) centered on each atom, multiplied by simple factors that give them s, p, or d shapes. Real atomic orbitals are not Gaussian, so several Gaussians of different widths are combined for each orbital. Gaussians are used anyway because the integrals a calculation needs between them have simple formulas, which makes them fast.
Basis set names look cryptic, but they encode size:
- 6-31G* (Pople style): each core orbital is made from six Gaussians, and each valence orbital is split into two parts made from three Gaussians and one. The star adds polarization functions, d-shaped functions on heavy atoms that let orbitals distort in bonds. A plus sign, as in 6-31+G*, adds diffuse functions: wide Gaussians needed for anions and weak interactions.
- def2-SVP, def2-TZVP, def2-QZVP (Karlsruhe): split valence, triple-zeta valence with polarization, and quadruple-zeta.[15] “Zeta” counts how many functions describe each valence orbital; more zeta means more flexibility. For elements heavier than krypton, the def2 sets replace the inner electrons with an effective core potential, the molecular-code version of the pseudopotentials described below.
- cc-pVTZ and aug-cc-pVTZ (Dunning): designed to converge systematically with correlated methods such as CCSD(T). “aug” adds diffuse functions.
The number of basis functions grows with the number of atoms, so the cost depends on how many atoms there are, not on the space around them. Empty space is free, which is the main reason molecular programs are efficient for molecules.
One side effect: when two molecules approach, each can borrow the other’s basis functions to describe its own electrons better, which makes binding look artificially strong. This basis set superposition error shrinks with larger basis sets and can be corrected with the counterpoise method.
Plane waves
Periodic programs build orbitals from plane waves: sine and cosine waves that extend across the whole simulation box. The repeating part of each orbital is built from waves that fit the box exactly, with a whole number of wavelengths, just as only certain notes fit on a guitar string. Any smooth, periodic function can be built from enough of them. The k-points explained below describe how the orbital’s phase changes between boxes.
The basis is controlled by one number, the cutoff energy. Each wave has a kinetic energy that grows as its wavelength shrinks, and the program includes every wave below the cutoff. A higher cutoff includes shorter waves, which describe finer detail. In Quantum ESPRESSO the cutoff is ecutwfc, in rydberg: 60 Ry is 60 × 13.6 ≈ 816 eV. In VASP it is ENCUT, in eV. Because one knob sets the quality, convergence is easy to check: raise the cutoff until the quantity you care about stops changing. Quantum ESPRESSO also has a second cutoff for the electron density, ecutrho. It is commonly 4 × ecutwfc for norm-conserving pseudopotentials and 8–12 × for ultrasoft ones. PAW may need 4 × or more, depending on the dataset; always check convergence.[33]
The weakness is the mirror image of the Gaussians’ strength. Plane waves fill the whole box whether atoms are there or not, so their number grows with the box volume. Doubling the box edge multiplies the volume, and roughly the number of plane waves, by eight. You pay for every cubic ångström, vacuum included.
Pseudopotentials
Near a nucleus, valence orbitals oscillate rapidly, because they must stay orthogonal to the core orbitals beneath them. Describing those wiggles with plane waves would need very short waves and an enormous cutoff. Yet the core electrons, such as the 1s electrons of carbon and oxygen, are chemically inert: they hardly change when bonds form.
A pseudopotential replaces the nucleus and its core electrons with a smoother effective potential. The valence orbitals it produces, the pseudo-orbitals, are smooth and node-free inside a chosen core radius, rc, and identical to the true orbitals outside it, where bonding happens. The calculation then needs far fewer plane waves and treats only the valence electrons.
There are three main types:
- Norm-conserving (NC): the pseudo-orbital holds the same amount of charge inside rc as the true one.[16] Simple and robust, but it needs a relatively high cutoff.
- Ultrasoft (US): relaxes that condition to allow much smoother orbitals and a lower cutoff, at the price of extra bookkeeping.[17]
- Projector augmented wave (PAW): also smooth and inexpensive, but it keeps the information needed to reconstruct the true orbital near the nucleus.[18] It can approach all-electron accuracy and is the standard in VASP. Accuracy depends on the dataset and convergence, rather than the type alone.
Quantum ESPRESSO users often take pseudopotentials from PSLibrary, a set of ultrasoft and PAW pseudopotentials covering most of the periodic table,[19] or from SSSP, a tested collection with recommended cutoffs.[20] PSLibrary file names are informative. In Fe.pbe-spn-kjpaw_psl.0.2.1.UPF, pbe is the functional it was built for, spn means the 3s and 3p semicore electrons are treated as valence electrons (with a nonlinear core correction), kjpaw means PAW, and the rest is the library version. A pseudopotential is generated for one functional. Using it with another, for example a PBE pseudopotential in a hybrid calculation, is an approximation, though a common and usually acceptable one.
Choice 3: isolated or periodic
Molecules in empty space
Molecular programs such as Gaussian and ORCA treat a molecule as alone in infinite empty space, as in a dilute gas. A solvent can be added approximately with an implicit solvation model (such as PCM or SMD), which represents the solvent as a continuous polarizable medium instead of individual molecules.
Periodic boundary conditions
A real piece of metal or a drop of oil contains around 1023 atoms. Periodic programs make that manageable by simulating one box, the cell, and treating it as surrounded on all sides by identical copies of itself, forever. These are periodic boundary conditions (PBC). An atom that leaves through one face re-enters through the opposite face, like a character in an old arcade game who walks off one side of the screen and reappears on the other. A crystal really is a repeating pattern, so a small cell describes a perfect crystal exactly. A liquid in a large enough periodic box behaves like bulk liquid with no surface.
Supercells
Anything placed in a periodic cell is repeated too. One defect, impurity, or adsorbed molecule in a small cell becomes a dense array of them that interact with their own copies. A supercell is a larger cell, for example 3 × 3 × 3 copies of the basic cell, that moves the copies further apart. Enlarge it until the quantity you care about stops changing.
Slabs: modeling a surface
To model a surface, cut the crystal, keep a few atomic layers (a slab), and add a vacuum gap above them. The cell is still periodic in all three directions, so the slab sees copies of itself across the vacuum. The gap must be wide enough, often 10–15 Å or more, that they do not interact. The bottom layers are usually fixed at bulk positions to imitate the material underneath. When something is adsorbed on only one side, a dipole correction is often added to cancel an artificial electric field across the vacuum. An adsorption energy is then E(slab with molecule) − E(clean slab) − E(isolated molecule), each calculated with the same settings.
A molecule in a box
A periodic program can still treat an isolated molecule by placing it in a large box with enough vacuum, often starting with about 10 Å between it and its nearest copy and testing larger gaps. For example, a 51-atom ZDDP molecule (zinc dialkyldithiophosphate, a common antiwear additive) may need a box more than 20 Å on a side, depending on its shape. Because plane waves fill that whole box, the calculation is usually much more expensive than the same molecule in ORCA.
Vacuum alone does not fully isolate the molecule. Electrostatic interactions with the copies fall off slowly with distance, especially for charged or strongly polar molecules. The Martyna–Tuckerman correction removes these electrostatic interactions;[21] in Quantum ESPRESSO it is assume_isolated = 'mt'. It needs a box at least roughly twice as large as the molecule’s electron cloud in each direction, which is another reason boxes for molecules get large. Other interactions with copies, including periodic dispersion corrections, still need care.
k-points
This term confuses most newcomers. In a crystal, an electron’s wave does not have to look identical in every cell: its phase can change from one cell to the next, like the timing of a repeating wave. Each possible pattern of phase changes is labeled by a vector, k. Calculating the energy involves averaging contributions over the distinct k values, and a program approximates this with a grid of sample k-points, usually a Monkhorst–Pack grid such as 6 × 6 × 6.[22]
An analogy: to estimate a country’s average temperature, you sample a grid of cities. Where temperature varies smoothly, a few cities are enough; where it changes abruptly, you need many. Three practical rules follow:
- Insulators and semiconductors vary smoothly and need relatively few k-points.
- Metals need many. In a metal, electrons fill the available states up to an energy called the Fermi level, and the occupation of each state jumps abruptly from full to empty there. Capturing that sharp edge needs a dense grid; a small cell of bulk iron is often given a dozen or more k-points in each direction.
- Bigger cells need fewer k-points. Doubling the cell in one direction roughly halves the k-points needed in that direction. For many large cells, and for a well-isolated molecule in a box, a single k-point is enough: the Γ (Gamma) point, k = 0, where the wave is identical in every cell. Large metallic cells may still need more points. Programs can run Γ-only calculations faster.
A slab gets a grid along the surface and a single k-point across the vacuum, written for example as 4 × 4 × 1. As with the cutoff, the right density is found by testing: increase the grid until the energy stops changing, often to within about 1 meV per atom.
Smearing
In a metal, the abrupt full-to-empty jump at the Fermi level also causes numerical trouble. As the calculation iterates, a state can flip from just below the Fermi level to just above it and back, and the calculation struggles to converge. Smearing replaces the abrupt step with a smooth one: states near the Fermi level may be partly occupied, as if the electrons had a small temperature. This also makes the average over k-points converge faster.
The smearing width is a parameter: degauss in Quantum ESPRESSO, in rydberg (around 0.01–0.02 Ry is common for metals), and SIGMA in VASP, in eV. Too much smearing distorts the result. Several schemes exist; Marzari–Vanderbilt “cold” smearing was designed so that the energy depends only weakly on the width.[23] Molecules and insulators normally use no smearing, with fixed occupations.
Spin polarization
Electrons have a property called spin. Along a chosen direction, it has two possible values, which we call up and down. In most stable organic molecules, every occupied orbital holds one up and one down electron, so the two spin populations are identical and can be treated together. Two cases break that pairing:
- Radicals have an unpaired electron. Examples are the phenoxyl radical formed when a phenolic antioxidant donates its hydrogen atom, and the peroxyl radicals (ROO•) it intercepts.
- Magnetic materials have unequal up and down populations on individual atoms, even if these cancel overall. In bulk iron they do not cancel, giving about 2.2 Bohr magnetons per atom, a unit of magnetic moment.
These need a treatment that allows different up and down populations, usually a spin-polarized or unrestricted calculation, at extra cost. In Quantum ESPRESSO this is nspin = 2, together with starting_magnetization to give the calculation a magnetic starting point; without one it can settle into a nonmagnetic solution. In Gaussian and ORCA you give the spin multiplicity, 2S + 1, where S is the total spin: 1 for an ordinary closed-shell molecule, 2 for a radical with one unpaired electron, 3 for ground-state O₂. Counting unpaired electrons plus one works when their spins align; it is not a general rule.
What you ask the program to do
SCF: the loop inside every calculation
The orbitals depend on the electrostatic potential the electrons feel, but that potential depends on where the electrons are, that is, on the orbitals. This chicken-and-egg problem is solved by iteration:
Guess a density → Build the potential → Solve for orbitals → New density → Repeat until nothing changes
When the density going in matches the density coming out closely enough, the solution is self-consistent. Quantum ESPRESSO’s conv_thr sets a threshold on the estimated energy error, in Ry, rather than directly on the density difference. This is the self-consistent field (SCF) procedure, and every calculation type below runs it at least once. Each new density is usually blended with earlier ones (mixing) to keep the loop stable. When an SCF calculation will not converge, the usual remedies are gentler mixing (a smaller mixing_beta in Quantum ESPRESSO), smearing for metals, and a better starting guess, such as an initial magnetization for magnetic systems.
Single point
One SCF calculation at a fixed geometry, returning the energy and, if requested, the forces and stress. Most energy comparisons are single points on geometries prepared by another calculation.
Relax (geometry optimization)
Compute the forces, move the atoms a step downhill, and repeat until the forces are close to zero. The result is the bottom of a nearby valley in the energy landscape, which is not necessarily the lowest valley overall. A variable-cell relaxation (vc-relax in Quantum ESPRESSO) also changes the size and shape of the cell, using the stress. Molecular programs usually follow an optimization with a frequency calculation: a true minimum has no imaginary vibrational frequencies.
NEB: finding a barrier
The nudged elastic band (NEB) method searches for a minimum-energy path between a known reactant and a known product.[24] It places a chain of intermediate copies of the system, called images, between the two and connects neighboring images with springs. The chain is then relaxed toward a nearby minimum-energy path; finding the easiest path overall is not guaranteed. The climbing-image variant pushes the highest image onto the transition state, and the barrier is that image’s energy minus the reactant’s.
Barriers matter because reaction rates depend on them exponentially. At room temperature, increasing the free-energy barrier by about 1.4 kcal/mol (0.06 eV) slows a reaction roughly tenfold, if the other factors stay the same. Free energy includes temperature and entropy effects, so an electronic energy barrier is a starting point for predicting rates. Molecular programs can also search for a transition state directly from a good guess and confirm it with a frequency calculation: a transition state has exactly one imaginary frequency, corresponding to motion along the reaction path.
AIMD: molecular dynamics driven by DFT
Ab initio molecular dynamics (AIMD) uses forces calculated from the electrons, usually with DFT, to move the atoms using Newton’s laws. In its usual Born–Oppenheimer form, each step needs an SCF calculation. Steps are often about 0.5–1 fs long (1 fs = 10⁻¹⁵ s), so a simulation of a few hundred atoms commonly reaches tens of picoseconds (1 ps = 1,000 fs). That is far shorter and smaller than classical or reactive force-field MD, but the chemistry comes directly from the electrons instead of a fitted model.
Stress and the virial
The stress is a 3 × 3 table of numbers describing how the energy changes when the cell is stretched or sheared. The diagonal entries describe pushing or pulling along x, y, and z; the off-diagonal entries describe shear. The closely related virial is essentially the stress multiplied by the cell volume, with a sign that depends on the program’s convention.[34] Stress is needed for variable-cell relaxations and for constant-pressure molecular dynamics, where a barostat adjusts the box to hold the pressure fixed. An isolated molecule has no cell to squeeze, so bulk stress is not normally meaningful for it.
Plane-wave programs compute the stress routinely (tstress = .true. in Quantum ESPRESSO). One caveat: at a fixed cutoff, the number of plane waves changes as the cell changes, which adds an artificial Pulay stress. Stress therefore usually needs a higher cutoff to converge than energies do.
Labels: DFT data for machine-learning potentials
A machine-learning interatomic potential (MLIP) learns to predict energies and forces from examples (see Learning the forces behind friction). Each example is a structure together with its DFT energy, the forces on all its atoms, and often, for periodic cells, the stress. That set of answers is the structure’s label, and a training set often contains thousands of labeled structures. Many models can obtain stress from how their predicted energy changes when the cell is deformed, even without stress labels.[34] Stress labels help train and check that prediction; pressure accuracy should be validated before constant-pressure MD.
The most important rule for labels is consistency. Every label in a training set should use the same functional, dispersion correction, pseudopotentials, cutoff, smearing, and spin treatment. Even with the same functional, different pseudopotentials can shift energies by element-dependent amounts, so labels from different sources should not be mixed without care. This matters for pretrained models: large public datasets such as the Materials Project and OMat24 were computed with VASP, largely at the PBE or PBE+U level,[25] [26] and the Materials Project also includes r²SCAN calculations. Labels from another program or setup will not necessarily match them.
The five programs
With the vocabulary in place, the differences between programs follow from the three choices.
| Program | Type | Basis | License |
|---|---|---|---|
| Gaussian | Molecular | Gaussian-type orbitals | Commercial |
| ORCA | Molecular | Gaussian-type orbitals | Free for academic use |
| Quantum ESPRESSO | Periodic | Plane waves + pseudopotentials | Open source (GPL) |
| VASP | Periodic | Plane waves + PAW | Commercial |
| CP2K | Molecular and periodic | Gaussians + plane waves | Open source (GPL) |
Gaussian
Gaussian is a long-established, widely used molecular program.[27] It offers many functionals, wavefunction methods, implicit solvation, and spectra (IR, Raman, UV-Vis, NMR), with a relatively simple input format. It also supports periodic systems, but QE and VASP are the usual choices for metals. It needs a commercial license.
ORCA
ORCA is a molecular program known for speed.[28] Approximations to the expensive integrals (RIJCOSX) make hybrid functionals fast, and it is a common choice for DLPNO-CCSD(T). It is strong in molecular spectroscopy, including X-ray absorption. It has no periodic boundary conditions, so it models parts of solids or surfaces as finite clusters rather than repeating cells. ORCA is free for academic use; check its license terms before any industry-linked work.
Quantum ESPRESSO
Quantum ESPRESSO (QE) is an open-source suite for periodic plane-wave calculations.[29] It is strong for metals, surfaces, and solids, with stress, magnetism, phonons, and, through XSpectra, X-ray absorption near-edge spectra (XANES) of solids and surfaces.[30] Its weaknesses follow from plane waves: isolated molecules are expensive because the vacuum costs as much as the atoms, and hybrid functionals are expensive.
VASP
VASP occupies the same niche as QE and is one of the most widely used programs in computational materials science.[31] It uses plane waves with PAW. Large public datasets, including the Materials Project and OMat24, were computed with VASP, so many pretrained MLIPs inherit its settings. Its weaknesses are the same as QE’s, and it requires a paid license for each research group.
CP2K
CP2K commonly uses a mixed scheme: orbitals are built from Gaussians, while the electron density is handled on a plane-wave grid.[32] The Gaussians tie the orbital basis size to the atoms, and the plane-wave grid makes the electrostatics of large periodic cells efficient. CP2K is a common choice for large periodic systems of hundreds to about a thousand atoms, such as liquids and solid–liquid interfaces, and for AIMD. An auxiliary basis method (ADMM) also makes hybrid functionals much cheaper in large cells. It has fewer spectroscopy tools than the molecular programs and more parameters to tune: basis sets, pseudopotentials, and two grid cutoffs must be chosen consistently. Many CP2K calculations use only the Γ point, so its strength is large cells rather than small metallic ones.
Which program for which job
| Task | Usually | Why |
|---|---|---|
| O–H bond dissociation energy of an antioxidant | ORCA or Gaussian: hybrid with dispersion, checked with DLPNO-CCSD(T) | Isolated molecules; hybrids are cheap; the radical has multiplicity 2 |
| Reaction barrier in a molecule | ORCA or Gaussian: hybrid with dispersion | Transition-state search and frequencies; GGA barriers are often too low |
| Molecule adsorbed on an iron surface | QE or VASP: PBE-D3, spin-polarized, k-points, smearing | A metal surface needs a periodic slab and metallic settings |
| Iron oxide surface | QE or VASP with DFT+U | Localized d electrons |
| Liquid or lubricant–surface interface, AIMD | CP2K | Large periodic cells at reasonable cost |
| Training labels for an MLIP | QE, VASP, or CP2K, one fixed setup | Consistent energies, forces, and stress |
| X-ray absorption of a solid or surface | QE (XSpectra) | Periodic system |
| X-ray absorption of a molecule | ORCA | Molecular spectroscopy |
Reading a method line
Papers compress all of these choices into one line. Two examples:
ωB97X-D3/def2-TZVP//B3LYP-D3(BJ)/def2-SVP. The double slash separates the energy from the geometry. The geometry (right side) was optimized with the B3LYP hybrid, D3 dispersion with Becke–Johnson damping, and the small def2-SVP basis. The energy (left side) was then computed at that geometry with the range-separated hybrid ωB97X, D3 dispersion, and the larger def2-TZVP basis.
PBE-D3(BJ), PAW (PSLibrary), 60 Ry cutoff, 4 × 4 × 1 k-points, Marzari–Vanderbilt smearing of 0.02 Ry, spin-polarized. A periodic calculation, probably of a metal surface: the PBE GGA with dispersion, PAW pseudopotentials, a plane-wave cutoff of 60 Ry (about 816 eV), a k-point grid that samples the surface with one point across the vacuum, cold smearing for the metal, and separate spin channels for magnetism.
Many of these terms appear directly in a Quantum ESPRESSO input. Here is the skeleton of a single-point calculation on a molecule in a box, such as ZDDP, with the atom lists left out:
&CONTROL
calculation = 'scf' ! single point; 'relax' optimizes the geometry
tprnfor = .true. ! print the forces
/
&SYSTEM
ibrav = 1, A = 22.0 ! cubic box, 22 Å on a side
nat = 51, ntyp = 6 ! 51 atoms of 6 elements: Zn, P, S, O, C, H
ecutwfc = 60 ! plane-wave cutoff, Ry
ecutrho = 480 ! example density cutoff, Ry; test for the PAW files used
assume_isolated = 'mt' ! removes electrostatic interactions with copies
vdw_corr = 'grimme-d3' ! D3 dispersion correction
/
&ELECTRONS
conv_thr = 1.0d-8 ! SCF convergence threshold, Ry
/
! one PAW pseudopotential file per element
ATOMIC_SPECIES
...
ATOMIC_POSITIONS angstrom
...
! a single k-point: the Gamma point
K_POINTS gamma
These numbers illustrate the input format; the box size and cutoffs still need convergence checks for the actual molecule and pseudopotentials. The functional is read from the pseudopotential files unless explicitly overridden, and grimme-d3 defaults to zero damping; D3(BJ) additionally needs dftd3_version = 4.
For an iron slab, the cell and atom lists would be changed to describe the slab, assume_isolated would be dropped, spin and smearing would be added to &SYSTEM, and the k-points would become a grid:
nspin = 2 ! spin-polarized
starting_magnetization(1) = 0.5 ! magnetic starting guess for species 1 (Fe)
occupations = 'smearing'
smearing = 'mv', degauss = 0.02 ! Marzari-Vanderbilt smearing, Ry
K_POINTS automatic
4 4 1 0 0 0
A one-line glossary
- DFT
- Gets the energy from the electron density; the unknown part is the exchange-correlation functional.
- Functional
- The specific approximation to the exchange-correlation energy.
- GGA (PBE)
- Uses the density and its gradient. Cheap; common for solids and metals; barriers often too low.
- meta-GGA (r²SCAN)
- Adds the kinetic energy density. Somewhat better than GGA at similar cost.
- Hybrid (B3LYP, PBE0, ωB97X)
- Mixes in exact Hartree–Fock exchange. Better barriers; cheap in molecular codes, expensive with plane waves.
- Dispersion correction (D3, D4)
- An added pairwise attraction for the van der Waals forces DFT misses.
- DFT+U
- A penalty that keeps transition-metal d electrons localized, for oxides such as Fe₂O₃.
- HF, MP2, CCSD(T)
- Wavefunction methods of increasing accuracy and cost; CCSD(T) is the gold standard.
- DLPNO-CCSD(T)
- A local approximation that makes CCSD(T) affordable for larger molecules, often 50–150 atoms or more.
- Basis set
- The building blocks used to write down orbitals.
- Gaussian-type orbitals
- Bumps centered on atoms; basis size grows with atoms; empty space needs no extra functions.
- Plane waves
- Waves filling the whole box; quality set by the cutoff energy; vacuum costs as much as atoms.
- Cutoff energy
- The highest-energy (shortest) plane wave included, such as
ecutwfcorENCUT. - Pseudopotential (NC, US, PAW)
- Replaces the nucleus and core electrons with a smoother potential so plane waves stay affordable.
- PBC
- Periodic boundary conditions: the cell repeats forever in all directions.
- Supercell
- An enlarged cell that keeps defects or molecules away from their copies.
- Slab
- A few atomic layers plus vacuum, used to model a surface.
- Molecule in a box
- How periodic codes treat a molecule: a large cell with about 10 Å of vacuum.
- Martyna–Tuckerman
- A correction that removes the electrostatic interaction of a molecule with its copies.
- k-points
- Sample points used to average contributions from different electron wave patterns in a periodic cell.
- Γ point
- The k-point k = 0; often enough for large cells and well-isolated molecules, but check convergence.
- Fermi level
- At zero temperature, the energy separating occupied and empty states in a metal.
- Smearing
- Smooths occupations near the Fermi level so metals converge.
- Spin polarization
- Treats up and down electrons separately; needed for radicals and magnetic metals.
- Multiplicity
- 2S + 1, where S is total spin: 1 for closed-shell molecules, 2 for a radical with one unpaired electron.
- SCF
- The iterative loop that makes the electrons consistent with their own potential.
- Single point
- Energy and forces at a fixed geometry.
- Relax
- Geometry optimization to a nearby energy minimum.
- NEB
- A chain of images that searches for a minimum-energy path and estimates its barrier.
- AIMD
- Molecular dynamics with forces from electronic-structure calculations, usually DFT.
- Stress and virial
- How the energy changes when the cell is deformed; needed for constant-pressure MD.
- Label
- The DFT energy, forces, and often stress for one structure, used to train an MLIP.
References
- Hohenberg, P., & Kohn, W. (1964). Inhomogeneous Electron Gas. Physical Review, 136, B864–B871.
- Kohn, W., & Sham, L. J. (1965). Self-Consistent Equations Including Exchange and Correlation Effects. Physical Review, 140, A1133–A1138.
- Perdew, J. P., & Schmidt, K. (2001). Jacob's ladder of density functional approximations for the exchange-correlation energy. AIP Conference Proceedings, 577, 1–20.
- Perdew, J. P., Burke, K., & Ernzerhof, M. (1996). Generalized Gradient Approximation Made Simple. Physical Review Letters, 77, 3865–3868.
- Furness, J. W., Kaplan, A. D., Ning, J., Perdew, J. P., & Sun, J. (2020). Accurate and Numerically Efficient r2SCAN Meta-Generalized Gradient Approximation. The Journal of Physical Chemistry Letters, 11, 8208–8215.
- Becke, A. D. (1993). Density-functional thermochemistry. III. The role of exact exchange. The Journal of Chemical Physics, 98, 5648–5652.
- Adamo, C., & Barone, V. (1999). Toward reliable density functional methods without adjustable parameters: The PBE0 model. The Journal of Chemical Physics, 110, 6158–6170.
- Chai, J.-D., & Head-Gordon, M. (2008). Systematic optimization of long-range corrected hybrid density functionals. The Journal of Chemical Physics, 128, 084106.
- Grimme, S., Antony, J., Ehrlich, S., & Krieg, H. (2010). A consistent and accurate ab initio parametrization of density functional dispersion correction (DFT-D) for the 94 elements H–Pu. The Journal of Chemical Physics, 132, 154104.
- Grimme, S., Ehrlich, S., & Goerigk, L. (2011). Effect of the damping function in dispersion corrected density functional theory. Journal of Computational Chemistry, 32, 1456–1465.
- Caldeweyher, E., et al. (2019). A generally applicable atomic-charge dependent London dispersion correction. The Journal of Chemical Physics, 150, 154122.
- Dudarev, S. L., Botton, G. A., Savrasov, S. Y., Humphreys, C. J., & Sutton, A. P. (1998). Electron-energy-loss spectra and the structural stability of nickel oxide: An LSDA+U study. Physical Review B, 57, 1505–1509.
- Raghavachari, K., Trucks, G. W., Pople, J. A., & Head-Gordon, M. (1989). A fifth-order perturbation comparison of electron correlation theories. Chemical Physics Letters, 157, 479–483.
- Riplinger, C., Sandhoefer, B., Hansen, A., & Neese, F. (2013). Natural triple excitations in local coupled cluster calculations with pair natural orbitals. The Journal of Chemical Physics, 139, 134101.
- Weigend, F., & Ahlrichs, R. (2005). Balanced basis sets of split valence, triple zeta valence and quadruple zeta valence quality for H to Rn. Physical Chemistry Chemical Physics, 7, 3297–3305.
- Hamann, D. R., Schlüter, M., & Chiang, C. (1979). Norm-Conserving Pseudopotentials. Physical Review Letters, 43, 1494–1497.
- Vanderbilt, D. (1990). Soft self-consistent pseudopotentials in a generalized eigenvalue formalism. Physical Review B, 41, 7892–7895.
- Blöchl, P. E. (1994). Projector augmented-wave method. Physical Review B, 50, 17953–17979.
- Dal Corso, A. (2014). Pseudopotentials periodic table: From H to Pu. Computational Materials Science, 95, 337–350.
- Prandini, G., Marrazzo, A., Castelli, I. E., Mounet, N., & Marzari, N. (2018). Precision and efficiency in solid-state pseudopotential calculations. npj Computational Materials, 4, 72.
- Martyna, G. J., & Tuckerman, M. E. (1999). A reciprocal space based method for treating long range interactions in ab initio and force-field-based calculations in clusters. The Journal of Chemical Physics, 110, 2810–2821.
- Monkhorst, H. J., & Pack, J. D. (1976). Special points for Brillouin-zone integrations. Physical Review B, 13, 5188–5192.
- Marzari, N., Vanderbilt, D., De Vita, A., & Payne, M. C. (1999). Thermal Contraction and Disordering of the Al(110) Surface. Physical Review Letters, 82, 3296–3299.
- Henkelman, G., Uberuaga, B. P., & Jónsson, H. (2000). A climbing image nudged elastic band method for finding saddle points and minimum energy paths. The Journal of Chemical Physics, 113, 9901–9904.
- Jain, A., et al. (2013). Commentary: The Materials Project: A materials genome approach to accelerating materials innovation. APL Materials, 1, 011002.
- Barroso-Luque, L., et al. (2024). Open Materials 2024 (OMat24) Inorganic Materials Dataset and Models. arXiv:2410.12771.
- Frisch, M. J., et al. (2016). Gaussian 16. Gaussian, Inc., Wallingford, CT.
- Neese, F., Wennmohs, F., Becker, U., & Riplinger, C. (2020). The ORCA quantum chemistry program package. The Journal of Chemical Physics, 152, 224108.
- Giannozzi, P., et al. (2009). QUANTUM ESPRESSO: a modular and open-source software project for quantum simulations of materials. Journal of Physics: Condensed Matter, 21, 395502.
- Gougoussis, C., Calandra, M., Seitsonen, A. P., & Mauri, F. (2009). First-principles calculations of x-ray absorption in a scheme based on ultrasoft pseudopotentials: From α-quartz to high-Tc compounds. Physical Review B, 80, 075102.
- Kresse, G., & Furthmüller, J. (1996). Efficient iterative schemes for ab initio total-energy calculations using a plane-wave basis set. Physical Review B, 54, 11169–11186.
- Kühne, T. D., et al. (2020). CP2K: An electronic structure and molecular dynamics software package – Quickstep: Efficient and accurate electronic structure calculations. The Journal of Chemical Physics, 152, 194103.
- Quantum ESPRESSO documentation. PWscf input reference: cutoffs, SCF thresholds, and dispersion settings.
- NequIP documentation. Stress and virial conventions and energy-based models and derivatives.