pyiron.vasp.vasprun module

class pyiron.vasp.vasprun.Vasprun[source]

Bases: object

This module is used to parse vasprun.xml files and store the data consistent with the pyiron input/output storage formats.

vasprun_dict
Dictionary containing all information from the calculation parsed from the vasprun.xml

file. If you consider a simulation with N atoms and M ionic steps

‘positions’ (numpy.ndarray): MxNx3 array containing all the relative positions ‘cell’ (numpy.ndarray): Mx3x3 array containing all the size and shape of cells at every iteration point ‘forces’ (numpy.ndarray): MxNx3 array containing all the forces in eV/A ‘total_energies’ (numpy.ndarray): 1xM array containing all the total energies in eV

Type

dict

from_file(filename='vasprun.xml')[source]

Parsing vasprun.xml from the working directory

Parameters

filename (str) – Path to the vasprun file

get_electronic_structure()[source]

Get’s the electronic structure from the VASP calculation

Returns

The electronic structure object

Return type

pyiron.atomistics.waves.electronic.ElectronicStructure

get_final_structure()[source]

Gets the final structure from the simulation

Returns

The final structure

Return type

pyiron.atomistics.structure.atoms.Atoms

get_initial_structure()[source]

Gets the initial structure from the simulation

Returns

The initial structure

Return type

pyiron.atomistics.structure.atoms.Atoms

parse_atom_information_to_dict(node, d)[source]

Parses atom information from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

parse_calc_to_dict(node, d)[source]

Parses ionic step data from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

parse_eigenvalues_to_dict(node, d)[source]

Parses eigenvalue and occupancy data from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

parse_fermi_level_to_dict(node, d)[source]

Parses fermi level from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

static parse_item_to_dict(node, d)[source]

Parses values from an item to a dictionary

Parameters
  • node (etree.Element instance) – Node to be parsed

  • d (dict) – The dictionary to which data is to be parsed

Returns

d (dictionary)

parse_kpoints_to_dict(node, d)[source]

Parses k-points data from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

parse_parameters(node, d)[source]

Parses parameter data from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

parse_partial_dos_to_dict(node, d)[source]

Parses partial dos data from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

parse_projected_dos_to_dict(node, d)[source]

Parses partial dos data from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

parse_recursively(node, d, key_name=None)[source]

Parses recursively from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

  • key_name (str) – Forcefully assign a key name in case it is not present in the xml file

parse_root_to_dict()[source]

Parses from the main xml root.

parse_scf(node)[source]

Parses the total energy and dipole moments for a VASP calculation

Parameters

node – (xml.etree.Element instance): The node to parse

Returns

Dictionary to containing parsed data

Return type

d (dict)

parse_structure_to_dict(node, d)[source]

Parses structure from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

parse_total_dos_to_dict(node, d)[source]

Parses total dos data from a node to a dictionary

Parameters
  • node (xml.etree.Element instance) – The node to parse

  • d (dict) – The dictionary to which data is to be parsed

exception pyiron.vasp.vasprun.VasprunError[source]

Bases: ValueError

pyiron.vasp.vasprun.clean_character(a, remove_char=' ')[source]
Parameters
  • a (str) – String to be cleaned

  • remove_char (str) – Character to be replaced

Returns

The clean string

Return type

str

pyiron.vasp.vasprun.clean_key(a, remove_char=' ')[source]

Replaces blanck spaces from a string for a dictionary key with “_”

Parameters
  • a (str) – String to be cleaned

  • remove_char (str) – Character to be replaced

Returns

The clean string

Return type

str