dfttk.eos

functions

The EOS functions are based on the following paper:

Shun-Li Shang et al., Computational Materials Science, 47, 4, (2010). https://doi.org/10.1016/j.commatsci.2009.12.006

It includes the following equations of state: 4-parameter Teter-Shang modified Birch-Murnaghan (mBM4), 5-parameter Teter-Shang modified Birch-Murnaghan (mBM5), 4-parameter Birch-Murnaghan (BM4), 5-parameter Birch-Murnaghan (BM5), 4-parameter Natural (LOG4), 5-parameter Natural (LOG5), 4-parameter Murnaghan, 4-parameter Vinet, and 4-parameter Morse.

dfttk.eos.functions.mBM4_equation(volume, a, b, c, d)[source]

mBM4 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

array of energy values

Return type:

ndarray

dfttk.eos.functions.mBM4_derivative(volume, b, c, d)[source]

Derivative of mBM4 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

array of energy derivatives

Return type:

ndarray

dfttk.eos.functions.mBM4_derivative2(volume, b, c, d)[source]

Second derivative of mBM4 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

array of second derivatives of energy

Return type:

ndarray

dfttk.eos.functions.mBM4_eos_parameters(a, b, c, d)[source]

Calculate V0, E0, B, BP, and B2P from a, b, c, and d.

Parameters:
  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

V0, E0, B, BP, B2P

Return type:

tuple[float, float, float, float, float]

dfttk.eos.functions.mBM4_eos_constants(V0, E0, B, BP)[source]

Calculate a, b, c, and d from V0, E0, B, and BP.

Parameters:
  • V0 (float) – equilibrium volume

  • E0 (float) – equilibrium energy

  • B (float) – bulk modulus

  • BP (float) – pressure derivative of bulk modulus

Returns:

a, b, c, d

Return type:

ndarray

dfttk.eos.functions.mBM4(volume, energy, volume_min=None, volume_max=None, num_volumes=1000)[source]

Fits the mBM4 EOS to the input volume and energy data.

Parameters:
  • volume (ndarray) – array of input volumes

  • energy (ndarray) – array of input energies

  • volume_min (float) – minimum volume for EOS fitting. Defaults to None.

  • volume_max (float) – maximum volume for EOS fitting. Defaults to None.

  • num_volumes (int) – number of volumes for EOS fitting. Defaults to 1000.

Returns:

EOS constants, EOS parameters, volume range, energy EOS, and pressure EOS

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

dfttk.eos.functions.mBM5_equation(volume, a, b, c, d, e)[source]

mBM5 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

array of energy values

Return type:

ndarray

dfttk.eos.functions.mBM5_derivative(volume, b, c, d, e)[source]

Derivative of mBM5 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

array of energy derivatives

Return type:

ndarray

dfttk.eos.functions.mBM5_derivative2(volume, b, c, d, e)[source]

Second derivative of mBM5 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

array of second derivatives of energy

Return type:

ndarray

dfttk.eos.functions.mBM5_eos_parameters(volume_range, a, b, c, d, e)[source]

Calculate V0, E0, B, BP, and B2P from a, b, c, d, and e.

Parameters:
  • volume_range (ndarray) – array of input volumes

  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

V0, E0, B, BP, B2P

Return type:

tuple[float, float, float, float, float]

dfttk.eos.functions.mBM5_eos_constants(V0, E0, B, BP, B2P)[source]

Calculate a, b, c, d, and e from V0, E0, B, BP, and B2P.

Parameters:
  • V0 (float) – equilibrium volume

  • E0 (float) – equilibrium energy

  • B (float) – bulk modulus

  • BP (float) – pressure derivative of bulk modulus

  • B2P (float) – second pressure derivative of bulk modulus

Returns:

a, b, c, d, e

Return type:

ndarray

dfttk.eos.functions.mBM5(volume, energy, volume_min=None, volume_max=None, num_volumes=1000)[source]

Fits the mBM5 EOS to the input volume and energy data.

Parameters:
  • volume (ndarray) – array of input volumes

  • energy (ndarray) – array of input energies

  • volume_min (float) – minimum volume for EOS fitting. Defaults to None.

  • volume_max (float) – maximum volume for EOS fitting. Defaults to None.

  • num_volumes (int) – number of volumes for EOS fitting. Defaults to 1000.

Returns:

EOS constants, EOS parameters, volume range, energy EOS, and pressure EOS

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

dfttk.eos.functions.BM4_equation(volume, a, b, c, d)[source]

BM4 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

array of energy values

Return type:

ndarray

dfttk.eos.functions.BM4_derivative(volume, b, c, d)[source]

Derivative of BM4 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

array of energy derivatives

Return type:

ndarray

dfttk.eos.functions.BM4_derivative2(volume, b, c, d)[source]

Second derivative of BM4 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

array of second derivatives of energy

Return type:

ndarray

dfttk.eos.functions.BM4_eos_parameters(a, b, c, d)[source]

Calculate V0, E0, B, BP, and B2P from a, b, c, and d.

Parameters:
  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

V0, E0, B, BP, B2P

Return type:

tuple[float, float, float, float, float]

dfttk.eos.functions.BM4_eos_constants(V0, E0, B, BP)[source]

Calculate a, b, c, and d from V0, E0, B, and BP.

Parameters:
  • V0 (float) – equilibrium volume

  • E0 (float) – equilibrium energy

  • B (float) – bulk modulus

  • BP (float) – pressure derivative of bulk modulus

Returns:

a, b, c, d

Return type:

ndarray

dfttk.eos.functions.BM4(volume, energy, volume_min=None, volume_max=None, num_volumes=1000)[source]

Fits the BM4 EOS to the input volume and energy data.

Parameters:
  • volume (ndarray) – array of input volumes

  • energy (ndarray) – array of input energies

Returns:

EOS constants, EOS parameters, volume range, energy EOS, and pressure EOS

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

dfttk.eos.functions.BM5_equation(volume, a, b, c, d, e)[source]

BM5 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

array of energy values

Return type:

ndarray

dfttk.eos.functions.BM5_derivative(volume, b, c, d, e)[source]

Derivative of BM5 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

array of energy derivatives

Return type:

ndarray

dfttk.eos.functions.BM5_derivative2(volume, b, c, d, e)[source]

Second derivative of BM5 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

array of second derivatives of energy

Return type:

ndarray

dfttk.eos.functions.BM5_eos_parameters(volume_range, a, b, c, d, e)[source]

Calculate V0, E0, B, BP, and B2P from a, b, c, d, and e.

Parameters:
  • volume_range (ndarray) – array of input volumes

  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

V0, E0, B, BP, B2P

Return type:

tuple[float, float, float, float, float]

dfttk.eos.functions.BM5_eos_constants(V0, E0, B, BP, B2P)[source]

Calculate a, b, c, d, and e from V0, E0, B, BP, and B2P.

Parameters:
  • V0 (float) – equilibrium volume

  • E0 (float) – equilibrium energy

  • B (float) – bulk modulus

  • BP (float) – pressure derivative of bulk modulus

  • B2P (float) – second pressure derivative of bulk modulus

Returns:

a, b, c, d, e

Return type:

tuple[float, float, float, float, float]

dfttk.eos.functions.BM5(volume, energy, volume_min=None, volume_max=None, num_volumes=1000)[source]

Fits the BM5 EOS to the input volume and energy data.

Parameters:
  • volume (ndarray) – array of input volumes

  • energy (ndarray) – array of input energies

  • volume_min (float) – minimum volume for EOS fitting. Defaults to None.

  • volume_max (float) – maximum volume for EOS fitting. Defaults to None.

  • num_volumes (int) – number of volumes for EOS fitting. Defaults to 1000.

Returns:

EOS constants, EOS parameters, volume range, energy EOS, and pressure EOS

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

dfttk.eos.functions.LOG4_equation(volume, a, b, c, d)[source]

LOG4 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

array of energy values

Return type:

ndarray

dfttk.eos.functions.LOG4_derivative(volume, b, c, d)[source]

Derivative of LOG4 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

array of energy derivatives

Return type:

ndarray

dfttk.eos.functions.LOG4_derivative2(volume, b, c, d)[source]

Second derivative of LOG4 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

array of second derivatives of energy

Return type:

ndarray

dfttk.eos.functions.LOG4_eos_parameters(volume_range, a, b, c, d)[source]

Calculate V0, E0, B, BP, and B2P from a, b, c, and d.

Parameters:
  • volume_range (ndarray) – array of input volumes

  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

V0, E0, B, BP, B2P

Return type:

tuple[float, float, float, float, float]

dfttk.eos.functions.LOG4_eos_constants(V0, E0, B, BP)[source]

Calculate a, b, c, and d from V0, E0, B, and BP.

Parameters:
  • V0 (float) – equilibrium volume

  • E0 (float) – equilibrium energy

  • B (float) – bulk modulus

  • BP (float) – pressure derivative of bulk modulus

Returns:

a, b, c, d

Return type:

tuple[float, float, float, float]

dfttk.eos.functions.LOG4(volume, energy, volume_min=None, volume_max=None, num_volumes=1000)[source]

Fits the LOG4 EOS to the input volume and energy data.

Parameters:
  • volume (ndarray) – array of input volumes

  • energy (ndarray) – array of input energies

  • volume_min (float) – minimum volume for EOS fitting. Defaults to None.

  • volume_max (float) – maximum volume for EOS fitting. Defaults to None.

  • num_volumes (int) – number of volumes for EOS fitting. Defaults to 1000.

Returns:

EOS constants, EOS parameters, volume range, energy EOS, and pressure EOS

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

dfttk.eos.functions.LOG5_equation(volume, a, b, c, d, e)[source]

LOG5 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

array of energy values

Return type:

ndarray

dfttk.eos.functions.LOG5_derivative(volume, b, c, d, e)[source]

Derivative of LOG5 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

array of energy derivatives

Return type:

ndarray

dfttk.eos.functions.LOG5_derivative2(volume, b, c, d, e)[source]

Second derivative of LOG5 EOS.

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

array of second derivatives of energy

Return type:

ndarray

dfttk.eos.functions.LOG5_eos_parameters(volume_range, a, b, c, d, e)[source]

Calculate V0, E0, B, BP, and B2P from a, b, c, d, and e.

Parameters:
  • volume_range (ndarray) – array of input volumes

  • a (float) – a constant

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

  • e (float) – e constant

Returns:

V0, E0, B, BP, B2P

Return type:

tuple[float, float, float, float, float]

dfttk.eos.functions.LOG5_eos_constants(V0, E0, B, BP, B2P)[source]

Calculate a, b, c, d, and e from V0, E0, B, BP, and B2P.

Parameters:
  • V0 (float) – equilibrium volume

  • E0 (float) – equilibrium energy

  • B (float) – bulk modulus

  • BP (float) – pressure derivative of bulk modulus

  • B2P (float) – second pressure derivative of bulk modulus

Returns:

a, b, c, d, e

Return type:

tuple[float, float, float, float, float]

dfttk.eos.functions.LOG5(volume, energy, volume_min=None, volume_max=None, num_volumes=1000)[source]

Fits the LOG5 EOS to the input volume and energy data.

Parameters:
  • volume (ndarray) – array of input volumes

  • energy (ndarray) – array of input energies

  • volume_min (float) – minimum volume for EOS fitting. Defaults to None.

  • volume_max (float) – maximum volume for EOS fitting. Defaults to None.

  • num_volumes (int) – number of volumes for EOS fitting. Defaults to 1000.

Returns:

EOS constants, EOS parameters, volume range, energy EOS, and pressure EOS

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

dfttk.eos.functions.murnaghan_equation(volume, V0, E0, B, BP)[source]

Murnaghan EOS

Parameters:
  • volume (ndarray) – array of input volumes

  • V0 (float) – equilibrium volume

  • E0 (float) – equilibrium energy

  • B (float) – bulk modulus

  • BP (float) – derivative of bulk modulus with respect to pressure

Returns:

array of energy values

Return type:

ndarray

dfttk.eos.functions.murnaghan_derivative(volume, V0, B, BP)[source]

Derivative of Murnaghan EOS

Parameters:
  • volume (ndarray) – array of input volumes

  • V0 (float) – equilibrium volume

  • B (float) – bulk modulus

  • BP (float) – derivative of bulk modulus with respect to pressure

Returns:

array of energy derivatives

Return type:

ndarray

dfttk.eos.functions.murnaghan(volume, energy, volume_min=None, volume_max=None, num_volumes=1000)[source]

Fits the Murnaghan EOS to the input volume and energy data.

Parameters:
  • volume (ndarray) – array of input volumes

  • energy (ndarray) – array of input energies

  • volume_min (float) – minimum volume for EOS fitting. Defaults to None.

  • volume_max (float) – maximum volume for EOS fitting. Defaults to None.

  • num_volumes (int) – number of volumes for EOS fitting. Defaults to 1000.

Returns:

EOS constants, EOS parameters, volume range, energy EOS, and pressure EOS

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

dfttk.eos.functions.vinet_equation(volume, V0, E0, B, BP)[source]

Vinet EOS

Parameters:
  • volume (ndarray) – array of input volumes

  • V0 (float) – equilibrium volume

  • E0 (float) – equilibrium energy

  • B (float) – bulk modulus

  • BP (float) – derivative of bulk modulus with respect to pressure

Returns:

array of energy values

Return type:

ndarray

dfttk.eos.functions.vinet_derivative(volume, V0, B, BP)[source]

Derivative of Vinet EOS

Parameters:
  • volume (ndarray) – array of input volumes

  • V0 (float) – equilibrium volume

  • B (float) – bulk modulus

  • BP (float) – derivative of bulk modulus with respect to pressure

Returns:

array of energy derivatives

Return type:

ndarray

dfttk.eos.functions.vinet(volume, energy, volume_min=None, volume_max=None, num_volumes=1000)[source]

Fits the Vinet EOS to the input volume and energy data.

Parameters:
  • volume (ndarray) – array of input volumes

  • energy (ndarray) – array of input energies

  • volume_min (float) – minimum volume for EOS fitting. Defaults to None.

  • volume_max (float) – maximum volume for EOS fitting. Defaults to None.

  • num_volumes (int) – number of volumes for EOS fitting. Defaults to 1000.

Returns:

EOS constants, EOS parameters, volume range, energy EOS, and pressure EOS

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

dfttk.eos.functions.morse_equation(volume, V0, E0, B, BP)[source]

Morse EOS

Parameters:
  • volume (ndarray) – array of input volumes

  • V0 (float) – equilibrium volume

  • E0 (float) – equilibrium energy

  • B (float) – bulk modulus

  • BP (float) – derivative of bulk modulus with respect to pressure

Returns:

array of energy values

Return type:

ndarray

dfttk.eos.functions.morse_derivative(volume, b, c, d)[source]

Derivative of Morse EOS

Parameters:
  • volume (ndarray) – array of input volumes

  • b (float) – b constant

  • c (float) – c constant

  • d (float) – d constant

Returns:

array of energy derivatives

Return type:

ndarray

dfttk.eos.functions.morse(volume, energy, volume_min=None, volume_max=None, num_volumes=1000)[source]

Fits the Morse EOS to the input volume and energy data.

Parameters:
  • volume (ndarray) – array of input volumes

  • energy (ndarray) – array of input energies

  • volume_min (float) – minimum volume for EOS fitting. Defaults to None.

  • volume_max (float) – maximum volume for EOS fitting. Defaults to None.

  • num_volumes (int) – number of volumes for EOS fitting. Defaults to 1000.

Returns:

EOS constants, EOS parameters, volume range, energy EOS, and pressure EOS

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

fit

EOSFitter class for fitting and plotting energy-volume data using various equations of state (EOS).

dfttk.eos.fit.assign_colors_to_configs(unique_configs, alpha=1, cmap='plotly')[source]

Assign colors to configurations based on the specified color map.

Supports two color maps: “plotly” and “distinctipy”.

Parameters:
  • unique_configs (list[str]) – List of unique configuration names.

  • alpha (float) – Alpha value for the color. Defaults to 1.

  • cmap (str) – Color map to use. Defaults to “plotly”.

Returns:

Dictionary mapping configurations to colors.

Return type:

dict

Raises:

ValueError – If cmap is not ‘plotly’ or ‘distinctipy’.

dfttk.eos.fit.assign_marker_symbols_to_configs(unique_configs)[source]

Assign marker symbols to configurations.

Parameters:

unique_configs (list[str]) – List of unique configuration names.

Returns:

Dictionary mapping configurations to marker symbols.

Return type:

dict

class dfttk.eos.fit.EOSFitter(name, number_of_atoms, volumes, energies)[source]

Bases: object

Class for fitting and plotting energy-volume data using various equations of state (EOS).

fit(eos_name='BM4', volume_min=None, volume_max=None, num_volumes=1000)[source]

Fit the given energy-volume data to an equation of state (EOS) using the specified EOS function.

The EOS function should be defined in the dfttk.eos.functions module.

Parameters:
  • eos_name (str) – Name of the EOS function to use. Defaults to “BM4”.

  • volume_min (float) – Minimum volume to consider for fitting. Defaults to None.

  • volume_max (float) – Maximum volume to consider for fitting. Defaults to None.

  • num_volumes (int) – Number of volumes to generate for the EOS fit. Defaults to 1000.

Raises:
  • ValueError – If the specified EOS function is not recognized.

  • RuntimeError – If an unexpected error occurs during fitting.

plot(highlight_minimum=True, per_atom=False, title=None, cmap='plotly', marker_alpha=1, marker_size=10)[source]

Plot the energy vs volume curves for each configuration.

Parameters:
  • highlight_minimum (bool) – Whether to highlight the minimum energy. Must be True or False. Defaults to True.

  • per_atom (bool) – Whether to plot energy and volume per atom. Must be True or False. Defaults to False.

  • title (str) – Title of the plot. Defaults to None.

  • cmap (str) – Color map to use. Defaults to “plotly”.

  • marker_alpha (int) – Alpha value for the marker color. Defaults to 1.

  • marker_size (int) – Size of the markers. Defaults to 10.

Returns:

A Plotly figure object containing the plot.

Return type:

Figure

Raises:

ValueError – If fit() has not been called before plot().

ev_curve_data

Module for managing energy-volume (E-V) data for a configuration using the EvCurveData class.

class dfttk.eos.ev_curve_data.EvCurveData(path, name)[source]

Bases: object

Class for handling energy-volume (E-V) curve data for a configuration.

get_vasp_input(incar_keys=['1relax', '2relax', '3static'], incar_names=['INCAR.1relax', 'INCAR.2relax', 'INCAR.3static'], kpoints_keys=['1relax', '2relax', '3static'], kpoints_names=['KPOINTS.1relax', 'KPOINTS.2relax', 'KPOINTS.3static'], contcar_name='CONTCAR.3static', selected_volumes=None, read_initial_poscar=True)[source]

Get the VASP input files from the specified path and store them in the class attributes.

Parameters:
  • incar_keys (list[str]) – List of INCAR keys for dictionary keys. Defaults to [“1relax”, “2relax”, “3static”].

  • incar_names (list[str]) – List of INCAR names to read. Defaults to [“INCAR.1relax”, “INCAR.2relax”, “INCAR.3static”].

  • kpoints_keys (list[str]) – List of KPOINTS keys for dictionary keys. Defaults to [“1relax”, “2relax”, “3static”].

  • kpoints_names (list[str]) – List of KPOINTS names to read. Defaults to [“KPOINTS.1relax”, “KPOINTS.2relax”, “KPOINTS.3static”].

  • contcar_name (str) – Name of the CONTCAR file. Defaults to “CONTCAR.3static”.

  • selected_volumes (list[float]) – List of volumes to filter the folders. If None, all folders are considered.

  • read_initial_poscar (bool) – Whether to read the initial POSCAR file. Defaults to True.

Return type:

None

get_energy_volume_data(selected_volumes=None, outcar_name='OUTCAR.3static', oszicar_name='OSZICAR.3static', contcar_name='CONTCAR.3static', collect_mag_data=False, magmom_tolerance=0.01, total_magnetic_moment_tolerance=0.01, mass_average='geometric')[source]

Get the energy-volume data from the specified path and store them in the class attributes.

Parameters:
  • selected_volumes (list[float]) – List of volumes to filter the folders. If None, all folders are considered.

  • outcar_name (str) – Name of the OUTCAR file. Defaults to “OUTCAR.3static”.

  • oszicar_name (str) – Name of the OSZICAR file. Defaults to “OSZICAR.3static”.

  • contcar_name (str) – Name of the CONTCAR file. Defaults to “CONTCAR.3static”.

  • collect_mag_data (bool) – Whether to collect magnetic data. Defaults to False.

  • magmom_tolerance (float) – Tolerance for magnetic moment. Defaults to 0.01.

  • total_magnetic_moment_tolerance (float) – Tolerance for total magnetic moment. Defaults to 0.01.

  • mass_average (str) – “arithmetic”, “geometric”, or “harmonic”. Defaults to “geometric”.

Return type:

None

fit_energy_volume_data(eos_name='BM4', volume_min=None, volume_max=None, num_volumes=1000)[source]

Fit the energy-volume data to an equation of state (EOS).

Parameters:
  • eos_name (str) – EOS function to use. Options: “mBM4”, “mBM5”, “BM4”, “BM5”, “LOG4”, “LOG5”, “vinet”, “murnaghan”, “morse”. Defaults to “BM4”.

  • volume_min (float) – Minimum volume for fitted EOS. Defaults to None.

  • volume_max (float) – Maximum volume for fitted EOS. Defaults to None.

  • num_volumes (int) – Number of volumes for fitted EOS. Defaults to 1000.

Raises:

RuntimeError – If energy-volume data has not been loaded. You must call get_energy_volume_data() first.

Return type:

None

plot(highlight_minimum=True, per_atom=False, title=None, cmap='plotly', marker_alpha=1.0, marker_size=10)[source]

Plot the energy-volume data and the fitted EOS.

Parameters:
  • highlight_minimum (bool) – Whether to highlight the minimum energy. Defaults to True.

  • per_atom (bool) – Whether to plot the energy per atom. Defaults to False.

  • title (str) – Title for the plot. Defaults to None.

  • cmap (str) – Color map for the plot. Defaults to “plotly”.

  • marker_alpha (float) – Transparency of the markers. Defaults to 1.0.

  • marker_size (int) – Size of the markers. Defaults to 10.

Returns:

Plotly figure object containing the energy-volume plot.

Return type:

Figure