aiida_quantumespresso.parsers.parse_raw.ph
#
A collection of function that are used to parse the output of Quantum Espresso PHonon.
The function that needs to be called from outside is parse_raw_ph_output(). Ideally, the functions should work even without aiida and will return a dictionary with parsed keys.
Module Contents#
Functions#
|
Parses the raw output of a Quantum ESPRESSO ph.x calculation. |
|
Parse the xml tensor file of QE v5.0.3 data must be read from the file with the .read() function (avoid |
|
Can be used to load the disordered matrices of the QE XML file. |
|
Parses the stdout of Quantum ESPRESSO |
|
Parse frequencies and eigenvectors of a single dynamical matrix. |
- aiida_quantumespresso.parsers.parse_raw.ph.parse_raw_ph_output(stdout, logs, tensors=None, dynamical_matrices=None)[source]#
Parses the raw output of a Quantum ESPRESSO ph.x calculation.
- Parameters:
stdout – the content of the stdout file as a string
tensors – the content of the tensors.xml file as a string
dynamical_matrices – a list of the content of the dynamical matrix files as a string
- Returns:
tuple of two dictionaries, with the parsed data and log messages, respectively
- aiida_quantumespresso.parsers.parse_raw.ph.parse_ph_tensor(data)[source]#
Parse the xml tensor file of QE v5.0.3 data must be read from the file with the .read() function (avoid readlines)
- aiida_quantumespresso.parsers.parse_raw.ph.parse_xml_matrices(tagname, target_tags)[source]#
Can be used to load the disordered matrices of the QE XML file.
- aiida_quantumespresso.parsers.parse_raw.ph.parse_ph_text_output(lines, logs)[source]#
Parses the stdout of Quantum ESPRESSO
ph.x
.- Parameters:
lines – list of strings, the file as read by readlines()
- Returns:
dictionary with parsed values
- aiida_quantumespresso.parsers.parse_raw.ph.parse_ph_dynmat(data, logs, lattice_parameter=None, also_eigenvectors=False, parse_header=False)[source]#
Parse frequencies and eigenvectors of a single dynamical matrix.
- Parameters:
data – the text read with the function readlines()
lattice_parameter – the lattice_parameter (‘alat’ in QE jargon). If None, q_point is kept in 2pi/a coordinates as in the dynmat file.
also_eigenvectors –
if True, return an additional ‘eigenvectors’ array in output, containing also the eigenvectors. This will be a list of lists, that when converted to a numpy array has 4 indices, with shape Neigenstates x Natoms x 3(xyz) x 2 (re,im) To convert to a complex numpy array, you can use:
ev = np.array(parsed_data['eigenvectors']) ev = ev[:,:,:,0] + 1j * ev[:,:,:,1]
parse_header – if True, return additional keys in the returned parsed_data dictionary, including information from the header
- Returns:
a dictionary with parsed values and units