PW

Description

Use the plugin to support inputs of Quantum Espresso pw.x executable.

Supported codes

  • tested from pw.x v5.0 onwards. Back compatibility is not guaranteed (although versions 4.3x might work most of the times).

Inputs

  • pseudo, class UpfData One pseudopotential file per atomic species.

    Alternatively, pseudo for every atomic species can be set with the use_pseudos_from_family method, if a family of pseudopotentials has been installed..

  • kpoints, class KpointsData Reciprocal space points on which to build the wavefunctions. Can either be a mesh or a list of points with/without weights

  • parameters, class ParameterData Input parameters of pw.x, as a nested dictionary, mapping the input of QE. Example:

    {"CONTROL":{"calculation":"scf"},
     "ELECTRONS":{"ecutwfc":30.,"ecutrho":100.},
    }
    

    See the QE documentation for the full list of variables and their meaning. Note: some keywords don’t have to be specified or Calculation will enter the SUBMISSIONFAILED state, and are already taken care of by AiiDA (are related with the structure or with path to files):

    'CONTROL', 'pseudo_dir': pseudopotential directory
    'CONTROL', 'outdir': scratch directory
    'CONTROL', 'prefix': file prefix
    'SYSTEM', 'ibrav': cell shape
    'SYSTEM', 'celldm': cell dm
    'SYSTEM', 'nat': number of atoms
    'SYSTEM', 'ntyp': number of species
    'SYSTEM', 'a': cell parameters
    'SYSTEM', 'b': cell parameters
    'SYSTEM', 'c': cell parameters
    'SYSTEM', 'cosab': cell parameters
    'SYSTEM', 'cosac': cell parameters
    'SYSTEM', 'cosbc': cell parameters
    
  • structure, class StructureData

  • settings, class ParameterData (optional) An optional dictionary that activates non-default operations. For a list of possible values to pass, see the section on the advanced features.

  • parent_folder, class RemoteData (optional) If specified, the scratch folder coming from a previous QE calculation is copied in the scratch of the new calculation.

  • vdw_table, class SinglefileData (optional) If specified, it should be a file for the van der Waals kernel table. The file is copied in the pseudo subfolder, without changing its name, and without any check, so it is your responsibility to select the correct file that you want to use.

Outputs

Note

The output_parameters has more parsed values in the EPFL version and output_bands is parsed only in the EPFL version.

There are several output nodes that can be created by the plugin, according to the calculation details. All output nodes can be accessed with the calculation.out method.

  • output_parameters ParameterData (accessed by calculation.res) Contains the scalar properties. Example: energy (in eV), total_force (modulus of the sum of forces in eV/Angstrom), warnings (possible error messages generated in the run).
  • output_array ArrayData Produced in case of calculations which do not change the structure, otherwise, an output_trajectory is produced. Contains vectorial properties, too big to be put in the dictionary. Example: forces (eV/Angstrom), stresses, ionic positions. Quantities are parsed at every step of the ionic-relaxation / molecular-dynamics run.
  • output_trajectory ArrayData Produced in case of calculations which change the structure, otherwise an output_array is produced. Contains vectorial properties, too big to be put in the dictionary. Example: forces (eV/Angstrom), stresses, ionic positions. Quantities are parsed at every step of the ionic-relaxation / molecular-dynamics run.
  • output_band (non spin polarized calculations)) or output_band1 + output_band2 (spin polarized calculations) BandsData Present only if parsing is activated with the `ALDO_BANDS` setting. Contains the list of electronic energies for every kpoint. If calculation is a molecular dynamics or a relaxation run, bands refer only to the last ionic configuration.
  • output_structure StructureData Present only if the calculation is moving the ions. Cell and ionic positions refer to the last configuration.
  • output_kpoints KpointsData Present only if the calculation changes the cell shape. Kpoints refer to the last structure.

Errors

Errors of the parsing are reported in the log of the calculation (accessible with the verdi calculation logshow command). Moreover, they are stored in the ParameterData under the key warnings, and are accessible with Calculation.res.warnings.

Additional advanced features

In this section we describe how to use some advanced functionality in the Quantum ESPRESSO pw.x plugin (note that most of them apply also to the cp.x plugin).

While the input link with name ‘parameters’ is used for the content of the namelists, additional parameters can be specified in the ‘settings’ input, also of type ParameterData.

Below we summarise some of the options that you can specify, and their effect. In each case, after having defined the content of settings_dict, you can use it as input of a calculation calc by doing:

calc.use_settings(ParameterData(dict=settings_dict))

Parsing band energies

During each scf or nscf run, QE stores the band energies at the k-points of interest in .xml files in the output directory. If you want to retrieve and parse them, you can set:

settings_dict = {
    'also_bands': True
}

Fixing some atom coordinates

If you want to ask QE to keep some coordinates of some atoms fixed (called if_pos in the QE documentation, and typically specified with 0 or 1 values after the atomic coordinates), you can specify the following list of lists:

settings_dict = {
    'fixed_coords': [
        [True,False,False],
        [True,True,True],
        [False,False,False],
        [False,False,False],
        [False,False,False],
        ],
}

the list of lists (of booleans) must be of length N times 3, where N is the number of sites (i.e., atoms) in the input structure. False means that the coordinate is free to move, True blocks that coordinate.

Passing an explicit list of kpoints on a grid

Some codes (e.g., Wannier90) require that a QE calculation is run with an explicit grid of points (i.e., all points in a grid, even if they are equivalent by symmetry). Instead of generating it manually, you can pass a usual KpointsData specifying a mesh, and then pass the following variable:

settings_dict = {
    'force_kpoints_list': True,
}

Gamma-only calculation

If you are using only the Gamma point (a grid of 1x1x1 without offset), you may want to use the following flag to tell QE to use the gamma-only routines (typically twice faster):

settings_dict = {
    'gamma_only': False,
}

Initialization only

Sometimes you want to run QE but stop it immediately after the initialisation part (e.g. to parse the number of symmetries detected, the number of G vectors, of k-points, ...) In this case, by specifying:

settings_dict = {
    'only_initialization': True,
}

a file named aiida.EXIT (where aiida is the prefix) will be also generated, asking QE to exit cleanly after the initialisation.

Different set of namelists

The QE plugin will automatically figure out which namelists should be specified (and in which order) depending con CONTROL.calculation (e.g. for SCF only CONTROL, SYSTEM, ELECTRONS, but also IONS for RELAX, ...). If you want to override the automatic list, you can specify the list of namelists you want to produce as follows:

settings_dict = {
    'namelists': ['CONTROL', 'SYSTEM', 'ELECTRONS', 'IONS', 'CELL', 'OTHERNL'],
}

Adding command-line options

If you want to add command-line options to the executable (particularly relevant e.g. to tune the parallelization level), you can pass each option as a string in a list, as follows:

settings_dict = {
    'cmdline': ['-nk', '4'],
}

Retrieving more files

If you know that your calculation is producing additional files that you want to retrieve (and preserve in the AiiDA repository in the long term), you can add those files as a list as follows (here in the case of a file named testfile.txt):

settings_dict = {
  'additional_retrieve_list': ['testfile.txt'],
}