Partition Functions¶
Module used to calculate partition functions.
- class occuprob.partitionfunctions.PartitionFunction[source]¶
An abstract class that represents a partition function.
- abstract calc_part_func(temperature)[source]¶
Abstract method to calculate the partition function in the given temperature range.
- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
partition_function – A 2D array of shape (N, M) contaning the calculated partition functions for each of the N minima in the given temperature range.
- Return type
numpy.ndarray
- abstract calc_part_func_w(temperature)[source]¶
Method to calculate \(W_a\), the derivative of the partition function with respect to \(\beta\) divided by the partition function, multiplied by \(\beta\):
\[\beta W_a = \frac{\beta}{Z_a} \frac{\partial Z_a}{\partial \beta}\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
part_func_w – A 2D array of shape (N, M) contaning the calculated derivatives of the partition function for each of the N minima, in the given temperature range.
- Return type
numpy.ndarray
- abstract calc_part_func_v(temperature)[source]¶
Method to calculate \(V_a\), the derivative of \(W_a\) with respect to \(\beta\), multiplied by \(\beta^2\):
\[\beta^2 V_a = \beta^2 \frac{\partial W_a}{\partial \beta}\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
part_func_v – A 2D array of shape (N, M) contaning the calculated derivatives of W for each of the N minima, in the given temperature range.
- Return type
numpy.ndarray
- class occuprob.partitionfunctions.ElectronicPF(potential_energy, spin_multiplicity)[source]¶
Represents a canonical electronic partition function.
- Variables
~ElectronicPF.potential_energy (
numpy.ndarray) – A 1D array containing the energy values (in eV) of each of the N minima.~ElectronicPF.spin_multiplicity (
numpy.ndarray) – A 1D array containing the spin multiplicity corresponding to each of the N minima.
- calc_part_func(temperature)[source]¶
Calculates the electronic canonical partition function in the given temperature range:
\[Z_{elec,a} = g_{spin,a}e^{-\beta E_a}\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
partition_function – A 2D array of shape (N, M) contaning the calculated partition functions for each of the N minima in the given temperature range.
- Return type
numpy.ndarray
- calc_part_func_w(temperature)[source]¶
Method to calculate \(W_{elec,a}\), the derivative of the partition function with respect to \(\beta\) divided by the partition function, multiplied by \(\beta\):
\[\beta W_{elec,a} = -\beta E_a\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
part_func_w – A 2D array of shape (N, M) contaning the calculated derivatives of the partition function for each of the N minima, in the given temperature range.
- Return type
numpy.ndarray
- calc_part_func_v(temperature)[source]¶
Method to calculate \(V_{elec,a}\), the derivative of \(W_{elec,a}\) with respect to \(\beta\), multiplied by \(\beta^2\):
\[\beta^2 V_{elec,a} = 0\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
part_func_v – A 2D array of shape (N, M) contaning the calculated derivatives of W for each of the N minima, in the given temperature range.
- Return type
numpy.ndarray
- class occuprob.partitionfunctions.RotationalPF(symmetry_order, moments)[source]¶
Represents a canonical rotational partition function in a high-temperature approximation.
- Variables
~RotationalPF.symmetry_order (
numpy.ndarray) – A 1D array of size N containing the order of rotational subgroup of the point group symmetry of each minimum.~RotationalPF.moments (
numpy.ndarray) – A 2D array of shape (N, 3) containing the principal moments of inertia of each minimum.
- calc_part_func(temperature)[source]¶
Calculates the electronic canonical partition function in the given temperature range.
\[Z_{rot,a} = \frac{\sqrt{\pi}}{\sigma_a} \left(\frac{2}{\beta \hbar^2}\right)^{\frac{3}{2}} \sqrt{I_{a,1}I_{a,2}I_{a,3}}\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
partition_function – A 2D array of shape (N, M) contaning the calculated partition functions for each of the N minima in the given temperature range.
- Return type
numpy.ndarray
- calc_part_func_w(temperature)[source]¶
Method to calculate \(W_{rot,a}\), the derivative of the partition function with respect to \(\beta\) divided by the partition function, multiplied by \(\beta\):
\[\beta W_{rot,a} = -\frac{3}{2}\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
part_func_w – A 2D array of shape (N, M) contaning the calculated derivatives of the partition function for each of the N minima, in the given temperature range.
- Return type
numpy.ndarray
- calc_part_func_v(temperature)[source]¶
Method to calculate \(V_{rot,a}\), the derivative of \(W_{rot,a}\) with respect to \(\beta\), multiplied by \(\beta^2\):
\[\beta^2 V_{rot,a} = \frac{3}{2}\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
part_func_v – A 2D array of shape (N, M) contaning the calculated derivatives of W for each of the N minima, in the given temperature range.
- Return type
numpy.ndarray
- class occuprob.partitionfunctions.ClassicalHarmonicPF(frequencies)[source]¶
Represents a canonical vibrational partition function in the classical harmonic approximation.
- Variables
~ClassicalHarmonicPF.frequencies (
numpy.ndarray) – A 2D array of shape (N, D) containing the D frequency values (in THz) of each of the N minima.
- calc_part_func(temperature)[source]¶
Calculates the classical vibrational partition function \(Z_{vib,a}\) in the given temperature range:
\[Z_{vib,a} = \left(\beta h \bar{\nu}_a\right)^{-\kappa}\]where \(\bar{\nu}_a\) is the geometric mean vibrational frequency of minima $a$ and \(\kappa\) is the number of vibrational modes.
- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
partition_function – A 2D array of shape (N, M) contaning the calculated partition functions for each of the N minima in the given temperature range.
- Return type
numpy.ndarray
- calc_part_func_w(temperature)[source]¶
Method to calculate \(W_{vib,a}\), the derivative of the partition function with respect to \(\beta\) divided by the partition function, multiplied by \(\beta\):
\[\beta V_{vib,a} = -\kappa\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
part_func_w – A 2D array of shape (N, M) contaning the calculated derivatives of the partition function for each of the N minima, in the given temperature range.
- Return type
numpy.ndarray
- calc_part_func_v(temperature)[source]¶
Method to calculate \(V_{vib,a}\), the derivative of \(W_{vib,a}\) with respect to \(\beta\), multiplied by \(\beta^2\):
\[\beta^2 V_{vib,a} = \kappa\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
part_func_v – A 2D array of shape (N, M) contaning the calculated derivatives of W for each of the N minima, in the given temperature range.
- Return type
numpy.ndarray
- class occuprob.partitionfunctions.QuantumHarmonicPF(frequencies)[source]¶
Represents a canonical vibrational partition function in the quantum harmonic approximation.
- Variables
~QuantumHarmonicPF.frequencies (
numpy.ndarray) – A 2D array of shape (N, D) containing the D frequency values (in THz) of each of the N minima.
- calc_part_func(temperature)[source]¶
Calculates the quantum vibrational partition function in the given temperature range.
\[Z_{vib,a} = \prod_{i=1}^{\kappa}\frac{e^{-\beta h\nu_{a,i}/2}} {1 - e^{-\beta h\nu_{a,i}}} = \frac{1}{2}\prod_{i}^{\kappa}\textrm{csch}(\beta h\nu_{a,i}/2)\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
partition_function – A 2D array of shape (N, M) contaning the calculated partition functions for each of the N minima in the given temperature range.
- Return type
numpy.ndarray
- calc_part_func_w(temperature)[source]¶
Method to calculate \(W_{vib,a}\), the derivative of the partition function with respect to \(\beta\) divided by the partition function, multiplied by \(\beta\):
\[\beta W_{vib,a} = \sum_{i=1}^{\kappa}(\beta h\nu_{a,i}/2) \textrm{coth}(\beta h\nu_{a,i}/2)\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
part_func_w – A 2D array of shape (N, M) contaning the calculated derivatives of the partition function for each of the N minima, in the given temperature range.
- Return type
numpy.ndarray
- calc_part_func_v(temperature)[source]¶
Method to calculate \(V_{vib,a}\), the derivative of \(W_{vib,a}\) with respect to \(\beta\), multiplied by \(\beta^2\):
\[\beta^2 V_{vib,a} = \sum_{i=1}^{\kappa}[(\beta h\nu_{a,i}/2) \textrm{csch}(\beta h\nu_{a,i}/2)]^2\]- Parameters
temperature (
numpy.ndarray) – A 1D array of size M containing the temperature values in K.- Returns
part_func_v – A 2D array of shape (N, M) contaning the calculated derivatives of W for each of the N minima, in the given temperature range.
- Return type
numpy.ndarray