Every reliable DFT result rests on two numerical parameters you must converge before trusting a single number: the plane-wave cutoff energy and the k-point sampling density. Skip this step and your total energies, lattice constants, and forces can be wrong by amounts larger than the effect you are studying. This tutorial shows how to converge both systematically in Quantum ESPRESSO, with a worked silicon example and a script to automate the sweep.
Why Convergence Testing Matters
Plane-wave DFT introduces two discretizations that control accuracy. The plane-wave basis is truncated at a kinetic-energy cutoff \(E_{\mathrm{cut}}\) (ecutwfc), so fewer plane waves means a coarser, less complete basis. The Brillouin-zone integrals that produce the charge density and total energy are approximated by a finite sum over \(\mathbf{k}\)-points:
so a sparse grid means a crude integral.
Both errors shrink as you increase the corresponding parameter, but so does the cost. The goal of convergence testing is to find the smallest values that give results converged to your target tolerance — typically \(\sim 1\,\mathrm{meV/atom}\) for total energies, tighter for phonons or reaction energies. Because these two parameters are largely independent, you converge them one at a time:
flowchart TD
A[Fix dense k-grid] --> B[Sweep ecutwfc]
B --> C{ΔE/atom below tolerance?}
C -->|No| B
C -->|Yes| D[Fix converged ecutwfc]
D --> E[Sweep ecutrho if US/PAW]
E --> F[Sweep k-grid]
F --> G{ΔE/atom below tolerance?}
G -->|No| F
G -->|Yes| H[Record production parameters<br/>+ safety margin]A crucial rule: converge each parameter using energy differences, not absolute energies. Judge convergence by
$$ \Delta E = \bigl\lvert E(p_{i+1}) - E(p_{i})\bigr\rvert $$where \(p\) is the parameter being swept. A single total energy drifts as you add basis functions, but the quantity you actually care about — an energy difference, a force, a lattice constant — converges faster and more meaningfully.
Converging the Wavefunction Cutoff (ecutwfc)
The variable ecutwfc sets the kinetic-energy cutoff \(E_{\mathrm{cut}}\) in Rydberg for the plane-wave expansion of the Kohn–Sham orbitals. Start with a base silicon SCF input and vary only this one number.
&CONTROL
calculation = 'scf'
prefix = 'si'
outdir = './tmp/'
pseudo_dir = './pseudo/'
/
&SYSTEM
ibrav = 2
celldm(1) = 10.26
nat = 2
ntyp = 1
ecutwfc = 20.0
ecutrho = 80.0
/
&ELECTRONS
conv_thr = 1.0d-8
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-n-rrkjus_psl.1.0.0.UPF
ATOMIC_POSITIONS (alat)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS (automatic)
8 8 8 0 0 0
Keep the k-point grid fixed at a dense value (here 8x8x8) so that only the basis changes. Then run the calculation for ecutwfc values of 20, 25, 30, 35, 40, 45, and 50 Ry and record the total energy each time.
Reading the Convergence Trend
Extract the final energy with a simple grep and compare consecutive values:
grep '^!' si_ecut30.out
Convergence is reached when increasing ecutwfc by 5 Ry changes the energy per atom by less than your tolerance. For this silicon pseudopotential the energy is typically converged to under 1 meV/atom by about 30-35 Ry. Choosing a slightly higher production value than the bare minimum gives you a safety margin at modest extra cost.
Converging the Charge-Density Cutoff (ecutrho)
The second cutoff, ecutrho, controls the fineness of the FFT grid used to represent the charge density and potentials. Its correct value depends on the pseudopotential type.
| Pseudopotential | Recommended ecutrho | Reason |
|---|---|---|
| Norm-conserving | 4x ecutwfc | Density has no augmentation charge |
| Ultrasoft | 8-12x ecutwfc | Augmentation charges are sharp |
| PAW | 8-12x ecutwfc | Similar hard density features |
For norm-conserving potentials the default 4x ratio is usually sufficient and needs no separate test. For ultrasoft and PAW sets, fix ecutwfc at its converged value and sweep ecutrho from 6x to 12x, watching the total energy and — more sensitively — the forces. Underconverged ecutrho produces the characteristic egg-box effect, where energy oscillates as atoms move across the FFT grid, ruining relaxations and phonons.
Converging the K-Point Grid
With the cutoffs fixed at converged values, now vary the Monkhorst-Pack grid in the K_POINTS (automatic) card. Test a sequence such as 2x2x2, 4x4x4, 6x6x6, 8x8x8, 10x10x10, and 12x12x12.
K_POINTS (automatic)
6 6 6 0 0 0
A few practical points:
- Denser grids matter more for metals than insulators, because the abrupt Fermi surface makes Brillouin-zone integration harder. Silicon, being a semiconductor, converges relatively quickly.
- Match the grid to cell shape. For an anisotropic cell, scale the divisions inversely with the lattice-vector lengths, so a long axis gets fewer k-points.
- Supercells need fewer k-points. Doubling the cell in real space halves the Brillouin zone, so a 2x2x2 supercell needs roughly half the grid density of the primitive cell.
A Worked Silicon Convergence Example
Running the full silicon sweep produces a table like the one below. Energies are per atom, referenced to the most converged run so the trend is easy to read.
ecutwfc (Ry) | k-grid | Energy per atom (meV, relative) |
|---|---|---|
| 20 | 8x8x8 | +48.2 |
| 25 | 8x8x8 | +12.6 |
| 30 | 8x8x8 | +2.1 |
| 35 | 8x8x8 | +0.4 |
| 40 | 8x8x8 | 0.0 (reference) |
| 30 | 2x2x2 | +21.7 |
| 30 | 4x4x4 | +3.8 |
| 30 | 6x6x6 | +0.6 |
| 30 | 8x8x8 | +0.1 |
| 30 | 10x10x10 | 0.0 |
The table shows ecutwfc = 30 Ry and a 6x6x6 grid bring silicon within about 1 meV/atom — a sensible production choice. Push to ecutwfc = 35 Ry and 8x8x8 for high-accuracy work like phonons or elastic constants.
Convergence Depends on the Property You Want
A parameter set converged for total energy is not necessarily converged for every property. Different observables have different sensitivities, and forgetting this leads to results that look fine but fail closer scrutiny.
- Total energy converges fastest and is the standard target for the sweeps above.
- Forces and stresses converge more slowly with
ecutrho, since they depend on gradients of the density. Relaxations and elastic constants need tighter density cutoffs than a single energy would suggest. - Phonon frequencies are extremely demanding, often requiring
ecutwfca few Rydberg above the energy-converged value and aconv_throf 1e-12 to 1e-14. - Band gaps and magnetic moments are especially sensitive to k-point density, because they probe specific regions of the Brillouin zone rather than an integrated quantity.
The practical lesson: converge with respect to the property you actually report. If your paper quotes a bulk modulus, converge the stress; if it quotes a phonon spectrum, converge frequencies. Reusing an energy-converged grid for a phonon calculation is a classic way to publish a wrong number.
Documenting and Reusing Converged Parameters
Once you have converged values for a given element and pseudopotential, record them in a lab notebook or a shared table so you never repeat the sweep unnecessarily. Note the pseudopotential filename, the functional, the converged ecutwfc and ecutrho, and the k-point density expressed as points per reciprocal Angstrom — the latter transfers cleanly between cells of different sizes, unlike a raw grid like 6x6x6.
Common Convergence-Testing Pitfalls
Even careful researchers stumble on the same handful of mistakes when running convergence tests.
- Changing two parameters at once. If you vary
ecutwfcand the k-grid together, you cannot attribute the energy change to either one. Hold everything else fixed while sweeping a single parameter. - Judging on absolute energy. As noted, absolute total energies drift with the basis. Always look at energy differences or the derived property you care about.
- Testing on the wrong structure. Convergence parameters transfer between similar chemistries, but a molecule in a large box, a metallic surface, and a bulk oxide can all need different cutoffs. Test on a system representative of your production runs.
- Ignoring the FFT-grid dependence of forces. A cutoff that converges energy to 1 meV/atom may leave forces noticeably noisy. If you will relax structures, verify force convergence too.
Automating the Convergence Sweep
Editing inputs by hand invites mistakes. A short shell loop generates and runs the whole ecutwfc sweep automatically:
#!/bin/bash
for ecut in 20 25 30 35 40 45 50; do
sed "s/ecutwfc.*/ecutwfc = ${ecut}.0/; s/ecutrho.*/ecutrho = $((ecut*4)).0/" \
si.base.in > si_ecut${ecut}.in
mpirun -np 4 pw.x -in si_ecut${ecut}.in > si_ecut${ecut}.out
energy=$(grep '^!' si_ecut${ecut}.out | awk '{print $5}')
echo "${ecut} Ry -> ${energy} Ry"
done
The same pattern works for k-points by substituting the K_POINTS line. For larger studies, tools like the ASE Python library or AiiDA can orchestrate these sweeps, track provenance, and plot the convergence curves for you.
Turning Data into a Decision
Plot energy per atom against each parameter and look for the plateau. The right choice is the first value on the plateau plus a small safety margin. Document the converged parameters alongside your results — reviewers and collaborators will ask, and reproducibility depends on it. For more background on plane-wave DFT and its parameters, the official Quantum ESPRESSO documentation is the authoritative source, and our getting started guide covers the first SCF run.
Run it on Simatra
Convergence testing means running the same calculation a dozen or more times, which is exactly the kind of embarrassingly parallel workload cloud compute handles best. Simatra runs Quantum ESPRESSO on GPU-accelerated clusters using GPU-Opt-V2 instances, delivering up to 5x faster convergence and supporting supercells up to ~2,000 atoms — so a full cutoff-and-k-point sweep finishes in a fraction of the wall-clock time. Explore our computational engines and start free with $100 in credits at app.simatra.io.
