dfttk.debye

class dfttk.debye.DebyeGruneisen[source]

Bases: object

A class for computing vibrational contributions to the Helmholtz free energy, entropy, and heat capacity using the Debye-Grüneisen model, with built-in plotting utilities.

process(number_of_atoms, volumes, temperatures, atomic_mass, V0, B, BP, scaling_factor=0.617, gruneisen_x=0.6666666666666666)[source]

This method computes the vibrational Helmholtz energy, entropy, and heat capacity for each combination of volume and temperature, and stores the results as attributes.

Parameters:
  • number_of_atoms (int) – Number of atoms in the supercell.

  • volumes (ndarray) – Array of input volumes in ų.

  • temperatures (ndarray) – Array of input temperatures in K.

  • atomic_mass (float) – Atomic mass in atomic mass units (u).

  • V0 (float) – Equilibrium volume in ų.

  • B (float) – Bulk modulus in GPa.

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

  • scaling_factor (float) – The scaling factor defaults to 0.617, as determined by Moruzzi et al. from their study on nonmagnetic cubic metals (https://doi.org/10.1103/PhysRevB.37.790).

  • gruneisen_x (float) – x parameter for the Grüneisen parameter calculation. Defaults to 2/3.

Return type:

None

plot_vt(type, selected_temperatures=None, selected_volumes=None)[source]

Plots the vibrational Helmholtz energy, entropy, or heat capacity as a function of temperature or volume.

Parameters:
  • type (str) – Must be one of the following values: 'helmholtz_energy_vs_temperature', 'entropy_vs_temperature', 'heat_capacity_vs_temperature', 'helmholtz_energy_vs_volume', 'entropy_vs_volume', or 'heat_capacity_vs_volume'.

  • selected_temperatures (ndarray) – Selected temperatures to use for volume plots, shape (n_selected_temperatures,). Defaults to None.

  • selected_volumes (ndarray) – Selected volumes to use for temperature plots, shape (n_selected_volumes,). Defaults to None.

Raises:
  • RuntimeError – If process() has not been called before plot_vt().

  • ValueError – The type argument is not one of the allowed values.

Return type:

Figure

Returns: Plotly figure as a function of temperature or volume.

static calculate_gruneisen_parameter(BP, gruneisen_x)[source]

Calculates the Grüneisen parameter (gamma). :type BP: float :param BP: First derivative of the bulk modulus with respect to pressure. :type gruneisen_x: float :param gruneisen_x: x parameter for the Grüneisen parameter calculation.

Returns: Grüneisen parameter (gamma).

Return type:

float

static calculate_debye_temperatures(volumes, atomic_mass, V0, B, scaling_factor, gruneisen_parameter)[source]

Compute the Debye temperature for each volume.

Parameters:
  • volumes (ndarray) – Array of input volumes in Å^3.

  • atomic_mass (float) – Atomic mass in atomic mass units (u).

  • V0 (float) – Equilibrium volume in Å^3.

  • B (float) – Bulk modulus in GPa.

  • scaling_factor (float) – Scaling factor.

  • gruneisen_parameter (float) – Grüneisen parameter (gamma).

Return type:

ndarray

Returns: Debye temperatures for each volume in K.

static calculate_debye_integral_n3(x_array)[source]

Calculate the Debye integral of order 3 for an array of upper limits.

For each value x in x_array, this computes:

\[D(x) = \frac{3}{x^3} \int_0^x \frac{t^3}{e^t - 1} \, dt\]
Parameters:

x_array (ndarray) – Array of upper integration limits, where each value is the Debye temperature divided by the temperature. The Debye temperature is fixed for a given volume, and the temperature is varied.

ValueError: If any value in x_array is zero, since this would lead to division by

zero in the formula.

Return type:

ndarray

Returns:

Array of Debye integrals of order 3 corresponding to each value in x_array.

calculate_helmholtz_energies(debye_temperature)[source]

Calculates the vibrational Helmholtz energy.

Parameters:

debye_temperature (float) – Debye temperature in K for a given volume.

Return type:

ndarray

Returns: Array of vibrational Helmholtz energy values in eV for each temperature.

calculate_entropies(debye_temperature)[source]

Calculate the vibrational entropy.

Parameters:

debye_temperature (float) – Debye temperature in K for a given volume.

Return type:

ndarray

Returns: Array of vibrational entropy values in eV/K for each temperature.

calculate_heat_capacities(debye_temperature)[source]

Calculates the vibrational heat capacity.

The integral evaluated is:

\[\]

frac{3}{x^3} int_0^x frac{t^4 e^t}{(e^t - 1)^2} , dt

Parameters:

debye_temperature (float) – Debye temperature in K for a given volume.

Return type:

ndarray

Returns: Array of vibrational heat capacity values in eV/K for each temperature.