vasppy.calculation module¶
- class Calculation(title, energy, stoichiometry)[source]¶
Bases:
object
class describing a single VASP calculation
Initialise a Calculation object
- Parameters:
title (Str) – The title string for this calculation.
energy (Float) – Final energy in eV.
(Dict{Str (stoichiometry) – Int}): A dict desribing the calculation stoichiometry, e.g. { ‘Ti’: 1, ‘O’: 2 }
- Returns:
None
- delta_E(reactants, products, check_balance=True)[source]¶
Calculate the change in energy for reactants –> products.
- Parameters:
reactants (list(
vasppy.Calculation
)) – A list ofvasppy.Calculation
objects. The initial state.products (list(
vasppy.Calculation
)) – A list ofvasppy.Calculation
objects. The final state.check_balance (
bool
, optional) – Check that the reaction stoichiometry is balanced. Default isTrue
.
- Returns:
(float) The change in energy.
- delta_stoichiometry(reactants, products)[source]¶
Calculate the change in stoichiometry for reactants –> products.
- Parameters:
reactants (list(
vasppy.Calculation
) – A list ofvasppy.Calculation objects.
The initial state.products (list(
vasppy.Calculation
) – A list ofvasppy.Calculation objects.
The final state.
- Returns:
The change in stoichiometry.
- Return type:
(Counter)
- energy_string_to_float(string)[source]¶
Convert a string of a calculation energy, e.g. ‘-1.2345 eV’ to a float.
- Parameters:
string (str) – The string to convert.
- Return
(float)
- import_calculations_from_file(filename, skip_incomplete_records=False)[source]¶
Construct a list of
Calculation
objects by reading a YAML file. Each YAML document should includetitle
,stoichiometry
, andenergy
fields, e.g.:title: my calculation stoichiometry: - A: 1 - B: 2 energy: -0.1234 eV
Separate calculations should be distinct YAML documents, separated by —
- Parameters:
filename (str) – Name of the YAML file to read.
skip_incomplete_records (bool) – Do not parse YAML documents missing one or more of the required keys. Default is
False
.
- Returns:
A dictionary of
Calculation
objects. For eachCalculation
object, thetitle
field from the YAML input is used as the dictionary key.- Return type:
(dict(vasppy.Calculation))