c2x and PWscf

Quantum Espresso is a GPLed suite of electronic structure codes, and c2x targets PWscf, the DFT component.

From version 2.15, c2x can read and write some data from its input files. Version 2.16 extends support to co-linear spin-polarised systems, and to reading .xml files and charge and spin densities.

There is an example of using pwscf and c2x to work on a system with colinear spins.


A file suffix of .in causes c2x to invoke an Abinit reader, which in turn invokes the Quantum Espresso reader if the first line is &control.

Reading of systems with any of the 17 Bravais lattices which QE understands is supported. Just atomic positions, k-points, energy cut-off and title are read.

There seems to be some confusion about the syntax of options on cards. On a line such as


should there be brackets around "angstrom", and should they be square brackets or parentheses? C2x will accept either or none.

When reading namelists, c2x ignores equals signs and commas, and accepts multiple parameters per line. It does not accept a linebreak between a parameter and its value.

.xml files

From version 2.16 c2x will read pwscf's .xml output files and its non-HDF5 charge-density.dat files. It will also attempt to read its pseudopotential files in order to extract the pseudocharges. Thus c2x can extract charge and spin densities, and calculate dipole moments etc., from pwscf calculations.

.cube files

The .cube files produced by QE's postprocessor pp.x are in atomic units. They should thus be read with the -U switch. The ionic charges given are the atomic numbers, not the pseudopotential charges, so these need to be modified by hand if calculating dipole moments.


Files are written with no brackets, and with one parameter per line in namelists. The -u flag is recognised for switching the output from Angstrom (default) to Bohr. Atomic positions are written in either Cartesian (--qe) or fractional (--qef) co-ordinates.