aiida_quantumespresso.parsers.parse_raw.pw#

A collection of function that are used to parse the output of Quantum Espresso PW.

The function that needs to be called from outside is parse_raw_output(). The functions mostly work without aiida specific functionalities. The parsing will try to convert whatever it can in some dictionary, which by operative decision doesn’t have much structure encoded, [the values are simple ]

Module Contents#

Functions#

reduce_symmetries(parsed_parameters, parsed_structure, ...)

Reduce the symmetry information parsed from the output to save space.

get_symmetry_mapping()

Hard coded names and rotation matrices + inversion from QE v 5.0.2 function for Parser class usage only.

detect_important_message(logs, line)

parse_stdout(stdout, input_parameters[, ...])

Parses the stdout content of a Quantum ESPRESSO pw.x calculation.

grep_energy_from_line(line)

Attributes#

lattice_tolerance

units_suffix

default_charge_units

default_dipole_units

default_energy_units

default_force_units

default_k_points_units

default_length_units

default_magnetization_units

default_polarization_units

default_stress_units

REG_ERROR_NPOOLS_TOO_HIGH

aiida_quantumespresso.parsers.parse_raw.pw.lattice_tolerance = 1e-05[source]#
aiida_quantumespresso.parsers.parse_raw.pw.units_suffix = '_units'[source]#
aiida_quantumespresso.parsers.parse_raw.pw.default_charge_units = 'e'[source]#
aiida_quantumespresso.parsers.parse_raw.pw.default_dipole_units = 'Debye'[source]#
aiida_quantumespresso.parsers.parse_raw.pw.default_energy_units = 'eV'[source]#
aiida_quantumespresso.parsers.parse_raw.pw.default_force_units = 'ev / angstrom'[source]#
aiida_quantumespresso.parsers.parse_raw.pw.default_k_points_units = '1 / angstrom'[source]#
aiida_quantumespresso.parsers.parse_raw.pw.default_length_units = 'Angstrom'[source]#
aiida_quantumespresso.parsers.parse_raw.pw.default_magnetization_units = 'Bohrmag / cell'[source]#
aiida_quantumespresso.parsers.parse_raw.pw.default_polarization_units = 'C / m^2'[source]#
aiida_quantumespresso.parsers.parse_raw.pw.default_stress_units = 'GPascal'[source]#
aiida_quantumespresso.parsers.parse_raw.pw.reduce_symmetries(parsed_parameters, parsed_structure, logger)[source]#

Reduce the symmetry information parsed from the output to save space.

In the standard output, each symmetry operation print two rotation matrices:

  • S_cryst^T: matrix in crystal coordinates, transposed

  • S_cart: matrix in cartesian coordinates,

The XML files only print one matrix:

  • S_cryst: matrix in crystal coordinates

The raw parsed symmetry information from the XML is large and will load the database heavily if stored as is for each calculation. Instead, we will map these dictionaries onto a static dictionary of rotation matrices generated by the _get_qe_symmetry_list static method. This dictionary will return the rotation matrices in cartesian coordinates, i.e. S_cart. In order to compare the raw matrices from the XML to these static matrices we have to convert S_cryst into S_cart. We derive here how that is done:

S_cryst * v_cryst = v_cryst’

where v_cryst’ is the rotated vector v_cryst under S_cryst We define cell where cell vectors are rows. Converting a vector from crystal to cartesian coordinates is defined as:

cell^T * v_cryst = v_cart

The inverse of this operation is defined as

v_cryst = cell^Tinv * v_cart

Replacing the last equation into the first we find:

S_cryst * cell^Tinv * v_cart = cell^Tinv * v_cart’

Multiply on the left with cell^T gives:

cell^T * S_cryst * cell^Tinv * v_cart = v_cart’

which can be rewritten as:

S_cart * v_cart = v_cart’

where:

S_cart = cell^T * S_cryst * cell^Tinv

We compute here the transpose and its inverse of the structure cell basis, which is needed to transform the parsed rotation matrices, which are in crystal coordinates, to cartesian coordinates, which are the matrices that are returned by the _get_qe_symmetry_list staticmethod

aiida_quantumespresso.parsers.parse_raw.pw.get_symmetry_mapping()[source]#

Hard coded names and rotation matrices + inversion from QE v 5.0.2 function for Parser class usage only.

Returns:

a list of dictionaries, each containing name (string), inversion (boolean) and matrix (list of lists)

aiida_quantumespresso.parsers.parse_raw.pw.REG_ERROR_NPOOLS_TOO_HIGH[source]#
aiida_quantumespresso.parsers.parse_raw.pw.detect_important_message(logs, line)[source]#
aiida_quantumespresso.parsers.parse_raw.pw.parse_stdout(stdout, input_parameters, parser_options=None, parsed_xml=None, crash_file=None)[source]#

Parses the stdout content of a Quantum ESPRESSO pw.x calculation.

Parameters:
  • stdout – the stdout content as a string

  • input_parameters – dictionary with the input parameters

  • crash_file – the content of the CRASH file as a string if it was written, None otherwise.

  • parser_options – the parser options from the settings input parameter node

  • parsed_xml – dictionary with data parsed from the XML output file

Returns:

tuple of two dictionaries, with the parsed data and log messages, respectively

aiida_quantumespresso.parsers.parse_raw.pw.grep_energy_from_line(line)[source]#