aiida_vasp.parsers.content_parsers.vasprun#

The vasprun.xml parser interface.

Contains the parsing interfaces to parsevasp used to parse vasprun.xml content.

Module Contents#

Classes#

VasprunParser

The parser interface that enables parsing of vasprun.xml content.

Functions#

_build_structure

Builds a structure according to AiiDA spec.

_invert_dict

API#

class aiida_vasp.parsers.content_parsers.vasprun.VasprunParser(*, handler: TextIO | BinaryIO | None = None, data: aiida.orm.Data | None = None, settings: dict[str, Any] | None = None, options: dict[str, Any] | None = None, raise_errors: bool = False)[source]#

Bases: aiida_vasp.parsers.content_parsers.base.BaseFileParser

The parser interface that enables parsing of vasprun.xml content.

The parser is triggered by using the keys listed in PARSABLE_QUANTITIES.

Initialization

OPEN_MODE = 'rb'#
DEFAULT_SETTINGS = None#
PARSABLE_QUANTITIES = None#
ENERGY_MAPPING = None#
ENERGY_MAPPING_VASP5 = None#
_init_from_handler(handler: BinaryIO | TextIO) None[source]#

Initialize using a file like handler.

property version: str | None#

Fetch the VASP version from parsevasp and return it as a string object.

property eigenvalues: dict[str, Any] | None#

Fetch eigenvalues.

property occupancies: dict[str, Any] | None#

Fetch occupancies.

property kpoints: dict[str, Any] | None#

Fetch the kpoints an prepare for consumption by the NodeComposer.

property structure: dict[str, Any] | None#

Fetch a given structure.

Which structure to fetch is controlled by inputs.

eFL: Need to clean this so that we can set different structures to pull from the outside. Could be usefull not pulling the whole trajectory.

Currently defaults to the last structure.

property last_structure: dict[str, Any] | None#

Fetch the structure.

After or at the last recorded ionic step.

property final_structure: dict[str, Any] | None#

Fetch the structure.

After or at the last recorded ionic step. Should in principle be the same as the method above.

property last_forces: numpy.ndarray | None#

Fetch forces.

After or at the last recorded ionic step.

property final_forces: numpy.ndarray | None#

Fetch forces.

After or at the last recorded ionic step.

property forces: numpy.ndarray | None#

Fetch final forces.

property last_stress: numpy.ndarray | None#

Fetch stess.

After or at the last recorded ionic step.

property final_stress: numpy.ndarray | None#

Fetch stress.

After or at the last recorded ionic step.

property stress: numpy.ndarray | None#

Fetch stress.

This container should contain all relevant stress. Currently, it only contains the final stress, which can be obtain by the id final_stress.

property trajectory: dict[str, Any] | None#

Fetch unitcells, positions, species, forces and stress.

For all calculation steps.

property total_energies: dict[str, float] | None#

Fetch the total energies after the last ionic run.

property energies: dict[str, Any] | None#

Fetch the total energies.

_energies(nosc: bool) dict[str, Any] | None[source]#

Fetch the total energies for all energy types, calculations (ionic steps) and electronic steps.

The returned dict from the parser contains the total energy types as a key (plus the _final, which is the final total energy ejected by VASP after the closure of the electronic steps). The energies can then be found in the flattened ndarray where the key electronic_steps indicate how many electronic steps there is per ionic step. Using the combination, one can rebuild the electronic step energy per ionic step etc.

Because the VASPrun parser returns both the electronic step energies (at the end of each cycles) and the ionic step energies (_final), we apply a mapping to recovery the naming such that the ionic step energies do not have the suffix, but the electronic step energies do.

property projectors: numpy.ndarray | None#

Fetch the projectors.

property dielectrics: dict[str, Any] | None#

Fetch the dielectric function.

property born_charges: numpy.ndarray | None#

Fetch the Born effective charges.

property hessian: numpy.ndarray | None#

Fetch the Hessian matrix.

property dynmat: dict[str, Any] | None#

Fetch the dynamical eigenvectors and eigenvalues.

property dos: dict[str, Any] | None#

Fetch the total density of states.

property fermi_level: float | None#

Fetch Fermi level.

property run_status: dict[str, bool | None]#

Fetch run_status information

property band_properties: dict[str, Any] | None#

Fetch key properties of the electronic structure.

property parameters: dict[str, Any] | None#

Fetch the parsed input parameters which will include default values defined in the XML file.

aiida_vasp.parsers.content_parsers.vasprun._build_structure(lattice: dict[str, Any]) dict[str, Any][source]#

Builds a structure according to AiiDA spec.

aiida_vasp.parsers.content_parsers.vasprun._invert_dict(dct: dict[Any, Any]) dict[Any, Any][source]#