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:

NamelistWhat it holds
&CONTROLGeneral variables controlling the run: what to calculate, where files go
&SYSTEMThe system: the cell, the number of atoms and species, the cutoffs, occupations
&ELECTRONSThe electron loop: self-consistency, mixing, diagonalization
&IONSMoving the atoms (relaxation, dynamics); optional
&CELLChanging 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), not ATOMIC_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.

Example
 &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.x uses the environment variable ESPRESSO_PSEUDO, else $HOME/espresso/pseudo/.
  • outdir: the folder for temporary and data files. Without it, pw.x uses ESPRESSO_TMPDIR if set, else the current folder.
  • tstress and tprnfor: compute the stress and the forces. Both default to .false. for an scf run.

&SYSTEM: the cell, the atoms and the cutoffs

  • ibrav = 2: the Bravais-lattice index, here face-centered cubic. ibrav = 0 means you give the three lattice vectors yourself in the CELL_PARAMETERS card.
  • celldm(1) = 10.20: the lattice parameter a, in bohr. You may give A, in ångström, instead, but not both.
  • nat = 2 and ntyp = 1: two atoms in the cell, of one species.
  • ecutwfc = 18.0: the kinetic-energy cutoff for the wavefunctions, in Ry. Its partner ecutrho, the cutoff for the charge density, defaults to four times ecutwfc. 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:

Example
    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 is 1e-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 from ATOMIC_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) or crystal_sg. Leaving the option out means alat and is deprecated.
  • K_POINTS: with no option, as here, the option is tpiba: a count (10), then each k-point in Cartesian coordinates in units of 2π/a, with a weight. With automatic, pw.x generates a Monkhorst-Pack grid from six numbers, as in the copper input: 8 8 8 0 0 0 is an 8 × 8 × 8 grid with no offset (a 1 would shift the grid by half a step in that direction). With gamma, 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 option alat, bohr or angstrom. It must be present when ibrav = 0 and 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.

QuantityUnits
ecutwfc, ecutrho, conv_thrRy
celldm(1)bohr
A (instead of celldm(1))Å
ATOMIC_POSITIONS, CELL_PARAMETERSSet by the card's option; always state it
Masses in ATOMIC_SPECIESAtomic mass units (C = 12)
K_POINTS with tpiba2π/a
Hubbard parameters (the HUBBARD card)eV, as the reference says

What do people mix up?

The mix-upWhat 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.

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.

LineFileWhy
calculation = 'scf'&CONTROLWhat to calculate is a general variable controlling the run, so it lives in &CONTROL. 'scf' is also its default.
ecutwfc =18.0,&SYSTEMThe wavefunction cutoff, in Ry, is one of the three variables &SYSTEM always needs, with nat and ntyp.
conv_thr = 1.0d-8&ELECTRONSThe convergence threshold of the self-consistency loop, in Ry, belongs with the other electronic variables.
Si 28.086 Si.pz-vbc.UPFA cardA line of the ATOMIC_SPECIES card: the label, the mass in atomic mass units, and the pseudopotential file.
prefix='silicon',&CONTROLThe 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,&SYSTEMThe lattice (face-centered cubic, a = 10.20 bohr) and the counts of atoms and species describe the system.
mixing_beta = 0.7&ELECTRONSThe mixing factor for self-consistency; 0.7 is its default.
8 8 8 0 0 0A cardThe 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&SYSTEMHow 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/',&CONTROLWhere 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.

Updated
12 November 2026
Applies to
Quantum ESPRESSO 7.6 (pw.x)
Source check
Checked against the docs, 12 November 2026

Where can I read more?

In the Quantum ESPRESSO repository, at release 7.6:

What was this page checked against?

Checked against Quantum ESPRESSO's documentation in its source repository, release tag qe-7.6, 12 November 2026. The project's website, quantum-espresso.org, could not be reached from the drafting environment, so the published input reference (INPUT_PW.html) was not read; its source was read in the repository instead: PW/Doc/INPUT_PW.def, PW/Doc/user_guide.tex, and PW/examples/example01/README with run_example. The files were fetched from the repository's GitHub copy (QEF/q-e) at tag qe-7.6, commit 9f93dde, tagged 9 July 2026, the same commit as that tag in the official GitLab repository; the development branch (develop, commit 066ca7d) held identical copies on 12 November 2026. Every link on this page was opened.