# rmgpy.data.thermo.ThermoDatabase¶

class rmgpy.data.thermo.ThermoDatabase

A class for working with the RMG thermodynamics database.

Return the set of thermodynamic parameters corresponding to a given Molecule object molecule using the group additivity values method. If no group additivity values are loaded, a DatabaseError is raised.

The entropy is not corrected for the symmetry of the molecule, this should be done later by the calling function.

correct_binding_energy(thermo, species, metal_to_scale_from=None, metal_to_scale_to=None)

Changes the provided thermo, by applying a linear scaling relation to correct the adsorption energy.

Parameters:
• thermo – starting thermo data

• species – the species (which is an adsorbate)

• metal_to_scale_from – the metal you want to scale from (string eg. ‘Pt111’ or None)

• metal_to_scale_to – the metal you want to scale to (string e.g ‘Pt111’ or None)

Returns:

corrected thermo

Estimate the thermodynamics of a radical by saturating it, applying the provided stable_thermo_estimator method on the saturated species, then applying hydrogen bond increment corrections for the radical site(s) and correcting for the symmetry.

No entropy is included in the returning term. This should be done later by the calling function.

Return the set of thermodynamic parameters corresponding to a given Molecule object molecule using the group additivity values method. If no group additivity values are loaded, a DatabaseError is raised.

The entropy is not corrected for the symmetry of the molecule, this should be done later by the calling function.

species: A species object containing thermo data and thermo data comments

Parses the verbose string of comments from the thermo data of the species object, and extracts the thermo sources.

Returns a dictionary with keys of either ‘Library’, ‘QM’, and/or ‘GAV’. Commonly, species thermo are estimated using only one of these sources. However, a radical can be estimated with more than one type of source, for instance a saturated library value and a GAV HBI correction, or a QM saturated value and a GAV HBI correction.

source = {‘Library’: String_Name_of_Library_Used,

‘QM’: String_of_Method_Used, ‘GAV’: Dictionary_of_Groups_Used }

The Dictionary_of_Groups_Used looks like {‘groupType’:[List of tuples containing (Entry, Weight)]

get_all_thermo_data(species)

Return all possible sets of thermodynamic parameters for a given Species object species. The hits from the depository come first, then the libraries (in order), and then the group additivity estimate. This method is useful for a generic search job.

Returns: a list of tuples (ThermoData, source, entry) (Source is a library or depository, or None)

Takes a string of comments from group additivity estimation, and extracts the ring and polycyclic ring groups from them, returning them as lists.

get_thermo_data(species, metal_to_scale_to=None, training_set=None)

Return the thermodynamic parameters for a given Species object species. This function first searches the loaded libraries in order, returning the first match found, before falling back to estimation via machine learning and then group additivity.

The method corrects for symmetry when the molecule uses machine learning or group additivity. Libraries and direct QM calculations are already corrected.

If either metal to scale to or from is not specified, assume the binding energies given in the input file

Returns: ThermoData

get_thermo_data_for_surface_species(species)

Get the thermo data for an adsorbed species, by desorbing it, finding the thermo of the gas-phase species, then adding an adsorption correction that is found from the groups/adsorption tree. Does not apply linear scaling relationship.

Returns a ThermoData object, with no Cp0 or CpInf

get_thermo_data_from_depository(species)

Return all possible sets of thermodynamic parameters for a given Species object species from the depository. If no depository is loaded, a DatabaseError is raised.

Returns: a list of tuples (thermo_data, depository, entry) without any Cp0 or CpInf data.

get_thermo_data_from_groups(species)

Return the set of thermodynamic parameters corresponding to a given Species object species by estimation using the group additivity values. If no group additivity values are loaded, a DatabaseError is raised.

The resonance isomer (molecule) with the lowest H298 is used, and as a side-effect the resonance isomers (items in species.molecule list) are sorted in ascending order.

This does not account for symmetry. The method calling this sould correct for it.

Returns: ThermoData

get_thermo_data_from_libraries(species, training_set=None)

Return the thermodynamic parameters for a given Species object species. This function first searches the loaded libraries in order, returning the first match found, before failing and returning None. training_set is used to identify if function is called during training set or not. During training set calculation we want to use gas phase thermo to not affect reverse rate calculation.

Returns: ThermoData or None

get_thermo_data_from_library(species, library)

Return the set of thermodynamic parameters corresponding to a given Species object species from the specified thermodynamics library. If library is a string, the list of libraries is searched for a library with that name. If no match is found in that library, None is returned. If no corresponding library is found, a DatabaseError is raised.

Returns a tuple: (ThermoData, library, entry) or None.

get_thermo_data_from_ml(species, ml_estimator, ml_settings)

Return the set of thermodynamic parameters corresponding to a given Species object species by estimation using the ML estimator. Also compare the estimated uncertainties to the user-defined cutoffs. If any of the uncertainties are larger than their corresponding cutoffs, return None. Also check all other options in ml_settings.

For HBI, the resonance isomer with the lowest H298 is used and the resonance isomers in species are sorted in ascending order.

The entropy is not corrected for the symmetry of the molecule. This should be done later by the calling function.

Load the thermo database from the given path on disk, where path points to the top-level folder of the thermo database.

Load the thermo database from the given path on disk, where path points to the top-level folder of the thermo database.

Load the thermo database from the given path on disk, where path points to the top-level folder of the thermo database.

Load the thermo database from the given path on disk, where path points to the top-level folder of the thermo database.

If no libraries are given, all are loaded.

Load the old RMG thermo database from the given path on disk, where path points to the top-level folder of the old RMG database.

Load the metal database from the given path on disk, where path points to the top-level folder of the thermo database.

prioritize_thermo(species, thermo_data_list)

Use some metrics to reorder a list of thermo data from best to worst. Return a list of indices with the desired order associated with the index of thermo from the data list.

prune_heteroatoms(allowed=None)

Remove all species from thermo libraries that contain atoms other than those allowed.

This is useful before saving the database for use in RMG-Java

record_polycylic_generic_nodes()

Identify generic nodes in tree for polycyclic groups. Saves them as a list in the generic_nodes attribute in the polycyclic ThermoGroups object, which must be pre-loaded.

Necessary for polycyclic heuristic.

record_ring_generic_nodes()

Identify generic nodes in tree for ring groups. Saves them as a list in the generic_nodes attribute in the ring ThermoGroups object, which must be pre-loaded.

Necessary for polycyclic heuristic.

save(path)

Save the thermo database to the given path on disk, where path points to the top-level folder of the thermo database.

save_depository(path)

Save the thermo depository to the given path on disk, where path points to the top-level folder of the thermo depository.

save_groups(path)

Save the thermo groups to the given path on disk, where path points to the top-level folder of the thermo groups.

save_libraries(path)

Save the thermo libraries to the given path on disk, where path points to the top-level folder of the thermo libraries.

save_old(path)

Save the old RMG thermo database to the given path on disk, where path points to the top-level folder of the old RMG database.

save_surface(path)

Save the metal library to the given path on disk, where path points to the top-level folder of the metal library.

set_binding_energies(binding_energies='Pt111')

Sets and stores the atomic binding energies specified in the input file.

All adsorbates will be scaled to use these elemental binding energies.

Parameters:

binding_energies (dict, optional) – the desired binding energies with elements as keys and binding energy/unit tuples (or Energy quantities) as values

Returns:

None, stores result in self.binding_energies