QE 2 · Quantum ESPRESSO · 7 min read
What is in a Quantum ESPRESSO input file?
Checked against the docs · Quantum ESPRESSO repository, tag qe-7.6 · Last checked 12 November 2026 · Spot a mistake? Tell us
Short answer
A pw.x input file is one plain text file: a few namelists, &CONTROL, &SYSTEM and &ELECTRONS (plus &IONS and &CELL when atoms or the cell move), followed by cards such as ATOMIC_SPECIES, ATOMIC_POSITIONS and K_POINTS. Any quantity whose units are not stated is in Rydberg atomic units: energies in Ry, lengths in bohr.
How is a pw.x input file organized?
Everything pw.x needs to know, apart from the pseudopotential files, is in one plain text file in two parts.
Namelists come first. A namelist is a block that starts with & and its name, holds variable = value pairs and ends with a line holding /. The PWscf user guide lists five:
| Namelist | What it holds |
|---|---|
&CONTROL | General variables controlling the run: what to calculate, where files go |
&SYSTEM | The system: the cell, the number of atoms and species, the cutoffs, occupations |
&ELECTRONS | The electron loop: self-consistency, mixing, diagonalization |
&IONS | Moving the atoms (relaxation, dynamics); optional |
&CELL | Changing the cell (variable-cell relaxation or dynamics); optional |
They must appear in that order. Whether &IONS and &CELL are needed depends on calculation in &CONTROL. Almost every variable has a default, which the guide warns "may or may not fit your needs"; in &SYSTEM, nat, ntyp and ecutwfc must always be given, plus the variables that describe the crystal, such as ibrav and celldm.
Cards come after. A card starts with a keyword line, sometimes followed by an option such as a unit, then rows of data: ATOMIC_SPECIES, ATOMIC_POSITIONS, K_POINTS, and when needed CELL_PARAMETERS, OCCUPATIONS and others.
A few rules of form, from the input reference:
- comments start with
!in a namelist; in a card, a line starting with!or#is a comment; - leave a space between a card name and its option:
ATOMIC_POSITIONS (bohr), notATOMIC_POSITIONS(bohr); - use plain ASCII text only: tabs, Windows line endings (CRLF) and "smart" quotation marks are a frequent source of trouble.
What does a real input look like?
This is the first input of the official PWscf example 1, a self-consistent calculation for silicon, as its script run_example writes it. $PSEUDO_DIR and $TMP_DIR are shell variables the script fills in from the file environment_variables.
&control
calculation = 'scf'
restart_mode='from_scratch',
prefix='silicon',
tstress = .true.
tprnfor = .true.
pseudo_dir = '$PSEUDO_DIR/',
outdir='$TMP_DIR/'
/
&system
ibrav= 2, celldm(1) =10.20, nat= 2, ntyp= 1,
ecutwfc =18.0,
/
&electrons
diagonalization='$diago'
mixing_mode = 'plain'
mixing_beta = 0.7
conv_thr = 1.0d-8
/
ATOMIC_SPECIES
Si 28.086 Si.pz-vbc.UPF
ATOMIC_POSITIONS alat
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS
10
0.1250000 0.1250000 0.1250000 1.00
0.1250000 0.1250000 0.3750000 3.00
0.1250000 0.1250000 0.6250000 3.00
0.1250000 0.1250000 0.8750000 3.00
0.1250000 0.3750000 0.3750000 3.00
0.1250000 0.3750000 0.6250000 6.00
0.1250000 0.3750000 0.8750000 6.00
0.1250000 0.6250000 0.6250000 3.00
0.3750000 0.3750000 0.3750000 1.00
0.3750000 0.3750000 0.6250000 3.00($diago is the script's own loop variable: it runs the same input with each diagonalization method it lists, such as david for Davidson and cg for conjugate gradients.)
&CONTROL: what to do, and where the files go
calculation = 'scf': a single self-consistent calculation at fixed atoms, which is also the default. The other options are'nscf','bands','relax','md','vc-relax'and'vc-md'(vc for variable cell).prefix='silicon': prepended to the names of the files the run writes; the default is'pwscf'.pseudo_dir: the folder holding the pseudopotential files. Without it,pw.xuses the environment variableESPRESSO_PSEUDO, else$HOME/espresso/pseudo/.outdir: the folder for temporary and data files. Without it,pw.xusesESPRESSO_TMPDIRif set, else the current folder.tstressandtprnfor: compute the stress and the forces. Both default to.false.for anscfrun.
&SYSTEM: the cell, the atoms and the cutoffs
ibrav = 2: the Bravais-lattice index, here face-centered cubic.ibrav = 0means you give the three lattice vectors yourself in theCELL_PARAMETERScard.celldm(1) = 10.20: the lattice parameter a, in bohr. You may giveA, in ångström, instead, but not both.nat = 2andntyp = 1: two atoms in the cell, of one species.ecutwfc = 18.0: the kinetic-energy cutoff for the wavefunctions, in Ry. Its partnerecutrho, the cutoff for the charge density, defaults to four timesecutwfc. Both depend on the pseudopotentials: How does Quantum ESPRESSO use pseudopotentials?
Silicon is an insulator, so the default occupations = 'fixed' is right. For a metal the user guide says to set occupations = 'smearing' with a smearing type and a width degauss, as the same example does for copper:
occupations='smearing', smearing='marzari-vanderbilt', degauss=0.02&ELECTRONS: the self-consistency loop
conv_thr = 1.0d-8: the loop stops when the estimated energy error falls below this, in Ry. The default is1e-06; the reference notes that it is extensive, like the total energy.mixing_beta = 0.7: the mixing factor for self-consistency, here at its default.
The cards: species, positions, k-points
ATOMIC_SPECIES: one line per species: a label, the mass in atomic mass units, and the pseudopotential file. The mass is used only for molecular dynamics and damped-dynamics optimization (it is stored for phonon calculations too).ATOMIC_POSITIONS alat: one line per atom: the label fromATOMIC_SPECIES, then x, y, z. The option sets the units:alat(Cartesian, in units of the lattice parameter),bohr,angstrom,crystal(fractions of the lattice vectors) orcrystal_sg. Leaving the option out meansalatand is deprecated.K_POINTS: with no option, as here, the option istpiba: a count (10), then each k-point in Cartesian coordinates in units of 2π/a, with a weight. Withautomatic,pw.xgenerates a Monkhorst-Pack grid from six numbers, as in the copper input:8 8 8 0 0 0is an 8 × 8 × 8 grid with no offset (a 1 would shift the grid by half a step in that direction). Withgamma, it uses only k = 0 with routines specialized for it. What k-points are: What are k-points?CELL_PARAMETERS: the three lattice vectors, one per line, with the optionalat,bohrorangstrom. It must be present whenibrav = 0and absent otherwise.
Which units does the input use?
The input reference states the rule at the top: every quantity whose units are not given explicitly is in Rydberg atomic units.
| Quantity | Units |
|---|---|
ecutwfc, ecutrho, conv_thr | Ry |
celldm(1) | bohr |
A (instead of celldm(1)) | Å |
ATOMIC_POSITIONS, CELL_PARAMETERS | Set by the card's option; always state it |
Masses in ATOMIC_SPECIES | Atomic mass units (C = 12) |
K_POINTS with tpiba | 2π/a |
Hubbard parameters (the HUBBARD card) | eV, as the reference says |
What do people mix up?
| The mix-up | What is true |
|---|---|
| "Namelists can come in any order." | They must appear in the order &CONTROL, &SYSTEM, &ELECTRONS, then &IONS and &CELL when used. |
"ecutwfc = 18 means 18 eV." | It is 18 Ry. Unstated units are Rydberg atomic units. |
"ATOMIC_POSITIONS without a unit is fine." | It falls back to alat, and the reference marks leaving the unit out as deprecated. |
"Give both celldm(1) and A to be safe." | Give one or the other, never both. |
"CELL_PARAMETERS is always needed." | Only with ibrav = 0; with any other ibrav it must be absent. |
| "The masses change the energy." | They are used only for dynamics and damped-dynamics optimization. |
"pw.x will tell me exactly what is wrong in the input." | The user guide says a misspelled variable or a stray character often gives only "Error while reading XXX namelist", so check spelling and file type first. |
Which values should I use?
The layout is the easy part; the values are the science.
- The cutoffs and the pseudopotentials they depend on: How does Quantum ESPRESSO use pseudopotentials?
- The whole first run, from this input to its total energy: How do I run my first Quantum ESPRESSO calculation?
- Every variable, its default and its options: the input reference,
PW/Doc/INPUT_PW.def(below).
Try it
Which part of the file does it go in?
Each line below comes from the PWscf example 1 inputs. Pick the namelist or card it belongs in; the answers follow the input reference.
| Line | File | Why |
|---|---|---|
calculation = 'scf' | &CONTROL | What to calculate is a general variable controlling the run, so it lives in &CONTROL. 'scf' is also its default. |
ecutwfc =18.0, | &SYSTEM | The wavefunction cutoff, in Ry, is one of the three variables &SYSTEM always needs, with nat and ntyp. |
conv_thr = 1.0d-8 | &ELECTRONS | The convergence threshold of the self-consistency loop, in Ry, belongs with the other electronic variables. |
Si 28.086 Si.pz-vbc.UPF | A card | A line of the ATOMIC_SPECIES card: the label, the mass in atomic mass units, and the pseudopotential file. |
prefix='silicon', | &CONTROL | The name prepended to the run's files is set in &CONTROL; its default is 'pwscf'. |
ibrav= 2, celldm(1) =10.20, nat= 2, ntyp= 1, | &SYSTEM | The lattice (face-centered cubic, a = 10.20 bohr) and the counts of atoms and species describe the system. |
mixing_beta = 0.7 | &ELECTRONS | The mixing factor for self-consistency; 0.7 is its default. |
8 8 8 0 0 0 | A card | The data line of K_POINTS (automatic) in the copper input: an 8 × 8 × 8 grid with no offset. |
occupations='smearing', smearing='marzari-vanderbilt', degauss=0.02 | &SYSTEM | How the states are occupied is part of the system's description; the user guide says a metal needs 'smearing' with a type and a width. |
pseudo_dir = '$PSEUDO_DIR/', | &CONTROL | Where to find the pseudopotential files is a file location, set in &CONTROL. The file names themselves go in ATOMIC_SPECIES. |
Verlet runs VASP and LAMMPS today and does not support Quantum ESPRESSO; everything on this page works without it.