aiida_quantumespresso.parsers.projwfc
#
Module Contents#
Classes#
This class is the implementation of the Parser class for the |
- class aiida_quantumespresso.parsers.projwfc.ProjwfcParser(node: aiida.orm.CalcJobNode)[source]#
Bases:
aiida_quantumespresso.parsers.base.BaseParser
This class is the implementation of the Parser class for the
projwfc.x
code in Quantum ESPRESSO.Parses projection arrays that map the projection onto each point in the bands structure, as well as pdos arrays, which map the projected density of states onto an energy axis.
- parse(**kwargs)[source]#
Parses the retrieved files of the
ProjwfcCalculation
and converts them into output nodes.
- _parse_xml(retrieved_temporary_folder: pathlib.Path) Tuple[dict, aiida.common.extendeddicts.AttributeDict, aiida.engine.ExitCode | None] [source]#
Parse the XML file.
The XML must be parsed in order to obtain the required information for the other parser methods.
- Parameters:
retrieved_temporary_folder – temporary folder of retrieved files that is deleted after parsing.
- Returns:
tuple with the parsed_xml and parsing logs.
- static _parse_orbitals(header: str, structure: aiida.orm.StructureData, non_collinear: bool, spinorbit: bool) list [source]#
Parse the orbitals from the stdout header.
This method reads in all the state lines - that is, the lines describing which atomic states taken from the pseudopotential are used for the projections. Then it converts these state lines into a set of orbitals.
- Parameters:
header – the header block of text before the first k-point is printed.
structure – the input structure.
non_collinear – True if the calculation is non-collinear.
spinorbit – True if the calculation used spin-orbit coupling.
- Returns:
a list of orbitals suitable for setting ProjectionData.
- static _parse_bands_and_projections(kpoint_blocks: list, num_orbitals: int) Tuple[numpy.typing.ArrayLike, numpy.typing.ArrayLike] [source]#
Parse the bands energies and orbital projections from the kpoint blocks in the stdout.
- Parameters:
kpoint_blocks – list of blocks for each k-point that contain the energies and projections in the stdout.
num_orbitals – number of orbitals used for the projections.
- Returns:
tuple with two arrays containing the band energies and projection values
- _parse_pdos_files(retrieved_temporary_folder: pathlib.Path, nspin: int, spinorbit: bool, logs: aiida.common.extendeddicts.AttributeDict) Tuple[numpy.typing.ArrayLike, aiida.orm.XyData, numpy.typing.ArrayLike] [source]#
Parse the PDOS files and convert them into arrays.
Reads in all of the
*.pdos*
files and converts the data into arrays. The PDOS arrays are then concatenated and reordered so the order of the columns matches the order of the orbitals read from the statelines. This is done in three steps:Sort the filenames by the atom # and wfc #, in that order.
Concatenate all the PDOS files into one large array.
Reorder the columns depending on the
npsin
value and if spin-orbit is used.
- Parameters:
retrieved_temporary_folder – temporary folder of retrieved files that is deleted after parsing.
nspin – nspin value of the parent calculation.
spinorbit – True if the calculation used spin-orbit coupling.
- Returns:
tuple of three containing the energy grid, the total DOS as a node and the PDOS
- classmethod _build_bands_and_projections(kpoints: aiida.orm.KpointsData, bands: numpy.typing.ArrayLike, energy: numpy.typing.ArrayLike, orbitals: List[aiida.tools.data.orbital.orbital.Orbital], projections: numpy.typing.ArrayLike, pdos_array: numpy.typing.ArrayLike, nspin: int) dict [source]#
Build the
BandsData
andProjectionData
output nodes.- Parameters:
kpoints – data node that contains the list of k-points.
bands – array that contains all of the band energies.
orbitals – list of orbitals used for the projections.
projections – array that contains all of the projection values.
pdos_array – array that contains all of the PDOS values.
nspin – nspin value of the parent calculation.
- Returns:
dictionary with the output links (keys) and the corresponding output nodes (values).
- static _intialize_bands_projection_data(kpoints: aiida.orm.KpointsData, bands: numpy.typing.ArrayLike, energy: numpy.typing.ArrayLike, orbitals: List[aiida.tools.data.orbital.orbital.Orbital], projections: numpy.typing.ArrayLike, pdos_array: numpy.typing.ArrayLike) Tuple[aiida.orm.BandsData, aiida.orm.ProjectionData] [source]#
Initialize an instance of
BandsData
and correspondingProjectionData
.- Parameters:
kpoints – data node that contains the list of k-points.
bands – array that contains all of the band energies.
orbitals – list of orbitals used for the projections.
projections – array that contains all of the projection values.
pdos_array – array that contains all of the PDOS values.
- Returns:
tuple with the
BandsData
andProjectionData
nodes.