2.3. Statistical mechanics functions

This module is used for calculating various thermodynamic properties using Helmholtz free energy.

qha.statmech.ho_free_energy(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj])

Calculate Helmholtz free energy of a single harmonic oscillator at a specific temperature. This is a vectorized function so the argument frequency can be an array.

Parameters
  • temperature – The temperature, in unit ‘Kelvin’. Zero-temperature is allowed.

  • frequency – The frequency of the harmonic oscillator, in unit ‘per cm’. If the frequency is less than or equal to \(0\), directly return 0 as its free energy.

Returns

Helmholtz free energy of the harmonic oscillator, whose unit depends on user’s settings.

qha.statmech.subsystem_partition_function(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj])

Calculate the subsystem partition function of a single harmonic oscillator at a specific temperature. This is a vectorized function so the argument frequency can be an array.

Parameters
  • temperature – The temperature, in unit ‘Kelvin’. Zero-temperature is allowed.

  • frequency – The frequency of the harmonic oscillator, in unit ‘per cm’. If the frequency is less than or equal to \(0\), directly return 1 as its subsystem partition function value.

Returns

The subsystem partition function of the harmonic oscillator.

qha.statmech.log_subsystem_partition_function(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj])

Calculate the natural logarithm of the subsystem partition function of a single harmonic oscillator at a specific temperature. This is a vectorized function so the argument frequency can be an array.

Parameters
  • temperature – The temperature, in unit ‘Kelvin’. Zero-temperature is allowed.

  • frequency – The frequency of the harmonic oscillator, in unit ‘per cm’. If the frequency is less than or equal to \(0\), directly return 0 as a result.

Returns

Natural logarithm of the subsystem partition function of the oscillator.