catmap.thermodynamics package

Submodules

catmap.thermodynamics.enthalpy_entropy module

class catmap.thermodynamics.enthalpy_entropy.ThermoCorrections(reaction_model=None)[source]

Bases: catmap.ReactionModelWrapper

Class for including thermodynamic corrections.

The function “get_thermodynamic_corrections” automatically does all the work assuming the correct functions are in place.

thermodynamic_corrections: List of fundamentally different types of
corrections which could be included. Defaults are gas and adsorbate but other possibilities might be interface, electrochemical, etc.
thermodynamic_variables: List of variables which define a thermodynamic
state. If these attributes of the underlying reaction model do not change then the thermodynamic corrections will not be recalculated in order to save time.
To add a new correction type (called custom_correction):
  1. Define the function which performs the correction as an attribute.
    Assume the function is called “simple_custom_correction”.
  2. Place the “custom_correction” in the “thermodynamic_corrections” list
  3. Place any variables which the custom correction depends on in
    the thermodynamic_variables list
  4. Set the “custom_correction_thermo_mode” attribute of the
    underlying reaction model to “simple_custom_correction”

If these steps are followed then the correction should automatically be included in all calculations.

__getattr__(attr)

Return the value of the reaction model instance if its there. Otherwise return the instances own value (or none if the instance does not have the attribute defined and the attribute is not private)

__init__(reaction_model=None)[source]
__module__ = 'catmap.thermodynamics.enthalpy_entropy'
__setattr__(attr, val)

Set attribute for the instance as well as the reaction_model instance

_bar2Pa = 100000.0
_get_echem_corrections(correction_dict)[source]

Perform the thermodynamic corrections relevant to electrochemistry but are not specific to any particular mode.

_kJmol2eV = 0.01036427
_shomate_eq(params, temperature=[])[source]
approach_to_equilibrium_pressure()[source]

Set product pressures based on approach to equilibrium. Requires the following attributes to be set: global_reactions - a list of global reactions in the same syntax as elementary expressions,

with each one followed by its respective approach to equilibrium.

pressure_mode - must be set to ‘approach_to_equilibrium’ Note that this function is not well-tested and should be used with caution.

average_transition_state(thermo_dict, transition_state_list=[], thermo_vars=[])[source]

Return transition state thermochemical corrections as average of IS and FS corrections

boltzmann_coverages(energy_dict)[source]

Return coverages based on Boltzmann distribution

concentration_pressure()[source]
estimate_hbond_corr()[source]

Generate hydrogen bonding corrections given a formula and estimations for various functional groups used in Peterson(2010) - valid mostly for Pt(111) This is a very simplistic function. If you need more advanced descriptions of hydrogen bonding, consider setting your own hbond_dict.

fixed_enthalpy_entropy_adsorbate()[source]

Return free energy corrections based on input enthalpy, entropy, ZPE

fixed_enthalpy_entropy_gas(gas_names=None)[source]

Calculate free energy corrections based on input enthalpy, entropy, ZPE

fixed_entropy_gas(include_ZPE=True)[source]

Add entropy based on fixed_entropy_dict (entropy contribution to free energy assumed linear with temperature) and ZPE

frozen_adsorbate()[source]

Neglect all zero point, enthalpy, entropy corrections to adsorbate energy.

frozen_fixed_entropy_gas()[source]

Do not add ZPE, calculate fixed entropy correction.

frozen_gas()[source]

Neglect all thermal contributions, including the zero point energy.

generate_echem_TS_energies()[source]

Give real energies to the fake echem transition states

get_frequency_cutoff(kB_multiplier, temperature=None)[source]
get_pressure_equilibrium(xguess=None, ftol=1e-05)[source]
get_rxn_index_from_TS(TS)[source]

Take in the name of a transition state and return the reaction index of the elementary rxn from which it belongs

get_thermodynamic_corrections(**kwargs)[source]

Calculate all ``thermodynamic’’ corrections beyond the energies in the input file. This master function will call sub-functions depending on the ``thermo mode’’ of each class of species

harmonic_adsorbate()[source]

Calculate the thermal correction to the free energy of an adsorbate in the harmonic approximation using the HarmonicThermo class in ase.thermochemistry.

adsorbate_names = the chemical formulas of the adsorbates of interest. freq_dict = dictionary of vibrational frequencies for each adsorbate of

interest. Vibrational frequencies should be in eV. The dictionary should be of the form freq_dict[ads_name] = [freq1, freq2, …]
hbond_electrochemical()[source]

Update simple_electrochemical with hbonding corrections as if they were on Pt(111)

hbond_with_estimates_electrochemical()[source]

Add hbond corrections to transition states involving pe and ele (coupled proton-electron transfers and electron transfers)

hindered_adsorbate()[source]

Calculate the thermal correction to the free energy of an adsorbate in the hindered translator and hindered rotor model using the HinderedThermo class in ase.thermochemistry along with the molecular structures in ase.data.molecules. Requires ase version 3.12.0 or greater.

adsorbate_names = the chemical formulas of the adsorbates of interest. freq_dict = dictionary of vibrational frequencies for each adsorbate of

interest. Vibrational frequencies should be in eV. The dictionary should be of the form freq_dict[ads_name] = [freq1, freq2, …]
hindered_ads_params = dictionary containing for each adsorbate
[0] = translational energy barrier in eV (barrier for the
adsorbate to diffuse on the surface)
[1] = rotational energy barrier in eV (barrier for the adsorbate
to rotate about an axis perpendicular to the surface)

[2] = surface site density in cm^-2 [3] = number of equivalent minima in full adsorbate rotation [4] = mass of the adsorbate in amu (can be unspecified by putting

None, in which case mass will attempt to be calculated from the ase atoms class)
[5] = reduced moment of inertia of the adsorbate in amu*Ang^-2
(can be unspecified by putting None, in which case inertia will attempt to be calculated from the ase atoms class)
[6] = symmetry number of the adsorbate (number of symmetric arms
of the adsorbate which depends upon how it is bound to the surface. For example, propane bound through its end carbon has a symmetry number of 1 but propane bound through its middle carbon has a symmetry number of 2. For single atom adsorbates such as O* the symmetry number is 1.)

The dictionary should be of the form hindered_ads_params[ads_name] = [barrierT, barrierR, site_density, rotational_minima, mass, inertia, symmetry_number]

atoms_dict = dictionary of ase atoms objects to use for calculating
mass and rotational inertia. If none is specified then the function will look in ase.data.molecules. Can be omitted if both mass and rotational inertia are specified in hindered_ads_params.
homogeneous_field()[source]

Update simple_electrochemical with field corrections for adsorbates that respond to a field

ideal_gas()[source]

Calculate the thermal correction to the free energy of an ideal gas using the IdealGasThermo class in ase.thermochemistry along with the molecular structures in ase.data.molecules.

gas_names = the chemical formulas of the gasses of interest (usually
ending in _g to denote that they are in the gas phase).
freq_dict = dictionary of vibrational frequencies for each gas
of interest. Vibrational frequencies should be in eV. The dictionary should be of the form freq_dict[gas_name] = [freq1, freq2, …]
ideal_gas_params = dictionary of the symmetry number,
geometry keyword, and spin of the gas. If no dictionary is specified then the function will attempt to look the gas up in the hard-coded gas_params dictionary. The dictionary should be of the form ideal_gas_params[gas_name] = [symmetry_number, geometry, spin]
atoms_dict = dictionary of ase atoms objects to use for
calculating rotational contributions. If none is specified then the function will look in ase.data.molecules.
local_field_electrochemical()[source]

Obtains corrections to thermo_dict in the presence of ions hey you need to specify these things: model.Upzc (float) model.CH (float) model.field_site_name model.unfield_site_name and DO NOT specify beta

set_affine_pressure_equilibrium(alpha, x0=[])[source]

defines gas_pressure as an affine combination between the actual pressure and that of equilibrium by an alpha factor

set_equilibrated()[source]

Set reactants/products as their equilibrium composition a priori such that close-to-equilibrium species TOF do not overshadow thos of species that are far from it. It will look for .equilibrated parameter. This function assume ‘static’ pressure, such the extent of reactions toward equilibrium would not lead to significant change in the systems’ total pressure.

shomate_adsorbate()[source]

Calculate the thermal correction to the free energy of an adsorbate using pre-fitted shomate parameters.

shomate_gas()[source]

Calculate free energy corrections using Shomate equation

simple_electrochemical()[source]

Calculate electrochemical (potential) corrections to free energy. Transition state energies are corrected by a beta*voltage term.

static_pressure()[source]
summary_text()[source]
zero_point_adsorbate()[source]

Add zero point energy correction to adsorbate energy.

zero_point_gas()[source]

Add zero point energy correction to gasses.

catmap.thermodynamics.enthalpy_entropy.fit_shomate(Ts, Cps, Hs, Ss, params0=[], plot_file=None)[source]

This regression functionality has been updated from a non-linear version to a linearized one which does not need initial guesses (params0). params0 was kept as parameter to the function for backwards compatibiliy. It should be following deprecated.

catmap.thermodynamics.enthalpy_entropy.harmonic_to_shomate(frequencies, Tmin, Tmax, resolution)[source]

Generate Shomate parameters as of frequency data by using fit_shomate.

catmap.thermodynamics.first_order_interactions module

class catmap.thermodynamics.first_order_interactions.FirstOrderInteractions(reaction_model=None)[source]

Bases: catmap.ReactionModelWrapper

Class for implementing ‘first-order adsorbate interaction model. Should be sub-classed by scaler.

__getattr__(attr)

Return the value of the reaction model instance if its there. Otherwise return the instances own value (or none if the instance does not have the attribute defined and the attribute is not private)

__init__(reaction_model=None)[source]
__module__ = 'catmap.thermodynamics.first_order_interactions'
__setattr__(attr, val)

Set attribute for the instance as well as the reaction_model instance

error_norm(diff_err, int_err)[source]
fit()[source]
fit_interaction_parameter(theta_list, E_diffs, E_ints, param_name, surf_name)[source]
fit_old()[source]
get_TS_weight_matrix(weight)[source]

Helper function to get `weights’ of how to distribute TS-cross interactions between IS/FS. Should not be called externally.

get_energy_error(epsilon_ij, theta, Ediff, Eint, parameter_name, surface_name)[source]
get_interaction_info()[source]
get_interaction_matrix(descriptors)[source]
get_interaction_scaling_matrix()[source]
get_interaction_transition_state_scaling_matrix()[source]
static linear_response(*args, **kwargs)[source]
parameterize_interactions()[source]
params_to_matrix(param_vector)[source]
static piecewise_linear_response(*args, **kwargs)[source]
required_interaction_parameters(cvg)[source]
static smooth_piecewise_linear_response(*args, **kwargs)[source]

catmap.thermodynamics.second_order_interactions module

class catmap.thermodynamics.second_order_interactions.SecondOrderInteractions(reaction_model=None)[source]

Bases: catmap.thermodynamics.first_order_interactions.FirstOrderInteractions, catmap.ReactionModelWrapper

Class for implementing ‘first-order adsorbate interaction model. Should be sub-classed by scaler.

__getattr__(attr)

Return the value of the reaction model instance if its there. Otherwise return the instances own value (or none if the instance does not have the attribute defined and the attribute is not private)

__init__(reaction_model=None)[source]
__module__ = 'catmap.thermodynamics.second_order_interactions'
__setattr__(attr, val)

Set attribute for the instance as well as the reaction_model instance

error_norm(diff_err, int_err)
fit()
fit_interaction_parameter(theta_list, E_diffs, E_ints, param_name, surf_name)
fit_old()
get_TS_weight_matrix(weight)

Helper function to get `weights’ of how to distribute TS-cross interactions between IS/FS. Should not be called externally.

get_energy_error(epsilon_ij, theta, Ediff, Eint, parameter_name, surface_name)
get_interaction_info()
get_interaction_matrix(descriptors)
get_interaction_scaling_matrix()
get_interaction_transition_state_scaling_matrix()
static linear_response(*args, **kwargs)[source]
static offset_smooth_piecewise_linear_response(*args, **kwargs)[source]
parameterize_interactions()
params_to_matrix(param_vector)
static piecewise_linear_response(*args, **kwargs)[source]
required_interaction_parameters(cvg)
static smooth_piecewise_linear_response(*args, **kwargs)[source]

Module contents