2.4. Single configuration free energy¶
Nearly all the functions in this module have been speeduped by Numba package, which means they are fast.
-
qha.single_configuration.
free_energy
(temperature, q_weights, static_energies, frequencies, static_only=False)[source]¶ The total free energy at a certain temperature.
- Parameters
temperature (float64) – A
float
that represents the temperature at which the total free energy is calculated. This value is in unit ‘Kelvin’.q_weights (array(float64, 1d, A)) – An \(m \times 1\) vector that represents the weight of each q-point in Brillouin zone sampling. This vector can be non-normalized since a normalization will be done internally.
static_energies (array(float64, 1d, A)) – An \(n \times 1\) vector that represents the static energy of the system with \(n\) different volumes. This should be the same unit as user-defined in the “settings” file.
frequencies (array(float64, 3d, A)) – An \(n \times m \times l\) 3D array that represents the frequency read from file.
static_only (
bool
) – IfTrue
, directly return the static energies, i.e., the static_energies parameter itself. This is useful when the user just wants to see static result while keeping all other functions unchanged.
- Return type
array(float64, 1d, A)
- Returns
An \(n \times 1\) vector that represents the total free energy of the system with \(n\) different volumes. The default unit is the same as in function
ho_free_energy
.
-
class
qha.single_configuration.
HOFreeEnergySampler
(temperature, q_weights, frequencies)[source]¶ A harmonic oscillator free energy sampler. The differences between
free_energy
andHOFreeEnergySampler
areHOFreeEnergySampler
provides several ways to compute free energies on different q-points, bands orvolumes, which could be used to check the correctness of the data.
HOFreeEnergySampler
can make calculation lazy, rather than directly calculates the values immediately.free_energy
is usually enough for computing the final free energy results.HOFreeEnergySampler
only calculates its vibrational part, static energies are not taken into account.
- Parameters
temperature (
float
) – Afloat
that represents the temperature at which the total free energy is calculated. This value is in unit ‘Kelvin’.q_weights (array(float64, 1d, A)) – An \(m \times 1\) vector that represents the weight of each q-point in Brillouin zone sampling. This vector can be non-normalized since a normalization will be done internally.
frequencies (array(float64, 3d, A)) – An \(n \times m \times l\) 3D array that represents the frequencies read from a file, usually in unit \(\text{cm}^{-1}\).
-
property
on_all_volumes
[source]¶ Sample free energies on every volume.
- Returns
A vector with length equals the number of volumes. Each element is the free energy of one volume.