Quantum ESPRESSO file reader

For loading atomic structures from input files of the Quantum ESPRESSO electronic-structure code, i.e. files written in the input format of the pw.x program (see the pw.x input description). Such files consist of Fortran namelist blocks (&CONTROL, &SYSTEM, &ELECTRONS, …), each terminated by a / line, followed by data cards such as ATOMIC_SPECIES, ATOMIC_POSITIONS, K_POINTS, and CELL_PARAMETERS. OVITO can directly load gzipped input files (“.gz” suffix).

The file format is detected automatically, irrespective of the filename extension (.in, .pwi, .qe, etc.): a file is recognized as a Quantum ESPRESSO input file if it starts with one or more namelist blocks (&...//), optionally preceded by comment lines, followed by an ATOMIC_SPECIES card. Only input files are supported; the output files written by pw.x (.out log files) and the XML data files in the outdir directory cannot be loaded by OVITO.

Imported data

The file reader parses the following parts of the input file:

Namelist parameters

The &SYSTEM namelist is scanned for the parameters ibrav, nat, ntyp, celldm(1), and A. The lattice parameter alat is taken from celldm(1) (given in Bohr units, converted to Å) or from A (given in Å). The number of atoms nat and the number of atomic species ntyp determine how many entries are read from the ATOMIC_POSITIONS and ATOMIC_SPECIES cards, respectively. All other namelist parameters are ignored.

ATOMIC_SPECIES card

Each of the ntyp entries defines a named particle type. The species name (e.g. Si) becomes the type name, for which OVITO assigns the standard color and display radius of the chemical element, and the atomic mass of the species is stored as the type’s mass. The pseudopotential file name is ignored.

ATOMIC_POSITIONS card

Each of the nat entries is read as one atom, creating the following per-atom properties:

  • Position — the atomic coordinates, converted to Cartesian coordinates in Å according to the unit specification of the card: alat (the default if no unit is given) multiplies the coordinates by the lattice parameter alat, bohr converts from Bohr radii to Å, angstrom takes the coordinates as they are, and crystal denotes fractional coordinates, which are transformed to Cartesian coordinates using the simulation cell vectors.

  • Particle Type — the species name given in the first column of each line, which refers to one of the types defined in the ATOMIC_SPECIES card.

  • Mass — the atomic mass of the atom’s species as given in the ATOMIC_SPECIES card.

CELL_PARAMETERS card

The three lines of the card are read as the cell vectors \(\mathbf{a}\), \(\mathbf{b}\), \(\mathbf{c}\) of the simulation cell, scaled according to the unit specification of the card: alat (the default if no unit is given), bohr, or angstrom. If this card is present, it always defines the cell geometry, irrespective of the ibrav value. The cell origin is placed at the coordinate origin, and periodic boundary conditions are enabled in all three directions.

Bravais lattice (ibrav)

If the file contains no CELL_PARAMETERS card, the simulation cell is constructed from the ibrav parameter and the lattice parameter alat according to the Quantum ESPRESSO conventions. The supported lattice types are ibrav=1 (simple cubic), ibrav=2 (fcc), ibrav=3 (bcc), and ibrav=-3 (bcc with symmetric axes).

Namelist parameter names are matched case-insensitively, as in Fortran, and Fortran-style floating-point numbers with a d/D exponent character (e.g. 4.65d0) are accepted everywhere.

Limitations

  • An input file contains a single structure only; the file reader does not support trajectories or animation sequences. Structures optimized or evolved by pw.x (relax, vc-relax, md calculations) are written to the program’s output files, which cannot be loaded by OVITO.

  • Bravais lattice types other than ibrav=1, 2, 3, and -3 are not supported. Files using any other ibrav value must specify the cell vectors explicitly in a CELL_PARAMETERS card (which Quantum ESPRESSO requires only for ibrav=0). The lattice parameters celldm(2)–celldm(6) and B, C, cosAB, cosAC, cosBC are not evaluated.

  • The crystal_sg unit option of the ATOMIC_POSITIONS card (Wyckoff positions with space group symmetry) is not supported.

  • The optional if_pos columns of the ATOMIC_POSITIONS card, which fix the coordinates of individual atoms during a relaxation, are ignored. Any further columns following the atomic coordinates are ignored as well.

  • The K_POINTS card and all other cards (OCCUPATIONS, CONSTRAINTS, ATOMIC_VELOCITIES, ATOMIC_FORCES, HUBBARD, etc.) are ignored.

  • The format does not store bonds. OVITO can generate them during import using the Generate bonds option (see below).

Options

Center simulation cell on coordinate origin

If enabled, OVITO shifts the simulation cell and all atom coordinates so that the geometric center of the cell coincides with the coordinate origin. Otherwise, the origin of the unit cell is placed at the coordinate origin.

Generate bonds

Lets OVITO create bonds between the atoms during import, using one of the parameter-free criteria of the Create bonds modifier. Bonds crossing the periodic cell boundaries are handled correctly.

Van der Waals radii

Two atoms are connected if their distance is smaller than 0.6 times the sum of their van der Waals radii. No bonds are created between two hydrogen atoms.

Covalent radii

Bonds are created based on the covalent radii and the maximum coordination numbers of the chemical elements.

VESTA-like

Bonds are created according to the built-in table of element-pair bond distances adopted from the VESTA program.

Alternatively, you can apply the Create bonds modifier to the loaded structure, which provides more control over the generation of bonds.

Python parameters

The file reader accepts the following optional keyword parameters in a call to the import_file() or load() Python functions.

import_file(location, centering=False, generate_bonds='off')
Parameters:
  • centering (bool) – Translate atom coordinates and simulation cell to center them at the coordinate origin.

  • generate_bonds (str) – Controls the generation of ad-hoc bonds connecting the atoms loaded from the file. The bond criterion can be based on the van der Waals radii of the chemical elements ('vdw'), on their covalent radii and maximum coordination numbers ('covalent'), or on the built-in table of element-pair bond distances adopted from the VESTA program ('vesta'). 'off' disables bond generation. These criteria correspond to the modes of the CreateBondsModifier, which you can alternatively apply to the system after import for more control over the generation of bonds.

Added in version 3.17.0: The centering and generate_bonds options are now supported by the Quantum ESPRESSO file reader.