pymatgen.analysis.eos module

class EOS(eos_name='murnaghan')[source]

Bases: object

Fit equation of state for bulk systems.

The following equations are supported:

murnaghan:
    PRB 28, 5480 (1983)

birch:
    Intermetallic compounds: Principles and Practice, Vol I: Principles.
    pages 195-210

birch_murnaghan:
    PRB 70, 224107

pourier_tarantola:
    PRB 70, 224107

vinet:
    PRB 70, 224107

Use:

eos = EOS(eos_name='murnaghan')
fit = eos.fit(volumes, energies)
print(fit)
fit.plot()
MODELS = {'quadratic': <function quadratic>, 'murnaghan': <function murnaghan>, 'birch': <function birch>, 'birch_murnaghan': <function birch_murnaghan>, 'pourier_tarantola': <function pourier_tarantola>, 'vinet': <function vinet>, 'deltafactor': <function deltafactor_polyfit>}
fit(volumes, energies, vol_unit='ang^3', energy_unit='eV')[source]

Fit energies (in eV) as function of volumes (in Angstrom**3).

Parameters:
  • volumes (list/np.array) –
  • energies (list/np.array) –
  • vol_unit (str) – volume units
  • energy_unit (str) – energy units
Returns:

EOSFit object that gives access to the optimal volume,

the minumum energy, and the bulk modulus.

Note: the units for the bulk modulus is eV/Angstrom^3.

Return type:

EOSFit

exception EOSError[source]

Bases: Exception

Exceptions raised by EOS.

class EOSFit(volumes, energies, func, eos_name)[source]

Bases: object

Performs the fit of E(V) and provides method to access the results of the fit.

Parameters:
  • energies (list) – energies in eV
  • volumes (list) – volumes in Angstrom^3
  • func – callable function
eos_name

EOS name

func

the equation of state function

params

tuple( minimum energy(e0), buk modulus(b0), derivative of bulk modulus wrt pressure(b1), minimum or the reference volume(v0) )

eos_params

the results returned by the fit.

b0_GPa

Returns the bulk modulus in GPa

fit(guess)[source]

Do the fitting

Parameters:guess (tuple) – initial guess for e0, b0, b1, v0(in that order)
Returns:
(minimum energy(e0), buk modulus(b0),
derivative of bulk modulus wrt pressure(b1), reference volume(v0))
Return type:tuple
initial_guess()[source]

Quadratic fit to get an initial guess for the parameters.

Returns:
(minimum energy(e0), buk modulus(b0),
derivative of bulk modulus wrt pressure(b1), minimum volume(v0))
Return type:tuple
name

**Returns* – str* – EOS name

plot(width=8, height=None, plt=None, dpi=None, **kwargs)[source]

Plot the equation of state.

Parameters:
  • width (float) – Width of plot in inches. Defaults to 8in.
  • height (float) – Height of plot in inches. Defaults to width * golden ratio.
  • plt (matplotlib.pyplot) – If plt is supplied, changes will be made to an existing plot. Otherwise, a new plot will be created.
  • dpi
  • kwargs (dict) – additional args fed to pyplot.plot. supported keys: style, color, text, label
Returns:

Matplotlib plot object.

results

Dictionary with the results. None if results are not available.

Returns:dict
birch(V, E0, B0, B1, V0)[source]

From Intermetallic compounds: Principles and Practice, Vol. I: Principles Chapter 9 pages 195-210 by M. Mehl. B. Klein, D. Papaconstantopoulos. case where n=0

birch_murnaghan(V, E0, B0, B1, V0)[source]

BirchMurnaghan equation from PRB 70, 224107

deltafactor_polyfit(volumes, energies)[source]

This is the routine used to compute V0, B0, B1 in the deltafactor code.

murnaghan(V, E0, B0, B1, V0)[source]

From PRB 28,5480 (1983)

pourier_tarantola(V, E0, B0, B1, V0)[source]

Pourier-Tarantola equation from PRB 70, 224107

quadratic(V, a, b, c)[source]

Quadratic fit

vinet(V, E0, B0, B1, V0)[source]

Vinet equation from PRB 70, 224107