Contributions to the free energy

Anharmonicity

The anharmonicity can be included in the calculations as an excess contribution which is called just ‘anharmonicity’. The temperature dependence of the phonon frequencies con be introduced using what its called ‘intrinsic anharmonicity’.

Source code

class debyetools.anharmonicity.Anharmonicity(s0: float, s1: float, s2: float)[source]

Instance for the excess contribution to the free energy.

Parameters

s0,s1,s2 (float) – Parameters of the A(V) term.

A(V: float) float[source]

A(V) = s0+s0*V+s1*V**2, where A is the polynomial model for the excess contribution to the free energy, A(V)*T.

Parameters

V (float) – Volume

Returns

s0+s0*V+s1*V**2

Return type

float

E(T, V: float) float[source]

Internal energy due the excess term.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

A(V)*T**2/2

Return type

float

F(T, V: float) float[source]

Free energy due the excess term.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

-A(V)*T**2/2

Return type

float

S(T, V: float) float[source]

Entropy due the excess term.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

A(V)*T

Return type

float

d2AdV2_T(V: float) float[source]

Second order volume derivative of A at fixed T.

Parameters

V (float) – Volume

Returns

2*s2

Return type

float

d2FdT2_V(T, V: float) float[source]

Second order Temperature derivative of the free energy due the excess term, at fixed V.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

-A(V)

Return type

float

d2FdV2_T(T, V: float) float[source]

Second order volume derivative of the free energy due the excess term, at fixed T.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

-(d2A(V)/dV2)_T*T**2/2

Return type

float

d2FdVdT(T, V: float) float[source]

Second order derivative of the free energy due the excess term, with respect to T and V.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

-(dA(V)/dV)_T*T

Return type

float

d3AdV3_T(V: float) float[source]

Third order volume derivative of A at fixed T.

Parameters

V (float) – Volume

Returns

0

Return type

float

d3FdV2dT(T, V: float) float[source]

Third order derivative of the free energy due the excess term, with respect to T, V, and V.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

-(d2A(V)/dV2)_T*T

Return type

float

d3FdV3_T(T, V: float) float[source]

Third order volume derivative of the free energy due the excess term, at fixed T.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

-(d3A(V)/dV3)_T*T**2/2

Return type

float

d3FdVdT2(T, V: float) float[source]

Third order derivative of the free energy due the excess term, with respect to T, T, and V.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

-(dA(V)/dV)_T

Return type

float

d4AdV4_T(V: float) float[source]

Fourth order volume derivative of A at fixed T.

Parameters

V (float) – Volume.

Returns

0

Return type

float.

d4FdV4_T(T, V: float) float[source]

Fourth order volume derivative of the free energy due the excess term, at fixed T.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

-(d4A(V)/dV4)_T*T**2/2

Return type

float

dAdV_T(V: float) float[source]

Volume derivative of A at fixed T.

Parameters

V (float) – Volume

Returns

s1+2*V*s2

Return type

float

dFdT_V(T, V: float) float[source]

Temperature derivative of the free energy due the excess term, at fixed V.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

-A(V)

Return type

float

dFdV_T(T, V: float) float[source]

Volume derivative of the free energy due the excess term, at fixed T.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

-(dA(V)/dV)_T*T**2/2

Return type

float

Defects

The defects due to mono-vacancies can be taken into account if the parameters are provided.

Source code

class debyetools.defects.Defects(Evac00: float, Svac00: float, Tm: float, a: float, P2: float, V0: float)[source]

Implementation of the defects contribution due to monovancies to the free energy.

Parameters
  • Evac00 (float) – Fomration energy of vacancies.

  • Svac00 (float) – Fomration entropy of vacancies.

  • Tm (float) – Melting temperature.

  • a (float) – Volume ratio of a mono vacancie relative to the equilibrium volume.

  • P2 (float) – Bulk modulus.

  • V0 (float) – Equilibrium volume.

E(T: float, V: float) float[source]

Defects energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume

Returns

E_def

Return type

float

Evac(V: float) float[source]

Enthalpy of formation of vacancies.

Parameters

V (float) – Volume.

Returns

Ef(V)

Return type

float

F(T: float, V: float) float[source]

Implementation of the defects contribution to the free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

energy

Return type

float

S(T: float, V: float) float[source]

Defects entropy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume

Returns

S_def

Return type

float

Svac(V: float) float[source]

Entropy of formation of vacancies.

Parameters

V (float) – Volume.

Returns

Svac0

Return type

float

d2EvacdV2_T(V: float) float[source]

Volume-derivative of the enthalpy of formation of vacancies.

Parameters

V (float) – Volume.

Returns

Volume-derivative of the enthalpy of formation of vacancies.

Return type

float

d2FdT2_V(T: float, V: float) float[source]

Derivative of defects contribution to the free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

Derivative of F_def

Return type

float

d2FdV2_T(T: float, V: float) float[source]

Derivative of defects contribution to the free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

Derivative of F_def

Return type

float

d2FdVdT(T: float, V: float) float[source]

Derivative of defects contribution to the free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

Derivative of F_def

Return type

float

d2SvacdV2_T(V: float) float[source]

Volume-derivative of the entropy of formation of vacancies.

Parameters

V (float) – Volume.

Returns

0

d3EvacdV3_T(V: float) float[source]

Volume-derivative of the enthalpy of formation of vacancies.

Parameters

V (float) – Volume.

Returns

Volume-derivative of the enthalpy of formation of vacancies.

Return type

float

d3FdV2dT(T: float, V: float) float[source]

Derivative of defects contribution to the free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

Derivative of F_def

Return type

float

d3FdV3_T(T: float, V: float) float[source]

Derivative of defects contribution to the free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

Derivative of F_def

Return type

float

d3FdVdT2(T: float, V: float) float[source]

Derivative of defects contribution to the free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

Derivative of F_def

Return type

float

d3SvacdV3_T(V: float) float[source]

Volume-derivative of the entropy of formation of vacancies.

Parameters

V (float) – Volume.

Returns

0

d4EvacdV4_T(V: float) float[source]

Volume-derivative of the enthalpy of formation of vacancies.

Parameters

V (float) – Volume.

Returns

Volume-derivative of the enthalpy of formation of vacancies.

Return type

float

d4FdV4_T(T: float, V: float) float[source]

Derivative of defects contribution to the free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

Derivative of F_def

Return type

float

d4SvacdV4_T(V: float) float[source]

Volume-derivative of the entropy of formation of vacancies.

Parameters

V (float) – Volume.

Returns

0

dEvacdV_T(V: float) float[source]

Volume-derivative of the enthalpy of formation of vacancies.

Parameters

V (float) – Volume.

Returns

Volume-derivative of the enthalpy of formation of vacancies.

Return type

float

dFdT_V(T: float, V: float) float[source]

Derivative of defects contribution to the free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

Derivative of F_def

Return type

float

dFdV_T(T: float, V: float) float[source]

Derivative of defects contribution to the free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

Derivative of F_def

Return type

float

dSvacdV_T(V: float) float[source]

Volume-derivative of the entropy of formation of vacancies.

Parameters

V (float) – Volume.

Returns

0

Electronic Contribution

In order to take the electronic contribution intro account an approximation of the electronic DOS evaluated at the volume dependent Fermi level is implemented. The parameters can be entered manually or fitted to DOS data from DFT calculations.

Source code

class debyetools.electronic.Electronic(*params: ndarray)[source]

Implementation of the electronic contribution to the free energy.

Parameters

params (float) – N(Ef)(V) function parameters.

E(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Electronic energy

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

E_el

Return type

float|np.ndarray

F(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Electronic contribution to the free energy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

F_el

Return type

float|np.ndarray

NfV(V: float) float[source]

N(Ef)(V)

Parameters

V (float) – Volume.

Returns

N(Ef)(V)

Return type

float

S(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Electronic entropy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

S_el

Return type

float|np.ndarray

d2FdT2_V(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Derivative of the electronic contribution to the free energy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

F_el

Return type

float|np.ndarray

d2FdV2_T(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Derivative of the electronic contribution to the free energy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

F_el

Return type

float|np.ndarray

d2FdVdT(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Derivative of the electronic contribution to the free energy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

F_el

Return type

float|np.ndarray

d2NfVdV2_T(V: float) float[source]

derivative of N(Ef)(V)

Parameters

V (float) – Volume.

Returns

derivative of N(Ef)(V)

Return type

float

d3FdV2dT(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Derivative of the electronic contribution to the free energy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

F_el

Return type

float|np.ndarray

d3FdV3_T(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Derivative of the electronic contribution to the free energy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

F_el

Return type

float|np.ndarray

d3FdVdT2(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Derivative of the electronic contribution to the free energy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

F_el

Return type

float|np.ndarray

d3NfVdV3_T(V: float) float[source]

derivative of N(Ef)(V)

Parameters

V (float) – Volume.

Returns

derivative of N(Ef)(V)

Return type

float

d4FdV4_T(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Derivative of the electronic contribution to the free energy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

F_el

Return type

float|np.ndarray

d4NfVdV4_T(V: float) float[source]

derivative of N(Ef)(V)

Parameters

V (float) – Volume.

Returns

derivative of N(Ef)(V)

Return type

float

dFdT_V(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Derivative of the electronic contribution to the free energy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

F_el

Return type

float|np.ndarray

dFdV_T(T: float | numpy.ndarray, V: float | numpy.ndarray) float | numpy.ndarray[source]

Derivative of the electronic contribution to the free energy.

Parameters
  • T (float|np.ndarray) – Temperature.

  • V (float|np.ndarray) – Volume.

Returns

F_el

Return type

float|np.ndarray

dNfVdV_T(V: float) float[source]

derivative of N(Ef)(V)

Parameters

V (float) – Volume.

Returns

derivative of N(Ef)(V)

Return type

float

debyetools.electronic.NfV2m(P: ndarray, Vdata: ndarray, NfVdata: ndarray) ndarray[source]

Error function for minimizaiton.

Parameters
  • P (np.ndarray) – Parameters.

  • Vdata (np.ndarray) – Volume data.

  • NfVdata (np.ndarray) – N(Ef)(V) data.

Returns

err.

Return type

np.ndarray

debyetools.electronic.NfV_poly_fun(V: float, _A: float, _B: float, _C: float, _D: float) float[source]

Polynomial model for N(Ef)(V) for min.

Parameters
  • V (float) – Volume/

  • _A (float) – param.

  • _B (float) – param.

  • _C (float) – param.

  • _D (float) – param.

Returns

polynimial for minimization.

Return type

float

debyetools.electronic.fit_electronic(Vs: ndarray, p_el: ndarray, E: ndarray, N: ndarray, Ef: ndarray, ixss: int = 6, ixse: int = -1) ndarray[source]

Fitting procedure for the N(Ef)(V) function.

Parameters
  • Vs (np.ndarray) – Volumes.

  • p_el (np.ndarray) – Initial parameters.

  • E (np.ndarray) – Matrix with energies at each level for each volume.

  • N (np.ndarray) – Matrix with densities of state at each level for each volume.

  • Ef (np.ndarray) – Fermi levels as function of temperature.

  • ixse (int) – (optional) eDOS subset index.

  • intixss – (optional) eDOS subset index.

Retun np.ndarray

optimized parameters.

Vibrational

The evaluation of the thermal behavior of compounds are calculating using the Debye approximation. The mass of the compound and the Poisson’s ration must be entered as input parameters. The information about the internal energy is passed as an potential.EOS object.

Source code

class debyetools.vibrational.Vibrational(nu: float, EOS_obj: object, m: float, intanh: ndarray, mode: str, rin=1)[source]

Instantiate the vibrational contribution to the free energy and its derivatives for the calculation of the thermodynamic properties.

Parameters
  • nu (float) – Poisson’s ratio.

  • EOS_obj (potential_instance) – Equation of state object.

  • m (float) – Mass in Kg/mol-at.

  • intanh (intAnharmonicity_instance) – Intrinsic anharmonicity object.

F(T: float, V: float) float[source]

Vibration Helmholtz free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

F_vib.

Return type

float

d2FdT2_V(T: float, V: float) float[source]

Derivative of vibrational Helmholtz free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

d2FdT2_V.

Return type

float

d2FdV2_T(T: float, V: float) float[source]

Derivative of vibrational Helmholtz free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

d2FdV2_T.

Return type

float

d2FdVdT(T: float, V: float) float[source]

Derivative of vibrational Helmholtz free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

d2FdVdT.

Return type

float

d3FdV2dT(T: float, V: float) float[source]

Derivative of vibrational Helmholtz free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

d3FdV2dT.

Return type

float

d3FdV3_T(T: float, V: float) float[source]

Derivative of vibrational Helmholtz free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

d3FdV3_T.

Return type

float

d3FdVdT2(T: float, V: float) float[source]

Derivative of vibrational Helmholtz free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

d3FdVdT2.

Return type

float

d4FdV4_T(T: float, V: float) float[source]

Derivative of vibrational Helmholtz free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

d4FdV4_T.

Return type

float

dFdT_V(T: float, V: float) float[source]

Derivative of vibrational Helmholtz free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

dFdT_V.

Return type

float

dFdV_T(T: float, V: float) float[source]

Derivative of vibrational Helmholtz free energy.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

Returns

dFdV_T.

Return type

float

set_int_anh(T: float, V: float) None[source]

Calculates intrinsic anharmonicity correction to the Debye temperature and its derivatives.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

set_int_anh_4minF(T: float, V: float) None[source]

Calculates intrinsic anharmonicity correction to the Debye temperature and its derivatives.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

set_theta(T: float, V: float) None[source]

Calculates the Debye Temperature and its derivatives.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

set_theta_4minF(T: float, V: float) None[source]

Calculates the Debye Temperature and its derivatives.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.