ccu.thermo.gibbs¶
Functions for calculating Gibbs free energies from vibrational data.
- ccu.thermo.gibbs._alert_imaginary_frequencies(approximation: Literal['IDEAL_GAS', 'HARMONIC'] = 'HARMONIC', lower_frequency_threshold: float = 12.0) None[source]¶
Issue an appropriate warning when there are imaginary frequencies.
- ccu.thermo.gibbs._normalize_frequencies(frequencies: list[complex], approximation: Literal['IDEAL_GAS', 'HARMONIC'] = 'HARMONIC', transition_state: bool = False, frequency_threshold: float = 12) list[float][source]¶
Add real frequencies and normalize sub-threshold frequencies.
- ccu.thermo.gibbs.calculate_free_energy(*, freq: list[float] | None = None, log_file: TextIO | None = None, vib_file: TextIO | None = None, approximation: Literal['IDEAL_GAS', 'HARMONIC'] = 'HARMONIC', symmetry: int = 1, geometry: Literal['linear', 'nonlinear'] = 'nonlinear', transition_state: bool = False, frequency_threshold: float = 12.0, temperature: float = 273.15, pressure: float = 1.0, spin: int = 0, atoms_file: str = 'in.traj') tuple[float, float, list[float]][source]¶
Calculate the thermodynamic corrections in the specified approximation.
- Parameters:
freq – A list of frequencies to use for free energy calculations.
log_file – A file in which to log the results.
vib_file – A file from which to read the frequencies.
approximation – Which approximation to use. One of
"IDEAL_GAS"or"HARMONIC". Defaults to"HARMONIC".symmetry – The symmetry number of the system. Defaults to 1.
geometry – The geometry of the system. One of
"linear"or"nonlinear"Defaults to"nonlinear".transition_state – Whether to treat the system as a transition state. Defaults to False.
frequency_threshold – All frequencies below this value with be normalized to this value. Defaults to 12.
temperature – The temperature for the system (in Kelvin). Note that this is only relevant if
approximation="IDEAL_GAS". Defaults to 273.15.pressure – The pressure for the system (in bar). Note that this is only relevant if
approximation="IDEAL_GAS". Defaults to 1.0.spin – The spin for the system. Note that this is only relevant if
approximation="IDEAL_GAS". Defaults to 0.atoms_file – A string pointing to the structure to which the vibrational calculations correspond. This is only required if
approximation="IDEAL_GAS". Defaults to"in.traj".
- Returns:
A 3-tuple (
ts,zpe,freq) wheretsis the entropic correction (\(-TS\)),zpeis the vibrational zero-point energy (\(ZPE\)), andfreqis a list of floats representing the frequencies used to calculate the zero-point energy.
Note
The free energy of the system can be calculated using (1)
- ccu.thermo.gibbs.select_frequencies(vib_file: TextIO | None = None, geometry: Literal['linear', 'nonlinear'] = 'nonlinear', approximation: Literal['IDEAL_GAS', 'HARMONIC'] = 'HARMONIC', transition_state: bool = False, frequency_threshold: float = 12) list[float][source]¶
Discard frequencies according to the geometry and approximations.
- Parameters:
vib_file – An opened text file in which to save the vibrational data.
geometry – A string indicating the geometry. One of
"linear"or"nonlinear". Defaults to"nonlinear".approximation – A string indicating the approximation used in the treatment of the free energy. Defaults to
"HARMONIC".transition_state – Whether the frequencies correspond to a transition state. Defaults to False.
frequency_threshold – All frequencies below this value will be normalized to this value. Defaults to 12 cm-1.
- Returns:
The appropriate frequencies for the system.