Superposition Approximations

Module used to combine partition function contributions and create superposition aproximations to the PES.

class occuprob.superpositions.SuperpositionApproximation[source]

Represents a superposition approximation of the PES for a particular system. In this approximation, the partition function of the system is written as the sum of the individual contributions from each geometrically unique local minimum the PES:

\[Z = \sum_{a=1}^{N} Z_a,\]

where \(Z_a\) is the partition function for the local minimum \(a\).

add_partition_functions(partition_functions)[source]

Add partition function contributions.

Parameters

partition_functions (PartitionFunction or list of PartitionFunction) – Partition function contribution(s) to add.

combine_contributions(temperature, combiner, method)[source]

Calculates and combines the contributions of each degree of freedom to the partition functions \(Z_a\) or their derivatives with respect to \(\beta\) (\(W_a\) or \(V_a\)).

Parameters
  • temperature (numpy.ndarray) – A 1D array of size M containing the temperature values in K.

  • combiner (callable) – Function used to combine the individual contributions. Can be either Numpy.sum or Numpy.prod.

  • method (string) – Name of the PartitionFunction class method used to compute the individual contributions (“calc_func”, “calc_func_w”, “calc_func_v”)

Returns

combined_functions – A 2D array of shape (N, M) containing the combined contributions for each of the N minima.

Return type

numpy.ndarray

calc_partition_functions(temperature)[source]

Calculates the individual contributions of each local minima to the partition function:

\[Z_a = Z_{elec,a}Z_{vib,a}Z_{rot,a}\cdots\]
Parameters

temperature (numpy.ndarray) – A 1D array of size M containing the temperature values in K.

Returns

partition_functions – A 2D array of shape (N, M) containing the individual partition function contributions of each of the N minima.

Return type

numpy.ndarray

calc_probability(temperature)[source]

Calculates the occupation probability in the temperature range provided, which is given by:

\[P_a = \frac{Z_a}{Z}\]
Parameters

temperature (numpy.ndarray) – A 1D array of size M containing the temperature values in K.

Returns

occupation_probability – A 2D array of shape (N, M) containing the occupation probability of each of the N minima.

Return type

numpy.ndarray

calc_ensemble_average(temperature, observable)[source]

Calculates the ensemble average for the given observable in the provided temperature range, which can be computed as:

\[\langle B \rangle = \sum_{a=1}^{N} B_a P_a,\]

where \(P_a\) is the occupation probability of minimum \(a\).

Parameters
  • temperature (numpy.ndarray) – A 1D array of size M containing the temperature values in K.

  • observable (numpy.ndarray) – A 2D array of shape (N, M) containing the input observable values for each local minimum as a function of the temperature.

Returns

ensemble_average – A 2D array of shape (1, M) containing the ensemble average of the input observable at the given temperature range.

Return type

numpy.ndarray

calc_heat_capacity(temperature)[source]

Calculates the canonical heat capacity for the given temperature range:

\[\begin{split}\frac{C_v}{k_B} &= \beta^2 \left[-\frac{1}{Z^2} \left(\sum_a W_a Z_a\right)^2 + \frac{1}{Z} \sum_a \left(W^2_a Z_a + V_a Z_a\right)\right] \\ &= -\left(\sum_a\beta W_a P_a\right)^2 + \sum_a \beta^2 \left(W^2_a P_a + V_a P_a\right) \\ &= -\langle \beta W \rangle^2 + \langle (\beta W)^2 \rangle +\langle \beta^2 V \rangle\end{split}\]

where

\[W_a = \frac{1}{Z_a} \frac{\partial Z_a}{\partial \beta} = W_{elec, a} + W_{vib, a} + W_{rot, a} + \dots\]

and

\[V_a = \frac{\partial W_a}{\partial \beta} = V_{elec, a} + V_{vib, a} + V_{rot, a} + \dots\]
Parameters

temperature (numpy.ndarray) – A 1D array of size M containing the temperature values in K.

Returns

heat_capacity – A 2D array of shape (1, M) containing the heat capacity of the system.

Return type

numpy.ndarray