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
&SYSTEMnamelist is scanned for the parametersibrav,nat,ntyp,celldm(1), andA. The lattice parameter alat is taken fromcelldm(1)(given in Bohr units, converted to Å) or fromA(given in Å). The number of atomsnatand the number of atomic speciesntypdetermine how many entries are read from theATOMIC_POSITIONSandATOMIC_SPECIEScards, respectively. All other namelist parameters are ignored.ATOMIC_SPECIEScardEach of the
ntypentries 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_POSITIONScardEach of the
natentries 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,bohrconverts from Bohr radii to Å,angstromtakes the coordinates as they are, andcrystaldenotes 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_SPECIEScard.Mass — the atomic mass of the atom’s species as given in the
ATOMIC_SPECIEScard.
CELL_PARAMETERScardThe 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, orangstrom. If this card is present, it always defines the cell geometry, irrespective of theibravvalue. 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_PARAMETERScard, the simulation cell is constructed from theibravparameter and the lattice parameter alat according to the Quantum ESPRESSO conventions. The supported lattice types areibrav=1(simple cubic),ibrav=2(fcc),ibrav=3(bcc), andibrav=-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,mdcalculations) are written to the program’s output files, which cannot be loaded by OVITO.Bravais lattice types other than
ibrav=1,2,3, and-3are not supported. Files using any otheribravvalue must specify the cell vectors explicitly in aCELL_PARAMETERScard (which Quantum ESPRESSO requires only foribrav=0). The lattice parameterscelldm(2)–celldm(6)andB,C,cosAB,cosAC,cosBCare not evaluated.The
crystal_sgunit option of theATOMIC_POSITIONScard (Wyckoff positions with space group symmetry) is not supported.The optional
if_poscolumns of theATOMIC_POSITIONScard, 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_POINTScard 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 theCreateBondsModifier, 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.