RMG-Py API Reference
RMG-Py API Reference
RMG-Py API Reference
Release 2.4.1
Bibliography 269
Index 273
i
ii
RMG-Py API Reference, Release 2.4.1
RMG is an automatic chemical reaction mechanism generator that constructs kinetic models composed of elementary
chemical reaction steps using a general understanding of how molecules react.
This is the API Reference guide for RMG. For instructions on how to use RMG, please refer to the User Guide.
For the latest documentation and source code, please visit http://reactionmechanismgenerator.github.io/RMG-Py/
CONTENTS 1
RMG-Py API Reference, Release 2.4.1
2 CONTENTS
CHAPTER
ONE
This document provides the complete details of the application programming interface (API) for the Python version
of the Reaction Mechanism Generator. The functionality of RMG-Py is divided into many modules and subpackages.
An overview of these components is given in the table below. Click on the name of a component to learn more and
view its API.
Module Description
arkane Computing chemical properties from quantum chemistry calculations
rmgpy.chemkin Reading and writing models in Chemkin format
rmgpy.constants Physical constants
rmgpy.data Working with the RMG database
rmgpy.kinetics Kinetics models of chemical reaction rates
rmgpy.molecule Molecular representations using chemical graph theory
rmgpy.pdep Pressure-dependent kinetics from master equation models
rmgpy.qm On-the-fly quantum calculations
rmgpy.quantity Physical quantities and unit conversions
rmgpy.reaction Chemical reactions
rmgpy.rmg Automatic reaction mechanism generation
rmgpy.solver Modeling reaction systems
rmgpy.species Chemical species
rmgpy.statmech Statistical mechanics models of molecular degrees of freedom
rmgpy.thermo Thermodynamics models of chemical species
rmgpy.exceptions Custom RMG exception classes
The arkane subpackage contains the main functionality for Arkane, a tool for computing thermodynamic and kinetic
properties of chemical species and reactions.
Class Description
GaussianLog Extract chemical parameters from Gaussian log files
3
RMG-Py API Reference, Release 2.4.1
Class Description
QchemLog Extract chemical parameters from Q-Chem log files
Class Description
MolproLog Extract chemical parameters from Molpro log files
1.1.4 Input
Function Description
loadInputFile() Load an Arkane job input file
Class Description
Arkane Main class for Arkane jobs
StatMechJob Compute the molecular degrees of freedom for a molecular conformation
ThermoJob Compute the thermodynamic properties of a species
KineticsJob Compute the high pressure-limit rate coefficient for a reaction using transition state theory
Compute the phenomenological pressure-dependent rate coefficients 𝑘(𝑇, 𝑃 ) for a uni-
PressureDependenceJob
molecular reaction network
arkane.gaussian.GaussianLog
class arkane.gaussian.GaussianLog(path)
Represent a log file from Gaussian. The attribute path refers to the location on disk of the Gaussian log file of
interest. Methods are provided to extract a variety of information into Arkane classes and/or NumPy arrays.
getNumberOfAtoms()
Return the number of atoms in the molecular configuration used in the Gaussian log file.
get_optical_isomers_and_symmetry_number()
This method uses the symmetry package from RMG’s QM module and returns a tuple where the first
element is the number of optical isomers and the second element is the symmetry number.
loadConformer(symmetry=None, spinMultiplicity=0, opticalIsomers=None, label=”)
Load the molecular degree of freedom data from a log file created as the result of a Gaussian “Freq”
quantum chemistry calculation. As Gaussian’s guess of the external symmetry number is not always
correct, you can use the symmetry parameter to substitute your own value; if not provided, the value in the
Gaussian log file will be adopted. In a log file with multiple Thermochemistry sections, only the last one
will be kept.
loadEnergy(zpe_scale_factor=1.0)
Load the energy in J/mol from a Gaussian log file. The file is checked for a complete basis set extrapolation;
if found, that value is returned. Only the last energy in the file is returned. The zero-point energy is not
included in the returned value; it is removed from the CBS-QB3 value.
loadForceConstantMatrix()
Return the force constant matrix from the Gaussian log file. The job that generated the log file must have
the option iop(7/33=1) in order for the proper force constant matrix (in Cartesian coordinates) to be
printed in the log file. If multiple such matrices are identified, only the last is returned. The units of
the returned force constants are J/m^2. If no force constant matrix can be found in the log file, None is
returned.
loadGeometry()
Return the optimum geometry of the molecular configuration from the Gaussian log file. If multiple such
geometries are identified, only the last is returned.
loadNegativeFrequency()
Return the negative frequency from a transition state frequency calculation in cm^-1.
loadScanEnergies()
Extract the optimized energies in J/mol from a log file, e.g. the result of a Gaussian “Scan” quantum
chemistry calculation.
loadZeroPointEnergy()
Load the unscaled zero-point energy in J/mol from a Gaussian log file.
arkane.qchem.QchemLog
class arkane.qchem.QChemLog(path)
Represent an output file from QChem. The attribute path refers to the location on disk of the QChem output file
of interest. Methods are provided to extract a variety of information into Arkane classes and/or NumPy arrays.
getNumberOfAtoms()
Return the number of atoms in the molecular configuration used in the QChem output file.
get_optical_isomers_and_symmetry_number()
This method uses the symmetry package from RMG’s QM module and returns a tuple where the first
element is the number of optical isomers and the second element is the symmetry number.
loadConformer(symmetry=None, spinMultiplicity=0, opticalIsomers=None, label=”)
Load the molecular degree of freedom data from an output file created as the result of a QChem “Freq”
calculation. As QChem’s guess of the external symmetry number is not always correct, you can use the
symmetry parameter to substitute your own value; if not provided, the value in the QChem output file will
be adopted.
loadEnergy(zpe_scale_factor=1.0)
Load the energy in J/mol from a QChem log file. Only the last energy in the file is returned. The zero-point
energy is not included in the returned value.
loadForceConstantMatrix()
Return the force constant matrix (in Cartesian coordinates) from the QChem log file. If multiple such
matrices are identified, only the last is returned. The units of the returned force constants are J/m^2. If no
force constant matrix can be found in the log file, None is returned.
loadGeometry()
Return the optimum geometry of the molecular configuration from the QChem log file. If multiple such
geometries are identified, only the last is returned.
loadNegativeFrequency()
Return the imaginary frequency from a transition state frequency calculation in cm^-1.
loadScanEnergies()
Extract the optimized energies in J/mol from a QChem log file, e.g. the result of a QChem “PES Scan”
quantum chemistry calculation.
loadZeroPointEnergy()
Load the unscaled zero-point energy in J/mol from a QChem output file.
arkane.molpro.MolproLog
class arkane.molpro.MolproLog(path)
Represents a Molpro log file. The attribute path refers to the location on disk of the Molpro log file of interest.
Methods are provided to extract a variety of information into Arkane classes and/or NumPy arrays.
getNumberOfAtoms()
Return the number of atoms in the molecular configuration used in the MolPro log file.
get_optical_isomers_and_symmetry_number()
This method uses the symmetry package from RMG’s QM module and returns a tuple where the first
element is the number of optical isomers and the second element is the symmetry number.
loadConformer(symmetry=None, spinMultiplicity=0, opticalIsomers=None, label=”)
Load the molecular degree of freedom data from a log file created as the result of a MolPro “Freq” quantum
chemistry calculation with the thermo printed.
loadEnergy(zpe_scale_factor=1.0)
Return either the f12 or MRCI energy in J/mol from a Molpro Logfile. If the MRCI job outputted the
MRCI+Davidson energy, the latter is returned. For CCSD(T)-f12, the function determines which energy
(f12a or f12b) to use based on the basis set, which it will parse out of the Molpro file. For the vdz and vtz
basis sets f12a is a better approximation, but for higher basis sets f12b is a better approximation.
loadForceConstantMatrix()
Print the force constant matrix by including the print, hessian command in the input file
loadGeometry()
Return the optimum geometry of the molecular configuration from the Molpro .out file. If multiple such
geometries are identified, only the last is returned.
loadNegativeFrequency()
Return the negative frequency from a transition state frequency calculation in cm^-1.
loadScanEnergies()
Rotor scans are not implemented in Molpro
loadZeroPointEnergy()
Load the unscaled zero-point energy in J/mol from a MolPro log file.
arkane.input.loadInputFile(path)
Load the Arkane input file located at path on disk, and return a list of the jobs defined in that file.
arkane.KineticsJob
usedTST - a boolean representing if TST was used to calculate the kinetics if kinetics is already given in
the input, then it is False.
Tlist
The temperatures at which the k(T) values are computed.
Tmax
The maximum temperature at which the computed k(T) values are valid, or None if not defined.
Tmin
The minimum temperature at which the computed k(T) values are valid, or None if not defined.
draw(outputDirectory, format=’pdf’)
Generate a PDF drawing of the reaction. This requires that Cairo and its Python wrapper be available; if
not, the drawing is not generated.
You may also generate different formats of drawings, by changing format to one of the following: pdf, svg,
png.
execute(outputFile=None, plot=True)
Execute the kinetics job, saving the results to the given outputFile on disk.
generateKinetics(Tlist=None)
Generate the kinetics data for the reaction and fit it to a modified Arrhenius model.
plot(outputDirectory)
Plot both the raw kinetics data and the Arrhenius fit versus temperature. The plot is saved to the file
kinetics.pdf in the output directory. The plot is not generated if matplotlib is not installed.
save(outputFile)
Save the results of the kinetics job to the file located at path on disk.
arkane.Arkane
Attribute Description
jobList A list of the jobs to execute
inputFile The path of the input file defining the jobs to execute
outputDirectory The directory in which to write the output files
verbose The level of detail in the generated logging messages
The output directory defaults to the same directory as the input file if not explicitly specified.
To use this class programmatically, create an instance and set its attributes using either the __init__()
method or by directly accessing the attributes, and then invoke the execute() method. You can also popu-
late the attributes from the command line using the parseCommandLineArguments() method before running
execute().
execute()
Execute, in order, the jobs found in input file specified by the inputFile attribute.
getLibraries()
Get RMG kinetics and thermo libraries
initializeLog(verbose=20, logFile=None)
Set up a logger for Arkane to use to print output to stdout. The verbose parameter is an integer specifying
the amount of log text seen at the console; the levels correspond to those of the logging module.
loadInputFile(inputFile)
Load a set of jobs from the given inputFile on disk. Returns the loaded set of jobs as a list.
logFooter(level=20)
Output a footer to the log.
logHeader(level=20)
Output a header containing identifying information about Arkane to the log.
parseCommandLineArguments()
Parse the command-line arguments being passed to Arkane. This uses the argparse module, which
ensures that the command-line arguments are sensible, parses them, and returns them.
arkane.output.prettify(string, indent=4)
Return a “pretty” version of the given string, representing a snippet of Python code such as a representation of
an object or function. This involves splitting of tuples, lists, and dicts (including parameter lists) onto multiple
lines, indenting as appropriate for readability.
class arkane.output.PrettifyVisitor(level=0, indent=4)
A class for traversing an abstract syntax tree to assemble a prettier version of the code used to create the tree.
Used by the prettify() function.
generic_visit(node)
Called if no explicit visitor function exists for a node.
visit(node)
Visit a node.
visit_Call(node)
Return a pretty representation of the class or function call represented by node.
visit_Dict(node)
Return a pretty representation of the dict represented by node.
visit_List(node)
Return a pretty representation of the list represented by node.
visit_Num(node)
Return a pretty representation of the number represented by node.
visit_Str(node)
Return a pretty representation of the string represented by node.
visit_Tuple(node)
Return a pretty representation of the tuple represented by node.
arkane.PressureDependenceJob
Attribute Description
Tmin The minimum temperature at which to compute 𝑘(𝑇, 𝑃 ) values
Tmax The maximum temperature at which to compute 𝑘(𝑇, 𝑃 ) values
Tcount The number of temperatures at which to compute 𝑘(𝑇, 𝑃 ) values
Pmin The minimum pressure at which to compute 𝑘(𝑇, 𝑃 ) values
Pmax The maximum pressure at which to compute 𝑘(𝑇, 𝑃 ) values
Pcount The number of pressures at which to compute 𝑘(𝑇, 𝑃 ) values
Emin The minimum energy to use to compute 𝑘(𝑇, 𝑃 ) values
Emax The maximum energy to use to compute 𝑘(𝑇, 𝑃 ) values
maximumGrainSize The maximum energy grain size to use to compute 𝑘(𝑇, 𝑃 ) values
minimumGrainCount The minimum number of energy grains to use to compute 𝑘(𝑇, 𝑃 ) values
method The method to use to reduce the master equation to 𝑘(𝑇, 𝑃 ) values
interpolationModel The interpolation model to fit to the computed 𝑘(𝑇, 𝑃 ) values
maximumAtoms The maximum number of atoms to apply pressure dependence to (in RMG jobs)
activeKRotor A flag indicating whether to treat the K-rotor as active or adiabatic
activeJRotor A flag indicating whether to treat the J-rotor as active or adiabatic
rmgmode A flag that toggles “RMG mode”, described below
network The unimolecular reaction network
Tlist An array of temperatures at which to compute 𝑘(𝑇, 𝑃 ) values
Plist An array of pressures at which to compute 𝑘(𝑇, 𝑃 ) values
Elist An array of energies to use to compute 𝑘(𝑇, 𝑃 ) values
In RMG mode, several alterations to the k(T,P) algorithm are made both for speed and due to the nature of the
approximations used:
• Densities of states are not computed for product channels
• Arbitrary rigid rotor moments of inertia are included in the active modes; these cancel in the ILT and
equilibrium expressions
• k(E) for each path reaction is computed in the direction A -> products, where A is always an explored
isomer; the high-P kinetics are reversed if necessary for this purpose
• Thermodynamic parameters are always used to compute the reverse k(E) from the forward k(E) for each
path reaction
RMG mode should be turned off by default except in RMG jobs.
Plist
The pressures at which the k(T,P) values are computed.
Pmax
The maximum pressure at which the computed k(T,P) values are valid, or None if not defined.
Pmin
The minimum pressure at which the computed k(T,P) values are valid, or None if not defined.
Tlist
The temperatures at which the k(T,P) values are computed.
Tmax
The maximum temperature at which the computed k(T,P) values are valid, or None if not defined.
Tmin
The minimum temperature at which the computed k(T,P) values are valid, or None if not defined.
copy()
Return a copy of the pressure dependence job.
draw(outputDirectory, format=’pdf’)
Generate a PDF drawing of the pressure-dependent reaction network. This requires that Cairo and its
Python wrapper be available; if not, the drawing is not generated.
You may also generate different formats of drawings, by changing format to one of the following: pdf, svg,
png.
execute(outputFile, plot, format=’pdf’, print_summary=True)
Execute a PressureDependenceJob
fitInterpolationModel(Tdata, Pdata, kdata, kunits)
Fit an interpolation model to a pressure dependent rate
fitInterpolationModels()
Fit all pressure dependent rates with interpolation models
generatePressureList()
Returns an array of pressures based on the interpolation model, minimum and maximum pressures Pmin
and Pmax in Pa, and the number of pressures Pcount. For Chebyshev polynomials a Gauss-Chebyshev
distribution is used; for all others a linear distribution on an logarithmic pressure domain is used. Note
that the Gauss-Chebyshev grid does not place Pmin and Pmax at the endpoints, yet the interpolation is still
valid up to these values.
generateTemperatureList()
Returns an array of temperatures based on the interpolation model, minimum and maximum temperatures
Tmin and Tmax in K, and the number of temperatures Tcount. For Chebyshev polynomials a Gauss-
Chebyshev distribution is used; for all others a linear distribution on an inverse temperature domain is used.
Note that the Gauss-Chebyshev grid does not place Tmin and Tmax at the endpoints, yet the interpolation
is still valid up to these values.
initialize()
Initialize a PressureDependenceJob
maximumGrainSize
The maximum allowed energy grain size, or None if not defined.
plot(outputDirectory)
Plot pressure dependent rates
save(outputFile)
Save the output of a pressure dependent job
saveInputFile(path)
Save an Arkane input file for the pressure dependence job to path on disk.
arkane.StatMechJob
arkane.ThermoJob
The rmgpy.chemkin module contains functions for reading and writing of Chemkin and Chemkin-like files.
Function Description
loadChemkinFile() Load a reaction mechanism from a Chemkin file
loadSpeciesDictionary() Load a species dictionary from a file
loadTransportFile() Load a Chemkin transport properties file
readKineticsEntry() Read a single reaction entry from a Chemkin file
readReactionComments() Read the comments associated with a reaction entry
readReactionsBlock() Read the reactions block of a Chemkin file
readThermoEntry() Read a single thermodynamics entry from a Chemkin file
removeCommentFromLine() Remove comment text from a line of a Chemkin file or species dictionary
Function Description
saveChemkinFile() Save a reaction mechanism to a Chemkin file
saveSpeciesDictionary() Save a species dictionary to a file
saveTransportFile() Save a Chemkin transport properties file
saveHTMLFile() Save an HTML file representing a Chemkin mechanism
saveJavaKineticsLibrary() Save a mechanism to a (Chemkin-like) kinetics library for RMG-Java
getSpeciesIdentifier() Return the Chemkin-valid identifier for a given species
markDuplicateReactions() Find and mark all duplicate reactions in a mechanism
writeKineticsEntry() Write a single reaction entry to a Chemkin file
writeThermoEntry() Write a single thermodynamics entry to a Chemkin file
Main functions
Helper functions
Main functions
rmgpy.chemkin.saveHTMLFile(path, readComments=True)
Save an output HTML file from the contents of a RMG-Java output folder
rmgpy.chemkin.saveJavaKineticsLibrary(path, species, reactions)
Save the reaction files for a RMG-Java kinetics library: pdepreactions.txt and reactions.txt given a list of reac-
tions, with species.txt containing the RMG-Java formatted dictionary.
Helper functions
rmgpy.chemkin.getSpeciesIdentifier(species)
Return a string identifier for the provided species that can be used in a Chemkin file. Although the Chemkin
format allows up to 16 characters for a species identifier, this function uses a maximum of 10 to ensure that all
reaction equations fit in the maximum limit of 52 characters.
rmgpy.chemkin.writeKineticsEntry(reaction, speciesList, verbose=True, javaLibrary=False, com-
mented=False)
Return a string representation of the reaction as used in a Chemkin file. Use verbose = True to turn on kinetics
comments. Use commented = True to comment out the entire reaction. Use javaLibrary = True in order to
generate a kinetics entry suitable for an RMG-Java kinetics library.
rmgpy.chemkin.writeThermoEntry(species, elementCounts=None, verbose=True)
Return a string representation of the NASA model readable by Chemkin. To use this method you must have
exactly two NASA polynomials in your model, and you must use the seven-coefficient forms for each.
rmgpy.chemkin.markDuplicateReactions(reactions)
For a given list of reactions, mark all of the duplicate reactions as understood by Chemkin.
This is pretty slow (quadratic in size of reactions list) so only call it if you’re really worried you may have
undetected duplicate reactions.
The rmgpy.constants module contains module-level variables defining relevant physical constants relevant in
chemistry applications. The recommended method of importing this module is
Class/Function Description
Entry An entry in a database
Database A database of entries
LogicNode A node in a database that represents a logical collection of entries
LogicAnd A logical collection of entries, where all entries in the collection must match
LogicOr A logical collection of entries, where any entry in the collection can match
makeLogicNode() Create a LogicNode based on a string representation
Class Description
ThermoDepository A depository of all thermodynamics parameters for one or more species
ThermoLibrary A library of curated thermodynamics parameters for one or more species
ThermoGroups A representation of a portion of a database for implementing the Benson group additivity
method
ThermoDatabase An entire thermodynamics database, including depositories, libraries, and groups
Class Description
DepositoryReaction A reaction with kinetics determined from querying a kinetics depository
LibraryReaction A reaction with kinetics determined from querying a kinetics library
TemplateReaction A reaction with kinetics determined from querying a kinetics group additivity or rate rules
method
ReactionRecipe A sequence of actions that represent the process of a chemical reaction
KineticsDepository A depository of all kinetics parameters for one or more reactions
KineticsLibrary A library of curated kinetics parameters for one or more reactions
KineticsGroups A set of group additivity values for a reaction family, organized in a tree
KineticsRules A set of rate rules for a reaction family
KineticsFamily A kinetics database for one reaction family, including depositories, libraries, groups, and
rules
KineticsDatabase A kinetics database for all reaction families, including depositories, libraries, groups, and
rules
Class Description
GroupFrequencies A set of characteristic frequencies for a group in the frequency database
StatmechDepository A depository of all statistical mechanics parameters for one or more species
StatmechLibrary A library of curated statistical mechanics parameters for one or more species
StatmechGroups A set of characteristic frequencies for various functional groups, organized in a tree
StatmechDatabase An entire statistical mechanics database, including depositories, libraries, and groups
Class/Function Description
DirectFit DQED class for fitting a small number of vibrational frequencies and hindered rotors
PseudoFit DQED class for fitting a large number of vibrational frequencies and hindered rotors by
assuming degeneracies for both
PseudoRotorFit DQED class for fitting a moderate number of vibrational frequencies and hindered rotors
by assuming degeneracies for hindered rotors only
fitStatmechDirect() Directly fit a small number of vibrational frequencies and hindered rotors
fitStatmechPseudo() Fit a large number of vibrational frequencies and hindered rotors by assuming degenera-
cies for both
fitStatmechPseudoRotors()
Fit a moderate number of vibrational frequencies and hindered rotors by assuming de-
generacies for hindered rotors only
fitStatmechToHeatCapacity()
Fit vibrational and torsional degrees of freedom to heat capacity data
rmgpy.data.base.Database
In constructing the tree, it is important to develop a hierarchy such that siblings are mutually exclusive, to
ensure that there is a unique path of descent down a tree for each structure. If non-mutually exclusive siblings
are encountered, a warning is raised and the parent of the siblings is returned.
There is no requirement that the children of a node span the range of more specific permutations of the parent.
As the database gets more complex, attempting to maintain complete sets of children for each parent in each
database rapidly becomes untenable, and is against the spirit of extensibility behind the database development.
You must derive from this class and implement the loadEntry(), saveEntry(),
processOldLibraryEntry(), and generateOldLibraryEntry() methods in order to load and
save from the new and old database formats.
ancestors(node)
Returns all the ancestors of a node, climbing up the tree to the top.
areSiblings(node, nodeOther)
Return True if node and nodeOther have the same parent node. Otherwise, return False. Both node and
nodeOther must be Entry types with items containing Group or LogicNode types.
descendTree(structure, atoms, root=None, strict=False)
Descend the tree in search of the functional group node that best matches the local structure around atoms
in structure.
If root=None then uses the first matching top node.
Returns None if there is no matching root.
Set strict to True if all labels in final matched node must match that of the structure. This is used in
kinetics groups to find the correct reaction template, but not generally used in other GAVs due to species
generally not being prelabeled.
descendants(node)
Returns all the descendants of a node, climbing down the tree to the bottom.
generateOldTree(entries, level)
Generate a multi-line string representation of the current tree using the old-style syntax.
getEntriesToSave()
Return a sorted list of the entries in this database that should be saved to the output file.
Then renumber the entry indexes so that we never have any duplicate indexes.
getSpecies(path, resonance=True)
Load the dictionary containing all of the species in a kinetics library or depository.
load(path, local_context=None, global_context=None)
Load an RMG-style database from the file at location path on disk. The parameters local_context and
global_context are used to provide specialized mapping of identifiers in the input file to corresponding
functions to evaluate. This method will automatically add a few identifiers required by all data entries, so
you don’t need to provide these.
loadOld(dictstr, treestr, libstr, numParameters, numLabels=1, pattern=True)
Load a dictionary-tree-library based database. The database is stored in three files: dictstr is the path to
the dictionary, treestr to the tree, and libstr to the library. The tree is optional, and should be set to ‘’ if not
desired.
loadOldDictionary(path, pattern)
Parse an old-style RMG database dictionary located at path. An RMG dictionary is a list of key-value
pairs of a one-line string key and a multi-line string value. Each record is separated by at least one empty
line. Returns a dict object with the values converted to Molecule or Group objects depending on the
value of pattern.
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
saveOldLibrary(path)
Save the current database library to a text file using the old-style syntax.
saveOldTree(path)
Save the current database tree to a text file using the old-style syntax.
rmgpy.data.kinetics.DepositoryReaction
𝑄‡ (𝑇 )
(︂ )︂
𝑘B 𝑇 𝐸0
𝑘(𝑇 ) = 𝜅(𝑇 ) exp −
ℎ 𝑄A (𝑇 )𝑄B (𝑇 ) 𝑘B 𝑇
where 𝑄‡ is the partition function of the transition state, 𝑄A and 𝑄B are the partition function of the
reactants, 𝐸0 is the ground-state energy difference from the transition state to the reactants, 𝑇 is the
absolute temperature, 𝑘B is the Boltzmann constant, and ℎ is the Planck constant. 𝜅(𝑇 ) is an optional
tunneling correction.
calculateTSTRateCoefficients(self, ndarray Tlist) → ndarray
There are a number of ways of determining the correct pairing for bimolecular reactions. Here we try a
simple similarity analysis by comparing the number of heavy atoms (C/O/N/S at the moment). This should
work most of the time, but a more rigorous algorithm may be needed for some cases.
generateReverseRateCoefficient(self, bool network_kinetics=False, Tmin=None, Tmax=None)
Generate and return a rate coefficient model for the reverse reaction. Currently this only works if the
kinetics attribute is one of several (but not necessarily all) kinetics types.
getEnthalpiesOfReaction(self, ndarray Tlist) → ndarray
Return the enthalpies of reaction in J/mol evaluated at temperatures Tlist in K.
getEnthalpyOfReaction(self, double T ) → double
Return the enthalpy of reaction in J/mol evaluated at temperature T in K.
getEntropiesOfReaction(self, ndarray Tlist) → ndarray
Return the entropies of reaction in J/mol*K evaluated at temperatures Tlist in K.
getEntropyOfReaction(self, double T ) → double
Return the entropy of reaction in J/mol*K evaluated at temperature T in K.
getEquilibriumConstant(self, double T, str type=’Kc’) → double
Return the equilibrium constant for the reaction at the specified temperature T in K. The type parameter
lets you specify the quantities used in the equilibrium constant: Ka for activities, Kc for concentrations
(default), or Kp for pressures. Note that this function currently assumes an ideal gas mixture.
getEquilibriumConstants(self, ndarray Tlist, str type=’Kc’) → ndarray
Return the equilibrium constants for the reaction at the specified temperatures Tlist in K. The type parame-
ter lets you specify the quantities used in the equilibrium constant: Ka for activities, Kc for concentrations
(default), or Kp for pressures. Note that this function currently assumes an ideal gas mixture.
getFreeEnergiesOfReaction(self, ndarray Tlist) → ndarray
Return the Gibbs free energies of reaction in J/mol evaluated at temperatures Tlist in K.
getFreeEnergyOfReaction(self, double T ) → double
Return the Gibbs free energy of reaction in J/mol evaluated at temperature T in K.
getRateCoefficient(self, double T, double P=0) → double
Return the overall rate coefficient for the forward reaction at temperature T in K and pressure P in Pa,
including any reaction path degeneracies.
If diffusionLimiter is enabled, the reaction is in the liquid phase and we use a diffusion limitation to correct
the rate. If not, then use the intrinsic rate coefficient.
getSource()
Return the database that was the source of this reaction. For a DepositoryReaction this should be a Kinet-
icsDepository object.
getStoichiometricCoefficient(self, Species spec) → int
Return the stoichiometric coefficient of species spec in the reaction. The stoichiometric coefficient is
increased by one for each time spec appears as a product and decreased by one for each time spec appears
as a reactant.
getSurfaceRateCoefficient(self, double T, double surfaceSiteDensity) → double
Return the overall surface rate coefficient for the forward reaction at temperature T in K with surface site
density surfaceSiteDensity in mol/m2. Value is returned in combination of [m,mol,s]
getURL(self )
Get a URL to search for this reaction in the rmg website.
get_mean_sigma_and_epsilon(self, bool reverse=False)
Calculates the collision diameter (sigma) using an arithmetic mean Calculates the well depth (epsilon)
using a geometric mean If reverse is False the above is calculated for the reactants, otherwise for the
products
get_reduced_mass(self, bool reverse=False)
Returns the reduced mass of the reactants if reverse is False Returns the reduced mass of the products if
reverse is True
hasTemplate(self, list reactants, list products) → bool
Return True if the reaction matches the template of reactants and products, which are both lists of
Species objects, or False if not.
index
‘int’
Type index
isAssociation(self ) → bool
−−
Return True if the reaction represents an association reaction A + B ↽−⇀
− C or False if not.
isBalanced(self ) → bool
Return True if the reaction has the same number of each atom on each side of the reaction equation, or
False if not.
isDissociation(self ) → bool
−−
Return True if the reaction represents a dissociation reaction A ↽−⇀
− B + C or False if not.
isIsomerization(self ) → bool
Return True if the reaction represents an isomerization reaction A −
↽−
−⇀
− B or False if not.
isIsomorphic(self, Reaction other, bool eitherDirection=True, bool checkIdentical=False, bool
checkOnlyLabel=False, bool checkTemplateRxnProducts=False, bool generateIni-
tialMap=False, bool strict=True) → bool
Return True if this reaction is the same as the other reaction, or False if they are different. The compar-
ison involves comparing isomorphism of reactants and products, and doesn’t use any kinetic information.
Parameters
• eitherDirection (bool, optional) – if False,then the reaction direction must
match.
• checkIdentical (bool, optional) – if True, check that atom ID’s match (used for
checking degeneracy)
• checkOnlyLabel (bool, optional) – if True, only check the string representation,
ignoring molecular structure comparisons
reactants
list
Type reactants
reverseThisArrheniusRate(self, Arrhenius kForward, str reverseUnits, Tmin=None, Tmax=None)
Reverses the given kForward, which must be an Arrhenius type. You must supply the correct units for the
reverse rate. The equilibrium constant is evaluated from the current reaction instance (self).
reversible
‘bool’
Type reversible
specificCollider
rmgpy.species.Species
Type specificCollider
toCantera(self, speciesList=None, useChemkinIdentifier=False)
Converts the RMG Reaction object to a Cantera Reaction object with the appropriate reaction class.
If useChemkinIdentifier is set to False, the species label is used instead. Be sure that species’ labels are
unique when setting it False.
toChemkin(self, speciesList=None, kinetics=True)
Return the chemkin-formatted string for this reaction.
If kinetics is set to True, the chemkin format kinetics will also be returned (requires the speciesList to
figure out third body colliders.) Otherwise, only the reaction string will be returned.
toLabeledStr(self, use_index=False)
the same as __str__ except that the labels are assumed to exist and used for reactant and products rather
than the labels plus the index in parentheses
transitionState
rmgpy.species.TransitionState
Type transitionState
rmgpy.data.base.Entry
Attribute Description
index A unique nonnegative integer index for the entry
label A unique string identifier for the entry (or ‘’ if not used)
item The item that this entry represents
parent The parent of the entry in the hierarchy (or None if not used)
children A list of the children of the entry in the hierarchy (or None if not used)
data The data to associate with the item
reference A Reference object containing bibliographic reference information to the source of the
data
referenceType The way the data was determined: 'theoretical', 'experimental', or 'review'
shortDesc A brief (one-line) description of the data
longDesc A long, verbose description of the data
rank An integer indicating the degree of confidence in the entry data, or None if not used
nodalDis- A float representing the distance of a given entry from it’s parent entry
tance
rmgpy.data.statmech.GroupFrequencies
rmgpy.data.kinetics.KineticsDatabase
class rmgpy.data.kinetics.KineticsDatabase
A class for working with the RMG kinetics database.
extractSourceFromComments(reaction)
reaction: A reaction object containing kinetics data and kinetics data comments. Should be ei-
ther a PDepReaction, LibraryReaction, or TemplateReaction object as loaded from the
rmgpy.chemkin.loadChemkinFile function
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 ‘Rate Rules’, ‘Training’, ‘Library’, or ‘PDep’. A reaction can only
be estimated using one of these methods.
source = {‘RateRules’: (Family_Label, OriginalTemplate, RateRules), ‘Library’:
String_Name_of_Library_Used, ‘PDep’: Network_Index, ‘Training’: (Family_Label, Train-
ing_Reaction_Entry), }
generate_reactions(reactants, products=None, only_families=None, resonance=True)
Generate all reactions between the provided list of one or two reactants, which should be Molecule
objects. This method searches the depository, libraries, and groups, in that order.
generate_reactions_from_families(reactants, products=None, only_families=None, reso-
nance=True)
Generate all reactions between the provided list or tuple of one or two reactants, which can be either
Molecule objects or Species objects. This method can apply all kinetics families or a selected subset.
Parameters
• reactants – Molecules or Species to react
• products – List of Molecules or Species of desired product structures (optional)
• only_families – List of family labels to generate reactions from (optional) Default is
to generate reactions from all families
• resonance – Flag to generate resonance structures for reactants and products (optional)
Default is True, resonance structures will be generated
Returns List of reactions containing Species objects with the specified reactants and products.
generate_reactions_from_libraries(reactants, products=None)
Find all reactions from all loaded kinetics library involving the provided reactants, which can be either
Molecule objects or Species objects.
generate_reactions_from_library(library, reactants, products=None)
Find all reactions from the specified kinetics library involving the provided reactants, which can be either
Molecule objects or Species objects.
getForwardReactionForFamilyEntry(entry, family, thermoDatabase)
For a given entry for a reaction of the given reaction family (the string label of the family), return the
reaction with kinetics and degeneracy for the “forward” direction as defined by the reaction family. For
families that are their own reverse, the direction the kinetics is given in will be preserved. If the entry
contains functional groups for the reactants, assume that it is given in the forward direction and do noth-
ing. Returns the reaction in the direction consistent with the reaction family template, and the matching
template. Note that the returned reaction will have its kinetics and degeneracy set appropriately.
In order to reverse the reactions that are given in the reverse of the direction the family is defined, we
need to compute the thermodynamics of the reactants and products. For this reason you must also pass the
thermoDatabase to use to generate the thermo data.
load(path, families=None, libraries=None, depositories=None)
Load the kinetics database from the given path on disk, where path points to the top-level folder of the
families database.
loadFamilies(path, families=None, depositories=None)
Load the kinetics families from the given path on disk, where path points to the top-level folder of the
kinetics families.
The families argument accepts a single item or list of the following:
• Specific kinetics family labels
• Names of family sets defined in recommended.py
• ‘all’
• ‘none’
If all items begin with a ! (e.g. [‘!H_Abstraction’]), then the selection will be inverted to families NOT in
the list.
loadLibraries(path, libraries=None)
Load the listed kinetics libraries from the given path on disk.
Loads them all if libraries list is not specified or None. The path points to the folder of kinetics libraries
in the database, and the libraries should be in files like <path>/<library>.py.
loadOld(path)
Load the old RMG kinetics database from the given path on disk, where path points to the top-level folder
of the old RMG database.
loadRecommendedFamiliesList(filepath)
Load the recommended families from the given file. The file is usually stored at ‘kinet-
ics/families/recommended.py’.
The old style was as a dictionary named recommendedFamilies containing all family names as keys with
True/False values.
The new style is as multiple sets with unique names which can be used individually or in combination.
Both styles can be loaded by this method.
react_molecules(molecules, products=None, only_families=None, prod_resonance=True)
Generate reactions from all families for the input molecules.
reconstructKineticsFromSource(reaction, source, fixBarrierHeight=False, forcePositiveBar-
rier=False)
Reaction is the original reaction with original kinetics. Note that for Library and PDep reactions this
function does not do anything other than return the original kinetics. . .
You must enter source data in the appropriate format such as returned from returned from
self.extractSourceFromComments, self-constructed. fixBarrierHeight and forcePositiveBarrier will
change the kinetics based on the Reaction.fixBarrierHeight function. Return Arrhenius form kinetics if
the source is from training reaction or rate rules.
save(path)
Save the kinetics database to the given path on disk, where path points to the top-level folder of the kinetics
database.
saveFamilies(path)
Save the kinetics families to the given path on disk, where path points to the top-level folder of the kinetics
families.
saveLibraries(path)
Save the kinetics libraries to the given path on disk, where path points to the top-level folder of the kinetics
libraries.
saveOld(path)
Save the old RMG kinetics database to the given path on disk, where path points to the top-level folder of
the old RMG database.
saveRecommendedFamilies(path)
Save the recommended families to [path]/recommended.py. The old style was as a dictionary named
recommendedFamilies. The new style is as multiple sets with different labels.
rmgpy.data.kinetics.KineticsDepository
areSiblings(node, nodeOther)
Return True if node and nodeOther have the same parent node. Otherwise, return False. Both node and
nodeOther must be Entry types with items containing Group or LogicNode types.
descendTree(structure, atoms, root=None, strict=False)
Descend the tree in search of the functional group node that best matches the local structure around atoms
in structure.
If root=None then uses the first matching top node.
Returns None if there is no matching root.
Set strict to True if all labels in final matched node must match that of the structure. This is used in
kinetics groups to find the correct reaction template, but not generally used in other GAVs due to species
generally not being prelabeled.
descendants(node)
Returns all the descendants of a node, climbing down the tree to the bottom.
generateOldTree(entries, level)
Generate a multi-line string representation of the current tree using the old-style syntax.
getEntriesToSave()
Return a sorted list of the entries in this database that should be saved to the output file.
Then renumber the entry indexes so that we never have any duplicate indexes.
getSpecies(path, resonance=True)
Load the dictionary containing all of the species in a kinetics library or depository.
loadOld(dictstr, treestr, libstr, numParameters, numLabels=1, pattern=True)
Load a dictionary-tree-library based database. The database is stored in three files: dictstr is the path to
the dictionary, treestr to the tree, and libstr to the library. The tree is optional, and should be set to ‘’ if not
desired.
loadOldDictionary(path, pattern)
Parse an old-style RMG database dictionary located at path. An RMG dictionary is a list of key-value
pairs of a one-line string key and a multi-line string value. Each record is separated by at least one empty
line. Returns a dict object with the values converted to Molecule or Group objects depending on the
value of pattern.
loadOldLibrary(path, numParameters, numLabels=1)
Parse an RMG database library located at path.
loadOldTree(path)
Parse an old-style RMG database tree located at path. An RMG tree is an n-ary tree representing the
hierarchy of items in the dictionary.
matchNodeToChild(parentNode, childNode)
Return True if parentNode is a parent of childNode. Otherwise, return False. Both parentNode and
childNode must be Entry types with items containing Group or LogicNode types. If parentNode and
childNode are identical, the function will also return False.
matchNodeToNode(node, nodeOther)
Return True if node and nodeOther are identical. Otherwise, return False. Both node and nodeOther must
be Entry types with items containing Group or LogicNode types.
matchNodeToStructure(node, structure, atoms, strict=False)
Return True if the structure centered at atom matches the structure at node in the dictionary. The structure
at node should have atoms with the appropriate labels because they are set on loading and never change.
However, the atoms in structure may not have the correct labels, hence the atoms parameter. The atoms
parameter may include extra labels, and so we only require that every labeled atom in the functional group
represented by node has an equivalent labeled atom in structure.
Matching to structure is more strict than to node. All labels in structure must be found in node. However
the reverse is not true, unless strict is set to True.
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
rmgpy.data.kinetics.KineticsFamily
There are a few reaction families that are their own reverse (hydrogen abstraction and intramolecular hydrogen
migration); for these reverseTemplate and reverseRecipe will both be None.
addAtomLabelsForReaction(reaction, output_with_resonance=True)
Apply atom labels on a reaction using the appropriate atom labels from this reaction family.
The reaction is modified in place containing species objects with the atoms labeled. If out-
put_with_resonance is True, all resonance structures are generated with labels. If false, only the first
resonance structure sucessfully able to map to the reaction is used. None is returned.
addEntry(parent, grp, name)
Adds a group entry with parent parent group structure grp and group name name
addKineticsRulesFromTrainingSet(thermoDatabase=None, trainIndices=None)
For each reaction involving real reactants and products in the training set, add a rate rule for that reaction.
addReverseAttribute(rxn, react_non_reactive=True)
For rxn (with species’ objects) from families with ownReverse, this method adds a reverse attribute that
contains the reverse reaction information (like degeneracy)
Returns True if successful and False if the reverse reaction is forbidden. Will raise a KineticsError if
unsuccessful for other reasons.
ancestors(node)
Returns all the ancestors of a node, climbing up the tree to the top.
applyRecipe(reactantStructures, forward=True, unique=True)
Apply the recipe for this reaction family to the list of Molecule objects reactantStructures. The atoms
of the reactant structures must already be tagged with the appropriate labels. Returns a list of structures
corresponding to the products after checking that the correct number of products was produced.
areSiblings(node, nodeOther)
Return True if node and nodeOther have the same parent node. Otherwise, return False. Both node and
nodeOther must be Entry types with items containing Group or LogicNode types.
calculateDegeneracy(reaction)
For a reaction with Molecule or Species objects given in the direction in which the kinetics are defined,
compute the reaction-path degeneracy.
This method by default adjusts for double counting of identical reactants. This should only be adjusted
once per reaction. To not adjust for identical reactants (since you will be reducing them later in the
algorithm), add ignoreSameReactants= True to this method.
cleanTreeGroups(thermoDatabase=None)
clears groups and rules in the tree, generates an appropriate root group to start from and then reads training
reactions Note this only works if a single top node (not a logic node) can be generated
crossValidate(folds=5, templateRxnMap=None, T=1000.0, iters=0, random_state=1)
Perform K-fold cross validation on an automatically generated tree at temperature T after finding an ap-
propriate node for kinetics estimation it will move up the tree iters times. Returns a dictionary mapping
{rxn:Ln(k_Est/k_Train)}
crossValidateOld(folds=5, T=1000.0, random_state=1, estimator=’rate rules’, thermo-
Database=None)
Perform K-fold cross validation on an automatically generated tree at temperature T Returns a dictionary
mapping {rxn:Ln(k_Est/k_Train)}
descendTree(structure, atoms, root=None, strict=False)
Descend the tree in search of the functional group node that best matches the local structure around atoms
in structure.
If root=None then uses the first matching top node.
Returns None if there is no matching root.
Set strict to True if all labels in final matched node must match that of the structure. This is used in
kinetics groups to find the correct reaction template, but not generally used in other GAVs due to species
generally not being prelabeled.
descendants(node)
Returns all the descendants of a node, climbing down the tree to the bottom.
distributeTreeDistances()
fills in nodalDistance (the distance between an entry and its parent) if not already entered with the value
from treeDistances associated with the tree the entry comes from
estimateKineticsUsingGroupAdditivity(template, degeneracy=1)
Determine the appropriate kinetics for a reaction with the given template using group additivity.
Returns just the kinetics, or None.
estimateKineticsUsingRateRules(template, degeneracy=1)
Determine the appropriate kinetics for a reaction with the given template using rate rules.
Returns a tuple (kinetics, entry) where entry is the database entry used to determine the kinetics only if it
is an exact match, and is None if some averaging or use of a parent node took place.
evalExt(parent, ext, extname, templateRxnMap, obj=None, T=1000.0)
evaluates the objective function obj for the extension ext with name extname to the parent entry parent
extendNode(parent, templateRxnMap, thermoDatabase=None, obj=None, T=1000.0)
Constructs an extension to the group parent based on evaluation of the objective function obj
extractSourceFromComments(reaction)
Returns the rate rule associated with the kinetics of a reaction by parsing the comments.
Will return the template associated with the matched rate rule. Returns a tuple containing
(Boolean_Is_Kinetics_From_Training_reaction, Source_Data)
where Exact is a boolean of whether the rate is an exact match, Template is the reaction template used,
RateRules is a list of the rate rule entries containing the kinetics used, and TrainingReactions are ones that
have created rules used in the estimate.
fillKineticsRulesByAveragingUp(verbose=False)
Fill in gaps in the kinetics rate rules by averaging child nodes recursively starting from the top level root
template.
generateOldTree(entries, level)
Generate a multi-line string representation of the current tree using the old-style syntax.
generateProductTemplate(reactants0)
Generate the product structures by applying the reaction template to the top-level nodes. For reactants
defined by multiple structures, only the first is used here; it is assumed to be the most generic.
generateReactions(reactants, products=None, prod_resonance=True)
Generate all reactions between the provided list of one, two, or three reactants, which should be either
single Molecule objects or lists of same. Does not estimate the kinetics of these reactions at this time.
Returns a list of TemplateReaction objects using Molecule objects for both reactants and products
The reactions are constructed such that the forward direction is consistent with the template of this reaction
family.
Parameters
• reactants (list) – List of Molecules to react.
• products (list, optional) – List of Molecules or Species of desired product struc-
tures.
• prod_resonance (bool, optional) – Flag to generate resonance structures for prod-
uct checking. Defaults to True, resonance structures are compared.
Returns List of all reactions containing Molecule objects with the specified reactants and prod-
ucts within this family. Degenerate reactions are returned as separate reactions.
generateTree(obj=None, thermoDatabase=None, T=1000.0)
Generate a tree by greedy optimization based on the objective function obj the optimization is done by
iterating through every group and if the group has more than one training reaction associated with it a set
of potential more specific extensions are generated and the extension that optimizing the objective function
combination is chosen and the iteration starts over at the beginning
additionally the tree structure is simplified on the fly by removing groups that have no kinetics data associ-
ated if their parent has no kinetics data associated and they either have only one child or have two children
one of which has no kinetics data and no children (its parent becomes the parent of its only relevant child
node)
getBackboneRoots()
Returns: the top level backbone node in a unimolecular family.
getEndRoots()
Returns: A list of top level end nodes in a unimolecular family
getEntriesToSave()
Return a sorted list of the entries in this database that should be saved to the output file.
Then renumber the entry indexes so that we never have any duplicate indexes.
getExtensionEdge(parent, templateRxnMap, obj, T )
finds the set of all extension groups to parent such that 1) the extension group divides the set of reactions
under parent 2) No generalization of the extension group divides the set of reactions under parent
We find this by generating all possible extensions of the initial group. Extensions that split reactions are
added to the list. All extensions that do not split reactions and do not create bonds are ignored (although
those that match every reaction are labeled so we don’t search them twice). Those that match all reactions
and involve bond creation undergo this process again.
Principle: Say you have two elementary changes to a group ext1 and ext2 if applying ext1 and ext2 results
in a split at least one of ext1 and ext2 must result in a split
Speed of this algorithm relies heavily on searching non bond creation dimensions once.
getKinetics(reaction, templateLabels, degeneracy=1, estimator=”, returnAllKinetics=True)
Return the kinetics for the given reaction by searching the various depositories as well as generating a
result using the user-specified estimator of either ‘group additivity’ or ‘rate rules’. Unlike the regular
getKinetics() method, this returns a list of results, with each result comprising of
1. the kinetics
2. the source - this will be None if from a template estimate
3. the entry - this will be None if from a template estimate
4. is_forward a boolean denoting whether the matched entry is in the same direction as the inputted
reaction. This will always be True if using rates rules or group additivity. This can be True or False if
using a depository
If returnAllKinetics==False, only the first (best?) matching kinetics is returned.
getKineticsForTemplate(template, degeneracy=1, method=’rate rules’)
Return an estimate of the kinetics for a reaction with the given template and reaction-path degeneracy.
There are two possible methods to use: ‘group additivity’ (new possible RMG-Py behavior) and ‘rate
rules’ (old RMG-Java behavior, and default RMG-Py behavior).
Returns a tuple (kinetics, entry): If it’s estimated via ‘rate rules’ and an exact match is found in the tree,
then the entry is returned as the second element of the tuple. But if an average is used, or the ‘group
additivity’ method, then the tuple returned is (kinetics, None).
getKineticsFromDepository(depository, reaction, template, degeneracy)
Search the given depository in this kinetics family for kinetics for the given reaction. Returns a list of all
of the matching kinetics, the corresponding entries, and True if the kinetics match the forward direction
or False if they match the reverse direction.
getLabeledReactantsAndProducts(reactants, products)
Given reactants, a list of Molecule objects, and products, a list of Molecule objects, return two new
lists of Molecule objects with atoms labeled: one for reactants, one for products. Returned molecules
are totally new entities in memory so input molecules reactants and products won’t be affected. If RMG
cannot find appropriate labels, (None, None) will be returned.
getRateRule(template)
Return the rate rule with the given template. Raises a ValueError if no corresponding entry exists.
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
saveOldTemplate(path)
Save an old-style RMG reaction family template from the location path.
saveOldTree(path)
Save the current database tree to a text file using the old-style syntax.
saveTrainingReactions(reactions, reference=None, referenceType=”, shortDesc=”, longDesc=”,
rank=3)
This function takes a list of reactions appends it to the training reactions file. It ignores the existence of
duplicate reactions.
The rank for each new reaction’s kinetics is set to a default value of 3 unless the user specifies differently
for those reactions.
For each entry, the long description is imported from the kinetics comment.
simpleRegularization(node)
Simplest regularization algorithm All nodes are made as specific as their descendant reactions Training
reactions are assumed to not generalize For example if an particular atom at a node is Oxygen for all of its
descendent reactions a reaction where it is Sulfur will never hit that node unless it is the top node even if
the tree did not split on the identity of that atom
splitReactions(rxns, newgrp)
divides the reactions in rxns between the new group structure newgrp and the old structure with label
oldlabel returns a list of reactions associated with the new group the list of reactions associated with the
old group and a list of the indices of all of the reactions associated with the new group
rmgpy.data.kinetics.KineticsGroups
However, the atoms in structure may not have the correct labels, hence the atoms parameter. The atoms
parameter may include extra labels, and so we only require that every labeled atom in the functional group
represented by node has an equivalent labeled atom in structure.
Matching to structure is more strict than to node. All labels in structure must be found in node. However
the reverse is not true, unless strict is set to True.
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
rmgpy.data.kinetics.KineticsLibrary
checkForDuplicates(markDuplicates=False)
Check that all duplicate reactions in the kinetics library are properly marked (i.e. with their duplicate
attribute set to True). If markDuplicates is set to True, then ignore and mark all duplicate reactions as
duplicate.
convertDuplicatesToMulti()
Merge all marked duplicate reactions in the kinetics library into single reactions with multiple kinetics.
descendTree(structure, atoms, root=None, strict=False)
Descend the tree in search of the functional group node that best matches the local structure around atoms
in structure.
If root=None then uses the first matching top node.
Returns None if there is no matching root.
Set strict to True if all labels in final matched node must match that of the structure. This is used in
kinetics groups to find the correct reaction template, but not generally used in other GAVs due to species
generally not being prelabeled.
descendants(node)
Returns all the descendants of a node, climbing down the tree to the bottom.
generateOldTree(entries, level)
Generate a multi-line string representation of the current tree using the old-style syntax.
getEntriesToSave()
Return a sorted list of the entries in this database that should be saved to the output file.
Then renumber the entry indexes so that we never have any duplicate indexes.
getLibraryReactions()
makes library and template reactions as appropriate from the library comments and returns at list of all of
these LibraryReaction and TemplateReaction objects
getSpecies(path, resonance=True)
Load the dictionary containing all of the species in a kinetics library or depository.
loadOld(path)
Load an old-style RMG kinetics library from the location path.
loadOldDictionary(path, pattern)
Parse an old-style RMG database dictionary located at path. An RMG dictionary is a list of key-value
pairs of a one-line string key and a multi-line string value. Each record is separated by at least one empty
line. Returns a dict object with the values converted to Molecule or Group objects depending on the
value of pattern.
loadOldLibrary(path, numParameters, numLabels=1)
Parse an RMG database library located at path.
loadOldTree(path)
Parse an old-style RMG database tree located at path. An RMG tree is an n-ary tree representing the
hierarchy of items in the dictionary.
markValidDuplicates(reactions1, reactions2)
Check for reactions that appear in both lists, and mark them as (valid) duplicates.
matchNodeToChild(parentNode, childNode)
Return True if parentNode is a parent of childNode. Otherwise, return False. Both parentNode and
childNode must be Entry types with items containing Group or LogicNode types. If parentNode and
childNode are identical, the function will also return False.
matchNodeToNode(node, nodeOther)
Return True if node and nodeOther are identical. Otherwise, return False. Both node and nodeOther must
be Entry types with items containing Group or LogicNode types.
matchNodeToStructure(node, structure, atoms, strict=False)
Return True if the structure centered at atom matches the structure at node in the dictionary. The structure
at node should have atoms with the appropriate labels because they are set on loading and never change.
However, the atoms in structure may not have the correct labels, hence the atoms parameter. The atoms
parameter may include extra labels, and so we only require that every labeled atom in the functional group
represented by node has an equivalent labeled atom in structure.
Matching to structure is more strict than to node. All labels in structure must be found in node. However
the reverse is not true, unless strict is set to True.
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
rmgpy.data.kinetics.KineticsRules
functions to evaluate. This method will automatically add a few identifiers required by all data entries, so
you don’t need to provide these.
loadOld(path, groups, numLabels)
Load a set of old rate rules for kinetics groups into this depository.
loadOldDictionary(path, pattern)
Parse an old-style RMG database dictionary located at path. An RMG dictionary is a list of key-value
pairs of a one-line string key and a multi-line string value. Each record is separated by at least one empty
line. Returns a dict object with the values converted to Molecule or Group objects depending on the
value of pattern.
loadOldLibrary(path, numParameters, numLabels=1)
Parse an RMG database library located at path.
loadOldTree(path)
Parse an old-style RMG database tree located at path. An RMG tree is an n-ary tree representing the
hierarchy of items in the dictionary.
matchNodeToChild(parentNode, childNode)
Return True if parentNode is a parent of childNode. Otherwise, return False. Both parentNode and
childNode must be Entry types with items containing Group or LogicNode types. If parentNode and
childNode are identical, the function will also return False.
matchNodeToNode(node, nodeOther)
Return True if node and nodeOther are identical. Otherwise, return False. Both node and nodeOther must
be Entry types with items containing Group or LogicNode types.
matchNodeToStructure(node, structure, atoms, strict=False)
Return True if the structure centered at atom matches the structure at node in the dictionary. The structure
at node should have atoms with the appropriate labels because they are set on loading and never change.
However, the atoms in structure may not have the correct labels, hence the atoms parameter. The atoms
parameter may include extra labels, and so we only require that every labeled atom in the functional group
represented by node has an equivalent labeled atom in structure.
Matching to structure is more strict than to node. All labels in structure must be found in node. However
the reverse is not true, unless strict is set to True.
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
rmgpy.data.kinetics.LibraryReaction
• If the above is not possible but high-pressure limit kinetics 𝑘∞ (𝑇 ) have been provided, then the
inverse Laplace transform method will be used.
The density of states for the product prodDensStates and the temperature of interest T in K can also
be provided. For isomerization and association reactions prodDensStates is required; for dissociation
reactions it is optional. The temperature is used if provided in the detailed balance expression to determine
the reverse kinetics, and in certain cases in the inverse Laplace transform method.
calculateTSTRateCoefficient(self, double T ) → double
Evaluate the forward rate coefficient for the reaction with corresponding transition state TS at temperature
T in K using (canonical) transition state theory. The TST equation is
𝑄‡ (𝑇 )
(︂ )︂
𝑘B 𝑇 𝐸0
𝑘(𝑇 ) = 𝜅(𝑇 ) exp −
ℎ 𝑄A (𝑇 )𝑄B (𝑇 ) 𝑘B 𝑇
where 𝑄‡ is the partition function of the transition state, 𝑄A and 𝑄B are the partition function of the
reactants, 𝐸0 is the ground-state energy difference from the transition state to the reactants, 𝑇 is the
absolute temperature, 𝑘B is the Boltzmann constant, and ℎ is the Planck constant. 𝜅(𝑇 ) is an optional
tunneling correction.
calculateTSTRateCoefficients(self, ndarray Tlist) → ndarray
Type elementary_high_p
ensure_species(self, bool reactant_resonance=False, bool product_resonance=False)
Ensure the reaction contains species objects in its reactant and product attributes. If the reaction is found
to hold molecule objects, it modifies the reactant, product and pairs to hold Species objects.
Generates resonance structures for Molecules if the corresponding options, reactant_resonance and/or
product_resonance, are True. Does not generate resonance for reactants or products that start as Species
objects.
fixBarrierHeight(self, bool forcePositive=False)
Turns the kinetics into Arrhenius (if they were ArrheniusEP) and ensures the activation energy is at least
the endothermicity for endothermic reactions, and is not negative only as a result of using Evans Polanyi
with an exothermic reaction. If forcePositive is True, then all reactions are forced to have a non-negative
barrier.
fixDiffusionLimitedA(self, T )
Decrease the pre-exponential factor (A) by the diffusion factor to account for the diffusion limit at the
specified temperature.
generate3dTS(self, reactants, products)
Generate the 3D structure of the transition state. Called from model.generateKinetics().
self.reactants is a list of reactants self.products is a list of products
generatePairs(self )
Generate the reactant-product pairs to use for this reaction when performing flux analysis. The exact
procedure for doing so depends on the reaction type:
There are a number of ways of determining the correct pairing for bimolecular reactions. Here we try a
simple similarity analysis by comparing the number of heavy atoms (C/O/N/S at the moment). This should
work most of the time, but a more rigorous algorithm may be needed for some cases.
generateReverseRateCoefficient(self, bool network_kinetics=False, Tmin=None, Tmax=None)
Generate and return a rate coefficient model for the reverse reaction. Currently this only works if the
kinetics attribute is one of several (but not necessarily all) kinetics types.
generate_high_p_limit_kinetics()
If the LibraryReactions represented by self has pressure dependent kinetics, try extracting the high pres-
sure limit rate from it. Used for incorporating library reactions with pressure-dependent kinetics in PDep
networks. Only reactions flagged as elementary_high_p=True should be processed here. If the kinet-
ics is a :class:Lindemann or a :class:Troe, simply get the high pressure limit rate. If the kinetics is a
:class:PDepArrhenius or a :class:Chebyshev, generate a :class:Arrhenius kinetics entry that represents the
high pressure limit if Pmax >= 90 bar . This high pressure limit Arrhenius kinetics is assigned to the
reaction network_kinetics attribute. If this method successfully generated the high pressure limit kinetics,
return True, otherwise False.
getEnthalpiesOfReaction(self, ndarray Tlist) → ndarray
Return the enthalpies of reaction in J/mol evaluated at temperatures Tlist in K.
getEnthalpyOfReaction(self, double T ) → double
Return the enthalpy of reaction in J/mol evaluated at temperature T in K.
index
‘int’
Type index
isAssociation(self ) → bool
−−
Return True if the reaction represents an association reaction A + B ↽−⇀
− C or False if not.
isBalanced(self ) → bool
Return True if the reaction has the same number of each atom on each side of the reaction equation, or
False if not.
isDissociation(self ) → bool
−−
Return True if the reaction represents a dissociation reaction A ↽−⇀
− B + C or False if not.
isIsomerization(self ) → bool
Return True if the reaction represents an isomerization reaction A −
↽−
−⇀
− B or False if not.
isIsomorphic(self, Reaction other, bool eitherDirection=True, bool checkIdentical=False, bool
checkOnlyLabel=False, bool checkTemplateRxnProducts=False, bool generateIni-
tialMap=False, bool strict=True) → bool
Return True if this reaction is the same as the other reaction, or False if they are different. The compar-
ison involves comparing isomorphism of reactants and products, and doesn’t use any kinetic information.
Parameters
• eitherDirection (bool, optional) – if False,then the reaction direction must
match.
• checkIdentical (bool, optional) – if True, check that atom ID’s match (used for
checking degeneracy)
• checkOnlyLabel (bool, optional) – if True, only check the string representation,
ignoring molecular structure comparisons
• checkTemplateRxnProducts (bool, optional) – if True, only check isomorphism
of reaction products (used when we know the reactants are identical, i.e. in generating
reactions)
• generateInitialMap (bool, optional) – if True, initialize map by pairing atoms
with same labels
• strict (bool, optional) – if False, perform isomorphism ignoring electrons
isSurfaceReaction(self ) → bool
Return True if one or more reactants or products are surface species (or surface sites)
isUnimolecular(self ) → bool
Return True if the reaction has a single molecule as either reactant or product (or both) A −
↽−
−⇀
− B + C or
−−⇀ −−⇀
A + B ↽−− C or A ↽−− B, or False if not.
is_forward
‘bool’
Type is_forward
k_effective_cache
dict
Type k_effective_cache
kinetics
rmgpy.kinetics.model.KineticsModel
Type kinetics
label
str
Type label
transitionState
rmgpy.species.TransitionState
Type transitionState
rmgpy.data.base.LogicNode
rmgpy.data.kinetics.ReactionRecipe
class rmgpy.data.kinetics.ReactionRecipe(actions=None)
Represent a list of actions that, when executed, result in the conversion of a set of reactants to a set of products.
There are currently five such actions:
The actions are stored as a list in the actions attribute. Each action is a list of items; the first is the action name,
while the rest are the action parameters as indicated above.
addAction(action)
Add an action to the reaction recipe, where action is a list containing the action name and the required
parameters, as indicated in the table above.
applyForward(struct, unique=True)
Apply the forward reaction recipe to molecule, a single Molecule object.
applyReverse(struct, unique=True)
Apply the reverse reaction recipe to molecule, a single Molecule object.
getReverse()
Generate a reaction recipe that, when applied, does the opposite of what the current recipe does, i.e., it is
the recipe for the reverse of the reaction that this is the recipe for.
rmgpy.data.statmech.StatmechDatabase
class rmgpy.data.statmech.StatmechDatabase
A class for working with the RMG statistical mechanics (frequencies) database.
getStatmechData(molecule, thermoModel=None)
Return the thermodynamic parameters for a given Molecule object molecule. This function first searches
the loaded libraries in order, returning the first match found, before falling back to estimation via group
additivity.
getStatmechDataFromDepository(molecule)
Return statmech data for the given Molecule object molecule by searching the entries in the depository.
Returns a list of tuples (statmechData, depository, entry).
getStatmechDataFromGroups(molecule, thermoModel)
Return statmech data for the given Molecule object molecule by estimating using characteristic group
frequencies and fitting the remaining internal modes to heat capacity data from the given thermo model
thermoModel. This always returns valid degrees of freedom data.
getStatmechDataFromLibrary(molecule, library)
Return statmech data for the given Molecule object molecule by searching the entries in the specified
StatmechLibrary object library. Returns None if no data was found.
load(path, libraries=None, depository=True)
Load the statmech database from the given path on disk, where path points to the top-level folder of the
thermo database.
loadDepository(path)
Load the statmech database from the given path on disk, where path points to the top-level folder of the
thermo database.
loadGroups(path)
Load the statmech database from the given path on disk, where path points to the top-level folder of the
thermo database.
loadLibraries(path, libraries=None)
Load the statmech database from the given path on disk, where path points to the top-level folder of the
thermo database.
loadOld(path)
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.
save(path)
Save the statmech database to the given path on disk, where path points to the top-level folder of the
statmech database.
saveDepository(path)
Save the statmech depository to the given path on disk, where path points to the top-level folder of the
statmech depository.
saveGroups(path)
Save the statmech groups to the given path on disk, where path points to the top-level folder of the statmech
groups.
saveLibraries(path)
Save the statmech libraries to the given path on disk, where path points to the top-level folder of the
statmech libraries.
saveOld(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.
rmgpy.data.statmech.StatmechDepository
descendants(node)
Returns all the descendants of a node, climbing down the tree to the bottom.
generateOldTree(entries, level)
Generate a multi-line string representation of the current tree using the old-style syntax.
getEntriesToSave()
Return a sorted list of the entries in this database that should be saved to the output file.
Then renumber the entry indexes so that we never have any duplicate indexes.
getSpecies(path, resonance=True)
Load the dictionary containing all of the species in a kinetics library or depository.
load(path, local_context=None, global_context=None)
Load an RMG-style database from the file at location path on disk. The parameters local_context and
global_context are used to provide specialized mapping of identifiers in the input file to corresponding
functions to evaluate. This method will automatically add a few identifiers required by all data entries, so
you don’t need to provide these.
loadOld(dictstr, treestr, libstr, numParameters, numLabels=1, pattern=True)
Load a dictionary-tree-library based database. The database is stored in three files: dictstr is the path to
the dictionary, treestr to the tree, and libstr to the library. The tree is optional, and should be set to ‘’ if not
desired.
loadOldDictionary(path, pattern)
Parse an old-style RMG database dictionary located at path. An RMG dictionary is a list of key-value
pairs of a one-line string key and a multi-line string value. Each record is separated by at least one empty
line. Returns a dict object with the values converted to Molecule or Group objects depending on the
value of pattern.
loadOldLibrary(path, numParameters, numLabels=1)
Parse an RMG database library located at path.
loadOldTree(path)
Parse an old-style RMG database tree located at path. An RMG tree is an n-ary tree representing the
hierarchy of items in the dictionary.
matchNodeToChild(parentNode, childNode)
Return True if parentNode is a parent of childNode. Otherwise, return False. Both parentNode and
childNode must be Entry types with items containing Group or LogicNode types. If parentNode and
childNode are identical, the function will also return False.
matchNodeToNode(node, nodeOther)
Return True if node and nodeOther are identical. Otherwise, return False. Both node and nodeOther must
be Entry types with items containing Group or LogicNode types.
matchNodeToStructure(node, structure, atoms, strict=False)
Return True if the structure centered at atom matches the structure at node in the dictionary. The structure
at node should have atoms with the appropriate labels because they are set on loading and never change.
However, the atoms in structure may not have the correct labels, hence the atoms parameter. The atoms
parameter may include extra labels, and so we only require that every labeled atom in the functional group
represented by node has an equivalent labeled atom in structure.
Matching to structure is more strict than to node. All labels in structure must be found in node. However
the reverse is not true, unless strict is set to True.
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
rmgpy.data.statmechfit
Fitting functions
Helper functions
rmgpy.data.statmechfit.harmonicOscillator_heatCapacity(T, freq)
Return the heat capacity in J/mol*K at the given set of temperatures Tlist in K for the harmonic oscillator with
a frequency freq in cm^-1.
rmgpy.data.statmechfit.harmonicOscillator_d_heatCapacity_d_freq(T, freq)
Return the first derivative of the heat capacity with respect to the harmonic oscillator frequency in J/mol*K/cm^-
1 at the given set of temperatures Tlist in K, evaluated at the frequency freq in cm^-1.
rmgpy.data.statmechfit.hinderedRotor_heatCapacity(T, freq, barr)
Return the heat capacity in J/mol*K at the given set of temperatures Tlist in K for the 1D hindered rotor with a
frequency freq in cm^-1 and a barrier height barr in cm^-1.
rmgpy.data.statmechfit.hinderedRotor_d_heatCapacity_d_freq(T, freq, barr)
Return the first derivative of the heat capacity with respect to the hindered rotor frequency in J/mol*K/cm^-1 at
the given set of temperatures Tlist in K, evaluated at the frequency freq in cm^-1 and a barrier height barr in
cm^-1.
rmgpy.data.statmechfit.hinderedRotor_d_heatCapacity_d_barr(T, freq, barr)
Return the first derivative of the heat capacity with respect to the hindered rotor frequency in J/mol*K/cm^-1 at
the given set of temperatures Tlist in K, evaluated at the frequency freq in cm^-1 and a barrier height barr in
cm^-1.
Helper classes
′ 𝜕𝑔𝑖
• A matrix of the current values of the Jacobian of the (linear) constrains: 𝐽𝑖𝑗 = 𝜕𝑥𝑗 .
initialize()
Initialize the DQED solver. The required parameters are:
• Neq - The number of algebraic equations.
• Nvars - The number of unknown variables.
• Ncons - The number of constraint equations.
The optional parameters are:
• bounds - A list of 2-tuples giving the lower and upper bound for each unknown variable. Use None
if there is no bound in one or either direction. If provided, you must give bounds for every unknown
variable.
• tolf - The tolerance used for stopping when the norm of the residual has absolute length less than tolf,
i.e. ‖𝑓⃗‖ ≤ 𝜖𝑓 .
• told - The tolerance used for stopping when changes to the unknown variables has absolute length less
than told, i.e. ‖∆⃗𝑥‖ ≤ 𝜖𝑑 .
• tolx - The tolerance used for stopping when changes to the unknown variables has relative length less
than tolx, i.e. ‖∆⃗𝑥‖ ≤ 𝜖𝑥 · ‖⃗𝑥‖.
• maxIter - The maximum number of iterations to use
• verbose - True to have DQED print extra information about the solve, False to only see printed
output when the solver has an error.
solve()
Using the initial guess x0, return the least-squares solution to the set of nonlinear algebraic equations
defined by the evaluate() method of the derived class. This is the method that actually conducts the
call to DQED. Returns the solution vector and a flag indicating the status of the solve. The possible output
values of the flag are:
Value Meaning
2 The norm of the residual is zero; the solution vector is a root of the system
3 The bounds on the trust region are being encountered on each step; the solution vector may or
may not be a local minimum
4 The solution vector is a local minimum
5 A significant amount of noise or uncertainty has been observed in the residual; the solution may
or may not be a local minimum
6 The solution vector is only changing by small absolute amounts; the solution may or may not
be a local minimum
7 The solution vector is only changing by small relative amounts; the solution may or may not be
a local minimum
8 The maximum number of iterations has been reached; the solution is the best found, but may or
may not be a local minimum
9-18 An error occurred during the solve operation; the solution is not a local minimum
𝜕𝑓𝑖
• A matrix of the current values of the Jacobian of the system of equations: 𝐽𝑖𝑗 = 𝜕𝑥𝑗 .
′ 𝜕𝑔𝑖
• A matrix of the current values of the Jacobian of the (linear) constrains: 𝐽𝑖𝑗 = 𝜕𝑥𝑗 .
initialize()
Initialize the DQED solver. The required parameters are:
• Neq - The number of algebraic equations.
• Nvars - The number of unknown variables.
• Ncons - The number of constraint equations.
The optional parameters are:
• bounds - A list of 2-tuples giving the lower and upper bound for each unknown variable. Use None
if there is no bound in one or either direction. If provided, you must give bounds for every unknown
variable.
• tolf - The tolerance used for stopping when the norm of the residual has absolute length less than tolf,
i.e. ‖𝑓⃗‖ ≤ 𝜖𝑓 .
• told - The tolerance used for stopping when changes to the unknown variables has absolute length less
than told, i.e. ‖∆⃗𝑥‖ ≤ 𝜖𝑑 .
• tolx - The tolerance used for stopping when changes to the unknown variables has relative length less
than tolx, i.e. ‖∆⃗𝑥‖ ≤ 𝜖𝑥 · ‖⃗𝑥‖.
• maxIter - The maximum number of iterations to use
• verbose - True to have DQED print extra information about the solve, False to only see printed
output when the solver has an error.
solve()
Using the initial guess x0, return the least-squares solution to the set of nonlinear algebraic equations
defined by the evaluate() method of the derived class. This is the method that actually conducts the
call to DQED. Returns the solution vector and a flag indicating the status of the solve. The possible output
values of the flag are:
Value Meaning
2 The norm of the residual is zero; the solution vector is a root of the system
3 The bounds on the trust region are being encountered on each step; the solution vector may or
may not be a local minimum
4 The solution vector is a local minimum
5 A significant amount of noise or uncertainty has been observed in the residual; the solution may
or may not be a local minimum
6 The solution vector is only changing by small absolute amounts; the solution may or may not
be a local minimum
7 The solution vector is only changing by small relative amounts; the solution may or may not be
a local minimum
8 The maximum number of iterations has been reached; the solution is the best found, but may or
may not be a local minimum
9-18 An error occurred during the solve operation; the solution is not a local minimum
evaluate(x)
Evaluate the nonlinear equations and constraints for this system, and the corresponding Jacobian matrices,
at the given value of the solution vector x. Return a tuple containing three items:
• A vector of the current values of the system of equations f (x).
𝜕𝑓𝑖
• A matrix of the current values of the Jacobian of the system of equations: 𝐽𝑖𝑗 = 𝜕𝑥𝑗 .
′ 𝜕𝑔𝑖
• A matrix of the current values of the Jacobian of the (linear) constrains: 𝐽𝑖𝑗 = 𝜕𝑥𝑗 .
initialize()
Initialize the DQED solver. The required parameters are:
• Neq - The number of algebraic equations.
• Nvars - The number of unknown variables.
• Ncons - The number of constraint equations.
The optional parameters are:
• bounds - A list of 2-tuples giving the lower and upper bound for each unknown variable. Use None
if there is no bound in one or either direction. If provided, you must give bounds for every unknown
variable.
• tolf - The tolerance used for stopping when the norm of the residual has absolute length less than tolf,
i.e. ‖𝑓⃗‖ ≤ 𝜖𝑓 .
• told - The tolerance used for stopping when changes to the unknown variables has absolute length less
than told, i.e. ‖∆⃗𝑥‖ ≤ 𝜖𝑑 .
• tolx - The tolerance used for stopping when changes to the unknown variables has relative length less
than tolx, i.e. ‖∆⃗𝑥‖ ≤ 𝜖𝑥 · ‖⃗𝑥‖.
• maxIter - The maximum number of iterations to use
• verbose - True to have DQED print extra information about the solve, False to only see printed
output when the solver has an error.
solve()
Using the initial guess x0, return the least-squares solution to the set of nonlinear algebraic equations
defined by the evaluate() method of the derived class. This is the method that actually conducts the
call to DQED. Returns the solution vector and a flag indicating the status of the solve. The possible output
values of the flag are:
Value Meaning
2 The norm of the residual is zero; the solution vector is a root of the system
3 The bounds on the trust region are being encountered on each step; the solution vector may or
may not be a local minimum
4 The solution vector is a local minimum
5 A significant amount of noise or uncertainty has been observed in the residual; the solution may
or may not be a local minimum
6 The solution vector is only changing by small absolute amounts; the solution may or may not
be a local minimum
7 The solution vector is only changing by small relative amounts; the solution may or may not be
a local minimum
8 The maximum number of iterations has been reached; the solution is the best found, but may or
may not be a local minimum
9-18 An error occurred during the solve operation; the solution is not a local minimum
rmgpy.data.statmech.StatmechGroups
loadOldDictionary(path, pattern)
Parse an old-style RMG database dictionary located at path. An RMG dictionary is a list of key-value
pairs of a one-line string key and a multi-line string value. Each record is separated by at least one empty
line. Returns a dict object with the values converted to Molecule or Group objects depending on the
value of pattern.
loadOldLibrary(path, numParameters, numLabels=1)
Parse an RMG database library located at path.
loadOldTree(path)
Parse an old-style RMG database tree located at path. An RMG tree is an n-ary tree representing the
hierarchy of items in the dictionary.
matchNodeToChild(parentNode, childNode)
Return True if parentNode is a parent of childNode. Otherwise, return False. Both parentNode and
childNode must be Entry types with items containing Group or LogicNode types. If parentNode and
childNode are identical, the function will also return False.
matchNodeToNode(node, nodeOther)
Return True if node and nodeOther are identical. Otherwise, return False. Both node and nodeOther must
be Entry types with items containing Group or LogicNode types.
matchNodeToStructure(node, structure, atoms, strict=False)
Return True if the structure centered at atom matches the structure at node in the dictionary. The structure
at node should have atoms with the appropriate labels because they are set on loading and never change.
However, the atoms in structure may not have the correct labels, hence the atoms parameter. The atoms
parameter may include extra labels, and so we only require that every labeled atom in the functional group
represented by node has an equivalent labeled atom in structure.
Matching to structure is more strict than to node. All labels in structure must be found in node. However
the reverse is not true, unless strict is set to True.
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
saveDictionary(path)
Extract species from all entries associated with a kinetics library or depository and save them to the path
given.
saveEntry(f, entry)
Write the given entry in the thermo database to the file object f.
saveOld(dictstr, treestr, libstr)
Save the current database to a set of text files using the old-style syntax.
saveOldDictionary(path)
Save the current database dictionary to a text file using the old-style syntax.
saveOldLibrary(path)
Save the current database library to a text file using the old-style syntax.
saveOldTree(path)
Save the current database tree to a text file using the old-style syntax.
rmgpy.data.statmech.StatmechLibrary
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
processOldLibraryEntry(data)
Process a list of parameters data as read from an old-style RMG thermo database, returning the corre-
sponding thermodynamics object.
removeGroup(groupToRemove)
Removes a group that is in a tree from the database. In addition to deleting from self.entries, it must also
update the parent/child relationships
Returns the removed group
save(path)
Save the current database to the file at location path on disk.
saveDictionary(path)
Extract species from all entries associated with a kinetics library or depository and save them to the path
given.
saveEntry(f, entry)
Write the given entry in the thermo database to the file object f.
saveOld(dictstr, treestr, libstr)
Save the current database to a set of text files using the old-style syntax.
saveOldDictionary(path)
Save the current database dictionary to a text file using the old-style syntax.
saveOldLibrary(path)
Save the current database library to a text file using the old-style syntax.
saveOldTree(path)
Save the current database tree to a text file using the old-style syntax.
rmgpy.data.kinetics.TemplateReaction
allow_max_rate_violation
‘bool’
Type allow_max_rate_violation
allow_pdep_route
‘bool’
Type allow_pdep_route
𝑄‡ (𝑇 )
(︂ )︂
𝑘B 𝑇 𝐸0
𝑘(𝑇 ) = 𝜅(𝑇 ) exp −
ℎ 𝑄A (𝑇 )𝑄B (𝑇 ) 𝑘B 𝑇
where 𝑄‡ is the partition function of the transition state, 𝑄A and 𝑄B are the partition function of the
reactants, 𝐸0 is the ground-state energy difference from the transition state to the reactants, 𝑇 is the
absolute temperature, 𝑘B is the Boltzmann constant, and ℎ is the Planck constant. 𝜅(𝑇 ) is an optional
tunneling correction.
calculateTSTRateCoefficients(self, ndarray Tlist) → ndarray
draw(self, path)
Generate a pictorial representation of the chemical reaction using the draw module. Use path to specify
the file to save the generated image to; the image type is automatically determined by extension. Valid
extensions are .png, .svg, .pdf, and .ps; of these, the first is a raster format and the remainder are
vector formats.
duplicate
‘bool’
Type duplicate
elementary_high_p
‘bool’
Type elementary_high_p
ensure_species(self, bool reactant_resonance=False, bool product_resonance=False)
Ensure the reaction contains species objects in its reactant and product attributes. If the reaction is found
to hold molecule objects, it modifies the reactant, product and pairs to hold Species objects.
Generates resonance structures for Molecules if the corresponding options, reactant_resonance and/or
product_resonance, are True. Does not generate resonance for reactants or products that start as Species
objects.
fixBarrierHeight(self, bool forcePositive=False)
Turns the kinetics into Arrhenius (if they were ArrheniusEP) and ensures the activation energy is at least
the endothermicity for endothermic reactions, and is not negative only as a result of using Evans Polanyi
with an exothermic reaction. If forcePositive is True, then all reactions are forced to have a non-negative
barrier.
fixDiffusionLimitedA(self, T )
Decrease the pre-exponential factor (A) by the diffusion factor to account for the diffusion limit at the
specified temperature.
generate3dTS(self, reactants, products)
Generate the 3D structure of the transition state. Called from model.generateKinetics().
self.reactants is a list of reactants self.products is a list of products
generatePairs(self )
Generate the reactant-product pairs to use for this reaction when performing flux analysis. The exact
procedure for doing so depends on the reaction type:
There are a number of ways of determining the correct pairing for bimolecular reactions. Here we try a
simple similarity analysis by comparing the number of heavy atoms (C/O/N/S at the moment). This should
work most of the time, but a more rigorous algorithm may be needed for some cases.
generateReverseRateCoefficient(self, bool network_kinetics=False, Tmin=None, Tmax=None)
Generate and return a rate coefficient model for the reverse reaction. Currently this only works if the
kinetics attribute is one of several (but not necessarily all) kinetics types.
getEnthalpiesOfReaction(self, ndarray Tlist) → ndarray
Return the enthalpies of reaction in J/mol evaluated at temperatures Tlist in K.
index
‘int’
Type index
isAssociation(self ) → bool
−−
Return True if the reaction represents an association reaction A + B ↽−⇀
− C or False if not.
isBalanced(self ) → bool
Return True if the reaction has the same number of each atom on each side of the reaction equation, or
False if not.
isDissociation(self ) → bool
−−
Return True if the reaction represents a dissociation reaction A ↽−⇀
− B + C or False if not.
isIsomerization(self ) → bool
Return True if the reaction represents an isomerization reaction A −
↽−
−⇀
− B or False if not.
isIsomorphic(self, Reaction other, bool eitherDirection=True, bool checkIdentical=False, bool
checkOnlyLabel=False, bool checkTemplateRxnProducts=False, bool generateIni-
tialMap=False, bool strict=True) → bool
Return True if this reaction is the same as the other reaction, or False if they are different. The compar-
ison involves comparing isomorphism of reactants and products, and doesn’t use any kinetic information.
Parameters
• eitherDirection (bool, optional) – if False,then the reaction direction must
match.
• checkIdentical (bool, optional) – if True, check that atom ID’s match (used for
checking degeneracy)
• checkOnlyLabel (bool, optional) – if True, only check the string representation,
ignoring molecular structure comparisons
• checkTemplateRxnProducts (bool, optional) – if True, only check isomorphism
of reaction products (used when we know the reactants are identical, i.e. in generating
reactions)
• generateInitialMap (bool, optional) – if True, initialize map by pairing atoms
with same labels
• strict (bool, optional) – if False, perform isomorphism ignoring electrons
isSurfaceReaction(self ) → bool
Return True if one or more reactants or products are surface species (or surface sites)
isUnimolecular(self ) → bool
Return True if the reaction has a single molecule as either reactant or product (or both) A −
↽−
−⇀
− B + C or
A+B− −⇀
↽−− C or A −−⇀
↽−− B, or False if not.
is_forward
‘bool’
Type is_forward
k_effective_cache
dict
Type k_effective_cache
kinetics
rmgpy.kinetics.model.KineticsModel
Type kinetics
label
str
Type label
matchesSpecies(self, list reactants, list products=None) → bool
Compares the provided reactants and products against the reactants and products of this reaction. Both
directions are checked.
Parameters
• reactants (list) – Species required on one side of the reaction
• products (list, optional) – Species required on the other side
network_kinetics
rmgpy.kinetics.arrhenius.Arrhenius
Type network_kinetics
pairs
list
Type pairs
products
list
Type products
rank
object
Type rank
reactants
list
Type reactants
reverseThisArrheniusRate(self, Arrhenius kForward, str reverseUnits, Tmin=None, Tmax=None)
Reverses the given kForward, which must be an Arrhenius type. You must supply the correct units for the
reverse rate. The equilibrium constant is evaluated from the current reaction instance (self).
reversible
‘bool’
Type reversible
specificCollider
rmgpy.species.Species
Type specificCollider
toCantera(self, speciesList=None, useChemkinIdentifier=False)
Converts the RMG Reaction object to a Cantera Reaction object with the appropriate reaction class.
If useChemkinIdentifier is set to False, the species label is used instead. Be sure that species’ labels are
unique when setting it False.
toChemkin(self, speciesList=None, kinetics=True)
Return the chemkin-formatted string for this reaction.
If kinetics is set to True, the chemkin format kinetics will also be returned (requires the speciesList to
figure out third body colliders.) Otherwise, only the reaction string will be returned.
toLabeledStr(self, use_index=False)
the same as __str__ except that the labels are assumed to exist and used for reactant and products rather
than the labels plus the index in parentheses
transitionState
rmgpy.species.TransitionState
Type transitionState
rmgpy.data.thermo.ThermoDatabase
class rmgpy.data.thermo.ThermoDatabase
A class for working with the RMG thermodynamics database.
computeGroupAdditivityThermo(molecule)
Return the set of thermodynamic parameters corresponding to a given Molecule object molecule by esti-
mation using the group additivity values. 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.
correctBindingEnergy(thermo, species)
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)
Returns corrected thermo
estimateRadicalThermoViaHBI(molecule, stableThermoEstimator)
Estimate the thermodynamics of a radical by saturating it, applying the provided stableThermoEstimator
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.
estimateThermoViaGroupAdditivity(molecule)
Return the set of thermodynamic parameters corresponding to a given Molecule object molecule by esti-
mation using the group additivity values. 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.
extractSourceFromComments(species)
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’: Dic-
tionary_of_Groups_Used }
saveGroups(path)
Save the thermo groups to the given path on disk, where path points to the top-level folder of the thermo
groups.
saveLibraries(path)
Save the thermo libraries to the given path on disk, where path points to the top-level folder of the thermo
libraries.
saveOld(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.
setDeltaAtomicAdsorptionEnergies(bindingEnergies=None)
Sets and stores the change in atomic binding energy between the desired and the Pt(111) default.
This depends on the two metal surfaces: the reference one used in the database of adsorption energies, and
the desired surface.
If bindingEnergies are not provided, resets the values to those of the Pt(111) default.
Parameters bindingEnergies (dict, optional) – the desired binding energies with ele-
ments as keys and binding energy/unit tuples as values
Returns None, stores result in self.deltaAtomicAdsorptionEnergy
rmgpy.data.thermo.ThermoDepository
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
removeGroup(groupToRemove)
Removes a group that is in a tree from the database. In addition to deleting from self.entries, it must also
update the parent/child relationships
Returns the removed group
save(path)
Save the current database to the file at location path on disk.
saveDictionary(path)
Extract species from all entries associated with a kinetics library or depository and save them to the path
given.
saveEntry(f, entry)
Write the given entry in the thermo database to the file object f.
saveOld(dictstr, treestr, libstr)
Save the current database to a set of text files using the old-style syntax.
saveOldDictionary(path)
Save the current database dictionary to a text file using the old-style syntax.
saveOldLibrary(path)
Save the current database library to a text file using the old-style syntax.
saveOldTree(path)
Save the current database tree to a text file using the old-style syntax.
rmgpy.data.thermo.ThermoGroups
generateOldTree(entries, level)
Generate a multi-line string representation of the current tree using the old-style syntax.
getEntriesToSave()
Return a sorted list of the entries in this database that should be saved to the output file.
Then renumber the entry indexes so that we never have any duplicate indexes.
getSpecies(path, resonance=True)
Load the dictionary containing all of the species in a kinetics library or depository.
load(path, local_context=None, global_context=None)
Load an RMG-style database from the file at location path on disk. The parameters local_context and
global_context are used to provide specialized mapping of identifiers in the input file to corresponding
functions to evaluate. This method will automatically add a few identifiers required by all data entries, so
you don’t need to provide these.
loadOld(dictstr, treestr, libstr, numParameters, numLabels=1, pattern=True)
Load a dictionary-tree-library based database. The database is stored in three files: dictstr is the path to
the dictionary, treestr to the tree, and libstr to the library. The tree is optional, and should be set to ‘’ if not
desired.
loadOldDictionary(path, pattern)
Parse an old-style RMG database dictionary located at path. An RMG dictionary is a list of key-value
pairs of a one-line string key and a multi-line string value. Each record is separated by at least one empty
line. Returns a dict object with the values converted to Molecule or Group objects depending on the
value of pattern.
loadOldLibrary(path, numParameters, numLabels=1)
Parse an RMG database library located at path.
loadOldTree(path)
Parse an old-style RMG database tree located at path. An RMG tree is an n-ary tree representing the
hierarchy of items in the dictionary.
matchNodeToChild(parentNode, childNode)
Return True if parentNode is a parent of childNode. Otherwise, return False. Both parentNode and
childNode must be Entry types with items containing Group or LogicNode types. If parentNode and
childNode are identical, the function will also return False.
matchNodeToNode(node, nodeOther)
Return True if node and nodeOther are identical. Otherwise, return False. Both node and nodeOther must
be Entry types with items containing Group or LogicNode types.
matchNodeToStructure(node, structure, atoms, strict=False)
Return True if the structure centered at atom matches the structure at node in the dictionary. The structure
at node should have atoms with the appropriate labels because they are set on loading and never change.
However, the atoms in structure may not have the correct labels, hence the atoms parameter. The atoms
parameter may include extra labels, and so we only require that every labeled atom in the functional group
represented by node has an equivalent labeled atom in structure.
Matching to structure is more strict than to node. All labels in structure must be found in node. However
the reverse is not true, unless strict is set to True.
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
rmgpy.data.thermo.ThermoLibrary
At- Description
tribute
node Either an Entry or a key in the self.entries dictionary which has a Group or LogicNode as its
Entry.item
struc- A Group or a Molecule
ture
atoms Dictionary of {label: atom} in the structure. A possible dictionary is the one produced by
structure.getLabeledAtoms()
strict If set to True, ensures that all the node’s atomLabels are matched by in the structure
The rmgpy.kinetics subpackage contains classes that represent various kinetics models of chemical reaction rates
and models of quantum mechanical tunneling through an activation barrier.
Class Description
KineticsData A kinetics model based on a set of discrete rate coefficient points in temperature
Arrhenius A kinetics model based on the (modified) Arrhenius expression
MultiArrhenius A kinetics model based on a sum of Arrhenius expressions
Class Description
PDepKineticsData A kinetics model based on a set of discrete rate coefficient points in temperature and pres-
sure
PDepArrhenius A kinetics model based on a set of Arrhenius expressions for a range of pressures
MultiPDepArrheniusA kinetics model based on a sum of PDepArrhenius expressions
Chebyshev A kinetics model based on a Chebyshev polynomial representation
ThirdBody A low pressure-limit kinetics model based on the (modified) Arrhenius expression, with a
third body
Lindemann A kinetics model of pressure-dependent falloff based on the Lindemann model
Troe A kinetics model of pressure-dependent falloff based on the Lindemann model with the
Troe falloff factor
Class Description
Wigner A one-dimensional tunneling model based on the Wigner expression
Eckart A one-dimensional tunneling model based on the (asymmetric) Eckart expression
rmgpy.kinetics.KineticsData
Attribute Description
Tdata An array of temperatures at which rate coefficient values are known
kdata An array of rate coefficient values
Tmin The minimum temperature at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature at which the model is valid, or zero if unknown or undefined
Pmin The minimum pressure at which the model is valid, or zero if unknown or undefined
Pmax The maximum pressure at which the model is valid, or zero if unknown or undefined
comment Information about the model (e.g. its source)
Pmax
The maximum pressure at which the model is valid, or None if not defined.
Pmin
The minimum pressure at which the model is valid, or None if not defined.
Tdata
An array of temperatures at which rate coefficient values are known.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
comment
str
Type comment
discrepancy(self, KineticsModel otherKinetics) → double
Returns some measure of the discrepancy based on two different reaction models.
getRateCoefficient(self, double T, double P=0.0) → double
Return the rate coefficient in the appropriate combination of m^3, mol, and s at temperature T in K.
isIdenticalTo(self, KineticsModel otherKinetics) → bool
Returns True if the kdata and Tdata match. Returns False otherwise.
isPressureDependent(self ) → bool
Return False since, by default, all objects derived from KineticsModel represent pressure-independent
kinetics.
isSimilarTo(self, KineticsModel otherKinetics) → bool
Returns True if rates of reaction at temperatures 500,1000,1500,2000 K and 1 and 10 bar are within +/ .5
for log(k), in other words, within a factor of 3.
isTemperatureValid(self, double T ) → bool
Return True if the temperature T in K is within the valid temperature range of the kinetic data, or False
if not. If the minimum and maximum temperature are not defined, True is returned.
kdata
An array of rate coefficient values.
setCanteraKinetics(self, ctReaction, speciesList)
Sets the kinetics for a cantera reaction object.
toHTML(self )
Return an HTML rendering.
rmgpy.kinetics.Arrhenius
Attribute Description
A The preexponential factor
T0 The reference temperature
n The temperature exponent
Ea The activation energy
Tmin The minimum temperature at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature at which the model is valid, or zero if unknown or undefined
Pmin The minimum pressure at which the model is valid, or zero if unknown or undefined
Pmax The maximum pressure at which the model is valid, or zero if unknown or undefined
comment Information about the model (e.g. its source)
The Arrhenius equation, given below, accurately reproduces the kinetics of many reaction families:
(︂ )︂𝑛 (︂ )︂
𝑇 𝐸a
𝑘(𝑇 ) = 𝐴 exp −
𝑇0 𝑅𝑇
Above, 𝐴 is the preexponential factor, 𝑇0 is the reference temperature, 𝑛 is the temperature exponent, and 𝐸a is
the activation energy.
A
The preexponential factor.
Ea
The activation energy.
Pmax
The maximum pressure at which the model is valid, or None if not defined.
Pmin
The minimum pressure at which the model is valid, or None if not defined.
T0
The reference temperature.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
changeRate(self, double factor)
Changes A factor in Arrhenius expression by multiplying it by a factor.
changeT0(self, double T0)
Changes the reference temperature used in the exponent to T0 in K, and adjusts the preexponential factor
accordingly.
comment
str
Type comment
discrepancy(self, KineticsModel otherKinetics) → double
Returns some measure of the discrepancy based on two different reaction models.
fitToData(self, ndarray Tlist, ndarray klist, str kunits, double T0=1, ndarray weights=None, bool three-
Params=True)
Fit the Arrhenius parameters to a set of rate coefficient data klist in units of kunits corresponding to a set
of temperatures Tlist in K. A linear least-squares fit is used, which guarantees that the resulting parameters
provide the best possible approximation to the data.
rmgpy.kinetics.MultiArrhenius
Attribute Description
arrhenius A list of the Arrhenius kinetics
Tmin The minimum temperature at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature at which the model is valid, or zero if unknown or undefined
Pmin The minimum pressure at which the model is valid, or zero if unknown or undefined
Pmax The maximum pressure at which the model is valid, or zero if unknown or undefined
comment Information about the model (e.g. its source)
Pmax
The maximum pressure at which the model is valid, or None if not defined.
Pmin
The minimum pressure at which the model is valid, or None if not defined.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
arrhenius
list
Type arrhenius
changeRate(self, double factor)
Change kinetics rate by a multiple factor.
comment
str
Type comment
discrepancy(self, KineticsModel otherKinetics) → double
Returns some measure of the discrepancy based on two different reaction models.
getRateCoefficient(self, double T, double P=0.0) → double
Return the rate coefficient in the appropriate combination of m^3, mol, and s at temperature T in K.
isIdenticalTo(self, KineticsModel otherKinetics) → bool
Returns True if kinetics matches that of another kinetics model. Each duplicate reaction must be matched
and equal to that in the other MultiArrhenius model in the same order. Otherwise returns False
isPressureDependent(self ) → bool
Return False since, by default, all objects derived from KineticsModel represent pressure-independent
kinetics.
isSimilarTo(self, KineticsModel otherKinetics) → bool
Returns True if rates of reaction at temperatures 500,1000,1500,2000 K and 1 and 10 bar are within +/ .5
for log(k), in other words, within a factor of 3.
isTemperatureValid(self, double T ) → bool
Return True if the temperature T in K is within the valid temperature range of the kinetic data, or False
if not. If the minimum and maximum temperature are not defined, True is returned.
setCanteraKinetics(self, ctReaction, speciesList)
Sets the kinetic rates for a list of cantera Reaction objects Here, ctReaction must be a list rather than a
single cantera reaction.
toArrhenius(self, double Tmin=-1, double Tmax=-1) → Arrhenius
Return an Arrhenius instance of the kinetics model
Fit the Arrhenius parameters to a set of rate coefficient data generated from the MultiArrhenius kinetics,
over the temperature range Tmin to Tmax, in Kelvin. If Tmin or Tmax are unspecified (or -1) then the
MultiArrhenius’s Tmin and Tmax are used. A linear least-squares fit is used, which guarantees that the
resulting parameters provide the best possible approximation to the data.
toHTML(self )
Return an HTML rendering.
rmgpy.kinetics.PDepKineticsData
Attribute Description
Tdata An array of temperatures at which rate coefficient values are known
Pdata An array of pressures at which rate coefficient values are known
kdata An array of rate coefficient values at each temperature and pressure
Tmin The minimum temperature at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature at which the model is valid, or zero if unknown or undefined
Pmin The minimum pressure at which the model is valid, or zero if unknown or undefined
Pmax The maximum pressure at which the model is valid, or zero if unknown or undefined
comment Information about the model (e.g. its source)
Pdata
An array of pressures at which rate coefficient values are known.
Pmax
The maximum pressure at which the model is valid, or None if not defined.
Pmin
The minimum pressure at which the model is valid, or None if not defined.
Tdata
An array of temperatures at which rate coefficient values are known.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
comment
str
Type comment
discrepancy(self, KineticsModel otherKinetics) → double
Returns some measure of the discrepancy based on two different reaction models.
efficiencies
dict
Type efficiencies
getCanteraEfficiencies(self, speciesList)
Returns a dictionary containing the collider efficiencies for this PDepKineticsModel object suitable
for setting the efficiencies in the following cantera reaction objects: ThreeBodyReaction, FalloffReac-
tion,‘ChemicallyActivatedReaction‘
getEffectiveColliderEfficiencies(self, list species) → ndarray
Return the effective collider efficiencies for all species in the form of a numpy array. This function helps
assist rapid effective pressure calculations in the solver.
getEffectivePressure(self, double P, list species, ndarray fractions) → double
Return the effective pressure in Pa for a system at a given pressure P in Pa composed of the given list of
species (Species or Molecule objects) with the given fractions.
getRateCoefficient(self, double T, double P=0.0) → double
Return the rate coefficient in the appropriate combination of m^3, mol, and s at temperature T in K and
pressure P in Pa.
highPlimit
rmgpy.kinetics.model.KineticsModel
Type highPlimit
isIdenticalTo(self, KineticsModel otherKinetics) → bool
Returns True if the kdata and Tdata match. Returns False otherwise.
isPressureDependent(self ) → bool
Return True since all objects derived from PDepKineticsModel represent pressure-dependent kinetics.
isPressureValid(self, double P) → bool
Return True if the pressure P in Pa is within the valid pressure range of the kinetic data, or False if not.
If the minimum and maximum pressure are not defined, True is returned.
isSimilarTo(self, KineticsModel otherKinetics) → bool
Returns True if rates of reaction at temperatures 500,1000,1500,2000 K and 1 and 10 bar are within +/ .5
for log(k), in other words, within a factor of 3.
isTemperatureValid(self, double T ) → bool
Return True if the temperature T in K is within the valid temperature range of the kinetic data, or False
if not. If the minimum and maximum temperature are not defined, True is returned.
kdata
An array of rate coefficient values at each temperature and pressure.
setCanteraKinetics(self, ctReaction, speciesList)
Sets the kinetics for a cantera reaction object.
toHTML(self )
Return an HTML rendering.
rmgpy.kinetics.PDepArrhenius
Attribute Description
pressures The list of pressures
arrhenius The list of Arrhenius objects at each pressure
Tmin The minimum temperature in K at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature in K at which the model is valid, or zero if unknown or undefined
Pmin The minimum pressure in bar at which the model is valid, or zero if unknown or undefined
Pmax The maximum pressure in bar at which the model is valid, or zero if unknown or undefined
efficiencies A dict associating chemical species with associated efficiencies
order The reaction order (1 = first, 2 = second, etc.)
comment Information about the model (e.g. its source)
The pressure-dependent Arrhenius formulation is sometimes used to extend the Arrhenius expression to handle
pressure-dependent kinetics. The formulation simply parameterizes 𝐴, 𝑛, and 𝐸a to be dependent on pressure:
(︂ )︂𝑛(𝑃 ) (︂ )︂
𝑇 𝐸a (𝑃 )
𝑘(𝑇, 𝑃 ) = 𝐴(𝑃 ) exp −
𝑇0 𝑅𝑇
Although this suggests some physical insight, the 𝑘(𝑇, 𝑃 ) data is often highly complex and non-Arrhenius,
limiting the usefulness of this formulation to simple systems.
Pmax
The maximum pressure at which the model is valid, or None if not defined.
Pmin
The minimum pressure at which the model is valid, or None if not defined.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
arrhenius
list
Type arrhenius
changeRate(self, double factor)
Changes kinetics rate by a multiple factor.
comment
str
Type comment
discrepancy(self, KineticsModel otherKinetics) → double
Returns some measure of the discrepancy based on two different reaction models.
efficiencies
dict
Type efficiencies
fitToData(self, ndarray Tlist, ndarray Plist, ndarray K, str kunits, double T0=1)
Fit the pressure-dependent Arrhenius model to a matrix of rate coefficient data K with units of kunits
corresponding to a set of temperatures Tlist in K and pressures Plist in Pa. An Arrhenius model is fit cpdef
changeRate(self, double factor)at each pressure.
getCanteraEfficiencies(self, speciesList)
Returns a dictionary containing the collider efficiencies for this PDepKineticsModel object suitable
for setting the efficiencies in the following cantera reaction objects: ThreeBodyReaction, FalloffReac-
tion,‘ChemicallyActivatedReaction‘
getEffectiveColliderEfficiencies(self, list species) → ndarray
Return the effective collider efficiencies for all species in the form of a numpy array. This function helps
assist rapid effective pressure calculations in the solver.
getEffectivePressure(self, double P, list species, ndarray fractions) → double
Return the effective pressure in Pa for a system at a given pressure P in Pa composed of the given list of
species (Species or Molecule objects) with the given fractions.
getRateCoefficient(self, double T, double P=0) → double
Return the rate coefficient in the appropriate combination of m^3, mol, and s at temperature T in K and
pressure P in Pa.
highPlimit
rmgpy.kinetics.model.KineticsModel
Type highPlimit
isIdenticalTo(self, KineticsModel otherKinetics) → bool
Returns True if kinetics matches that of another kinetics model. Each duplicate reaction must be matched
and equal to that in the other PDepArrhenius model in the same order. Otherwise returns False
isPressureDependent(self ) → bool
Return True since all objects derived from PDepKineticsModel represent pressure-dependent kinetics.
isPressureValid(self, double P) → bool
Return True if the pressure P in Pa is within the valid pressure range of the kinetic data, or False if not.
If the minimum and maximum pressure are not defined, True is returned.
isSimilarTo(self, KineticsModel otherKinetics) → bool
Returns True if rates of reaction at temperatures 500,1000,1500,2000 K and 1 and 10 bar are within +/ .5
for log(k), in other words, within a factor of 3.
isTemperatureValid(self, double T ) → bool
Return True if the temperature T in K is within the valid temperature range of the kinetic data, or False
if not. If the minimum and maximum temperature are not defined, True is returned.
pressures
The list of pressures.
setCanteraKinetics(self, ctReaction, speciesList)
Sets a Cantera PlogReaction()’s rates attribute with A list of tuples containing [(pressure in Pa, cantera
arrhenius object), (..)]
toHTML(self )
Return an HTML rendering.
rmgpy.kinetics.MultiPDepArrhenius
Attribute Description
arrhenius A list of the PDepArrhenius kinetics at each temperature
Tmin The minimum temperature at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature at which the model is valid, or zero if unknown or undefined
Pmin The minimum pressure at which the model is valid, or zero if unknown or undefined
Pmax The maximum pressure at which the model is valid, or zero if unknown or undefined
comment Information about the model (e.g. its source)
Pmax
The maximum pressure at which the model is valid, or None if not defined.
Pmin
The minimum pressure at which the model is valid, or None if not defined.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
arrhenius
list
Type arrhenius
changeRate(self, double factor)
Change kinetic rate by a multiple factor.
comment
str
Type comment
discrepancy(self, KineticsModel otherKinetics) → double
Returns some measure of the discrepancy based on two different reaction models.
efficiencies
dict
Type efficiencies
getCanteraEfficiencies(self, speciesList)
Returns a dictionary containing the collider efficiencies for this PDepKineticsModel object suitable
for setting the efficiencies in the following cantera reaction objects: ThreeBodyReaction, FalloffReac-
tion,‘ChemicallyActivatedReaction‘
getEffectiveColliderEfficiencies(self, list species) → ndarray
Return the effective collider efficiencies for all species in the form of a numpy array. This function helps
assist rapid effective pressure calculations in the solver.
getEffectivePressure(self, double P, list species, ndarray fractions) → double
Return the effective pressure in Pa for a system at a given pressure P in Pa composed of the given list of
species (Species or Molecule objects) with the given fractions.
getRateCoefficient(self, double T, double P=0.0) → double
Return the rate coefficient in the appropriate combination of m^3, mol, and s at temperature T in K and
pressure P in Pa.
highPlimit
rmgpy.kinetics.model.KineticsModel
Type highPlimit
isIdenticalTo(self, KineticsModel otherKinetics) → bool
Returns True if kinetics matches that of another kinetics model. Each duplicate reaction must be matched
and equal to that in the other MultiArrhenius model in the same order. Otherwise returns False
isPressureDependent(self ) → bool
Return True since all objects derived from PDepKineticsModel represent pressure-dependent kinetics.
isPressureValid(self, double P) → bool
Return True if the pressure P in Pa is within the valid pressure range of the kinetic data, or False if not.
If the minimum and maximum pressure are not defined, True is returned.
isSimilarTo(self, KineticsModel otherKinetics) → bool
Returns True if rates of reaction at temperatures 500,1000,1500,2000 K and 1 and 10 bar are within +/ .5
for log(k), in other words, within a factor of 3.
isTemperatureValid(self, double T ) → bool
Return True if the temperature T in K is within the valid temperature range of the kinetic data, or False
if not. If the minimum and maximum temperature are not defined, True is returned.
setCanteraKinetics(self, ctReaction, speciesList)
Sets the PLOG kinetics for multiple cantera Reaction objects, provided in a list. ctReaction is a list of
cantera reaction objects.
toHTML(self )
Return an HTML rendering.
rmgpy.kinetics.Chebyshev
Attribute Description
coeffs Matrix of Chebyshev coefficients, such that the resulting 𝑘(𝑇, 𝑃 ) has units of cm^3, mol, s
kunits The units of the rate coefficient
degreeT The number of terms in the inverse temperature direction
degreeP The number of terms in the log pressure direction
Tmin The minimum temperature at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature at which the model is valid, or zero if unknown or undefined
Pmin The minimum pressure at which the model is valid, or zero if unknown or undefined
Pmax The maximum pressure at which the model is valid, or zero if unknown or undefined
comment Information about the model (e.g. its source)
The Chebyshev polynomial formulation is a means of fitting a wide range of complex 𝑘(𝑇, 𝑃 ) behavior. How-
ever, there is no meaningful physical interpretation of the polynomial-based fit, and one must take care to
minimize the magnitude of Runge’s phenomenon. The formulation is as follows:
𝑁𝑇 ∑︁
∑︁ 𝑁𝑃
log 𝑘(𝑇, 𝑃 ) = 𝛼𝑡𝑝 𝜑𝑡 (𝑇˜)𝜑𝑝 (𝑃˜ )
𝑡=1 𝑝=1
Above, 𝛼𝑡𝑝 is a constant, 𝜑𝑛 (𝑥) is the Chebyshev polynomial of degree 𝑛 evaluated at 𝑥, and
−1
2𝑇 −1 − 𝑇min −1
− 𝑇max
𝑇˜ ≡ −1 −1
𝑇max − 𝑇min
degreeP
‘int’
Type degreeP
degreeT
‘int’
Type degreeT
discrepancy(self, KineticsModel otherKinetics) → double
Returns some measure of the discrepancy based on two different reaction models.
efficiencies
dict
Type efficiencies
fitToData(self, ndarray Tlist, ndarray Plist, ndarray K, str kunits, int degreeT, int degreeP, double
Tmin, double Tmax, double Pmin, double Pmax)
Fit a Chebyshev kinetic model to a set of rate coefficients K, which is a matrix corresponding to the
temperatures Tlist in K and pressures Plist in Pa. degreeT and degreeP are the degree of the polynomials
in temperature and pressure, while Tmin, Tmax, Pmin, and Pmax set the edges of the valid temperature
and pressure ranges in K and bar, respectively.
getCanteraEfficiencies(self, speciesList)
Returns a dictionary containing the collider efficiencies for this PDepKineticsModel object suitable
for setting the efficiencies in the following cantera reaction objects: ThreeBodyReaction, FalloffReac-
tion,‘ChemicallyActivatedReaction‘
getEffectiveColliderEfficiencies(self, list species) → ndarray
Return the effective collider efficiencies for all species in the form of a numpy array. This function helps
assist rapid effective pressure calculations in the solver.
getEffectivePressure(self, double P, list species, ndarray fractions) → double
Return the effective pressure in Pa for a system at a given pressure P in Pa composed of the given list of
species (Species or Molecule objects) with the given fractions.
getRateCoefficient(self, double T, double P=0) → double
Return the rate coefficient in the appropriate combination of m^3, mol, and s at temperature T in K and
pressure P in Pa by evaluating the Chebyshev expression.
highPlimit
rmgpy.kinetics.model.KineticsModel
Type highPlimit
isIdenticalTo(self, KineticsModel otherKinetics) → bool
Checks to see if kinetics matches that of other kinetics and returns True if coeffs, kunits, Tmin,
isPressureDependent(self ) → bool
Return True since all objects derived from PDepKineticsModel represent pressure-dependent kinetics.
isPressureValid(self, double P) → bool
Return True if the pressure P in Pa is within the valid pressure range of the kinetic data, or False if not.
If the minimum and maximum pressure are not defined, True is returned.
isSimilarTo(self, KineticsModel otherKinetics) → bool
Returns True if rates of reaction at temperatures 500,1000,1500,2000 K and 1 and 10 bar are within +/ .5
for log(k), in other words, within a factor of 3.
rmgpy.kinetics.ThirdBody
Attribute Description
arrheniusLow The Arrhenius kinetics at the low-pressure limit
Tmin The minimum temperature at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature at which the model is valid, or zero if unknown or undefined
Pmin The minimum pressure at which the model is valid, or zero if unknown or undefined
Pmax The maximum pressure at which the model is valid, or zero if unknown or undefined
efficiencies A dict associating chemical species with associated efficiencies
comment Information about the model (e.g. its source)
Third-body kinetics simply introduce an inert third body to the rate expression:
𝑘(𝑇, 𝑃 ) = 𝑘0 (𝑇 )[M]
Above, [M] ≈ 𝑃/𝑅𝑇 is the concentration of the bath gas. This formulation is equivalent to stating that the
kinetics are always in the low-pressure limit.
Pmax
The maximum pressure at which the model is valid, or None if not defined.
Pmin
The minimum pressure at which the model is valid, or None if not defined.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
arrheniusLow
rmgpy.kinetics.arrhenius.Arrhenius
Type arrheniusLow
changeRate(self, double factor)
Changes kinetics rate by a multiple factor.
comment
str
Type comment
discrepancy(self, KineticsModel otherKinetics) → double
Returns some measure of the discrepancy based on two different reaction models.
efficiencies
dict
Type efficiencies
getCanteraEfficiencies(self, speciesList)
Returns a dictionary containing the collider efficiencies for this PDepKineticsModel object suitable
for setting the efficiencies in the following cantera reaction objects: ThreeBodyReaction, FalloffReac-
tion,‘ChemicallyActivatedReaction‘
getEffectiveColliderEfficiencies(self, list species) → ndarray
Return the effective collider efficiencies for all species in the form of a numpy array. This function helps
assist rapid effective pressure calculations in the solver.
getEffectivePressure(self, double P, list species, ndarray fractions) → double
Return the effective pressure in Pa for a system at a given pressure P in Pa composed of the given list of
species (Species or Molecule objects) with the given fractions.
getRateCoefficient(self, double T, double P=0.0) → double
Return the value of the rate coefficient 𝑘(𝑇 ) in units of m^3, mol, and s at the specified temperature
T in K and pressure P in Pa. If you wish to consider collision efficiencies, then you should first use
getEffectivePressure() to compute the effective pressure, and pass that value as the pressure to this
method.
highPlimit
rmgpy.kinetics.model.KineticsModel
Type highPlimit
isIdenticalTo(self, KineticsModel otherKinetics) → bool
Checks to see if kinetics matches that of other kinetics and returns True if coeffs, kunits, Tmin,
isPressureDependent(self ) → bool
Return True since all objects derived from PDepKineticsModel represent pressure-dependent kinetics.
isPressureValid(self, double P) → bool
Return True if the pressure P in Pa is within the valid pressure range of the kinetic data, or False if not.
If the minimum and maximum pressure are not defined, True is returned.
isSimilarTo(self, KineticsModel otherKinetics) → bool
Returns True if rates of reaction at temperatures 500,1000,1500,2000 K and 1 and 10 bar are within +/ .5
for log(k), in other words, within a factor of 3.
isTemperatureValid(self, double T ) → bool
Return True if the temperature T in K is within the valid temperature range of the kinetic data, or False
if not. If the minimum and maximum temperature are not defined, True is returned.
setCanteraKinetics(self, ctReaction, speciesList)
Sets the kinetics and efficiencies for a cantera ThreeBodyReaction object
toHTML(self )
Return an HTML rendering.
rmgpy.kinetics.Lindemann
Attribute Description
arrheniusHigh The Arrhenius kinetics at the high-pressure limit
arrheniusLow The Arrhenius kinetics at the low-pressure limit
Tmin The minimum temperature at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature at which the model is valid, or zero if unknown or undefined
Pmin The minimum pressure at which the model is valid, or zero if unknown or undefined
Pmax The maximum pressure at which the model is valid, or zero if unknown or undefined
efficiencies A dict associating chemical species with associated efficiencies
comment Information about the model (e.g. its source)
The Lindemann model qualitatively predicts the falloff of some simple pressure-dependent reaction kinetics.
The formulation is as follows:
[︂ ]︂
𝑃r
𝑘(𝑇, 𝑃 ) = 𝑘∞ (𝑇 )
1 + 𝑃r
where
𝑘0 (𝑇 )
𝑃r = [M]
𝑘∞ (𝑇 )
(︂ )︂
𝐸0
𝑘0 (𝑇 ) = 𝐴0 𝑇 𝑛0 exp −
𝑅𝑇
(︂ )︂
𝐸∞
𝑘∞ (𝑇 ) = 𝐴∞ 𝑇 𝑛∞ exp −
𝑅𝑇
and [M] ≈ 𝑃/𝑅𝑇 is the concentration of the bath gas. The Arrhenius expressions 𝑘0 (𝑇 ) and 𝑘∞ (𝑇 ) represent
the low-pressure and high-pressure limit kinetics, respectively.
Pmax
The maximum pressure at which the model is valid, or None if not defined.
Pmin
The minimum pressure at which the model is valid, or None if not defined.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
arrheniusHigh
rmgpy.kinetics.arrhenius.Arrhenius
Type arrheniusHigh
arrheniusLow
rmgpy.kinetics.arrhenius.Arrhenius
Type arrheniusLow
rmgpy.kinetics.Troe
Attribute Description
arrheniusHigh The Arrhenius kinetics at the high-pressure limit
arrheniusLow The Arrhenius kinetics at the low-pressure limit
alpha The 𝛼 parameter
T1 The 𝑇1 parameter
T2 The 𝑇2 parameter
T3 The 𝑇3 parameter
Tmin The minimum temperature at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature at which the model is valid, or zero if unknown or undefined
Pmin The minimum pressure at which the model is valid, or zero if unknown or undefined
Pmax The maximum pressure at which the model is valid, or zero if unknown or undefined
efficiencies A dict associating chemical species with associated efficiencies
comment Information about the model (e.g. its source)
The Troe model attempts to make the Lindemann model quantitative by introducing a broadening factor 𝐹 . The
formulation is as follows:
[︂ ]︂
𝑃r
𝑘(𝑇, 𝑃 ) = 𝑘∞ (𝑇 ) 𝐹
1 + 𝑃r
where
𝑘0 (𝑇 )
𝑃r = [M]
𝑘∞ (𝑇 )
(︂)︂
𝑛0 𝐸0
𝑘0 (𝑇 ) = 𝐴0 𝑇 exp −
𝑅𝑇
(︂ )︂
𝑛∞ 𝐸∞
𝑘∞ (𝑇 ) = 𝐴∞ 𝑇 exp −
𝑅𝑇
and [M] ≈ 𝑃/𝑅𝑇 is the concentration of the bath gas. The Arrhenius expressions 𝑘0 (𝑇 ) and 𝑘∞ (𝑇 ) represent
the low-pressure and high-pressure limit kinetics, respectively. The broadening factor 𝐹 is computed via
{︃ [︂ ]︂2 }︃−1
log 𝑃r + 𝑐
log 𝐹 = 1 + log 𝐹cent
𝑛 − 𝑑(log 𝑃r + 𝑐)
𝑐 = −0.4 − 0.67 log 𝐹cent
𝑛 = 0.75 − 1.27 log 𝐹cent
𝑑 = 0.14
𝐹cent = (1 − 𝛼) exp (−𝑇 /𝑇3 ) + 𝛼 exp (−𝑇 /𝑇1 ) + exp (−𝑇2 /𝑇 )
Pmax
The maximum pressure at which the model is valid, or None if not defined.
Pmin
The minimum pressure at which the model is valid, or None if not defined.
T1
The Troe 𝑇1 parameter.
T2
The Troe 𝑇2 parameter.
T3
The Troe 𝑇3 parameter.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
alpha
‘double’
Type alpha
arrheniusHigh
rmgpy.kinetics.arrhenius.Arrhenius
Type arrheniusHigh
arrheniusLow
rmgpy.kinetics.arrhenius.Arrhenius
Type arrheniusLow
changeRate(self, double factor)
Changes kinetics rate by a multiple factor.
comment
str
Type comment
discrepancy(self, KineticsModel otherKinetics) → double
Returns some measure of the discrepancy based on two different reaction models.
efficiencies
dict
Type efficiencies
getCanteraEfficiencies(self, speciesList)
Returns a dictionary containing the collider efficiencies for this PDepKineticsModel object suitable
for setting the efficiencies in the following cantera reaction objects: ThreeBodyReaction, FalloffReac-
tion,‘ChemicallyActivatedReaction‘
getEffectiveColliderEfficiencies(self, list species) → ndarray
Return the effective collider efficiencies for all species in the form of a numpy array. This function helps
assist rapid effective pressure calculations in the solver.
getEffectivePressure(self, double P, list species, ndarray fractions) → double
Return the effective pressure in Pa for a system at a given pressure P in Pa composed of the given list of
species (Species or Molecule objects) with the given fractions.
getRateCoefficient(self, double T, double P=0.0) → double
Return the value of the rate coefficient 𝑘(𝑇 ) in units of m^3, mol, and s at the specified temperature
T in K and pressure P in Pa. If you wish to consider collision efficiencies, then you should first use
getEffectivePressure() to compute the effective pressure, and pass that value as the pressure to this
method.
highPlimit
rmgpy.kinetics.model.KineticsModel
Type highPlimit
isIdenticalTo(self, KineticsModel otherKinetics) → bool
Checks to see if kinetics matches that of other kinetics and returns True if coeffs, kunits, Tmin,
isPressureDependent(self ) → bool
Return True since all objects derived from PDepKineticsModel represent pressure-dependent kinetics.
isPressureValid(self, double P) → bool
Return True if the pressure P in Pa is within the valid pressure range of the kinetic data, or False if not.
If the minimum and maximum pressure are not defined, True is returned.
isSimilarTo(self, KineticsModel otherKinetics) → bool
Returns True if rates of reaction at temperatures 500,1000,1500,2000 K and 1 and 10 bar are within +/ .5
for log(k), in other words, within a factor of 3.
isTemperatureValid(self, double T ) → bool
Return True if the temperature T in K is within the valid temperature range of the kinetic data, or False
if not. If the minimum and maximum temperature are not defined, True is returned.
setCanteraKinetics(self, ctReaction, speciesList)
Sets the efficiencies, kinetics, and troe falloff parameters for a cantera FalloffReaction.
toHTML(self )
Return an HTML rendering.
rmgpy.kinetics.Wigner
class rmgpy.kinetics.Wigner(frequency)
A tunneling model based on the Wigner formula. The attributes are:
Attribute Description
frequency The imaginary frequency of the transition state
An early formulation for incorporating the effect of tunneling is that of Wigner [1932Wigner]:
(︂ )︂2
1 ℎ |𝜈TS |
𝜅(𝑇 ) = 1 +
24 𝑘B 𝑇
where ℎ is the Planck constant, 𝜈TS is the negative frequency, 𝑘B is the Boltzmann constant, and 𝑇 is the
absolute temperature.
The Wigner formula represents the first correction term in a perturbative expansion for a parabolic barrier
[1959Bell], and is therefore only accurate in the limit of a small tunneling correction. There are many cases
for which the tunneling correction is very large; for these cases the Wigner model is inappropriate.
calculateTunnelingFactor(self, double T ) → double
Calculate and return the value of the Wigner tunneling correction for the reaction at the temperature T in
K.
calculateTunnelingFunction(self, ndarray Elist) → ndarray
Raises NotImplementedError, as the Wigner tunneling model does not have a well-defined energy-
dependent tunneling function.
frequency
The negative frequency along the reaction coordinate.
rmgpy.kinetics.Eckart
Attribute Description
frequency The imaginary frequency of the transition state
E0_reac The ground-state energy of the reactants
E0_TS The ground-state energy of the transition state
E0_prod The ground-state energy of the products
If E0_prod is not given, it is assumed to be the same as the reactants; this results in the so-called “symmetric”
Eckart model. Providing E0_prod, and thereby using the “asymmetric” Eckart model, is the recommended
approach.
The Eckart tunneling model is based around a potential of the form
[︃ ]︃
~2 𝐴𝑒𝑥 𝐵𝑒𝑥
𝑉 (𝑥) = + 2
2𝑚 1 + 𝑒𝑥 (1 + 𝑒𝑥 )
where 𝑥 represents the reaction coordinate and 𝐴 and 𝐵 are parameters. The potential is symmetric if 𝐴 = 0
and asymmetric if 𝐴 ̸= 0. If we add the constraint |𝐵| > |𝐴| then the potential has a maximum at
(︂ )︂
𝐵+𝐴
𝑥max = ln
𝐵−𝐴
~2 (𝐴 + 𝐵)2
𝑉 (𝑥max ) =
2𝑚 4𝐵
The one-dimensional Schrodinger equation with the Eckart potential is analytically solvable. The resulting
microcanonical tunneling factor 𝜅(𝐸) is a function of the total energy of the molecular system:
where
√
2 𝛼1 𝜉
2𝜋𝑎 = −1/2 −1/2
𝛼1 + 𝛼2
√︀
2 |(𝜉 − 1)𝛼1 + 𝛼2 |
2𝜋𝑏 = −1/2 −1/2
𝛼1 + 𝛼2
√︀
2𝜋𝑑 = 2 |𝛼1 𝛼2 − 4𝜋 2 /16|
∆𝑉1
𝛼1 = 2𝜋
ℎ |𝜈TS |
∆𝑉2
𝛼2 = 2𝜋
ℎ |𝜈TS |
𝐸
𝜉=
∆𝑉1
∆𝑉1 and ∆𝑉2 are the thermal energy difference between the transition state and the reactants and products,
respectively; 𝜈TS is the negative frequency, ℎ is the Planck constant.
Applying a Laplace transform gives the canonical tunneling factor as a function of temperature 𝑇 (expressed as
𝛽 ≡ 1/𝑘B 𝑇 ):
∫︁ ∞
𝜅(𝑇 ) = 𝑒 𝛽Δ𝑉1
𝜅(𝐸)𝑒−𝛽𝐸 𝑑𝐸
0
The rmgpy.molecule subpackage contains classes and functions for working with molecular representations, partic-
ularly using chemical graph theory.
1.6.1 Graphs
Class Description
Vertex A generic vertex (node) in a graph
Edge A generic edge (arc) in a graph
Graph A generic graph data type
Class Description
VF2 Graph isomorphism using the VF2 algorithm
Class/Function Description
Element A model of a chemical element
getElement() Return the Element object for a given atomic number or symbol
AtomType A model of an atom type: an element and local bond structure
getAtomType() Return the AtomType object for a given atom in a molecule
1.6.4 Molecules
Class Description
Atom An atom in a molecule
Bond A bond in a molecule
Molecule A molecular structure represented using a chemical graph
Class Description
GroupAtom An atom in a functional group
GroupBond A bond in a functional group
Group A functional group structure represented using a chemical graph
Class Description
rmgpy.molecule.resonance Resonance structure generation methods
rmgpy.molecule.kekulize Kekule structure generation
rmgpy.molecule.pathfinder Resonance path enumeration
rmgpy.molecule.converter Molecule object converter (RDKit/OpenBabel)
rmgpy.molecule.translator Molecule string representation translator
Function Description
fromAdjacencyList() Convert an adjacency list to a set of atoms and bonds
toAdjacencyList() Convert a set of atoms and bonds to an adjacency list
Class Description
calculateAtomSymmetryNumber() Calculate the atom-centered symmetry number for an atom in a molecule
calculateBondSymmetryNumber() Calculate the bond-centered symmetry number for a bond in a molecule
calculateAxisSymmetryNumber() Calculate the axis-centered symmetry number for a double bond axis in a
molecule
calculateCyclicSymmetryNumber()
Calculate the ring-centered symmetry number for a ring in a molecule
calculateSymmetryNumber() Calculate the total internal + external symmetry number for a molecule
Class Description
MoleculeDrawer Draw the skeletal formula of a molecule
ReactionDrawer Draw a chemical reaction
rmgpy.molecule.graph.Vertex
class rmgpy.molecule.graph.Vertex
A base class for vertices in a graph. Contains several connectivity values useful for accelerating isomorphism
searches, as proposed by Morgan (1965).
connectivity1
‘short’
Type connectivity1
connectivity2
‘short’
Type connectivity2
connectivity3
‘short’
Type connectivity3
copy(self ) → Vertex
Return a copy of the vertex. The default implementation assumes that no semantic information is associ-
ated with each vertex, and therefore simply returns a new Vertex object.
edges
dict
Type edges
rmgpy.molecule.graph.Edge
Type vertex2
rmgpy.molecule.graph.Graph
class rmgpy.molecule.graph.Graph(vertices=None)
A graph data type. The vertices of the graph are stored in a list vertices; this provides a consistent traversal
order. A single edge can be accessed using the getEdge() method or by accessing specific vertices using
vertex1.edges[vertex2]; in either case, an exception will be raised if the edge does not exist. All edges of
a vertex can be accessed using the getEdges() method or vertex.edges.
addEdge(self, Edge edge) → Edge
Add an edge to the graph. The two vertices in the edge must already exist in the graph, or a ValueError
is raised.
addVertex(self, Vertex vertex) → Vertex
Add a vertex to the graph. The vertex is initialized with no edges.
copy(self, bool deep=False) → Graph
Create a copy of the current graph. If deep is True, a deep copy is made: copies of the vertices and edges
are used in the new graph. If deep is False or not specified, a shallow copy is made: the original vertices
and edges are used in the new graph.
copyAndMap(self ) → dict
Create a deep copy of the current graph, and return the dict ‘mapping’. Method was modified from
Graph.copy() method
findIsomorphism(self, Graph other, dict initialMap=None, bool saveOrder=False, bool strict=True)
→ list
Returns True if other is subgraph isomorphic and False otherwise, and the matching mapping. Uses the
VF2 algorithm of Vento and Foggia.
Parameters
• initialMap (dict, optional) – initial atom mapping to use
• saveOrder (bool, optional) – if True, reset atom order after performing atom iso-
morphism
• strict (bool, optional) – if False, perform isomorphism ignoring electrons
findSubgraphIsomorphisms(self, Graph other, dict initialMap=None, bool saveOrder=False) → list
Returns True if other is subgraph isomorphic and False otherwise. Also returns the lists all of valid
mappings.
Uses the VF2 algorithm of Vento and Foggia.
getAllCycles(self, Vertex startingVertex) → list
Given a starting vertex, returns a list of all the cycles containing that vertex.
This function returns a duplicate of each cycle because [0,1,2,3] is counted as separate from [0,3,2,1]
getAllCyclesOfSize(self, int size) → list
Return a list of the all non-duplicate rings with length ‘size’. The algorithm implements was adapted from
a description by Fan, Panaye, Doucet, and Barbu (doi: 10.1021/ci00015a002)
B. T. Fan, A. Panaye, J. P. Doucet, and A. Barbu. “Ring Perception: A New Algorithm for Directly Finding
the Smallest Set of Smallest Rings from a Connection Table.” J. Chem. Inf. Comput. Sci. 33, p. 657-662
(1993).
getAllCyclicVertices(self ) → list
Returns all vertices belonging to one or more cycles.
getAllEdges(self ) → list
Returns a list of all edges in the graph.
getAllPolycyclicVertices(self ) → list
Return all vertices belonging to two or more cycles, fused or spirocyclic.
getAllSimpleCyclesOfSize(self, int size) → list
Return a list of all non-duplicate monocyclic rings with length ‘size’.
Naive approach by eliminating polycyclic rings that are returned by getAllCyclicsOfSize.
getDisparateRings(self ) → tuple
Get all disjoint monocyclic and polycyclic cycle clusters in the molecule. Takes the RC and recursively
merges all cycles which share vertices.
Returns: monocyclic_cycles, polycyclic_cycles
getEdge(self, Vertex vertex1, Vertex vertex2) → Edge
Returns the edge connecting vertices vertex1 and vertex2.
getEdges(self, Vertex vertex) → dict
Return a dictionary of the edges involving the specified vertex.
getLargestRing(self, Vertex vertex) → list
returns the largest ring containing vertex. This is typically useful for finding the longest path in a polycyclic
ring, since the polycyclic rings returned from getPolycyclicRings are not necessarily in order in the ring
structure.
getMaxCycleOverlap(self ) → int
Return the maximum number of vertices that are shared between any two cycles in the graph. For example,
if there are only disparate monocycles or no cycles, the maximum overlap is zero; if there are “spiro”
cycles, it is one; if there are “fused” cycles, it is two; and if there are “bridged” cycles, it is three.
getMonocyclicRings(self ) → list
Return a list of cycles that are monocyclic.
getPolycyclicRings(self ) → list
Return a list of cycles that are polycyclic. In other words, merge the cycles which are fused or spirocyclic
into a single polycyclic cycle, and return only those cycles. Cycles which are not polycyclic are not
returned.
getRelevantCycles(self ) → list
Returns the set of relevant cycles as a list of lists. Uses RingDecomposerLib for ring perception.
Kolodzik, A.; Urbaczek, S.; Rarey, M. Unique Ring Families: A Chemically Meaningful Description of
Molecular Ring Topologies. J. Chem. Inf. Model., 2012, 52 (8), pp 2013-2021
Flachsenberg, F.; Andresen, N.; Rarey, M. RingDecomposerLib: An Open-Source Implementation of
Unique Ring Families and Other Cycle Bases. J. Chem. Inf. Model., 2017, 57 (2), pp 122-126
getSmallestSetOfSmallestRings(self ) → list
Returns the smallest set of smallest rings as a list of lists. Uses RingDecomposerLib for ring perception.
Kolodzik, A.; Urbaczek, S.; Rarey, M. Unique Ring Families: A Chemically Meaningful Description of
Molecular Ring Topologies. J. Chem. Inf. Model., 2012, 52 (8), pp 2013-2021
Flachsenberg, F.; Andresen, N.; Rarey, M. RingDecomposerLib: An Open-Source Implementation of
Unique Ring Families and Other Cycle Bases. J. Chem. Inf. Model., 2017, 57 (2), pp 122-126
get_edges_in_cycle(self, list vertices, bool sort=False) → list
For a given list of atoms comprising a ring, return the set of bonds connecting them, in order around the
ring.
If sort=True, then sort the vertices to match their connectivity. Otherwise, assumes that they are already
sorted, which is true for cycles returned by getRelevantCycles or getSmallestSetOfSmallestRings.
hasEdge(self, Vertex vertex1, Vertex vertex2) → bool
Returns True if vertices vertex1 and vertex2 are connected by an edge, or False if not.
hasVertex(self, Vertex vertex) → bool
Returns True if vertex is a vertex in the graph, or False if not.
isCyclic(self ) → bool
Return True if one or more cycles are present in the graph or False otherwise.
isEdgeInCycle(self, Edge edge) → bool
Return True if the edge between vertices vertex1 and vertex2 is in one or more cycles in the graph, or
False if not.
isIsomorphic(self, Graph other, dict initialMap=None, bool saveOrder=False, bool strict=True) →
bool
Returns True if two graphs are isomorphic and False otherwise. Uses the VF2 algorithm of Vento and
Foggia.
Parameters
• initialMap (dict, optional) – initial atom mapping to use
• saveOrder (bool, optional) – if True, reset atom order after performing atom iso-
morphism
• strict (bool, optional) – if False, perform isomorphism ignoring electrons
isMappingValid(self, Graph other, dict mapping, bool equivalent=True, bool strict=True) → bool
Check that a proposed mapping of vertices from self to other is valid by checking that the vertices and
edges involved in the mapping are mutually equivalent. If equivalent is True it checks if atoms and edges
are equivalent, if False it checks if they are specific cases of each other. If strict is True, electrons and
bond orders are considered, and ignored if False.
isSubgraphIsomorphic(self, Graph other, dict initialMap=None, bool saveOrder=False) → bool
Returns True if other is subgraph isomorphic and False otherwise. Uses the VF2 algorithm of Vento and
Foggia.
isVertexInCycle(self, Vertex vertex) → bool
Return True if the given vertex is contained in one or more cycles in the graph, or False if not.
merge(self, Graph other) → Graph
Merge two graphs so as to store them in a single Graph object.
ordered_vertices
list
Type ordered_vertices
removeEdge(self, Edge edge)
Remove the specified edge from the graph. Does not remove vertices that no longer have any edges as a
result of this removal.
removeVertex(self, Vertex vertex)
Remove vertex and all edges associated with it from the graph. Does not remove vertices that no longer
have any edges as a result of this removal.
resetConnectivityValues(self )
Reset any cached connectivity information. Call this method when you have modified the graph.
restore_vertex_order(self )
reorder the vertices to what they were before sorting if you saved the order
rmgpy.molecule.vf2.VF2
rmgpy.molecule.Element
This class is specifically for properties that all atoms of the same element share. Ideally there is only one instance
of this class for each element.
chemkinName
str
Type chemkinName
covRadius
‘float’
Type covRadius
isotope
‘int’
Type isotope
mass
‘float’
Type mass
name
str
Type name
number
‘int’
Type number
symbol
str
Type symbol
rmgpy.molecule.getElement(value, int isotope=-1) → Element
Return the Element object corresponding to the given parameter value. If an integer is provided, the value is
treated as the atomic number. If a string is provided, the value is treated as the symbol. An ElementError is
raised if no matching element is found.
rmgpy.molecule.AtomType
metadata describing the atom type’s hierarchy with regard to other atom types, and the atom types that can result
when various actions involving this atom type are taken. The attributes are:
allDouble
list
Type allDouble
benzene
list
Type benzene
breakBond
list
Type breakBond
charge
list
Type charge
decrementBond
list
Type decrementBond
decrementLonePair
list
Type decrementLonePair
decrementRadical
list
Type decrementRadical
equivalent(self, AtomType other) → bool
Returns True if two atom types atomType1 and atomType2 are equivalent or False otherwise. This
function respects wildcards, e.g. R!H is equivalent to C.
formBond
list
Type formBond
generic
list
Type generic
getFeatures(self ) → list
Returns a list of the features that are checked to determine atomtype
incrementBond
list
Type incrementBond
incrementLonePair
list
Type incrementLonePair
incrementRadical
list
Type incrementRadical
isSpecificCaseOf(self, AtomType other) → bool
Returns True if atom type atomType1 is a specific case of atom type atomType2 or False otherwise.
label
str
Type label
lonePairs
list
Type lonePairs
oDouble
list
Type oDouble
quadruple
list
Type quadruple
rDouble
list
Type rDouble
sDouble
list
Type sDouble
setActions(self, incrementBond, decrementBond, formBond, breakBond, incrementRadical, decremen-
tRadical, incrementLonePair, decrementLonePair)
single
list
Type single
specific
list
Type specific
triple
list
Type triple
rmgpy.molecule.getAtomType(atom, dict bonds) → AtomType
Determine the appropriate atom type for an Atom object atom with local bond structure bonds, a dict containing
atom-bond pairs.
The atom type of an atom describes the atom itself and (often) something about the local bond structure around
that atom. This is a useful semantic tool for accelerating graph isomorphism queries, and a useful shorthand when
specifying molecular substructure patterns via an RMG-style adjacency list.
We define the following basic atom types:
Reaction recipes
A reaction recipe is a procedure for applying a reaction to a set of chemical species. Each reaction recipe is made up
of a set of actions that, when applied sequentially, a set of chemical reactants to chemical products via that reaction’s
characteristic chemical process. Each action requires a small set of parameters in order to be fully defined.
We define the following reaction recipe actions:
rmgpy.molecule.Atom
Additionally, the mass, number, and symbol attributes of the atom’s element can be read (but not written)
directly from the atom object, e.g. atom.symbol instead of atom.element.symbol.
applyAction(self, action)
Update the atom pattern as a result of applying action, a tuple containing the name of the reaction recipe
action along with any required parameters. The available actions can be found here.
atomType
rmgpy.molecule.atomtype.AtomType
Type atomType
charge
‘short’
Type charge
connectivity1
‘short’
Type connectivity1
connectivity2
‘short’
Type connectivity2
connectivity3
‘short’
Type connectivity3
coords
numpy.ndarray
Type coords
copy(self ) → Vertex
Generate a deep copy of the current atom. Modifying the attributes of the copy will not affect the original.
decrementLonePairs(self )
Update the lone electron pairs pattern as a result of applying a LOSE_PAIR action.
decrementRadical(self )
Update the atom pattern as a result of applying a LOSE_RADICAL action, where radical specifies the
number of radical electrons to remove.
edges
dict
Type edges
element
rmgpy.molecule.element.Element
Type element
equivalent(self, Vertex other, bool strict=True) → bool
Return True if other is indistinguishable from this atom, or False otherwise. If other is an Atom object,
then all attributes except label and ‘ID’ must match exactly. If other is an GroupAtom object, then the
atom must match any of the combinations in the atom pattern. If strict is False, then only the element
is compared and electrons are ignored.
getBondOrdersForAtom(self )
This helper function is to help calculate total bond orders for an input atom.
Some special consideration for the order B bond. For atoms having three B bonds, the order for each is
4/3.0, while for atoms having other than three B bonds, the order for each is 3/2.0
get_descriptor(self )
Return a tuple used for sorting atoms. Currently uses atomic number, connectivity value, radical electrons,
lone pairs, and charge
id
‘int’
Type id
ignore
‘bool’
Type ignore
incrementLonePairs(self )
Update the lone electron pairs pattern as a result of applying a GAIN_PAIR action.
incrementRadical(self )
Update the atom pattern as a result of applying a GAIN_RADICAL action, where radical specifies the
number of radical electrons to add.
isCarbon(self ) → bool
Return True if the atom represents a carbon atom or False if not.
isChlorine(self ) → bool
Return True if the atom represents a chlorine atom or False if not.
isFluorine(self ) → bool
Return True if the atom represents a fluorine atom or False if not.
isHydrogen(self ) → bool
Return True if the atom represents a hydrogen atom or False if not.
isIodine(self ) → bool
Return True if the atom represents an iodine atom or False if not.
isNOS(self ) → bool
Return True if the atom represent either nitrogen, sulfur, or oxygen False if it does not.
isNitrogen(self )
Return True if the atom represents a nitrogen atom or False if not.
isNonHydrogen(self ) → bool
Return True if the atom does not represent a hydrogen atom or False if it does.
isOxygen(self ) → bool
Return True if the atom represents an oxygen atom or False if not.
isSilicon(self ) → bool
Return True if the atom represents a silicon atom or False if not.
isSpecificCaseOf(self, Vertex other) → bool
Return True if self is a specific case of other, or False otherwise. If other is an Atom object, then this is
the same as the equivalent() method. If other is an GroupAtom object, then the atom must match or
be more specific than any of the combinations in the atom pattern.
isSulfur(self ) → bool
Return True if the atom represents a sulfur atom or False if not.
isSurfaceSite(self ) → bool
Return True if the atom represents a surface site or False if not.
label
str
Type label
lonePairs
‘short’
Type lonePairs
mapping
rmgpy.molecule.graph.Vertex
Type mapping
props
dict
Type props
radicalElectrons
‘short’
Type radicalElectrons
resetConnectivityValues(self )
Reset the cached structure information for this vertex.
setLonePairs(self, int lonePairs)
Set the number of lone electron pairs.
sortingLabel
‘short’
Type sortingLabel
terminal
‘bool’
Type terminal
updateCharge(self )
Update self.charge, according to the valence, and the number and types of bonds, radicals, and lone pairs.
rmgpy.molecule.Bond
applyAction(self, action)
Update the bond as a result of applying action, a tuple containing the name of the reaction recipe action
along with any required parameters. The available actions can be found here.
copy(self ) → Edge
Generate a deep copy of the current bond. Modifying the attributes of the copy will not affect the original.
decrementOrder(self )
Update the bond as a result of applying a CHANGE_BOND action to decrease the order by one.
equivalent(self, Edge other) → bool
Return True if other is indistinguishable from this bond, or False otherwise. other can be either a Bond
or a GroupBond object.
getBDE(self )
estimate the bond dissociation energy in J/mol of the bond based on the order of the bond and the atoms
involved in the bond
getOrderNum(self ) → float
returns the bond order as a number
getOrderStr(self ) → str
returns a string representing the bond order
Bond types
The bond type simply indicates the order of a chemical bond. We define the following bond types:
rmgpy.molecule.Molecule
A new molecule object can be easily instantiated by passing the SMILES or InChI string representing the molec-
ular structure.
InChI
InChI string for this molecule. Read-only.
SMILES
SMILES string for this molecule. Read-only.
addAtom(self, Atom atom)
Add an atom to the graph. The atom is initialized with no bonds.
the file to save the generated image to; the image type is automatically determined by extension. Valid
extensions are .png, .svg, .pdf, and .ps; of these, the first is a raster format and the remainder are
vector formats.
enumerate_bonds(self ) → dict
Count the number of each type of bond (e.g. ‘C-H’, ‘C=C’) present in the molecule :return: dictionary,
with bond strings as keys and counts as values
findIsomorphism(self, Graph other, dict initialMap=None, bool saveOrder=False, bool strict=True)
→ list
Returns True if other is isomorphic and False otherwise, and the matching mapping. The initialMap
attribute can be used to specify a required mapping from self to other (i.e. the atoms of self are the keys,
while the atoms of other are the values). The returned mapping also uses the atoms of self for the keys
and the atoms of other for the values. The other parameter must be a Molecule object, or a TypeError
is raised.
Parameters
• initialMap (dict, optional) – initial atom mapping to use
• saveOrder (bool, optional) – if True, reset atom order after performing atom iso-
morphism
• strict (bool, optional) – if False, perform isomorphism ignoring electrons
findSubgraphIsomorphisms(self, Graph other, dict initialMap=None, bool saveOrder=False) → list
Returns True if other is subgraph isomorphic and False otherwise. Also returns the lists all of valid
mappings. The initialMap attribute can be used to specify a required mapping from self to other (i.e. the
atoms of self are the keys, while the atoms of other are the values). The returned mappings also use the
atoms of self for the keys and the atoms of other for the values. The other parameter must be a Group
object, or a TypeError is raised.
find_H_bonds(self )
generates a list of (new-existing H bonds ignored) possible Hbond coordinates [(i1,j1),(i2,j2),. . . ] where i
and j values correspond to the indexes of the atoms involved, Hbonds are allowed if they meet the following
constraints:
1) between a H and [O,N] atoms
2) the hydrogen is covalently bonded to an O or N
3) the Hydrogen bond must complete a ring with at least 5 members
4) An atom can only be hydrogen bonded to one other atom
fingerprint
Fingerprint used to accelerate graph isomorphism comparisons with other molecules. The fingerprint is
a short string containing a summary of selected information about the molecule. Two fingerprint strings
matching is a necessary (but not sufficient) condition for the associated molecules to be isomorphic.
Currently, the fingerprint is simply the chemical formula.
fromAdjacencyList(self, str adjlist, bool saturateH=False)
Convert a string adjacency list adjlist to a molecular structure. Skips the first line (assuming it’s a label)
unless withLabel is False.
fromAugmentedInChI(self, aug_inchi)
Convert an Augmented InChI string aug_inchi to a molecular structure.
fromInChI(self, str inchistr, backend=’try-all’)
Convert an InChI string inchistr to a molecular structure.
fromSMARTS(self, smartsstr)
Convert a SMARTS string smartsstr to a molecular structure. Uses RDKit to perform the conversion. This
Kekulizes everything, removing all aromatic atom types.
fromSMILES(self, str smilesstr, backend=’try-all’)
Convert a SMILES string smilesstr to a molecular structure.
fromXYZ(self, ndarray atomicNums, ndarray coordinates)
Create an RMG molecule from a list of coordinates and a corresponding list of atomic numbers. These
are typically received from CCLib and the molecule is sent to ConnectTheDots so will only contain single
bonds.
generate_H_bonded_structures(self )
generates a list of Hbonded molecular structures in addition to the constraints on Hydrogen bonds applied
in the find_H_Bonds function the generated structures are constrained to:
1) An atom can only be hydrogen bonded to one other atom
2) Only two H-bonds can exist in a given molecule
the second is done to avoid explosive growth in the number of structures as without this constraint the
number of possible structures grows 2^n where n is the number of possible H-bonds
generate_resonance_structures(self, bool keep_isomorphic=False, bool filter_structures=True)
→ list
Returns a list of resonance structures of the molecule.
getAllCycles(self, Vertex startingVertex) → list
Given a starting vertex, returns a list of all the cycles containing that vertex.
This function returns a duplicate of each cycle because [0,1,2,3] is counted as separate from [0,3,2,1]
getAllCyclesOfSize(self, int size) → list
Return a list of the all non-duplicate rings with length ‘size’. The algorithm implements was adapted from
a description by Fan, Panaye, Doucet, and Barbu (doi: 10.1021/ci00015a002)
B. T. Fan, A. Panaye, J. P. Doucet, and A. Barbu. “Ring Perception: A New Algorithm for Directly Finding
the Smallest Set of Smallest Rings from a Connection Table.” J. Chem. Inf. Comput. Sci. 33, p. 657-662
(1993).
getAllCyclicVertices(self ) → list
Returns all vertices belonging to one or more cycles.
getAllEdges(self ) → list
Returns a list of all edges in the graph.
getAllPolycyclicVertices(self ) → list
Return all vertices belonging to two or more cycles, fused or spirocyclic.
getAllSimpleCyclesOfSize(self, int size) → list
Return a list of all non-duplicate monocyclic rings with length ‘size’.
Naive approach by eliminating polycyclic rings that are returned by getAllCyclicsOfSize.
getAromaticRings(self, list rings=None) → tuple
Returns all aromatic rings as a list of atoms and a list of bonds.
Identifies rings using Graph.getSmallestSetOfSmallestRings(), then uses RDKit to perceive aromaticity.
RDKit uses an atom-based pi-electron counting algorithm to check aromaticity based on Huckel’s Rule.
Therefore, this method identifies “true” aromaticity, rather than simply the RMG bond type.
The method currently restricts aromaticity to six-membered carbon-only rings. This is a limitation imposed
by RMG, and not by RDKit.
getMonocyclicRings(self ) → list
Return a list of cycles that are monocyclic.
getNetCharge(self )
Iterate through the atoms in the structure and calculate the net charge on the overall molecule.
getNthNeighbor(self, startingAtoms, distanceList, ignoreList=None, n=1)
Recursively get the Nth nonHydrogen neighbors of the startingAtoms, and return them in a list. startin-
gAtoms is a list of :class:Atom for which we will get the nth neighbor. distanceList is a list of intergers,
corresponding to the desired neighbor distances. ignoreList is a list of :class:Atom that have been counted
in (n-1)th neighbor, and will not be returned. n is an interger, corresponding to the distance to be calculated
in the current iteration.
getNumAtoms(self, str element=None) → int
Return the number of atoms in molecule. If element is given, ie. “H” or “C”, the number of atoms of that
element is returned.
getPolycyclicRings(self ) → list
Return a list of cycles that are polycyclic. In other words, merge the cycles which are fused or spirocyclic
into a single polycyclic cycle, and return only those cycles. Cycles which are not polycyclic are not
returned.
getRadicalAtoms(self )
Return the atoms in the molecule that have unpaired electrons.
getRadicalCount(self ) → short
Return the total number of radical electrons on all atoms in the molecule. In this function, monoradical
atoms count as one, biradicals count as two, etc.
getRelevantCycles(self ) → list
Returns the set of relevant cycles as a list of lists. Uses RingDecomposerLib for ring perception.
Kolodzik, A.; Urbaczek, S.; Rarey, M. Unique Ring Families: A Chemically Meaningful Description of
Molecular Ring Topologies. J. Chem. Inf. Model., 2012, 52 (8), pp 2013-2021
Flachsenberg, F.; Andresen, N.; Rarey, M. RingDecomposerLib: An Open-Source Implementation of
Unique Ring Families and Other Cycle Bases. J. Chem. Inf. Model., 2017, 57 (2), pp 122-126
getSingletCarbeneCount(self ) → short
Return the total number of singlet carbenes (lone pair on a carbon atom) in the molecule. Counts the
number of carbon atoms with a lone pair. In the case of [C] with two lone pairs, this method will return 1.
getSmallestSetOfSmallestRings(self ) → list
Returns the smallest set of smallest rings as a list of lists. Uses RingDecomposerLib for ring perception.
Kolodzik, A.; Urbaczek, S.; Rarey, M. Unique Ring Families: A Chemically Meaningful Description of
Molecular Ring Topologies. J. Chem. Inf. Model., 2012, 52 (8), pp 2013-2021
Flachsenberg, F.; Andresen, N.; Rarey, M. RingDecomposerLib: An Open-Source Implementation of
Unique Ring Families and Other Cycle Bases. J. Chem. Inf. Model., 2017, 57 (2), pp 122-126
getSymmetryNumber(self )
Returns the symmetry number of Molecule. First checks whether the value is stored as an attribute of
Molecule. If not, it calls the calculateSymmetryNumber method.
getURL(self )
Get a URL to the molecule’s info page on the RMG website.
get_edges_in_cycle(self, list vertices, bool sort=False) → list
For a given list of atoms comprising a ring, return the set of bonds connecting them, in order around the
ring.
If sort=True, then sort the vertices to match their connectivity. Otherwise, assumes that they are already
sorted, which is true for cycles returned by getRelevantCycles or getSmallestSetOfSmallestRings.
get_element_count(self ) → dict
Returns the element count for the molecule as a dictionary.
hasAtom(self, Atom atom) → bool
Returns True if atom is an atom in the graph, or False if not.
hasBond(self, Atom atom1, Atom atom2) → bool
Returns True if atoms atom1 and atom2 are connected by an bond, or False if not.
hasEdge(self, Vertex vertex1, Vertex vertex2) → bool
Returns True if vertices vertex1 and vertex2 are connected by an edge, or False if not.
hasVertex(self, Vertex vertex) → bool
Returns True if vertex is a vertex in the graph, or False if not.
has_lone_pairs(self ) → bool
Return True if the molecule contains at least one lone electron pair, or False otherwise.
identifyRingMembership(self )
Performs ring perception and saves ring membership information to the Atom.props attribute.
implicitHydrogens
‘bool’
Type implicitHydrogens
isAromatic(self )
Returns True if the molecule is aromatic, or False if not. Iterates over the SSSR’s and searches for
rings that consist solely of Cb atoms. Assumes that aromatic rings always consist of 6 atoms. In cases of
naphthalene, where a 6 + 4 aromatic system exists, there will be at least one 6 membered aromatic ring so
this algorithm will not fail for fused aromatic rings.
isArylRadical(self, list aromaticRings=None) → bool
Return True if the molecule only contains aryl radicals, ie. radical on an aromatic ring, or False other-
wise.
isAtomInCycle(self, Atom atom) → bool
Return True if atom is in one or more cycles in the structure, and False if not.
isBondInCycle(self, Bond bond ) → bool
Return True if the bond between atoms atom1 and atom2 is in one or more cycles in the graph, or False
if not.
isCyclic(self ) → bool
Return True if one or more cycles are present in the graph or False otherwise.
isEdgeInCycle(self, Edge edge) → bool
Return True if the edge between vertices vertex1 and vertex2 is in one or more cycles in the graph, or
False if not.
props
dict
Type props
rdMol
object
Type rdMol
rdMolConfId
‘int’
Type rdMolConfId
reactive
‘bool’
Type reactive
removeAtom(self, Atom atom)
Remove atom and all bonds associated with it from the graph. Does not remove atoms that no longer have
any bonds as a result of this removal.
removeBond(self, Bond bond )
Remove the bond between atoms atom1 and atom2 from the graph. Does not remove atoms that no longer
have any bonds as a result of this removal.
removeEdge(self, Edge edge)
Remove the specified edge from the graph. Does not remove vertices that no longer have any edges as a
result of this removal.
removeVanDerWaalsBonds(self )
Remove all van der Waals bonds.
removeVertex(self, Vertex vertex)
Remove vertex and all edges associated with it from the graph. Does not remove vertices that no longer
have any edges as a result of this removal.
remove_H_bonds(self )
removes any present hydrogen bonds from the molecule
resetConnectivityValues(self )
Reset any cached connectivity information. Call this method when you have modified the graph.
restore_vertex_order(self )
reorder the vertices to what they were before sorting if you saved the order
saturate_radicals(self )
Saturate the molecule by replacing all radicals with bonds to hydrogen atoms. Changes self molecule
object.
saturate_unfilled_valence(self, update=True)
Saturate the molecule by adding H atoms to any unfilled valence
sortAtoms(self )
Sort the atoms in the graph. This can make certain operations, e.g. the isomorphism functions, much more
efficient.
This function orders atoms using several attributes in atom.getDescriptor(). Currently it sorts by placing
heaviest atoms first and hydrogen atoms last. Placing hydrogens last during sorting ensures that functions
with hydrogen removal work properly.
This is useful for isomorphism comparison against something that was made via fromXYZ, which does
not attempt to perceive bond orders
update(self, log_species=True)
Update connectivity values, atom types of atoms. Update multiplicity, and sort atoms using the new
connectivity values.
updateAtomTypes(self, bool logSpecies=True, bool raiseException=True)
Iterate through the atoms in the structure, checking their atom types to ensure they are correct (i.e. accu-
rately describe their local bond environment) and complete (i.e. are as detailed as possible).
If raiseException is False, then the generic atomType ‘R’ will be prescribed to any atom when getAtom-
Type fails. Currently used for resonance hybrid atom types.
updateConnectivityValues(self )
Update the connectivity values for each vertex in the graph. These are used to accelerate the isomorphism
checking.
updateLonePairs(self )
Iterate through the atoms in the structure and calculate the number of lone electron pairs, assuming a
neutral molecule.
updateMultiplicity(self )
Update the multiplicity of a newly formed molecule.
vertices
list
Type vertices
rmgpy.molecule.GroupAtom
Each list represents a logical OR construct, i.e. an atom will match the group if it matches any item in the list.
However, the radicalElectrons, and charge attributes are linked such that an atom must match values from the
same index in each of these in order to match.
applyAction(self, list action)
Update the atom group as a result of applying action, a tuple containing the name of the reaction recipe
action along with any required parameters. The available actions can be found here.
atomType
list
Type atomType
charge
list
Type charge
connectivity1
‘short’
Type connectivity1
connectivity2
‘short’
Type connectivity2
connectivity3
‘short’
Type connectivity3
copy(self ) → Vertex
Return a deep copy of the GroupAtom object. Modifying the attributes of the copy will not affect the
original.
countBonds(self, wildcards=False) → list
Returns: list of the number of bonds currently on the :class:GroupAtom
If the argument wildcards is turned off then any bonds with multiple options for bond orders will not be
counted
edges
dict
Type edges
equivalent(self, Vertex other, bool strict=True) → bool
Returns True if other is equivalent to self or False if not, where other can be either an Atom or an
GroupAtom object. When comparing two GroupAtom objects, this function respects wildcards, e.g. R!H
is equivalent to C.
hasWildcards(self ) → bool
Return True if the atom has wildcards in any of the attributes: atomtype, radical electrons, lone pairs,
charge, and bond order. Returns ‘’False” if no attribute has wildcards.
ignore
‘bool’
Type ignore
isCarbon(self ) → bool
Return True if the atom represents an sulfur atom or False if not.
isNitrogen(self ) → bool
Return True if the atom represents an sulfur atom or False if not.
isOxygen(self ) → bool
Return True if the atom represents an oxygen atom or False if not.
Type terminal
rmgpy.molecule.GroupBond
Each list represents a logical OR construct, i.e. a bond will match the group if it matches any item in the list.
applyAction(self, list action)
Update the bond group as a result of applying action, a tuple containing the name of the reaction recipe
action along with any required parameters. The available actions can be found here.
copy(self ) → Edge
Return a deep copy of the GroupBond object. Modifying the attributes of the copy will not affect the
original.
equivalent(self, Edge other) → bool
Returns True if other is equivalent to self or False if not, where other can be either an Bond or an
GroupBond object.
getOrderNum(self ) → list
returns the bond order as a list of numbers
getOrderStr(self ) → list
returns a list of strings representing the bond order
getOtherVertex(self, Vertex vertex) → Vertex
Given a vertex that makes up part of the edge, return the other vertex. Raise a ValueError if the given
vertex is not part of the edge.
isBenzene(self, bool wildcards=False) → bool
Return True if the bond represents a benzene bond or False if not. If wildcards is False we return False
anytime there is more than one bond order, otherwise we return True if any of the options are benzene
isDouble(self, bool wildcards=False) → bool
Return True if the bond represents a double bond or False if not. If wildcards is False we return False
anytime there is more than one bond order, otherwise we return True if any of the options are double.
isHydrogenBond(self, wildcards=False)
Return True if the bond represents a hydrogen bond or False if not. If wildcards is False we return False
anytime there is more than one bond order, otherwise we return True if any of the options are hydrogen
bonds.
isQuadruple(self, wildcards=False)
Return True if the bond represents a quadruple bond or False if not. If wildcards is False we return
False anytime there is more than one bond order, otherwise we return True if any of the options are
quadruple.
isSingle(self, bool wildcards=False) → bool
Return True if the bond represents a single bond or False if not. If wildcards is False we return False
anytime there is more than one bond order, otherwise we return True if any of the options are single.
NOTE: we can replace the absolute value relation with math.isclose when we swtich to python 3.5+
rmgpy.molecule.Group
Parameters
• group – :class:Group with atoms to classify
• partners – dictionary of partnered up atoms, which must be a cbf atom
Returns: tuple with lists of each atom classification
clearLabeledAtoms(self )
Remove the labels from all atoms in the molecular group.
containsLabeledAtom(self, str label) → bool
Return True if the group contains an atom with the label label and False otherwise.
containsSurfaceSite(self ) → bool
Returns True iff the group contains an ‘X’ surface site.
copy(self, bool deep=False) → Graph
Create a copy of the current graph. If deep is True, a deep copy is made: copies of the vertices and edges
are used in the new graph. If deep is False or not specified, a shallow copy is made: the original vertices
and edges are used in the new graph.
copyAndMap(self ) → dict
Create a deep copy of the current graph, and return the dict ‘mapping’. Method was modified from
Graph.copy() method
edges involved in the mapping are mutually equivalent. If equivalent is True it checks if atoms and edges
are equivalent, if False it checks if they are specific cases of each other. If strict is True, electrons and
bond orders are considered, and ignored if False.
isSubgraphIsomorphic(self, Graph other, dict initialMap=None, bool generateInitialMap=False,
bool saveOrder=False) → bool
Returns True if other is subgraph isomorphic and False otherwise. In other words, return True if self
is more specific than other. The initialMap attribute can be used to specify a required mapping from self
to other (i.e. the atoms of self are the keys, while the atoms of other are the values). The other parameter
must be a Group object, or a TypeError is raised.
isSurfaceSite(self ) → bool
Returns True iff the group is nothing but a surface site ‘X’.
isVertexInCycle(self, Vertex vertex) → bool
Return True if the given vertex is contained in one or more cycles in the graph, or False if not.
makeSampleMolecule(self ) → Molecule
Returns: A sample class :Molecule: from the group
merge(self, Graph other) → Graph
Merge two groups so as to store them in a single Group object. The merged Group object is returned.
mergeGroups(self, Group other) → Group
This function takes other :class:Group object and returns a merged :class:Group object based on overlap-
ping labeled atoms between self and other
Currently assumes other can be merged at the closest labelled atom
multiplicity
list
Type multiplicity
ordered_vertices
list
Type ordered_vertices
pickWildcards(self )
Returns: the :class:Group object without wildcards in either atomtype or bonding
This function will naively pick the first atomtype for each atom, but will try to pick bond orders that make
sense given the selected atomtypes
props
dict
Type props
radicalCount
‘short’
Type radicalCount
removeAtom(self, GroupAtom atom)
Remove atom and all bonds associated with it from the graph. Does not remove atoms that no longer have
any bonds as a result of this removal.
removeBond(self, GroupBond bond )
Remove the bond between atoms atom1 and atom2 from the graph. Does not remove atoms that no longer
have any bonds as a result of this removal.
We also only check when there is exactly one atomType, one bondType, one radical setting. For any group
where there are wildcards or multiple attributes, we cannot apply this check.
In the case where the atomType is ambigious based on bonds and valency, this function will not change
the type.
Returns a ‘True’ if the group was modified otherwise returns ‘False’
standardizeGroup(self ) → bool
This function modifies groups to make them have a standard AdjList form.
Currently it makes atomtypes as specific as possible and makes CO/CS atomtypes have explicit O2d/S2d
ligands. Other functions can be added as necessary
Returns a ‘True’ if the group was modified otherwise returns ‘False’
toAdjacencyList(self, str label=”)
Convert the molecular structure to a string adjacency list.
update(self )
updateConnectivityValues(self )
Update the connectivity values for each vertex in the graph. These are used to accelerate the isomorphism
checking.
updateFingerprint(self )
Update the molecular fingerprint used to accelerate the subgraph isomorphism checks.
update_charge(self )
Update the partial charge according to the valence electron, total bond order, lone pairs and radical elec-
trons. This method is used for products of specific families with recipes that modify charges.
vertices
list
Type vertices
rmgpy.molecule.resonance
2. False negatives from RDKit aromaticity detection can occur if a radical is delocalized into an aromatic
ring
3. sp2 hybridized radicals in the plane of an aromatic ring do not participate in hyperconjugation
4. Non-aromatic resonance structures of PAHs are not important resonance contributors (assumption)
Aromatic species are broken into the following categories for resonance treatment:
• Radical polycyclic aromatic species: Kekule structures are generated in order to generate adjacent reso-
nance structures. The resulting structures are then used for Clar structure generation. After all three steps,
any non-aromatic structures are removed, under the assumption that they are not important resonance
contributors.
• Radical monocyclic aromatic species: Kekule structures are generated along with adjacent resonance struc-
tures. All are kept regardless of aromaticity because the radical is more likely to delocalize into the ring.
• Stable polycyclic aromatic species: Clar structures are generated
• Stable monocyclic aromatic species: Kekule structures are generated
rmgpy.molecule.resonance.populate_resonance_algorithms
Generate list of resonance structure algorithms relevant to the current molecule.
Takes a dictionary of features generated by analyze_molecule(). Returns a list of resonance algorithms.
rmgpy.molecule.kekulize
This module contains functions for kekulization of a aromatic molecule. The only function that should be used outside
of this module is the main kekulize() function. The remaining functions and classes are designed only to support the
kekulization algorithm, and should not be used on their own.
The basic algorithm is as follows: 1. Identify all aromatic rings in the molecule, based on bond types. 2. For each
ring, identify endocyclic and exocyclic bonds. 3. Determine if any bonds in the ring are already defined (not benzene
bonds). 4. For the remaining bonds, determine whether or not they can be double bonds. 5. If a clear determination
cannot be made, make heuristic based assumption. 6. Continue until all bonds in the ring are determined. 7. Continue
until all rings in the molecule are determined.
Here, endo refers to bonds that comprise a given ring, while exo refers to bonds that are connected to atoms in the ring,
but not part of the ring itself.
A key part of the algorithm is use of degree of freedom (DOF) analysis in order to determine the optimal order to
solve the system. Rings and bonds with fewer DOFs have fewer ways to be to be kekulized, and are generally easier
to solve. Each ring or bond that is fixed reduces the DOF of adjacent rings and bonds, and the process continues until
the entire molecule can be solved.
class rmgpy.molecule.kekulize.AromaticBond(bond=None, ring_bonds=None, endo_dof=-
1, exo_dof=-1, double_possible=True, dou-
ble_required=False)
Helper class containing information about a single aromatic bond in a molecule.
DO NOT use outside of this module. This class does not do any aromaticity perception.
bond
rmgpy.molecule.molecule.Bond
Type bond
double_possible
‘bool’
Type double_possible
double_required
‘bool’
Type double_required
endo_dof
‘int’
Type endo_dof
exo_dof
‘int’
Type exo_dof
ring_bonds
set
Type ring_bonds
update(self )
Update the local degree of freedom information for this aromatic bond. The DOF counts do not include
the bond itself, only its adjacent bonds.
endo_dof refers to the number of adjacent bonds in the ring without fixed bond orders. exo_dof refers to
the number of adjacent bonds outside the ring without fixed bond orders.
class rmgpy.molecule.kekulize.AromaticRing(atoms=None, endo_bonds=None, exo_bonds=None,
endo_dof=-1, exo_dof=-1)
Helper class containing information about a single aromatic ring in a molecule.
DO NOT use outside of this module. This class does not do any aromaticity perception.
atoms
list
Type atoms
endo_dof
‘int’
Type endo_dof
exo_dof
‘int’
Type exo_dof
kekulize(self ) → bool
Attempts to kekulize a single aromatic ring in a molecule.
Returns True if successful, and False otherwise.
process_bonds(self ) → tuple
Create AromaticBond objects for each endocyclic bond.
resolved
list
Type resolved
unresolved
list
Type unresolved
update(self )
Update the degree of freedom information for this aromatic ring.
endo_dof refers to the number of bonds in the ring without fixed bond orders. exo_dof refers to the number
of bonds outside the ring without fixed bond orders.
rmgpy.molecule.kekulize.kekulize(Molecule mol)
Kekulize an aromatic molecule in place. If the molecule cannot be kekulized, a KekulizationError will be raised.
However, the molecule will be left in a semi-kekulized state. Therefore, if the original molecule needs to be
kept, it is advisable to create a copy before kekulizing.
Args: Molecule object to be kekulized
rmgpy.molecule.pathfinder
This module provides functions for searching paths within a molecule. The paths generally consist of alternating
atoms and bonds.
rmgpy.molecule.pathfinder.add_allyls
Find all the (3-atom, 2-bond) patterns “X=X-X” starting from the last atom of the existing path.
The bond attached to the starting atom should be non single. The second bond should be single.
rmgpy.molecule.pathfinder.add_inverse_allyls
Find all the (3-atom, 2-bond) patterns “start~atom2=atom3” starting from the last atom of the existing path.
The second bond should be non-single.
rmgpy.molecule.pathfinder.add_unsaturated_bonds
Find all the (2-atom, 1-bond) patterns “X=X” starting from the last atom of the existing path.
The bond attached to the starting atom should be non single.
rmgpy.molecule.pathfinder.compute_atom_distance
Compute the distances between each pair of atoms in the atom_indices.
The distance between two atoms is defined as the length of the shortest path between the two atoms minus 1,
because the start atom is part of the path.
The distance between multiple atoms is defined by generating all possible combinations between two atoms and
storing the distance between each combination of atoms in a dictionary.
The parameter ‘atom_indices’ is a list of 1-based atom indices.
rmgpy.molecule.pathfinder.find_N5dc_radical_delocalization_paths
Find all the resonance structures of an N5dc nitrogen atom with a single bond to a radical N/O/S site, another
single bond to a negatively charged N/O/S site, and one double bond (not participating in this transformation)
Example:
• N=[N+]([O])([O-]) <=> N=[N+]([O-])([O]), these structures are isomorphic but not identical, the transi-
tion is important for correct degeneracy calculations
In this transition atom1 is the middle N+ (N5dc), atom2 is the radical site, and atom3 is negatively charged A
“if atom1.atomType.label == ‘N5dc’” check should be done before calling this function
rmgpy.molecule.pathfinder.find_adj_lone_pair_multiple_bond_delocalization_paths
Find all the delocalization paths of atom1 which either
• Has a lonePair and is bonded by a single/double bond (e.g., [::NH-]-[CH2+], [::N-]=[CH+]) – direction 1
• Can obtain a lonePair and is bonded by a double/triple bond (e.g., [:NH]=[CH2], [:N]#[CH]) – direction 2
Giving the following resonance transitions, for example:
Direction “1” is the direction <increasing> the bond order as in [::N]-[.CH2] <=> [:N.]=[CH2] Direction “2” is
the direction <decreasing> the bond order as in [:N.]=[CH2] <=> [::N]-[.CH2] (where ‘:’ denotes a lone pair,
‘.’ denotes a radical, ‘-‘ not in [] denotes a single bond, ‘-‘/’+’ denote charge) (In direction 1 atom1 <losses> a
lone pair, gains a radical, and atom2 looses a radical. In direction 2 atom1 <gains> a lone pair, looses a radical,
and atom2 gains a radical)
rmgpy.molecule.pathfinder.find_allyl_delocalization_paths
Find all the delocalization paths allyl to the radical center indicated by atom1.
rmgpy.molecule.pathfinder.find_allyl_end_with_charge
Search for a (3-atom, 2-bond) path between start and end atom that consists of alternating non-single and single
bonds and ends with a charged atom.
Returns a list with atom and bond elements from start to end, or an empty list if nothing was found.
rmgpy.molecule.pathfinder.find_butadiene
Search for a path between start and end atom that consists of alternating non-single and single bonds.
Returns a list with atom and bond elements from start to end, or None if nothing was found.
rmgpy.molecule.pathfinder.find_butadiene_end_with_charge
Search for a (4-atom, 3-bond) path between start and end atom that consists of alternating non-single and single
bonds and ends with a charged atom.
Returns a list with atom and bond elements from start to end, or None if nothing was found.
rmgpy.molecule.pathfinder.find_lone_pair_multiple_bond_paths
Find all the delocalization paths between lone electron pair and multiple bond in a 3-atom system atom1 indi-
cates the localized lone pair site. Currently carbenes are excluded from this path.
Examples:
• N2O (N#[N+][O-] <-> [N-]=[N+]=O)
• Azide (N#[N+][NH-] <-> [N-]=[N+]=N <-> [N-2][N+]#[NH+])
• N#N group on sulfur (O[S-](O)[N+]#N <-> OS(O)=[N+]=[N-] <-> O[S+](O)#[N+][N-2])
• N[N+]([O-])=O <=> N[N+](=O)[O-], these structures are isomorphic but not identical, this transition is
important for correct degeneracy calculations
rmgpy.molecule.pathfinder.find_shortest_path
rmgpy.molecule.pathfinder.is_atom_able_to_gain_lone_pair
Helper function Returns True if atom is N/O/S and is able to <gain> an additional lone pair, False otherwise We
don’t allow O to remain with no lone pairs
rmgpy.molecule.pathfinder.is_atom_able_to_lose_lone_pair
Helper function Returns True if atom is N/O/S and is able to <loose> a lone pair, False otherwise We don’t allow
O to remain with no lone pairs
rmgpy.molecule.converter
This module provides methods for converting molecules between RMG, RDKit, and OpenBabel.
rmgpy.molecule.converter.debugRDKitMol
Takes an rdkit molecule object and logs some debugging information equivalent to calling rdmol.Debug() but
uses our logging framework. Default logging level is INFO but can be controlled with the level parameter. Also
returns the message as a string, should you want it for something.
rmgpy.molecule.converter.fromOBMol
Convert a OpenBabel Mol object obmol to a molecular structure. Uses OpenBabel to perform the conversion.
rmgpy.molecule.converter.fromRDKitMol
Convert a RDKit Mol object rdkitmol to a molecular structure. Uses RDKit to perform the conversion. This
Kekulizes everything, removing all aromatic atom types.
rmgpy.molecule.converter.toOBMol
Convert a molecular structure to an OpenBabel OBMol object. Uses OpenBabel to perform the conversion.
rmgpy.molecule.converter.toRDKitMol
Convert a molecular structure to a RDKit rdmol object. Uses RDKit to perform the conversion. Perceives
aromaticity and, unless removeHs==False, removes Hydrogen atoms.
If returnMapping==True then it also returns a dictionary mapping the atoms to RDKit’s atom indices.
rmgpy.molecule.translator
This module provides methods for translating to and from common molecule representation formats, e.g. SMILES,
InChI, SMARTS.
rmgpy.molecule.translator.fromAugmentedInChI
Creates a Molecule object from the augmented inchi.
First, the inchi is converted into a Molecule using the backend parsers.
Next, the multiplicity and unpaired electron information is used to fix a number of parsing errors made by the
backends.
Finally, the atom types of the corrected molecule are perceived.
Returns a Molecule object
rmgpy.molecule.translator.fromInChI
Convert an InChI string inchistr to a molecular structure. Uses a user-specified backend for conversion, currently
supporting rdkit (default) and openbabel.
rmgpy.molecule.translator.fromSMARTS
Convert a SMARTS string smartsstr to a molecular structure. Uses RDKit to perform the conversion. This
Kekulizes everything, removing all aromatic atom types.
rmgpy.molecule.translator.fromSMILES
Convert a SMILES string smilesstr to a molecular structure. Uses a user-specified backend for conversion,
currently supporting rdkit (default) and openbabel.
rmgpy.molecule.translator.toInChI
Convert a molecular structure to an InChI string. For aug_level=0, generates the canonical InChI. For
aug_level=1, appends the molecule multiplicity. For aug_level=2, appends positions of unpaired and paired
electrons.
Uses RDKit or OpenBabel for conversion.
Parameters
• choice of backend, 'try-all', 'rdkit', or 'openbabel' (backend) –
• level of augmentation, 0, 1, or 2 (aug_level) –
rmgpy.molecule.translator.toInChIKey
Convert a molecular structure to an InChI Key string. For aug_level=0, generates the canonical InChI. For
aug_level=1, appends the molecule multiplicity. For aug_level=2, appends positions of unpaired and paired
electrons.
Uses RDKit or OpenBabel for conversion.
Parameters
Adjacency Lists
Note: The adjacency list syntax changed in July 2014. The minimal requirement for most translations is to prefix the
number of unpaired electrons with the letter u. The new syntax, however, allows much greater flexibility, including
definition of lone pairs, partial charges, wildcards, and molecule multiplicities.
Note: To quickly visualize any adjacency list, or to generate an adjacency list from other types of molecular rep-
resentations such as SMILES, InChI, or even common species names, use the Molecule Search tool found here:
http://rmg.mit.edu/molecule_search
An adjacency list is the most general way of specifying a chemical molecule or molecular pattern in RMG. It is based
on the adjacency list representation of the graph data type – the underlying data type for molecules and patterns in
RMG – but extended to allow for specification of extra semantic information.
The first line of most adjacency lists is a unique identifier for the molecule or pattern the adjacency list represents.
This is not strictly required, but is recommended in most cases. Generally the identifier should only use alphanumeric
characters and the underscore, as if an identifier in many popular programming languages. However, strictly speaking
any non-space ASCII character is allowed.
The subsequent lines may contain keyword-value pairs. Currently there is only one keyword, multiplicity.
For species or molecule declarations, the value after multiplicity defines the spin multiplicity of the molecule.
E.g. multiplicity 1 for most ground state closed shell species, multiplicity 2 for most radical species, and
multiplicity 3 for a triplet biradical. If the multiplicity line is not present then a value of (1 + number of
unpaired electrons) is assumed. Thus, it can usually be omitted, but if present can be used to distinguish, for example,
singlet CH2 from triplet CH2.
If defining a Functional Group, then the value must be a list, which defines the multiplicities that will be matched by
the group, eg. multiplicity [1,2,3] or, for a single value, multiplicity [1]. If a wildcard is desired, the
line 'multiplicity x can be used instead to accept all multiplicities. If the multiplicity line is omitted altogether,
then a wildcard is assumed.
e.g. the following two group adjlists represent identical groups.
group1
multiplicity x
1 R!H u0
group2
1 R!H u0
After the identifier line and keyword-value lines, each subsequent line describes a single atom and its local bond
structure. The format of these lines is a whitespace-delimited list with tokens
The first item is the number used to identify that atom. Any number may be used, though it is recommended to number
the atoms sequentially starting from one. Next is an optional label used to tag that atom; this should be an asterisk
followed by a unique number for the label, e.g. *1. In some cases (e.g. thermodynamics groups) there is only one
labeled atom, and the label is just an asterisk with no number: *.
After that is the atom’s element or atom type, indicated by its atomic symbol, followed by a sequence of tokens
describing the electronic state of the atom:
• u0 number of unpaired electrons (eg. radicals)
• p0 number of lone pairs of electrons, common on oxygen and nitrogen.
• c0 formal charge on the atom, e.g. c-1 (negatively charged), c0, c+1 (positively charged)
For Molecule definitions: The value must be a single integer (and for charge must have a + or - sign if not equal to
0) The number of unpaired electrons (i.e. radical electrons) is required, even if zero. The number of lone pairs and the
formal charge are assumed to be zero if omitted.
For Group definitions: The value can be an integer or a list of integers (with signs, for charges), eg. u[0,1,2] or
c[0,+1,+2,+3,+4], or may be a wildcard x which matches any valid value, eg. px is the same as p[0,1,2,3,4, .
..] and cx is the same as c[...,-4,-3,-2,-1,0,+1,+2,+3,+4,...]. Lists must be enclosed is square brackets,
and separated by commas, without spaces. If lone pairs or formal charges are omitted from a group definition, the
wildcard is assumed.
The last set of tokens is the list of bonds. To indicate a bond, place the number of the atom at the other end of the bond
and the bond type within curly braces and separated by a comma, e.g. {2,S}. Multiple bonds from the same atom
should be separated by whitespace.
Note: You must take care to make sure each bond is listed on the lines of both atoms in the bond, and that these
entries have the same bond type. RMG will raise an exception if it encounters such an invalid adjacency list.
When writing a molecular substructure pattern, you may specify multiple elements, radical counts, and bond types as
a comma-separated list inside square brackets. For example, to specify any carbon or oxygen atom, use the syntax
[C,O]. For a single or double bond to atom 2, write {2,[S,D]}.
Atom types such as R!H or Cdd may also be used as a shorthand. (Atom types like Cdd can also be used in full
molecules, but this use is discouraged, as RMG can compute them automatically for full molecules.)
Below is an example adjacency list, for 1,3-hexadiene, with the weakest bond in the molecule labeled with *1 and
*2. Note that hydrogen atoms can be omitted if desired, as their presence is inferred, provided that unpaired electrons,
lone pairs, and charges are all correctly defined:
HXD13
multiplicity 1
1 C u0 {2,D}
2 C u0 {1,D} {3,S}
3 C u0 {2,S} {4,D}
4 C u0 {3,D} {5,S}
5 *1 C u0 {4,S} {6,S}
6 *2 C u0 {5,S}
The allowed element types, radicals, and bonds are listed in the following table:
Notation Explanation
Chemical Element C Carbon atom
O Oxygen atom
H Hydrogen atom
S Sulfur atom
N Nitrogen atom
Nonreactive Elements Si Silicon atom
Cl Chlorine atom
He Helium atom
Ar Argon atom
rmgpy.molecule.symmetry
A=C=C=C.. A-C=C=C=C-A
s=1 s=1
If an end has 2 groups that are different then it breaks the symmetry and the symmetry for that axis is 1, no
matter what’s at the other end:
A\ A\ /A
T=C=C=C=C-A T=C=C=C=T
B/ A/ \B
s=1 s=1
If you have one or more ends with 2 groups, and neither end breaks the symmetry, then you have an axis
symmetry number of 2:
A\ /B A\
C=C=C=C=C C=C=C=C-B
A/ \B A/
s=2 s=2
rmgpy.molecule.draw.MoleculeDrawer
class rmgpy.molecule.draw.MoleculeDrawer(options=None)
This class provides functionality for drawing the skeletal formula of molecules using the Cairo 2D graphics
engine. The most common use case is simply:
where molecule is the Molecule object to draw. You can also pass a dict of options to the constructor to affect
how the molecules are drawn.
draw(molecule, format, target=None)
Draw the given molecule using the given image format - pdf, svg, ps, or png. If path is given, the drawing
is saved to that location on disk. The options dict is an optional set of key-value pairs that can be used to
control the generated drawing.
This function returns the Cairo surface and context used to create the drawing, as well as a bounding box
for the molecule being drawn as the tuple (left, top, width, height).
render(cr, offset=None)
Uses the Cairo graphics library to create a skeletal formula drawing of a molecule containing the list of
atoms and dict of bonds to be drawn. The 2D position of each atom in atoms is given in the coordinates
array. The symbols to use at each atomic position are given by the list symbols. You must specify the Cairo
context cr to render to.
rmgpy.molecule.draw.ReactionDrawer
class rmgpy.molecule.draw.ReactionDrawer(options=None)
This class provides functionality for drawing chemical reactions using the skeletal formula of each reactant and
product molecule via the Cairo 2D graphics engine. The most common use case is simply:
where reaction is the Reaction object to draw. You can also pass a dict of options to the constructor to affect
how the molecules are drawn.
draw(reaction, format, path=None)
Draw the given reaction using the given image format - pdf, svg, ps, or png. If path is given, the drawing
is saved to that location on disk.
This function returns the Cairo surface and context used to create the drawing, as well as a bounding box
for the molecule being drawn as the tuple (left, top, width, height).
The rmgpy.pdep subpackage provides functionality for calcuating the pressure-dependent rate coefficients 𝑘(𝑇, 𝑃 )
for unimolecular reaction networks.
A unimolecular reaction network is defined by a set of chemically reactive molecular configurations - local minima on
a potential energy surface - divided into unimolecular isomers and bimolecular reactants or products. In our vernacular,
reactants can associate to form an isomer, while such association is neglected for products. These configurations are
connected by chemical reactions to form a network; these are referred to as path reactions. The system also consists of
an excess of inert gas M, representing a thermal bath; this allows for neglecting all collisions other than those between
an isomer and the bath gas.
An isomer molecule at sufficiently high internal energy can be transformed by a number of possible events:
• The isomer molecule can collide with any other molecule, resulting in an increase or decrease in energy
• The isomer molecule can isomerize to an adjacent isomer at the same energy
• The isomer molecule can dissociate into any directly connected bimolecular reactant or product channel
It is this competition between collision and reaction events that gives rise to pressure-dependent kinetics.
Class Description
SingleExponentialDown A collisional energy transfer model based on the single exponential down model
Function Description
Return the microcanonical rate coefficient 𝑘(𝐸) for a reaction
calculateMicrocanonicalRateCoefficient()
applyRRKMTheory() Use RRKM theory to compute 𝑘(𝐸) for a reaction
applyInverseLaplaceTransformMethod() Use the inverse Laplace transform method to compute 𝑘(𝐸) for
a reaction
Class Description
Configuration A molecular configuration on a potential energy surface
Network A collisional energy transfer model based on the single exponential down model
Function Description
generateFullMEMatrix() Return the full master equation matrix for a network
Function Description
msc.applyModifiedStrongCollisionMethod()
Reduce the master equation to phenomenological rate coefficients
𝑘(𝑇, 𝑃 ) using the modified strong collision method
rs.applyReservoirStateMethod() Reduce the master equation to phenomenological rate coefficients
𝑘(𝑇, 𝑃 ) using the reservoir state method
cse.applyChemicallySignificantEigenvaluesMethod()
Reduce the master equation to phenomenological rate coefficients
𝑘(𝑇, 𝑃 ) using the chemically-significant eigenvalues method
rmgpy.pdep.SingleExponentialDown
Attribute Description
alpha0 The average energy transferred in a deactivating collision at the reference temperature
T0 The reference temperature
n The temperature exponent
𝐸′ − 𝐸
(︂ )︂
𝑃 (𝐸, 𝐸 ′ ) = 𝐶(𝐸 ′ ) exp − 𝐸 < 𝐸′
𝛼
where the parameter 𝛼 = ⟨∆𝐸d ⟩ represents the average energy transferred in a deactivating collision. This is the
most commonly-used collision model, simply because it only has one parameter to determine. The parameter 𝛼
is specified using the equation
(︂ )︂𝑛
𝑇
𝛼 = 𝛼0
𝑇0
where 𝛼0 is the value of 𝛼 at temperature 𝑇0 in K. Set the exponent 𝑛 to zero to obtain a temperature-independent
value for 𝛼.
T0
The reference temperature.
alpha0
The average energy transferred in a deactivating collision at the reference temperature.
as_dict(self ) → dict
A helper function for dumping objects as dictionaries for YAML files
Returns A dictionary representation of the object
Return type dict
calculateCollisionEfficiency(self, double T, ndarray Elist, ndarray Jlist, ndarray densStates,
double E0, double Ereac)
Calculate an efficiency factor for collisions, particularly useful for the modified strong collision method.
The collisions involve the given species with density of states densStates corresponding to energies Elist‘ in
J/mol, ground-state energy E0 in kJ/mol, and first reactive energy Ereac in kJ/mol. The collisions occur at
temperature T in K and are described by the average energy transferred in a deactivating collision dEdown
in kJ/mol. The algorithm here is implemented as described by Chang, Bozzelli, and Dean [?].
Reaction events
RRKM theory
is given by
𝑁 ‡ (𝐸, 𝐽)
𝑘(𝐸, 𝐽) =
ℎ𝜌(𝐸, 𝐽)
where 𝑁 ‡ (𝐸, 𝐽) is the sum of states of the transition state and 𝜌(𝐸, 𝐽) is the density of states of the reactant. If
the J-rotor is treated as active, the J-dependence can be averaged in the above expression to give
𝑁 ‡ (𝐸)
𝑘(𝐸) =
ℎ𝜌(𝐸)
as a function of total energy alone. This is reasonable at high temperatures, but less accurate at low temperatures.
Use of RRKM theory requires detailed information about the statistical mechanics of the reactant and transition
state. However, it is generally more accurate than the inverse Laplace transform method.
Given a high-pressure limit rate coefficient 𝑘∞ (𝑇 ) represented as an Arrhenius expression with positive 𝑛 and
𝐸a , the microcanonical rate coefficient 𝑘(𝐸) can be determined via an inverse Laplace transform. For 𝑛 = 0
the transform can be defined analytically:
𝜌(𝐸 − 𝐸a )
𝑘(𝐸) = 𝐴 (𝑛 = 0)
𝜌(𝐸)
For 𝑛 > 0 the transform is defined numerically. For 𝑛 < 0 or 𝐸a < 0 the transform is not defined; in this case
we approximate by simply lumping the 𝑇 𝑛 or 𝑒−𝐸a /𝑅𝑇 terms into the preexponential factor, and use a different
𝑘(𝐸) at each temperature.
The ILT method does not required detailed transition state information, but only the high-pressure limit kinet-
ics. However, it assumes that (1) 𝑘∞ (𝑇 ) is valid over the temperature range from zero to infinity and (2) the
activation energy 𝐸a is physically identical to the reaction barrier 𝐸0‡ − 𝐸0 .
rmgpy.pdep.Configuration
class rmgpy.pdep.Configuration(*species)
A representation of a molecular configuration on a potential energy surface.
E0
The ground-state energy of the configuration in J/mol.
Elist
numpy.ndarray
Type Elist
activeJRotor
‘bool’
Type activeJRotor
activeKRotor
‘bool’
Type activeKRotor
calculateCollisionFrequency(self, double T, double P, dict bathGas) → double
Return the value of the collision frequency in Hz at the given temperature T in K and pressure P in Pa. If a
dictionary bathGas of bath gas species and corresponding mole fractions is given, the collision parameters
of the bas gas species will be averaged with those of the species before computing the collision frequency.
Only the Lennard-Jones collision model is currently supported.
calculateDensityOfStates(self, ndarray Elist, bool activeJRotor=True, bool activeKRotor=True,
bool rmgmode=False)
Calculate the density (and sum) of states for the configuration at the given energies above the ground state
Elist in J/mol. The activeJRotor and activeKRotor flags control whether the J-rotor and/or K-rotor are
treated as active (and therefore included in the density and sum of states). The computed density and sum
of states arrays are stored on the object for future use.
cleanup(self )
Delete intermediate arrays used in computing k(T,P) values.
densStates
numpy.ndarray
Type densStates
generateCollisionMatrix(self, double T, ndarray densStates, ndarray Elist, ndarray Jlist=None) →
ndarray
Return the collisional energy transfer probabilities matrix for the configuration at the given temperature
T in K using the given energies Elist in kJ/mol and total angular momentum quantum numbers Jlist. The
density of states of the configuration densStates in mol/kJ is also required.
getEnthalpy(self, double T ) → double
Return the enthalpy in kJ/mol at the specified temperature T in K.
getEntropy(self, double T ) → double
Return the entropy in J/mol*K at the specified temperature T in K.
getFreeEnergy(self, double T ) → double
Return the Gibbs free energy in kJ/mol at the specified temperature T in K.
getHeatCapacity(self, double T ) → double
Return the constant-pressure heat capacity in J/mol*K at the specified temperature T in K.
hasStatMech(self ) → bool
Return True if all species in the configuration have statistical mechanics parameters, or False otherwise.
hasThermo(self ) → bool
Return True if all species in the configuration have thermodynamics parameters, or False otherwise.
isBimolecular(self ) → bool
Return True if the configuration represents a bimolecular reactant or product channel, or False otherwise.
isTransitionState(self ) → bool
Return True if the configuration represents a transition state, or False otherwise.
isUnimolecular(self ) → bool
Return True if the configuration represents a unimolecular isomer, or False otherwise.
mapDensityOfStates(self, ndarray Elist, ndarray Jlist=None)
Return a mapping of the density of states for the configuration to the given energies Elist in J/mol and, if
the J-rotor is not active, the total angular momentum quantum numbers Jlist.
mapSumOfStates(self, ndarray Elist, ndarray Jlist=None)
Return a mapping of the density of states for the configuration to the given energies Elist in J/mol and, if
the J-rotor is not active, the total angular momentum quantum numbers Jlist.
species
list
Type species
sumStates
numpy.ndarray
Type sumStates
rmgpy.pdep.Network
Attribute Description
isomers A list of the unimolecular isomers in the network
reactants A list of the bimolecular reactant channels (Configuration objects) in the network
products A list of the bimolecular product channels (Configuration objects) in the network
pathReac- A list of “path” reaction objects that connect adjacent isomers (the high-pressure-limit)
tions
bathGas A dictionary of the bath gas species (keys) and their mole fractions (values)
netReac- A list of “net” reaction objects that connect any pair of isomers
tions
T The current temperature in K
P The current pressure in bar
Elist The current array of energy grains in kJ/mol
Jlist The current array of total angular momentum quantum numbers
Nisom The number of unimolecular isomers in the network
Nreac The number of bimolecular reactant channels in the network
Nprod The number of bimolecular product channels in the network
Ngrains The number of energy grains
NJ The number of angular momentum grains
grainSize Maximum size of separation between energies
grainCount Minimum number of descrete energies separated
E0 A list of ground state energies of isomers, reactants, and products
activeKRo- True if the K-rotor is treated as active, False if treated as adiabatic
tor
activeJRotor True if the J-rotor is treated as active, False if treated as adiabatic
rmgmode True if in RMG mode, False otherwise
eqRatios An array containing concentration of each isomer and reactant channel present at equilibrium
collFreq An array of the frequency of collision between
Mcoll Matrix of first-order rate coefficients for collisional population transfer between grains for
each isomer
densStates 3D np array of stable configurations, number of grains, and number of J
applyChemicallySignificantEigenvaluesMethod(lumpingOrder=None)
Compute the phenomenological rate coefficients 𝑘(𝑇, 𝑃 ) at the current conditions using the chemically-
significant eigenvalues method. If a lumpingOrder is provided, the algorithm will attempt to lump the
configurations (given by index) in the order provided, and return a reduced set of 𝑘(𝑇, 𝑃 ) values.
applyModifiedStrongCollisionMethod(efficiencyModel=’default’)
Compute the phenomenological rate coefficients 𝑘(𝑇, 𝑃 ) at the current conditions using the modified
strong collision method.
applyReservoirStateMethod()
Compute the phenomenological rate coefficients 𝑘(𝑇, 𝑃 ) at the current conditions using the reservoir state
method.
calculateCollisionModel()
Calculate the matrix of first-order rate coefficients for collisional population transfer between grains for
each isomer, including the corresponding collision frequencies.
calculateDensitiesOfStates()
Calculate the densities of states of each configuration that has states data. The densities of states are
computed such that they can be applied to each temperature in the range of interest by interpolation.
calculateEquilibriumRatios()
Return an array containing the fraction of each isomer and reactant channel present at equilibrium, as
determined from the Gibbs free energy and using the concentration equilibrium constant 𝐾c . These values
are ratios, and the absolute magnitude is not guaranteed; however, the implementation scales the elements
of the array so that they sum to unity.
calculateMicrocanonicalRates()
Calculate and return arrays containing the microcanonical rate coefficients 𝑘(𝐸) for the isomerization,
dissociation, and association path reactions in the network.
getAllSpecies()
Return a list of all unique species in the network, including all isomers, reactant and product channels, and
bath gas species.
initialize(Tmin, Tmax, Pmin, Pmax, maximumGrainSize=0.0, minimumGrainCount=0, activeJRo-
tor=True, activeKRotor=True, rmgmode=False)
Initialize a pressure dependence calculation by computing several quantities that are independent of the
conditions. You must specify the temperature and pressure ranges of interesting using Tmin and Tmax in
K and Pmin and Pmax in Pa. You must also specify the maximum energy grain size grainSize in J/mol
and/or the minimum number of grains grainCount.
invalidate()
Mark the network as in need of a new calculation to determine the pressure-dependent rate coefficients
mapDensitiesOfStates()
Map the overall densities of states to the current energy grains. Semi-logarithmic interpolation will be
used if the grain sizes of Elist0 and Elist do not match; this should not be a significant source of error as
long as the grain sizes are sufficiently small.
printSummary(level=20)
Print a formatted list of information about the current network. Each molecular configuration - unimolec-
ular isomers, bimolecular reactant channels, and bimolecular product channels - is given along with its
energy on the potential energy surface. The path reactions connecting adjacent molecular configurations
are also given, along with their energies on the potential energy surface. The level parameter controls the
level of logging to which the summary is written, and is DEBUG by default.
selectEnergyGrains(T, grainSize=0.0, grainCount=0)
Select a suitable list of energies to use for subsequent calculations. This is done by finding the minimum
and maximum energies on the potential energy surface, then adding a multiple of 𝑘B 𝑇 onto the maximum
energy.
You must specify either the desired grain spacing grainSize in J/mol or the desired number of grains
Ngrains, as well as a temperature T in K to use for the equilibrium calculation. You can specify both
grainSize and grainCount, in which case the one that gives the more accurate result will be used (i.e. they
represent a maximum grain size and a minimum number of grains). An array containing the energy grains
in J/mol is returned.
setConditions(T, P, ymB=None)
Set the current network conditions to the temperature T in K and pressure P in Pa. All of the internal
variables are updated accordingly if they are out of date. For example, those variables that depend only on
temperature will not be recomputed if the temperature is the same.
solveFullME(tlist, x0)
Directly solve the full master equation using a stiff ODE solver. Pass the reaction network to solve, the
temperature T in K and pressure P in Pa to solve at, the energies Elist in J/mol to use, the output time points
tlist in s, the initial total populations x0, the full master equation matrix M, the accounting matrix indices
relating isomer and energy grain indices to indices of the master equation matrix, and the densities of states
densStates in mol/J of each isomer. Returns the times in s, population distributions for each isomer, and
total population profiles for each configuration.
solveReducedME(tlist, x0)
Directly solve the reduced master equation using a stiff ODE solver. Pass the output time points tlist in s
and the initial total populations x0. Be sure to run one of the methods for generating 𝑘(𝑇, 𝑃 ) values before
calling this method. Returns the times in s, population distributions for each isomer, and total population
profiles for each configuration.
The objective of each of the methods described in this section is to reduce the master equation into a small number of
phenomenological rate coefficients 𝑘(𝑇, 𝑃 ). All of the methods share a common formalism in that they seek to express
the population distribution vector p𝑖 for each unimolecular isomer 𝑖 as a linear combination of the total populations of
all unimolecular isomers and bimolecular reactant channels.
rmgpy.pdep.rs.applyReservoirStateMethod(network)
In the reservoir state method, the population distribution of each isomer is partitioned into the low-energy grains
(called the reservoir) and the high-energy grains (called the active space). The partition generally occurs at or
near the lowest transition state energy for each isomer. The reservoir population is assumed to be thermalized,
while the active-space population is assumed to be in pseudo-steady state. Applying these approximations
converts the master equation into a single large matrix equation. Solving this matrix equation gives the pseudo-
steady state populations of each isomer as a function of the total population of each isomer and reactant channel,
which are then applied to determine the 𝑘(𝑇, 𝑃 ) values.
The reservoir state method is only slightly more expensive than the modified strong collision method. At low
temperatures the approximations used are very good, and the resulting 𝑘(𝑇, 𝑃 ) values are more accurate than the
modified strong collision values. However, at high temperatures the thermalized reservoir approximation breaks
down, resulting in very inaccurate 𝑘(𝑇, 𝑃 ) values. Thus, the reservoir state method is not robustly applicable
over a wide range of temperatures and pressures.
The rmgpy.qm subpackage contains classes and functions for working with molecular geometries, and interfacing
with quantum chemistry software.
1.8.1 Main
Class Description
QMSettings A class to store settings related to quantum mechanics calculations
QMCalculator An object to store settings and previous calculations
1.8.2 Molecule
Class Description
Geometry A geometry, used for quantum calculations
QMMolecule A base class for QM Molecule calculations
1.8.3 QM Data
Class/Function Description
QMData General class for data extracted from a QM calculation
1.8.4 QM Verifier
Class/Function Description
QMVerifier Verifies whether a QM job was succesfully completed
1.8.5 Symmetry
Class/Function Description
PointGroup A symmetry Point Group
PointGroupCalculator Wrapper type to determine molecular symmetry point groups based on 3D coordi-
nates
SymmetryJob Determine the point group using the SYMMETRY program
1.8.6 Gaussian
Class/Function Description
Gaussian A base class for all QM calculations that use Gaussian
GaussianMol A base Class for calculations of molecules using Gaussian.
GaussianMolPM3 A base Class for calculations of molecules using Gaussian at PM3.
GaussianMolPM6 A base Class for calculations of molecules using Gaussian at PM6.
1.8.7 Mopac
Class/Function Description
Mopac A base class for all QM calculations that use Mopac
MopacMol A base Class for calculations of molecules using Mopac.
MopacMolPM3 A base Class for calculations of molecules using Mopac at PM3.
MopacMolPM6 A base Class for calculations of molecules using Mopac at PM6.
MopacMolPM7 A base Class for calculations of molecules using Mopac at PM7.
rmgpy.qm.main
checkAllSet()
Check that all the required settings are set.
class rmgpy.qm.main.QMCalculator(software=None, method=’pm3’, fileStore=None, scratchDirec-
tory=None, onlyCyclics=True, maxRadicalNumber=0)
A Quantum Mechanics calculator object, to store settings.
The attributes are:
checkPaths()
Check the paths in the settings are OK. Make folders as necessary.
checkReady()
Check that it’s ready to run calculations.
getThermoData(molecule)
Generate thermo data for the given Molecule via a quantum mechanics calculation.
Ignores the settings onlyCyclics and maxRadicalNumber and does the calculation anyway if asked. (I.e.
the code that chooses whether to call this method should consider those settings).
initialize()
Do any startup tasks.
runJobs(spc_list, procnum=1)
Run QM jobs for the provided species list (in parallel if requested).
setDefaultOutputDirectory(outputDirectory)
IF the fileStore or scratchDirectory are not already set, put them in here.
rmgpy.qm.molecule
generateRDKitGeometries()
Use RDKit to guess geometry.
Save mol files of both crude and refined. Saves coordinates on atoms.
getCrudeMolFilePath()
Returns the path of the crude mol file.
getFilePath(extension, scratch=True)
Returns the path to the file with the given extension.
The provided extension should include the leading dot. If called with scratch=False then it will be in the
fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.
getRefinedMolFilePath()
Returns the path the the refined mol file.
rd_build()
Import rmg molecule and create rdkit molecule with the same atom labeling.
rd_embed(rdmol, numConfAttempts)
Embed the RDKit molecule and create the crude molecule file.
saveCoordinatesFromQMData(qmdata)
Save geometry info from QMData (eg CCLibData)
uniqueID = None
A short unique ID such as an augmented InChI Key.
uniqueIDlong = None
Long, truly unique, ID, such as the augmented InChI.
class rmgpy.qm.molecule.QMMolecule(molecule, settings)
A base class for QM Molecule calculations.
Specific programs and methods should inherit from this and define some extra attributes and methods:
• outputFileExtension
• inputFileExtension
• generateQMData() . . . and whatever else is needed to make this method work.
The attributes are:
calculateChiralityCorrection()
Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.
calculateThermoData()
Calculate the thermodynamic properties.
Stores and returns a ThermoData object as self.thermo. self.qmData and self.pointGroup need to be gen-
erated before this method is called.
checkPaths()
Check the paths in the settings are OK. Make folders as necessary.
checkReady()
Check that it’s ready to run calculations.
createGeometry()
Creates self.geometry with RDKit geometries
determinePointGroup()
Determine point group using the SYMMETRY Program
Stores the resulting PointGroup in self.pointGroup
generateQMData()
Calculate the QM data somehow and return a CCLibData object, or None if it fails.
generateThermoData()
Generate Thermo Data via a QM calc.
Returns None if it fails.
getFilePath(extension, scratch=True)
Returns the path to the file with the given extension.
The provided extension should include the leading dot. If called with scratch=False then it will be in the
fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.
getInChiKeyAug()
Returns the augmented InChI from self.molecule
getMolFilePathForCalculation(attempt)
Get the path to the MOL file of the geometry to use for calculation attempt.
If attempt <= self.scriptAttempts then we use the refined coordinates, then we start to use the crude coor-
dinates.
getThermoFilePath()
Returns the path the thermo data file.
initialize()
Do any startup tasks.
inputFilePath
Get the input file name.
loadThermoData()
Try loading a thermo data from a previous run.
maxAttempts
The total number of attempts to try
outputFilePath
Get the output file name.
parse()
Parses the results of the Mopac calculation, and returns a QMData object.
saveThermoData()
Save the generated thermo data.
scriptAttempts
The number of attempts with different script keywords
rmgpy.qm.qmdata
rmgpy.qm.qmverifier
class rmgpy.qm.qmverifier.QMVerifier(molfile)
rmgpy.qm.symmetry
uniqueID = None
The object that holds information from a previous QM Job on 3D coords, molecule etc. . .
writeInputFile()
Write the input file for the SYMMETRY program.
rmgpy.qm.gaussian
class rmgpy.qm.gaussian.Gaussian
A base class for all QM calculations that use Gaussian.
Classes such as GaussianMol will inherit from this class.
failureKeys = ['ERROR TERMINATION', 'IMAGINARY FREQUENCIES']
List of phrases that indicate failure NONE of these must be present in a succesful job.
parse()
Parses the results of the Gaussian calculation, and returns a QMData object.
successKeys = ['Normal termination of Gaussian']
List of phrases to indicate success. ALL of these must be present in a successful job.
verifyOutputFile()
Check’s that an output file exists and was successful.
Returns a boolean flag that states whether a successful GAUSSIAN simulation already exists for the
molecule with the given (augmented) InChI Key.
The definition of finding a successful simulation is based on these criteria: 1) finding an output file with
the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation
failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI
of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry,
when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)
If any of the above criteria is not matched, False will be returned. If all are satisfied, it will return True.
class rmgpy.qm.gaussian.GaussianMol(molecule, settings)
A base Class for calculations of molecules using Gaussian.
Inherits from both QMMolecule and Gaussian.
calculateChiralityCorrection()
Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.
calculateThermoData()
Calculate the thermodynamic properties.
Stores and returns a ThermoData object as self.thermo. self.qmData and self.pointGroup need to be gen-
erated before this method is called.
checkPaths()
Check the paths in the settings are OK. Make folders as necessary.
checkReady()
Check that it’s ready to run calculations.
createGeometry()
Creates self.geometry with RDKit geometries
determinePointGroup()
Determine point group using the SYMMETRY Program
Stores the resulting PointGroup in self.pointGroup
generateQMData()
Calculate the QM data and return a QMData object.
generateThermoData()
Generate Thermo Data via a QM calc.
Returns None if it fails.
getFilePath(extension, scratch=True)
Returns the path to the file with the given extension.
The provided extension should include the leading dot. If called with scratch=False then it will be in the
fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.
getInChiKeyAug()
Returns the augmented InChI from self.molecule
getMolFilePathForCalculation(attempt)
Get the path to the MOL file of the geometry to use for calculation attempt.
If attempt <= self.scriptAttempts then we use the refined coordinates, then we start to use the crude coor-
dinates.
getParser(outputFile)
Returns the appropriate cclib parser.
getThermoFilePath()
Returns the path the thermo data file.
initialize()
Do any startup tasks.
inputFileKeywords(attempt)
Return the top keywords for attempt number attempt.
NB. attempt begins at 1, not 0.
inputFilePath
Get the input file name.
loadThermoData()
Try loading a thermo data from a previous run.
maxAttempts
The total number of attempts to try
outputFilePath
Get the output file name.
parse()
Parses the results of the Mopac calculation, and returns a QMData object.
saveThermoData()
Save the generated thermo data.
scriptAttempts
The number of attempts with different script keywords
verifyOutputFile()
Check’s that an output file exists and was successful.
Returns a boolean flag that states whether a successful GAUSSIAN simulation already exists for the
molecule with the given (augmented) InChI Key.
The definition of finding a successful simulation is based on these criteria: 1) finding an output file with
the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation
failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI
of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry,
when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)
If any of the above criteria is not matched, False will be returned. If all are satisfied, it will return True.
writeInputFile(attempt)
Using the Geometry object, write the input file for the attempt.
class rmgpy.qm.gaussian.GaussianMolPM3(molecule, settings)
Gaussian PM3 calculations for molecules
This is a class of its own in case you wish to do anything differently, but for now it’s only the ‘pm3’ in the
keywords that differs.
calculateChiralityCorrection()
Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.
calculateThermoData()
Calculate the thermodynamic properties.
Stores and returns a ThermoData object as self.thermo. self.qmData and self.pointGroup need to be gen-
erated before this method is called.
checkPaths()
Check the paths in the settings are OK. Make folders as necessary.
checkReady()
Check that it’s ready to run calculations.
createGeometry()
Creates self.geometry with RDKit geometries
determinePointGroup()
Determine point group using the SYMMETRY Program
Stores the resulting PointGroup in self.pointGroup
generateQMData()
Calculate the QM data and return a QMData object.
generateThermoData()
Generate Thermo Data via a QM calc.
Returns None if it fails.
getFilePath(extension, scratch=True)
Returns the path to the file with the given extension.
The provided extension should include the leading dot. If called with scratch=False then it will be in the
fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.
getInChiKeyAug()
Returns the augmented InChI from self.molecule
getMolFilePathForCalculation(attempt)
Get the path to the MOL file of the geometry to use for calculation attempt.
If attempt <= self.scriptAttempts then we use the refined coordinates, then we start to use the crude coor-
dinates.
getParser(outputFile)
Returns the appropriate cclib parser.
getThermoFilePath()
Returns the path the thermo data file.
initialize()
Do any startup tasks.
inputFileKeywords(attempt)
Return the top keywords for attempt number attempt.
NB. attempt begins at 1, not 0.
inputFilePath
Get the input file name.
keywords = ['# pm3 opt=(verytight,gdiis) freq IOP(2/16=3)', '# pm3 opt=(verytight,gdiis) freq IO
Keywords that will be added at the top of the qm input file
loadThermoData()
Try loading a thermo data from a previous run.
maxAttempts
The total number of attempts to try
outputFilePath
Get the output file name.
parse()
Parses the results of the Mopac calculation, and returns a QMData object.
saveThermoData()
Save the generated thermo data.
scriptAttempts
The number of attempts with different script keywords
verifyOutputFile()
Check’s that an output file exists and was successful.
Returns a boolean flag that states whether a successful GAUSSIAN simulation already exists for the
molecule with the given (augmented) InChI Key.
The definition of finding a successful simulation is based on these criteria: 1) finding an output file with
the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation
failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI
of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry,
when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)
If any of the above criteria is not matched, False will be returned. If all are satisfied, it will return True.
writeInputFile(attempt)
Using the Geometry object, write the input file for the attempt.
class rmgpy.qm.gaussian.GaussianMolPM6(molecule, settings)
Gaussian PM6 calculations for molecules
This is a class of its own in case you wish to do anything differently, but for now it’s only the ‘pm6’ in the
keywords that differs.
calculateChiralityCorrection()
Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.
calculateThermoData()
Calculate the thermodynamic properties.
Stores and returns a ThermoData object as self.thermo. self.qmData and self.pointGroup need to be gen-
erated before this method is called.
checkPaths()
Check the paths in the settings are OK. Make folders as necessary.
checkReady()
Check that it’s ready to run calculations.
createGeometry()
Creates self.geometry with RDKit geometries
determinePointGroup()
Determine point group using the SYMMETRY Program
Stores the resulting PointGroup in self.pointGroup
generateQMData()
Calculate the QM data and return a QMData object.
generateThermoData()
Generate Thermo Data via a QM calc.
Returns None if it fails.
getFilePath(extension, scratch=True)
Returns the path to the file with the given extension.
The provided extension should include the leading dot. If called with scratch=False then it will be in the
fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.
getInChiKeyAug()
Returns the augmented InChI from self.molecule
getMolFilePathForCalculation(attempt)
Get the path to the MOL file of the geometry to use for calculation attempt.
If attempt <= self.scriptAttempts then we use the refined coordinates, then we start to use the crude coor-
dinates.
getParser(outputFile)
Returns the appropriate cclib parser.
getThermoFilePath()
Returns the path the thermo data file.
initialize()
Do any startup tasks.
inputFileKeywords(attempt)
Return the top keywords for attempt number attempt.
NB. attempt begins at 1, not 0.
inputFilePath
Get the input file name.
keywords = ['# pm6 opt=(verytight,gdiis) freq IOP(2/16=3)', '# pm6 opt=(verytight,gdiis) freq IO
Keywords that will be added at the top of the qm input file
loadThermoData()
Try loading a thermo data from a previous run.
maxAttempts
The total number of attempts to try
outputFilePath
Get the output file name.
parse()
Parses the results of the Mopac calculation, and returns a QMData object.
saveThermoData()
Save the generated thermo data.
scriptAttempts
The number of attempts with different script keywords
verifyOutputFile()
Check’s that an output file exists and was successful.
Returns a boolean flag that states whether a successful GAUSSIAN simulation already exists for the
molecule with the given (augmented) InChI Key.
The definition of finding a successful simulation is based on these criteria: 1) finding an output file with
the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation
failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI
of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry,
when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)
If any of the above criteria is not matched, False will be returned. If all are satisfied, it will return True.
writeInputFile(attempt)
Using the Geometry object, write the input file for the attempt.
rmgpy.qm.mopac
class rmgpy.qm.mopac.Mopac
A base class for all QM calculations that use MOPAC.
Classes such as MopacMol will inherit from this class.
failureKeys = ['IMAGINARY FREQUENCIES', 'EXCESS NUMBER OF OPTIMIZATION CYCLES', 'NOT ENOUGH TIME
List of phrases that indicate failure NONE of these must be present in a succesful job.
getParser(outputFile)
Returns the appropriate cclib parser.
successKeys = ['DESCRIPTION OF VIBRATIONS', 'MOPAC DONE']
List of phrases to indicate success. ALL of these must be present in a successful job.
usePolar = False
Keywords for the multiplicity
verifyOutputFile()
Check’s that an output file exists and was successful.
Returns a boolean flag that states whether a successful MOPAC simulation already exists for the molecule
with the given (augmented) InChI Key.
The definition of finding a successful simulation is based on these criteria: 1) finding an output file with
the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation
failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI
of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry,
when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)
If any of the above criteria is not matched, False will be returned. If all succeed, then it will return True.
class rmgpy.qm.mopac.MopacMol(molecule, settings)
A base Class for calculations of molecules using MOPAC.
Inherits from both QMMolecule and Mopac.
calculateChiralityCorrection()
Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.
calculateThermoData()
Calculate the thermodynamic properties.
Stores and returns a ThermoData object as self.thermo. self.qmData and self.pointGroup need to be gen-
erated before this method is called.
checkPaths()
Check the paths in the settings are OK. Make folders as necessary.
checkReady()
Check that it’s ready to run calculations.
createGeometry()
Creates self.geometry with RDKit geometries
determinePointGroup()
Determine point group using the SYMMETRY Program
Stores the resulting PointGroup in self.pointGroup
generateQMData()
Calculate the QM data and return a QMData object, or None if it fails.
generateThermoData()
Generate Thermo Data via a QM calc.
Returns None if it fails.
getFilePath(extension, scratch=True)
Returns the path to the file with the given extension.
The provided extension should include the leading dot. If called with scratch=False then it will be in the
fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.
getInChiKeyAug()
Returns the augmented InChI from self.molecule
getMolFilePathForCalculation(attempt)
Get the path to the MOL file of the geometry to use for calculation attempt.
If attempt <= self.scriptAttempts then we use the refined coordinates, then we start to use the crude coor-
dinates.
getParser(outputFile)
Returns the appropriate cclib parser.
getThermoFilePath()
Returns the path the thermo data file.
initialize()
Do any startup tasks.
inputFileKeywords(attempt)
Return the top, bottom, and polar keywords.
inputFilePath
Get the input file name.
keywords = [{'top': 'precise nosym THREADS=1', 'bottom': 'oldgeo thermo nosym precise THREADS=
Keywords that will be added at the top and bottom of the qm input file
loadThermoData()
Try loading a thermo data from a previous run.
maxAttempts
The total number of attempts to try
outputFilePath
Get the output file name.
parse()
Parses the results of the Mopac calculation, and returns a QMData object.
saveThermoData()
Save the generated thermo data.
scriptAttempts
The number of attempts with different script keywords
verifyOutputFile()
Check’s that an output file exists and was successful.
Returns a boolean flag that states whether a successful MOPAC simulation already exists for the molecule
with the given (augmented) InChI Key.
The definition of finding a successful simulation is based on these criteria: 1) finding an output file with
the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation
failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI
of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry,
when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)
If any of the above criteria is not matched, False will be returned. If all succeed, then it will return True.
writeInputFile(attempt)
Using the Geometry object, write the input file for the attempt.
class rmgpy.qm.mopac.MopacMolPM3(molecule, settings)
Mopac PM3 calculations for molecules
This is a class of its own in case you wish to do anything differently, but for now it’s the same as all the MOPAC
PMn calculations, only pm3
calculateChiralityCorrection()
Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.
calculateThermoData()
Calculate the thermodynamic properties.
Stores and returns a ThermoData object as self.thermo. self.qmData and self.pointGroup need to be gen-
erated before this method is called.
checkPaths()
Check the paths in the settings are OK. Make folders as necessary.
checkReady()
Check that it’s ready to run calculations.
createGeometry()
Creates self.geometry with RDKit geometries
determinePointGroup()
Determine point group using the SYMMETRY Program
Stores the resulting PointGroup in self.pointGroup
generateQMData()
Calculate the QM data and return a QMData object, or None if it fails.
generateThermoData()
Generate Thermo Data via a QM calc.
Returns None if it fails.
getFilePath(extension, scratch=True)
Returns the path to the file with the given extension.
The provided extension should include the leading dot. If called with scratch=False then it will be in the
fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.
getInChiKeyAug()
Returns the augmented InChI from self.molecule
getMolFilePathForCalculation(attempt)
Get the path to the MOL file of the geometry to use for calculation attempt.
If attempt <= self.scriptAttempts then we use the refined coordinates, then we start to use the crude coor-
dinates.
getParser(outputFile)
Returns the appropriate cclib parser.
getThermoFilePath()
Returns the path the thermo data file.
initialize()
Do any startup tasks.
inputFileKeywords(attempt)
Return the top, bottom, and polar keywords for attempt number attempt.
NB. attempt begins at 1, not 0.
inputFilePath
Get the input file name.
loadThermoData()
Try loading a thermo data from a previous run.
maxAttempts
The total number of attempts to try
outputFilePath
Get the output file name.
parse()
Parses the results of the Mopac calculation, and returns a QMData object.
saveThermoData()
Save the generated thermo data.
scriptAttempts
The number of attempts with different script keywords
verifyOutputFile()
Check’s that an output file exists and was successful.
Returns a boolean flag that states whether a successful MOPAC simulation already exists for the molecule
with the given (augmented) InChI Key.
The definition of finding a successful simulation is based on these criteria: 1) finding an output file with
the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation
failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI
of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry,
when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)
If any of the above criteria is not matched, False will be returned. If all succeed, then it will return True.
writeInputFile(attempt)
Using the Geometry object, write the input file for the attempt.
class rmgpy.qm.mopac.MopacMolPM6(molecule, settings)
Mopac PM6 calculations for molecules
This is a class of its own in case you wish to do anything differently, but for now it’s the same as all the MOPAC
PMn calculations, only pm6
calculateChiralityCorrection()
Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.
calculateThermoData()
Calculate the thermodynamic properties.
Stores and returns a ThermoData object as self.thermo. self.qmData and self.pointGroup need to be gen-
erated before this method is called.
checkPaths()
Check the paths in the settings are OK. Make folders as necessary.
checkReady()
Check that it’s ready to run calculations.
createGeometry()
Creates self.geometry with RDKit geometries
determinePointGroup()
Determine point group using the SYMMETRY Program
Stores the resulting PointGroup in self.pointGroup
generateQMData()
Calculate the QM data and return a QMData object, or None if it fails.
generateThermoData()
Generate Thermo Data via a QM calc.
Returns None if it fails.
getFilePath(extension, scratch=True)
Returns the path to the file with the given extension.
The provided extension should include the leading dot. If called with scratch=False then it will be in the
fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.
getInChiKeyAug()
Returns the augmented InChI from self.molecule
getMolFilePathForCalculation(attempt)
Get the path to the MOL file of the geometry to use for calculation attempt.
If attempt <= self.scriptAttempts then we use the refined coordinates, then we start to use the crude coor-
dinates.
getParser(outputFile)
Returns the appropriate cclib parser.
getThermoFilePath()
Returns the path the thermo data file.
initialize()
Do any startup tasks.
inputFileKeywords(attempt)
Return the top, bottom, and polar keywords for attempt number attempt.
NB. attempt begins at 1, not 0.
inputFilePath
Get the input file name.
loadThermoData()
Try loading a thermo data from a previous run.
maxAttempts
The total number of attempts to try
outputFilePath
Get the output file name.
parse()
Parses the results of the Mopac calculation, and returns a QMData object.
saveThermoData()
Save the generated thermo data.
scriptAttempts
The number of attempts with different script keywords
verifyOutputFile()
Check’s that an output file exists and was successful.
Returns a boolean flag that states whether a successful MOPAC simulation already exists for the molecule
with the given (augmented) InChI Key.
The definition of finding a successful simulation is based on these criteria: 1) finding an output file with
the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation
failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI
of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry,
when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)
If any of the above criteria is not matched, False will be returned. If all succeed, then it will return True.
writeInputFile(attempt)
Using the Geometry object, write the input file for the attempt.
class rmgpy.qm.mopac.MopacMolPM7(molecule, settings)
Mopac PM7 calculations for molecules
This is a class of its own in case you wish to do anything differently, but for now it’s the same as all the MOPAC
PMn calculations, only pm7
calculateChiralityCorrection()
Returns the chirality correction to entropy (R*ln(2) if chiral) in J/mol/K.
calculateThermoData()
Calculate the thermodynamic properties.
Stores and returns a ThermoData object as self.thermo. self.qmData and self.pointGroup need to be gen-
erated before this method is called.
checkPaths()
Check the paths in the settings are OK. Make folders as necessary.
checkReady()
Check that it’s ready to run calculations.
createGeometry()
Creates self.geometry with RDKit geometries
determinePointGroup()
Determine point group using the SYMMETRY Program
Stores the resulting PointGroup in self.pointGroup
generateQMData()
Calculate the QM data and return a QMData object, or None if it fails.
generateThermoData()
Generate Thermo Data via a QM calc.
Returns None if it fails.
getFilePath(extension, scratch=True)
Returns the path to the file with the given extension.
The provided extension should include the leading dot. If called with scratch=False then it will be in the
fileStore directory, else scratch=True is assumed and it will be in the scratchDirectory directory.
getInChiKeyAug()
Returns the augmented InChI from self.molecule
getMolFilePathForCalculation(attempt)
Get the path to the MOL file of the geometry to use for calculation attempt.
If attempt <= self.scriptAttempts then we use the refined coordinates, then we start to use the crude coor-
dinates.
getParser(outputFile)
Returns the appropriate cclib parser.
getThermoFilePath()
Returns the path the thermo data file.
initialize()
Do any startup tasks.
inputFileKeywords(attempt)
Return the top, bottom, and polar keywords for attempt number attempt.
NB. attempt begins at 1, not 0.
inputFilePath
Get the input file name.
loadThermoData()
Try loading a thermo data from a previous run.
maxAttempts
The total number of attempts to try
outputFilePath
Get the output file name.
parse()
Parses the results of the Mopac calculation, and returns a QMData object.
saveThermoData()
Save the generated thermo data.
scriptAttempts
The number of attempts with different script keywords
verifyOutputFile()
Check’s that an output file exists and was successful.
Returns a boolean flag that states whether a successful MOPAC simulation already exists for the molecule
with the given (augmented) InChI Key.
The definition of finding a successful simulation is based on these criteria: 1) finding an output file with
the file name equal to the InChI Key 2) NOT finding any of the keywords that are denote a calculation
failure 3) finding all the keywords that denote a calculation success. 4) finding a match between the InChI
of the given molecule and the InchI found in the calculation files 5) checking that the optimized geometry,
when connected by single bonds, is isomorphic with self.molecule (converted to single bonds)
If any of the above criteria is not matched, False will be returned. If all succeed, then it will return True.
writeInputFile(attempt)
Using the Geometry object, write the input file for the attempt.
Class Description
ScalarQuantity A scalar physical quantity, with units and uncertainty
ArrayQuantity An array physical quantity, with units and uncertainty
Quantity() Return a scalar or array physical quantity
Units can be classified into categories based on the associated dimensionality. For example, miles and kilometers
are both units of length; seconds and hours are both units of time, etc. Clearly, quantities of different unit types are
fundamentally different.
RMG provides functions that create physical quantities (scalar or array) and validate the units for a variety of unit
types. This prevents the user from inadvertently mixing up their units - e.g. by setting an enthalpy with entropy units
- which should reduce errors. RMG recognizes the following unit types:
In RMG, all energies, heat capacities, concentrations, fluxes, and rate coefficients are treated as intensive; this means
that these quantities are always expressed “per mole” or “per molecule”. All other unit types are extensive. A special
exception is added for mass so as to allow for coercion of g/mol to amu.
RMG also handles rate coefficient units as a special case, as there are multiple allowed dimensionalities based on the
reaction order. Note that RMG generally does not attempt to verify that the rate coefficient units match the reaction
order, but only that it matches one of the possibilities.
The table above gives the SI unit that RMG uses internally to work with physical quantities. This does not necessarily
correspond with the units used when outputting values. For example, pressures are often output in units of bar instead
of Pa, and moments of inertia in amu * angstrom2 instead of kg * m2 . The recommended rule of thumb is to use
prefixed SI units (or aliases thereof) in the output; for example, use kJ/mol instead of kcal/mol for energy values.
rmgpy.quantity.ScalarQuantity
Attribute Description
value The numeric value of the quantity in the given units
units The units the value was specified in
uncertainty The numeric uncertainty in the value in the given units (unitless if multiplicative)
uncertainty- The type of uncertainty: '+|-' for additive, '*|/' for multiplicative
Type
value_si The numeric value of the quantity in the corresponding SI units
uncertainty_si The numeric value of the uncertainty in the corresponding SI units (unitless if multiplica-
tive)
It is often more convenient to perform computations using SI units instead of the given units of the quantity. For
this reason, the SI equivalent of the value attribute can be directly accessed using the value_si attribute. This
value is cached on the ScalarQuantity object for speed.
as_dict(self ) → dict
A helper function for YAML dumping
copy(self ) → ScalarQuantity
Return a copy of the quantity.
equals(self, quantity)
Return True if the everything in a quantity object matches the parameters in this object. If there are lists
of values or uncertainties, each item in the list must be matching and in the same order. Otherwise, return
False (Originally intended to return warning if units capitalization was different, however, Quantity object
only parses units matching in case, so this will not be a problem.)
getConversionFactorFromSI(self ) → double
Return the conversion factor for converting a quantity to a given set of units from the SI equivalent units.
getConversionFactorFromSItoCmMolS(self ) → double
Return the conversion factor for converting into SI units only with all lengths in cm, instead of m. This
is useful for outputting chemkin file kinetics. Depending on the stoichiometry of the reaction the reaction
rate coefficient could be /s, cm^3/mol/s, cm^6/mol^2/s, and for heterogeneous reactions even more possi-
bilities. Only lengths are changed. Everything else is in SI, i.e. moles (not molecules) and seconds (not
minutes).
getConversionFactorToSI(self ) → double
Return the conversion factor for converting a quantity in a given set of‘units‘ to the SI equivalent units.
getUncertainty(self )
The numeric value of the uncertainty, in the given units if additive, or no units if multiplicative.
getUncertaintyType(self ) → str
The type of uncertainty: '+|-' for additive, '*|/' for multiplicative
getValue(self )
The numeric value of the quantity, in the given units
isUncertaintyAdditive(self ) → bool
Return True if the uncertainty is specified in additive format and False otherwise.
isUncertaintyMultiplicative(self ) → bool
Return True if the uncertainty is specified in multiplicative format and False otherwise.
uncertainty
ScalarQuantity.getUncertainty(self)
The numeric value of the uncertainty, in the given units if additive, or no units if multiplicative.
uncertaintyType
ScalarQuantity.getUncertaintyType(self) -> str
The type of uncertainty: '+|-' for additive, '*|/' for multiplicative
uncertainty_si
‘double’
Type uncertainty_si
units
str
Type units
value
ScalarQuantity.getValue(self)
The numeric value of the quantity, in the given units
value_si
‘double’
Type value_si
rmgpy.quantity.ArrayQuantity
Attribute Description
value The numeric value of the quantity in the given units
units The units the value was specified in
uncertainty The numeric uncertainty in the value (unitless if multiplicative)
uncertainty- The type of uncertainty: '+|-' for additive, '*|/' for multiplicative
Type
value_si The numeric value of the quantity in the corresponding SI units
uncertainty_si The numeric value of the uncertainty in the corresponding SI units (unitless if multiplica-
tive)
It is often more convenient to perform computations using SI units instead of the given units of the quantity. For
this reason, the SI equivalent of the value attribute can be directly accessed using the value_si attribute. This
value is cached on the ArrayQuantity object for speed.
as_dict(self ) → dict
A helper function for YAML dumping
copy(self ) → ArrayQuantity
Return a copy of the quantity.
equals(self, quantity)
Return True if the everything in a quantity object matches the parameters in this object. If there are lists
of values or uncertainties, each item in the list must be matching and in the same order. Otherwise, return
False (Originally intended to return warning if units capitalization was different, however, Quantity object
only parses units matching in case, so this will not be a problem.)
getConversionFactorFromSI(self ) → double
Return the conversion factor for converting a quantity to a given set of units from the SI equivalent units.
getConversionFactorFromSItoCmMolS(self ) → double
Return the conversion factor for converting into SI units only with all lengths in cm, instead of m. This
is useful for outputting chemkin file kinetics. Depending on the stoichiometry of the reaction the reaction
rate coefficient could be /s, cm^3/mol/s, cm^6/mol^2/s, and for heterogeneous reactions even more possi-
bilities. Only lengths are changed. Everything else is in SI, i.e. moles (not molecules) and seconds (not
minutes).
getConversionFactorToSI(self ) → double
Return the conversion factor for converting a quantity in a given set of‘units‘ to the SI equivalent units.
getUncertainty(self )
The numeric value of the uncertainty, in the given units if additive, or no units if multiplicative.
getUncertaintyType(self ) → str
The type of uncertainty: '+|-' for additive, '*|/' for multiplicative
getValue(self )
The numeric value of the array quantity, in the given units.
isUncertaintyAdditive(self ) → bool
Return True if the uncertainty is specified in additive format and False otherwise.
isUncertaintyMultiplicative(self ) → bool
Return True if the uncertainty is specified in multiplicative format and False otherwise.
make_object(self, dict data, dict class_dict)
A helper function for constructing objects from a dictionary (used when loading YAML files)
Parameters
• data (dict) – The dictionary representation of the object
setUncertaintyType(self, str v)
Check the uncertainty type is valid, then set it.
If you set the uncertainty then change the type, we have no idea what to do with the units. This ensures
you set the type first.
setValue(self, v)
uncertainty
ArrayQuantity.getUncertainty(self)
The numeric value of the uncertainty, in the given units if additive, or no units if multiplicative.
uncertaintyType
ArrayQuantity.getUncertaintyType(self) -> str
The type of uncertainty: '+|-' for additive, '*|/' for multiplicative
uncertainty_si
numpy.ndarray
Type uncertainty_si
units
str
Type units
value
ArrayQuantity.getValue(self)
The numeric value of the array quantity, in the given units.
value_si
numpy.ndarray
Type value_si
rmgpy.quantity.Quantity
rmgpy.quantity.Quantity(*args, **kwargs)
Create a ScalarQuantity or ArrayQuantity object for a given physical quantity. The physical quantity can
be specified in several ways:
• A scalar-like or array-like value (for a dimensionless quantity)
• An array of arguments (including keyword arguments) giving some or all of the value, units, uncertainty,
and/or uncertaintyType.
• A tuple of the form (value,), (value,units), (value,units,uncertainty), or (value,units,
uncertaintyType,uncertainty)
The rmgpy.reaction subpackage contains classes and functions for working with chemical reaction.
1.10.1 Reaction
Class Description
Reaction A chemical reaction
rmgpy.reaction.Reaction
allow_max_rate_violation
‘bool’
Type allow_max_rate_violation
allow_pdep_route
‘bool’
Type allow_pdep_route
calculateMicrocanonicalRateCoefficient(self, ndarray Elist, ndarray Jlist, ndarray reac-
DensStates, ndarray prodDensStates=None, double
T=0.0)
Calculate the microcanonical rate coefficient 𝑘(𝐸) for the reaction reaction at the energies Elist in J/mol.
reacDensStates and prodDensStates are the densities of states of the reactant and product configurations
for this reaction. If the reaction is irreversible, only the reactant density of states is required; if the reaction
is reversible, then both are required. This function will try to use the best method that it can based on the
input data available:
• If detailed information has been provided for the transition state (i.e. the molecular degrees of free-
dom), then RRKM theory will be used.
• If the above is not possible but high-pressure limit kinetics 𝑘∞ (𝑇 ) have been provided, then the
inverse Laplace transform method will be used.
The density of states for the product prodDensStates and the temperature of interest T in K can also
be provided. For isomerization and association reactions prodDensStates is required; for dissociation
reactions it is optional. The temperature is used if provided in the detailed balance expression to determine
the reverse kinetics, and in certain cases in the inverse Laplace transform method.
calculateTSTRateCoefficient(self, double T ) → double
Evaluate the forward rate coefficient for the reaction with corresponding transition state TS at temperature
T in K using (canonical) transition state theory. The TST equation is
𝑄‡ (𝑇 )
(︂ )︂
𝑘B 𝑇 𝐸0
𝑘(𝑇 ) = 𝜅(𝑇 ) exp −
ℎ 𝑄A (𝑇 )𝑄B (𝑇 ) 𝑘B 𝑇
where 𝑄‡ is the partition function of the transition state, 𝑄A and 𝑄B are the partition function of the
reactants, 𝐸0 is the ground-state energy difference from the transition state to the reactants, 𝑇 is the
absolute temperature, 𝑘B is the Boltzmann constant, and ℎ is the Planck constant. 𝜅(𝑇 ) is an optional
tunneling correction.
calculateTSTRateCoefficients(self, ndarray Tlist) → ndarray
extensions are .png, .svg, .pdf, and .ps; of these, the first is a raster format and the remainder are
vector formats.
duplicate
‘bool’
Type duplicate
elementary_high_p
‘bool’
Type elementary_high_p
ensure_species(self, bool reactant_resonance=False, bool product_resonance=False)
Ensure the reaction contains species objects in its reactant and product attributes. If the reaction is found
to hold molecule objects, it modifies the reactant, product and pairs to hold Species objects.
Generates resonance structures for Molecules if the corresponding options, reactant_resonance and/or
product_resonance, are True. Does not generate resonance for reactants or products that start as Species
objects.
fixBarrierHeight(self, bool forcePositive=False)
Turns the kinetics into Arrhenius (if they were ArrheniusEP) and ensures the activation energy is at least
the endothermicity for endothermic reactions, and is not negative only as a result of using Evans Polanyi
with an exothermic reaction. If forcePositive is True, then all reactions are forced to have a non-negative
barrier.
fixDiffusionLimitedA(self, T )
Decrease the pre-exponential factor (A) by the diffusion factor to account for the diffusion limit at the
specified temperature.
generate3dTS(self, reactants, products)
Generate the 3D structure of the transition state. Called from model.generateKinetics().
self.reactants is a list of reactants self.products is a list of products
generatePairs(self )
Generate the reactant-product pairs to use for this reaction when performing flux analysis. The exact
procedure for doing so depends on the reaction type:
There are a number of ways of determining the correct pairing for bimolecular reactions. Here we try a
simple similarity analysis by comparing the number of heavy atoms (C/O/N/S at the moment). This should
work most of the time, but a more rigorous algorithm may be needed for some cases.
generateReverseRateCoefficient(self, bool network_kinetics=False, Tmin=None, Tmax=None)
Generate and return a rate coefficient model for the reverse reaction. Currently this only works if the
kinetics attribute is one of several (but not necessarily all) kinetics types.
getEnthalpiesOfReaction(self, ndarray Tlist) → ndarray
Return the enthalpies of reaction in J/mol evaluated at temperatures Tlist in K.
getEnthalpyOfReaction(self, double T ) → double
Return the enthalpy of reaction in J/mol evaluated at temperature T in K.
index
‘int’
Type index
isAssociation(self ) → bool
Return True if the reaction represents an association reaction A + B −
↽−
−⇀
− C or False if not.
isBalanced(self ) → bool
Return True if the reaction has the same number of each atom on each side of the reaction equation, or
False if not.
isDissociation(self ) → bool
Return True if the reaction represents a dissociation reaction A −
↽−
−⇀
− B + C or False if not.
isIsomerization(self ) → bool
−−
Return True if the reaction represents an isomerization reaction A ↽−⇀
− B or False if not.
isIsomorphic(self, Reaction other, bool eitherDirection=True, bool checkIdentical=False, bool
checkOnlyLabel=False, bool checkTemplateRxnProducts=False, bool generateIni-
tialMap=False, bool strict=True) → bool
Return True if this reaction is the same as the other reaction, or False if they are different. The compar-
ison involves comparing isomorphism of reactants and products, and doesn’t use any kinetic information.
Parameters
• eitherDirection (bool, optional) – if False,then the reaction direction must
match.
• checkIdentical (bool, optional) – if True, check that atom ID’s match (used for
checking degeneracy)
• checkOnlyLabel (bool, optional) – if True, only check the string representation,
ignoring molecular structure comparisons
• checkTemplateRxnProducts (bool, optional) – if True, only check isomorphism
of reaction products (used when we know the reactants are identical, i.e. in generating
reactions)
• generateInitialMap (bool, optional) – if True, initialize map by pairing atoms
with same labels
• strict (bool, optional) – if False, perform isomorphism ignoring electrons
isSurfaceReaction(self ) → bool
Return True if one or more reactants or products are surface species (or surface sites)
isUnimolecular(self ) → bool
−−
Return True if the reaction has a single molecule as either reactant or product (or both) A ↽−⇀
− B + C or
A+B↽ −−
−⇀
− C or A ↽ −−
−⇀− B, or False if not.
is_forward
‘bool’
Type is_forward
k_effective_cache
dict
Type k_effective_cache
kinetics
rmgpy.kinetics.model.KineticsModel
Type kinetics
label
str
Type label
transitionState
rmgpy.species.TransitionState
Type transitionState
The rmgpy.rmg subpackage contains the main functionality for using RMG-Py to automatically generate detailed
reaction mechanisms.
Class Description
Species A chemical species, with RMG-specific functionality
CoreEdgeReactionModel A reaction model comprised of core and edge species and reactions
1.11.2 Input
Function Description
readInputFile() Load an RMG job input file
saveInputFile() Save an RMG job input file
1.11.3 Output
Function Description
saveOutputHTML() Save the results of an RMG job to an HTML file
saveDiffHTML() Save a comparison of two reaction mechanisms to an HTML file
Class Description
RMG Main class for RMG jobs
Class Description
PDepReaction A pressure-dependent “net” reaction
PDepNetwork A pressure-dependent unimolecular reaction network, with RMG-specific functionality
rmgpy.rmg.model.CoreEdgeReactionModel
Attribute Description
core The species and reactions of the current model core
edge The species and reactions of the current model edge
networkDict A dictionary of pressure-dependent reaction networks (Network objects) indexed by
source.
networkList A list of pressure-dependent reaction networks (Network objects)
networkCount A counter for the number of pressure-dependent networks created
indexSpecies- A dictionary with a unique index pointing to the species objects
Dict
solventName String describing solvent name for liquid reactions. Empty for non-liquid estimation
surfaceSiteDen- The surface site density (a SurfaceConcentration quantity) or None if no heterogeneous
sity catalyst.
moves any reactions in the edge that gain core status as a result of this change in status to the core. If this
are any such reactions, they are returned in a list.
addSpeciesToEdge(spec)
Add a species spec to the reaction model edge.
adjustSurface()
Here we add species intended to be added and remove any species that need to be moved out of the core.
For now we remove reactions from the surface that have become part of a PDepNetwork by intersecting the
set of surface reactions with the core so that all surface reactions are in the core thus the surface algorithm
currently (June 2017) is not implemented for pdep networks (however it will function fine for non-pdep
reactions on a pdep run)
applyKineticsToReaction(reaction)
retrieve the best kinetics for the reaction and apply it towards the forward or reverse direction (if reverse,
flip the direaction).
applyThermoToSpecies(procnum)
Generate thermo for species. QM calculations are parallelized if requested.
checkForExistingReaction(rxn)
Check to see if an existing reaction has the same reactants, products, and family as rxn. Returns True or
False and the matched reaction (if found).
First, a shortlist of reaction is retrieved that have the same reaction keys as the parameter reaction.
Next, the reaction ID containing an identifier (e.g. label) of the reactants and products is compared between
the parameter reaction and the each of the reactions in the shortlist. If a match is found, the discovered
reaction is returned.
If a match is not yet found, the Library (seed mechs, reaction libs) in the reaction database are iterated over
to check if a reaction was overlooked (a reaction with a different “family” key as the parameter reaction).
checkForExistingSpecies(molecule)
Check to see if an existing species contains the same molecule.Molecule as molecule. Comparison is
done using isomorphism without consideration of electrons. Therefore, resonance structures of a species
will all match each other.
Returns the matched species if found and None otherwise.
clearSurfaceAdjustments()
empties surface tracking varaibles
enlarge(newObject=None, reactEdge=False, unimolecularReact=None, bimolecularReact=None, tri-
molecularReact=None)
Enlarge a reaction model by processing the objects in the list newObject. If newObject is a rmg.species.
Species object, then the species is moved from the edge to the core and reactions generated for that
species, reacting with itself and with all other species in the model core. If newObject is a rmg.unirxn.
network.Network object, then reactions are generated for the species in the network with the largest
leak flux.
If the reactEdge flag is True, then no newObject is needed, and instead the algorithm proceeds to react the
core species together to form edge reactions.
generateKinetics(reaction)
Generate best possible kinetics for the given reaction using the kinetics database.
generateThermo(spc, rename=False)
Generate thermo for species.
getLists()
Return lists of all of the species and reactions in the core and the edge.
getModelSize()
Return the numbers of species and reactions in the model core and edge. Note that this is not necessarily
equal to the lengths of the corresponding species and reaction lists.
getStoichiometryMatrix()
Return the stoichiometry matrix for all generated species and reactions. The id of each species and reaction
is the corresponding row and column, respectively, in the matrix.
initializeIndexSpeciesDict()
Populates the core species dictionary
integer -> core Species
with the species that are currently in the core.
makeNewPDepReaction(forward)
Make a new pressure-dependent reaction based on a list of reactants and a list of products. The reaction
belongs to the specified network and has pressure-dependent kinetics given by kinetics.
No checking for existing reactions is made here. The returned PDepReaction object is not added to the
global list of reactions, as that is intended to represent only the high-pressure-limit set. The reaction-
Counter is incremented, however, since the returned reaction can and will exist in the model edge and/or
core.
makeNewReaction(forward, checkExisting=True, generateThermo=True)
Make a new reaction given a Reaction object forward. The reaction is added to the global list of reactions.
Returns the reaction in the direction that corresponds to the estimated kinetics, along with whether or not
the reaction is new to the global reaction list.
The forward direction is determined using the “is_reverse” attribute of the reaction’s family. If the reaction
family is its own reverse, then it is made such that the forward reaction is exothermic at 298K.
The forward reaction is appended to self.newReactionList if it is new.
makeNewSpecies(object, label=”, reactive=True, checkForExisting=True, generateThermo=True)
Formally create a new species from the specified object, which can be either a Molecule object or an
rmgpy.species.Species object. It is emphasized that reactive relates to the Species attribute, while
reactive_structure relates to the Molecule attribute.
markChemkinDuplicates()
Check that all reactions that will appear the chemkin output have been checked as duplicates.
Call this if you’ve done something that may have introduced undetected duplicate reactions, like add a
reaction library or seed mechanism. Anything added via the expand() method should already be detected.
printEnlargeSummary(newCoreSpecies, newCoreReactions, newEdgeSpecies, newEdgeReactions, re-
actionsMovedFromEdge=None, reactEdge=False)
Output a summary of a model enlargement step to the log. The details of the enlargement are passed in the
newCoreSpecies, newCoreReactions, newEdgeSpecies, and newEdgeReactions objects.
processNewReactions(newReactions, newSpecies, pdepNetwork=None, generateThermo=True)
Process a list of newly-generated reactions involving the new core species or explored isomer newSpecies
in network pdepNetwork.
Makes a reaction and decides where to put it: core, edge, or PDepNetwork.
prune(reactionSystems, toleranceKeepInEdge, toleranceMoveToCore, maximumEdgeSpecies, min-
SpeciesExistIterationsForPrune)
Remove species from the model edge based on the simulation results from the list of reactionSystems.
registerReaction(rxn)
Adds the reaction to the reaction database.
The reaction database is structured as a multi-level dictionary, for efficient search and retrieval of existing
reactions.
The database has two types of dictionary keys: - reaction family - reactant(s) keys
First, the keys are generated for the parameter reaction.
Next, it is checked whether the reaction database already contains similar keys. If not, a new container is
created, either a dictionary for the family key and first reactant key, or a list for the second reactant key.
Finally, the reaction is inserted as the first element in the list.
removeEmptyPdepNetworks()
searches for and deletes any empty pdep networks
removeSpeciesFromEdge(reactionSystems, spec)
Remove species spec from the reaction model edge.
retrieve(family_label, key1, key2)
Returns a list of reactions from the reaction database with the same keys as the parameters.
Returns an empty list when one of the keys could not be found.
searchRetrieveReactions(rxn)
Searches through the reaction database for reactions with an identical reaction key as the key of the pa-
rameter reaction.
Both the reaction key based on the reactants as well as on the products is used to search for possible
candidate reactions.
setThermodynamicFilteringParameters(Tmax, toleranceThermoKeepSpeciesInEdge, minCore-
SizeForPrune, maximumEdgeSpecies, reactionSystems)
sets parameters for thermodynamic filtering based on the current core Tmax is the maximum reactor tem-
perature in K toleranceThermoKeepSpeciesInEdge is the Gibbs number above which species will be fil-
tered minCoreSizeForPrune is the core size at which thermodynamic filtering will start maximumEdge-
Species is the maximum allowed number of edge species reactionSystems is a list of reactionSystem
objects
thermoFilterDown(maximumEdgeSpecies, minSpeciesExistIterationsForPrune=0)
removes species from the edge based on their Gibbs energy until maximumEdgeSpecies is reached under
the constraint that all removed species are older than minSpeciesExistIterationsForPrune iterations maxi-
mumEdgeSpecies is the maximum allowed number of edge species minSpeciesExistIterationsForPrune is
the number of iterations a species must be in the edge before it is eligible for thermo filtering
thermoFilterSpecies(spcs)
checks Gibbs energy of the species in species against the maximum allowed Gibbs energy
updateUnimolecularReactionNetworks()
Iterate through all of the currently-existing unimolecular reaction networks, updating those that have been
marked as invalid. In each update, the phenomonological rate coefficients 𝑘(𝑇, 𝑃 ) are computed for each
net reaction in the network, and the resulting reactions added or updated.
class rmgpy.rmg.model.ReactionModel(species=None, reactions=None)
Represent a generic reaction model. A reaction model consists of species, a list of species, and reactions, a list
of reactions.
merge(other)
Return a new ReactionModel object that is the union of this model and other.
rmgpy.rmg.input.readInputFile(path, rmg0)
Read an RMG input file at path on disk into the RMG object rmg.
rmgpy.rmg.input.saveInputFile(path, rmg)
Save an RMG input file at path on disk from the RMG object rmg.
rmgpy.rmg.main.RMG
Attribute Description
inputFile The path to the input file
databaseDirectory The directory containing the RMG database
thermoLibraries The thermodynamics libraries to load
reactionLibraries The kinetics libraries to load
statmechLibraries The statistical mechanics libraries to load
seedMechanisms The seed mechanisms included in the model
kineticsFamilies The kinetics families to use for reaction generation
kineticsDepositories The kinetics depositories to use for looking up kinetics in each family
kineticsEstimator The method to use to estimate kinetics: ‘group additivity’ or ‘rate rules’
solvent If solvation estimates are required, the name of the solvent.
reactionModel The core-edge reaction model generated by this job
reactionSystems A list of the reaction systems used in this job
database The RMG database used in this job
modelSettingsList List of ModelSettings objects containing information related to how to manage species/reaction mov
simulatorSettingsList List of SimulatorSettings objects containing information on how to run simulations
trimolecular True to consider reactions between three species (i.e., if trimolecular reaction families are present)
unimolecularThreshold Array of flags indicating whether a species is above the unimolecular reaction threshold
bimolecularThreshold Array of flags indicating whether two species are above the bimolecular reaction threshold
trimolecularThreshold Array of flags indicating whether three species are above the trimolecular reaction threshold
unimolecularReact Array of flags indicating whether a species should react unimolecularly in the enlarge step
bimolecularReact Array of flags indicating whether two species should react in the enlarge step
trimolecularReact Array of flags indicating whether three species should react in the enlarge step
termination A list of termination targets (i.e TerminationTime and TerminationConversion objects)
speciesConstraints Dictates the maximum number of atoms, carbons, electrons, etc. generated by RMG
outputDirectory The directory used to save output files
verbosity The level of logging verbosity for console output
loadRestart True if restarting a previous job, False otherwise
saveRestartPeriod The time period to periodically save a restart file (Quantity), or None for never.
units The unit system to use to save output files (currently must be ‘si’)
generateOutputHTML True to draw pictures of the species and reactions, saving a visualized model in an output HTML fil
generatePlots True to generate plots of the job execution statistics after each iteration, False otherwise
verboseComments True to keep the verbose comments for database estimates, False otherwise
saveEdgeSpecies True to save chemkin and HTML files of the edge species, False otherwise
keepIrreversible True to keep ireversibility of library reactions as is (‘<=>’ or ‘=>’). False (default) to force all libr
trimolecularProductReversible True (default) to allow families with trimolecular products to react in the reverse direction, False o
pressureDependence Whether to process unimolecular (pressure-dependent) reaction networks
quantumMechanics Whether to apply quantum mechanical calculations instead of group additivity to certain molecular t
checkInput()
Check for a few common mistakes in the input file.
checkLibraries()
Check unwanted use of libraries: Liquid phase libraries in Gas phase simulation. Loading a Liquid phase
library obtained in another solvent than the one defined in the input file. Other checks can be added here.
check_model()
Run checks on the RMG model
clear()
Clear all loaded information about the job (except the file paths).
execute(**kwargs)
Execute an RMG job using the command-line arguments args as returned by the argparse package.
finish()
Complete the model generation.
generateCanteraFiles(chemkinFile, **kwargs)
Convert a chemkin mechanism chem.inp file to a cantera mechanism file chem.cti and save it in the cantera
directory
initialize(**kwargs)
Initialize an RMG job using the command-line arguments args as returned by the argparse package.
loadInput(path=None)
Load an RMG job from the input file located at inputFile, or from the inputFile attribute if not given as a
parameter.
loadRMGJavaInput(path)
Load an RMG-Java job from the input file located at inputFile, or from the inputFile attribute if not given
as a parameter.
loadRestartFile(path)
Load a restart file at path on disk.
loadThermoInput(path=None)
Load an Thermo Estimation job from a thermo input file located at inputFile, or from the inputFile attribute
if not given as a parameter.
logHeader(level=20)
Output a header containing identifying information about RMG to the log.
makeSeedMech(firstTime=False)
causes RMG to make a seed mechanism out of the current chem_annotated.inp and species_dictionary.txt
this seed mechanism is outputted in a seed folder within the run directory and automatically added to as
the (or replaces the current) ‘Seed’ thermo and kinetics libraries in database
if run with firstTime=True it will change self.name to be unique within the thermo/kinetics libraries by
adding integers to the end of the name to prevent overwritting
makeSpeciesLabelsIndependent(species)
This method looks at the core species labels and makes sure none of them conflict If a conflict occurs, the
second occurance will have ‘-2’ added returns a list of the old labels
processPdepNetworks(obj)
properly processes PDepNetwork objects and lists of PDepNetwork objects returned from simulate
processReactionsToSpecies(obj)
properly processes Reaction objects and lists of Reaction objects returned from simulate
processToSpeciesNetworks(obj)
breaks down the objects returned by simulate into Species and PDepNetwork components
readMeaningfulLineJava(f )
Read a meaningful line from an RMG-Java condition file object f, returning the line with any comments
removed.
register_listeners()
Attaches listener classes depending on the options found in the RMG input file.
run_model_analysis(number=10)
Run sensitivity and uncertainty analysis if requested.
run_uncertainty_analysis()
Run uncertainty analysis if proper settings are available.
saveEverything()
Saves the output HTML, the Chemkin file, and the Restart file (if appropriate).
The restart file is only saved if self.saveRestartPeriod or self.done.
saveInput(path=None)
Save an RMG job to the input file located at path, or from the outputFile attribute if not given as a param-
eter.
updateReactionThresholdAndReactFlags(rxnSysUnimolecularThreshold=None, rxnSysBimolec-
ularThreshold=None, rxnSysTrimolecularThresh-
old=None, skipUpdate=False)
updates the length and boolean value of the unimolecular and bimolecular react and threshold flags
rmgpy.rmg.main.initializeLog(verbose, log_file_name)
Set up a logger for RMG to use to print output to stdout. The verbose parameter is an integer specifying the
amount of log text seen at the console; the levels correspond to those of the logging module.
rmgpy.rmg.main.makeProfileGraph(stats_file)
Uses gprof2dot to create a graphviz dot file of the profiling information.
This requires the gprof2dot package available via pip install gprof2dot. Render the result using the program
‘dot’ via a command like dot -Tps2 input.dot -o output.ps2.
Rendering the ps2 file to pdf requires an external pdf converter ps2pdf output.ps2 which produces a out-
put.ps2.pdf file.
rmgpy.rmg.main.processProfileStats(stats_file, log_file)
process, drawings of all species are created in the species folder (if they don’t already exist) using the rmgpy.
molecule.draw module. The jinja package is used to generate the HTML; if this package is not found, no
HTML will be generated (but the program will carry on).
rmgpy.rmg.output.saveDiffHTML(path, commonSpeciesList, speciesList1, speciesList2, commonReac-
tions, uniqueReactions1, uniqueReactions2)
This function outputs the species and reactions on an HTML page for the comparison of two RMG models.
rmgpy.rmg.pdep.PDepNetwork
addPathReaction(newReaction)
Add a path reaction to the network. If the path reaction already exists, no action is taken.
applyChemicallySignificantEigenvaluesMethod(lumpingOrder=None)
Compute the phenomenological rate coefficients 𝑘(𝑇, 𝑃 ) at the current conditions using the chemically-
significant eigenvalues method. If a lumpingOrder is provided, the algorithm will attempt to lump the
configurations (given by index) in the order provided, and return a reduced set of 𝑘(𝑇, 𝑃 ) values.
applyModifiedStrongCollisionMethod(efficiencyModel=’default’)
Compute the phenomenological rate coefficients 𝑘(𝑇, 𝑃 ) at the current conditions using the modified
strong collision method.
applyReservoirStateMethod()
Compute the phenomenological rate coefficients 𝑘(𝑇, 𝑃 ) at the current conditions using the reservoir state
method.
calculateCollisionModel()
Calculate the matrix of first-order rate coefficients for collisional population transfer between grains for
each isomer, including the corresponding collision frequencies.
calculateDensitiesOfStates()
Calculate the densities of states of each configuration that has states data. The densities of states are
computed such that they can be applied to each temperature in the range of interest by interpolation.
calculateEquilibriumRatios()
Return an array containing the fraction of each isomer and reactant channel present at equilibrium, as
determined from the Gibbs free energy and using the concentration equilibrium constant 𝐾c . These values
are ratios, and the absolute magnitude is not guaranteed; however, the implementation scales the elements
of the array so that they sum to unity.
calculateMicrocanonicalRates()
Calculate and return arrays containing the microcanonical rate coefficients 𝑘(𝐸) for the isomerization,
dissociation, and association path reactions in the network.
cleanup()
Delete intermedate arrays used to compute k(T,P) values.
exploreIsomer(isomer)
Explore a previously-unexplored unimolecular isomer in this partial network using the provided core-edge
reaction model reactionModel, returning the new reactions and new species.
getAllSpecies()
Return a list of all unique species in the network, including all isomers, reactant and product channels, and
bath gas species.
getLeakBranchingRatios(T, P)
Return a dict with the unexplored isomers in the partial network as the keys and the fraction of the total
leak coefficient as the values.
getLeakCoefficient(T, P)
Return the pressure-dependent rate coefficient 𝑘(𝑇, 𝑃 ) describing the total rate of “leak” from this network.
This is defined as the sum of the 𝑘(𝑇, 𝑃 ) values for all net reactions to nonexplored unimolecular isomers.
getMaximumLeakSpecies(T, P)
Get the unexplored (unimolecular) isomer with the maximum leak flux. Note that the leak rate coefficients
vary with temperature and pressure, so you must provide these in order to get a meaningful result.
get_energy_filtered_reactions(T, tol)
Returns a list of products and isomers that are greater in Free Energy than a*R*T + Gfsource(T)
get_rate_filtered_reactions(T, P, tol)
determines the set of pathReactions that have fluxes less than tol at steady state where all A => B + C
reactions are irreversible and there is a constant flux from/to the source configuration of 1.0
initialize(Tmin, Tmax, Pmin, Pmax, maximumGrainSize=0.0, minimumGrainCount=0, activeJRo-
tor=True, activeKRotor=True, rmgmode=False)
Initialize a pressure dependence calculation by computing several quantities that are independent of the
conditions. You must specify the temperature and pressure ranges of interesting using Tmin and Tmax in
K and Pmin and Pmax in Pa. You must also specify the maximum energy grain size grainSize in J/mol
and/or the minimum number of grains grainCount.
invalidate()
Mark the network as in need of a new calculation to determine the pressure-dependent rate coefficients
label
Get the label for this network (analogous to reaction families as a reaction’s source)
mapDensitiesOfStates()
Map the overall densities of states to the current energy grains. Semi-logarithmic interpolation will be
used if the grain sizes of Elist0 and Elist do not match; this should not be a significant source of error as
long as the grain sizes are sufficiently small.
merge(other)
Merge the partial network other into this network.
printSummary(level=20)
Print a formatted list of information about the current network. Each molecular configuration - unimolec-
ular isomers, bimolecular reactant channels, and bimolecular product channels - is given along with its
energy on the potential energy surface. The path reactions connecting adjacent molecular configurations
are also given, along with their energies on the potential energy surface. The level parameter controls the
level of logging to which the summary is written, and is DEBUG by default.
remove_disconnected_reactions()
gets rid of reactions/isomers/products not connected to the source by a reaction sequence
remove_reactions(reactionModel, rxns)
removes a list of reactions from the network and all reactions/products left disconnected by removing those
reactions
rmgpy.rmg.pdep.PDepReaction
allow_max_rate_violation
‘bool’
Type allow_max_rate_violation
allow_pdep_route
‘bool’
Type allow_pdep_route
𝑄‡ (𝑇 )
(︂ )︂
𝑘B 𝑇 𝐸0
𝑘(𝑇 ) = 𝜅(𝑇 ) exp −
ℎ 𝑄A (𝑇 )𝑄B (𝑇 ) 𝑘B 𝑇
where 𝑄‡ is the partition function of the transition state, 𝑄A and 𝑄B are the partition function of the
reactants, 𝐸0 is the ground-state energy difference from the transition state to the reactants, 𝑇 is the
absolute temperature, 𝑘B is the Boltzmann constant, and ℎ is the Planck constant. 𝜅(𝑇 ) is an optional
tunneling correction.
calculateTSTRateCoefficients(self, ndarray Tlist) → ndarray
draw(self, path)
Generate a pictorial representation of the chemical reaction using the draw module. Use path to specify
the file to save the generated image to; the image type is automatically determined by extension. Valid
extensions are .png, .svg, .pdf, and .ps; of these, the first is a raster format and the remainder are
vector formats.
duplicate
‘bool’
Type duplicate
elementary_high_p
‘bool’
Type elementary_high_p
ensure_species(self, bool reactant_resonance=False, bool product_resonance=False)
Ensure the reaction contains species objects in its reactant and product attributes. If the reaction is found
to hold molecule objects, it modifies the reactant, product and pairs to hold Species objects.
Generates resonance structures for Molecules if the corresponding options, reactant_resonance and/or
product_resonance, are True. Does not generate resonance for reactants or products that start as Species
objects.
fixBarrierHeight(self, bool forcePositive=False)
Turns the kinetics into Arrhenius (if they were ArrheniusEP) and ensures the activation energy is at least
the endothermicity for endothermic reactions, and is not negative only as a result of using Evans Polanyi
with an exothermic reaction. If forcePositive is True, then all reactions are forced to have a non-negative
barrier.
fixDiffusionLimitedA(self, T )
Decrease the pre-exponential factor (A) by the diffusion factor to account for the diffusion limit at the
specified temperature.
generate3dTS(self, reactants, products)
Generate the 3D structure of the transition state. Called from model.generateKinetics().
self.reactants is a list of reactants self.products is a list of products
generatePairs(self )
Generate the reactant-product pairs to use for this reaction when performing flux analysis. The exact
procedure for doing so depends on the reaction type:
There are a number of ways of determining the correct pairing for bimolecular reactions. Here we try a
simple similarity analysis by comparing the number of heavy atoms (C/O/N/S at the moment). This should
work most of the time, but a more rigorous algorithm may be needed for some cases.
generateReverseRateCoefficient(self, bool network_kinetics=False, Tmin=None, Tmax=None)
Generate and return a rate coefficient model for the reverse reaction. Currently this only works if the
kinetics attribute is one of several (but not necessarily all) kinetics types.
getEnthalpiesOfReaction(self, ndarray Tlist) → ndarray
Return the enthalpies of reaction in J/mol evaluated at temperatures Tlist in K.
Type index
isAssociation(self ) → bool
Return True if the reaction represents an association reaction A + B −
↽−
−⇀
− C or False if not.
isBalanced(self ) → bool
Return True if the reaction has the same number of each atom on each side of the reaction equation, or
False if not.
isDissociation(self ) → bool
Return True if the reaction represents a dissociation reaction A −
↽−
−⇀
− B + C or False if not.
isIsomerization(self ) → bool
−−
Return True if the reaction represents an isomerization reaction A ↽−⇀
− B or False if not.
isIsomorphic(self, Reaction other, bool eitherDirection=True, bool checkIdentical=False, bool
checkOnlyLabel=False, bool checkTemplateRxnProducts=False, bool generateIni-
tialMap=False, bool strict=True) → bool
Return True if this reaction is the same as the other reaction, or False if they are different. The compar-
ison involves comparing isomorphism of reactants and products, and doesn’t use any kinetic information.
Parameters
• eitherDirection (bool, optional) – if False,then the reaction direction must
match.
• checkIdentical (bool, optional) – if True, check that atom ID’s match (used for
checking degeneracy)
• checkOnlyLabel (bool, optional) – if True, only check the string representation,
ignoring molecular structure comparisons
• checkTemplateRxnProducts (bool, optional) – if True, only check isomorphism
of reaction products (used when we know the reactants are identical, i.e. in generating
reactions)
• generateInitialMap (bool, optional) – if True, initialize map by pairing atoms
with same labels
• strict (bool, optional) – if False, perform isomorphism ignoring electrons
isSurfaceReaction(self ) → bool
Return True if one or more reactants or products are surface species (or surface sites)
isUnimolecular(self ) → bool
−−
Return True if the reaction has a single molecule as either reactant or product (or both) A ↽−⇀
− B + C or
A+B↽ −−
−⇀
− C or A ↽ −−
−⇀− B, or False if not.
is_forward
‘bool’
Type is_forward
k_effective_cache
dict
Type k_effective_cache
kinetics
rmgpy.kinetics.model.KineticsModel
Type kinetics
label
str
Type label
matchesSpecies(self, list reactants, list products=None) → bool
Compares the provided reactants and products against the reactants and products of this reaction. Both
directions are checked.
Parameters
• reactants (list) – Species required on one side of the reaction
• products (list, optional) – Species required on the other side
network_kinetics
rmgpy.kinetics.arrhenius.Arrhenius
Type network_kinetics
pairs
list
Type pairs
products
list
Type products
rank
object
Type rank
reactants
list
Type reactants
reverseThisArrheniusRate(self, Arrhenius kForward, str reverseUnits, Tmin=None, Tmax=None)
Reverses the given kForward, which must be an Arrhenius type. You must supply the correct units for the
reverse rate. The equilibrium constant is evaluated from the current reaction instance (self).
reversible
‘bool’
Type reversible
specificCollider
rmgpy.species.Species
Type specificCollider
toCantera(self, speciesList=None, useChemkinIdentifier=False)
Converts the RMG Reaction object to a Cantera Reaction object with the appropriate reaction class.
If useChemkinIdentifier is set to False, the species label is used instead. Be sure that species’ labels are
unique when setting it False.
toChemkin(self, speciesList=None, kinetics=True)
Return the chemkin-formatted string for this reaction.
If kinetics is set to True, the chemkin format kinetics will also be returned (requires the speciesList to
figure out third body colliders.) Otherwise, only the reaction string will be returned.
toLabeledStr(self, use_index=False)
the same as __str__ except that the labels are assumed to exist and used for reactant and products rather
than the labels plus the index in parentheses
transitionState
rmgpy.species.TransitionState
Type transitionState
rmgpy.rmg.model.Species
Attribute Description
index A unique nonnegative integer index
label A descriptive string label
thermo The heat capacity model for the species
conformer The molecular conformer for the species
molecule A list of the Molecule objects describing the molec-
ular structure
transportData A set of transport collision parameters
molecularWeight The molecular weight of the species
energyTransferModel The collisional energy transfer model to use
reactive
True if the species participates in reaction families, False if not
Reaction libraries and seed mechanisms that
include the species are always considered
regardless of this variable
InChI
InChI string representation of this species. Read-only.
SMILES
SMILES string representation of this species. Read-only.
Note that SMILES representations for different resonance structures of the same species may be different.
aug_inchi
str
Type aug_inchi
calculateCp0(self ) → double
Return the value of the heat capacity at zero temperature in J/mol*K.
calculateCpInf(self ) → double
Return the value of the heat capacity at infinite temperature in J/mol*K.
conformer
rmgpy.statmech.conformer.Conformer
Type conformer
containsSurfaceSite(self ) → bool
Return True if the species is adsorbed on a surface (or is itself a site), else False.
copy(self, bool deep=False) → Species
Create a copy of the current species. If the kw argument ‘deep’ is True, then a deep copy will be made of
the Molecule objects in self.molecule.
For other complex attributes, a deep copy will always be made.
creationIteration
‘int’
Type creationIteration
energyTransferModel
object
Type energyTransferModel
explicitlyAllowed
‘bool’
Type explicitlyAllowed
fingerprint
Fingerprint of this species, taken from molecule attribute. Read-only.
fromAdjacencyList(self, adjlist)
Load the structure of a species as a Molecule object from the given adjacency list adjlist and store it as the
first entry of a list in the molecule attribute. Does not generate resonance isomers of the loaded molecule.
fromSMILES(self, smiles)
Load the structure of a species as a Molecule object from the given SMILES string smiles and store it
as the first entry of a list in the molecule attribute. Does not generate resonance isomers of the loaded
molecule.
generateEnergyTransferModel(self )
Generate the collisional energy transfer model parameters for the species. This “algorithm” is very much
in need of improvement.
generateStatMech(self )
Generate molecular degree of freedom data for the species. You must have already provided a thermody-
namics model using e.g. generateThermoData().
generateTransportData(self )
Generate the transportData parameters for the species.
generate_aug_inchi(self )
Type thermo
toAdjacencyList(self )
Return a string containing each of the molecules’ adjacency lists.
toCantera(self, useChemkinIdentifier=False)
Converts the RMG Species object to a Cantera Species object with the appropriate thermo data.
If useChemkinIdentifier is set to False, the species label is used instead. Be sure that species’ labels are
unique when setting it False.
toChemkin(self )
Return the chemkin-formatted string for this species.
transportData
object
Type transportData
The rmgpy.solver module contains classes used to represent and simulate reaction systems.
Class Description
ReactionSystem Base class for all reaction systems
SimpleReactor A simple isothermal, isobaric, well-mixed batch reactor
LiquidReactor A homogeneous, isothermal, isobaric liquid batch reactor
Class Description
TerminationTime Represent a time at which the simulation should be terminated
TerminationConversion Represent a species conversion at which the simulation should be terminated
rmgpy.solver.ReactionSystem
advance()
Simulate from the current value of the independent variable to a specified value tout, taking as many steps
as necessary. The resulting values of 𝑡, y, and 𝑑y
𝑑𝑡 can then be accessed via the t, y, and dydt attributes.
atol_array
numpy.ndarray
Type atol_array
bimolecularThreshold
numpy.ndarray
Type bimolecularThreshold
computeRateDerivative(self )
Returns derivative vector df/dk_j where dy/dt = f(y, t, k) and k_j is the rate parameter for the jth core
reaction.
compute_network_variables(self, pdepNetworks=None)
Initialize the arrays containing network information:
• NetworkLeakCoefficients is a n x 1 array with n the number of pressure-dependent networks.
• NetworkIndices is a n x 3 matrix with n the number of pressure-dependent networks and 3 the
maximum number of molecules allowed in either the reactant or product side of a reaction.
coreReactionRates
numpy.ndarray
Type coreReactionRates
coreSpeciesConcentrations
numpy.ndarray
Type coreSpeciesConcentrations
coreSpeciesConsumptionRates
numpy.ndarray
Type coreSpeciesConsumptionRates
coreSpeciesProductionRates
numpy.ndarray
Type coreSpeciesProductionRates
coreSpeciesRates
numpy.ndarray
Type coreSpeciesRates
dydt0
numpy.ndarray
Type dydt0
edgeReactionRates
numpy.ndarray
Type edgeReactionRates
edgeSpeciesRates
numpy.ndarray
Type edgeSpeciesRates
Type numSurfaceSpecies
productIndices
numpy.ndarray
Type productIndices
prunableNetworkIndices
numpy.ndarray
Type prunableNetworkIndices
prunableNetworks
list
Type prunableNetworks
prunableSpecies
list
Type prunableSpecies
prunableSpeciesIndices
numpy.ndarray
Type prunableSpeciesIndices
reactantIndices
numpy.ndarray
Type reactantIndices
reactionIndex
dict
Type reactionIndex
reset_max_edge_species_rate_ratios(self )
This function sets maxEdgeSpeciesRateRatios back to zero for pruning of ranged reactors it is important
to avoid doing this every initialization
residual()
Evaluate the residual function for this model, given the current value of the independent variable t, depen-
dent variables y, and first derivatives dydt. Return a numpy array with the values of the residual function
and an integer with status information (0 if okay, -2 to terminate).
rtol_array
numpy.ndarray
Type rtol_array
sensitiveSpecies
list
Type sensitiveSpecies
sensitivityCoefficients
numpy.ndarray
Type sensitivityCoefficients
sensitivityThreshold
‘double’
Type sensitivityThreshold
set_initial_conditions(self )
Sets the common initial conditions of the rate equations that represent the reaction system.
• Sets the initial time of the reaction system to 0
• Initializes the species moles to a n x 1 array with zeros
set_initial_derivative(self )
Sets the derivative of the species moles with respect to the independent variable (time) equal to the residual.
set_initial_reaction_thresholds(self )
simulate(self, list coreSpecies, list coreReactions, list edgeSpecies, list edgeReactions, list surface-
Species, list surfaceReactions, list pdepNetworks=None, bool prune=False, bool sensitiv-
ity=False, list sensWorksheet=None, modelSettings=None, simulatorSettings=None, dict con-
ditions=None)
Simulate the reaction system with the provided reaction model, consisting of lists of core species, core re-
actions, edge species, and edge reactions. As the simulation proceeds the system is monitored for validity.
If the model becomes invalid (e.g. due to an excessively large edge flux), the simulation is interrupted and
the object causing the model to be invalid is returned. If the simulation completes to the desired termination
criteria and the model remains valid throughout, None is returned.
snapshots
list
Type snapshots
speciesIndex
dict
Type speciesIndex
step()
Perform one simulation step from the current value of the independent variable toward (but not past) a
specified value tout. The resulting values of 𝑡, y, and 𝑑y
𝑑𝑡 can then be accessed via the t, y, and dydt
attributes.
surfaceReactionIndices
numpy.ndarray
Type surfaceReactionIndices
surfaceSpeciesIndices
numpy.ndarray
Type surfaceSpeciesIndices
t0
‘float’
Type t0
termination
list
Type termination
trimolecular
‘bool’
Type trimolecular
trimolecularThreshold
numpy.ndarray
Type trimolecularThreshold
unimolecularThreshold
numpy.ndarray
Type unimolecularThreshold
validLayeringIndices
numpy.ndarray
Type validLayeringIndices
y0
numpy.ndarray
Type y0
rmgpy.solver.SimpleReactor
advance()
Simulate from the current value of the independent variable to a specified value tout, taking as many steps
as necessary. The resulting values of 𝑡, y, and 𝑑y
𝑑𝑡 can then be accessed via the t, y, and dydt attributes.
atol_array
numpy.ndarray
Type atol_array
bimolecularThreshold
numpy.ndarray
Type bimolecularThreshold
calculate_effective_pressure(self, rxn)
Computes the effective pressure for a reaction as:
∑︁ 𝑦𝑖 * 𝑒𝑓 𝑓𝑖
𝑃𝑒𝑓 𝑓 = 𝑃 * ∑︀
𝑖 𝑗 𝑦𝑗
with:
• P the pressure of the reactor,
• y the array of initial moles of the core species
or as:
𝑃 * 𝑦𝑠𝑝𝑒𝑐𝑖𝑓 𝑖𝑐𝐶𝑜𝑙𝑙𝑖𝑑𝑒𝑟
𝑃𝑒𝑓 𝑓 = ∑︀
𝑗 𝑦𝑗
if a specificCollider is mentioned.
colliderEfficiencies
numpy.ndarray
Type colliderEfficiencies
computeRateDerivative(self )
Returns derivative vector df/dk_j where dy/dt = f(y, t, k) and k_j is the rate parameter for the jth core
reaction.
compute_network_variables(self, pdepNetworks=None)
Initialize the arrays containing network information:
• NetworkLeakCoefficients is a n x 1 array with n the number of pressure-dependent networks.
• NetworkIndices is a n x 3 matrix with n the number of pressure-dependent networks and 3 the
maximum number of molecules allowed in either the reactant or product side of a reaction.
constantVolume
‘bool’
Type constantVolume
convertInitialKeysToSpeciesObjects(self, speciesDict)
Convert the initialMoleFractions dictionary from species names into species objects, using the given dic-
tionary of species.
coreReactionRates
numpy.ndarray
Type coreReactionRates
coreSpeciesConcentrations
numpy.ndarray
Type coreSpeciesConcentrations
coreSpeciesConsumptionRates
numpy.ndarray
Type coreSpeciesConsumptionRates
coreSpeciesProductionRates
numpy.ndarray
Type coreSpeciesProductionRates
coreSpeciesRates
numpy.ndarray
Type coreSpeciesRates
dydt0
numpy.ndarray
Type dydt0
edgeReactionRates
numpy.ndarray
Type edgeReactionRates
edgeSpeciesRates
numpy.ndarray
Type edgeSpeciesRates
generate_rate_coefficients(self, coreReactions, edgeReactions)
Populates the forward rate coefficients (kf), reverse rate coefficients (kb) and equilibrium constants (Keq)
arrays with the values computed at the temperature and (effective) pressure of the reaction system.
generate_reactant_product_indices(self, coreReactions, edgeReactions)
Creates a matrix for the reactants and products.
generate_reaction_indices(self, coreReactions, edgeReactions)
Assign an index to each reaction (core first, then edge) and store the (reaction, index) pair in a dictionary.
generate_species_indices(self, coreSpecies, edgeSpecies)
Assign an index to each species (core first, then edge) and store the (species, index) pair in a dictionary.
getLayeringIndices(self )
determines the edge reaction indices that indicate reactions that are valid for movement from edge to
surface based on the layering constraint
get_species_index(self, spc)
Retrieves the index that is associated with the parameter species from the species index dictionary.
get_threshold_rate_constants(self, modelSettings)
Get the threshold rate constants for reaction filtering.
initialMoleFractions
dict
Type initialMoleFractions
initialize()
Initialize the DASPK solver by setting the initial values of the independent variable t0, dependent variables
y0, and first derivatives dydt0. If provided, the derivatives must be consistent with the other initial condi-
tions; if not provided, DASPK will attempt to estimate a consistent set of initial values for the derivatives.
You can also set the absolute and relative tolerances atol and rtol, respectively, either as single values for
all dependent variables or individual values for each dependent variable.
initializeModel(self, list coreSpecies, list coreReactions, list edgeSpecies, list edgeReactions,
list surfaceSpecies=None, list surfaceReactions=None, list pdepNetworks=None,
atol=1e-16, rtol=1e-8, sensitivity=False, sens_atol=1e-6, sens_rtol=1e-4, filterRe-
actions=False, dict conditions=None)
Initialize a simulation of the simple reactor using the provided kinetic model.
initialize_solver(self )
initialize_surface(self, list coreSpecies, list coreReactions, list surfaceSpecies, list surfaceReac-
tions)
removes surfaceSpecies and surfaceReactions from until they are self consistent:
1) every reaction has one species in the surface
2) every species participates in a surface reaction
initiate_tolerances(self, atol=1e-16, rtol=1e-8, sensitivity=False, sens_atol=1e-6, sens_rtol=1e-
4)
Computes the number of differential equations and initializes the tolerance arrays.
jacobian(self, double t, ndarray y, ndarray dydt, double cj, ndarray senpar=numpy.zeros(1,
numpy.float64))
Return the analytical Jacobian for the reaction system.
jacobianMatrix
numpy.ndarray
Type jacobianMatrix
kb
numpy.ndarray
Type kb
kf
numpy.ndarray
Type kf
logConversions(self, speciesIndex, y0)
Log information about the current conversion values.
logRates(self, double charRate, species, double speciesRate, double maxDifLnAccumNum, network,
double networkRate)
Log information about the current maximum species and network rates.
maxEdgeSpeciesRateRatios
numpy.ndarray
Type maxEdgeSpeciesRateRatios
maxNetworkLeakRateRatios
numpy.ndarray
Type maxNetworkLeakRateRatios
nSims
‘int’
Type nSims
neq
‘int’
Type neq
networkIndices
numpy.ndarray
Type networkIndices
networkLeakCoefficients
numpy.ndarray
Type networkLeakCoefficients
networkLeakRates
numpy.ndarray
Type networkLeakRates
numCoreReactions
‘int’
Type numCoreReactions
numCoreSpecies
‘int’
Type numCoreSpecies
numEdgeReactions
‘int’
Type numEdgeReactions
numEdgeSpecies
‘int’
Type numEdgeSpecies
numPdepNetworks
‘int’
Type numPdepNetworks
numSurfaceReactions
‘int’
Type numSurfaceReactions
numSurfaceSpecies
‘int’
Type numSurfaceSpecies
pdepColliderKinetics
list
Type pdepColliderKinetics
pdepColliderReactionIndices
numpy.ndarray
Type pdepColliderReactionIndices
pdepSpecificColliderKinetics
list
Type pdepSpecificColliderKinetics
pdepSpecificColliderReactionIndices
numpy.ndarray
Type pdepSpecificColliderReactionIndices
productIndices
numpy.ndarray
Type productIndices
prunableNetworkIndices
numpy.ndarray
Type prunableNetworkIndices
prunableNetworks
list
Type prunableNetworks
prunableSpecies
list
Type prunableSpecies
prunableSpeciesIndices
numpy.ndarray
Type prunableSpeciesIndices
reactantIndices
numpy.ndarray
Type reactantIndices
reactionIndex
dict
Type reactionIndex
reset_max_edge_species_rate_ratios(self )
This function sets maxEdgeSpeciesRateRatios back to zero for pruning of ranged reactors it is important
to avoid doing this every initialization
residual(self, double t, ndarray y, ndarray dydt, ndarray senpar=numpy.zeros(1, numpy.float64))
Return the residual function for the governing DAE system for the simple reaction system.
rtol_array
numpy.ndarray
Type rtol_array
sensConditions
dict
Type sensConditions
sensitiveSpecies
list
Type sensitiveSpecies
sensitivityCoefficients
numpy.ndarray
Type sensitivityCoefficients
sensitivityThreshold
‘double’
Type sensitivityThreshold
set_colliders(self, coreReactions, edgeReactions, coreSpecies)
Store collider efficiencies and reaction indices for pdep reactions that have collider efficiencies, and store
specific collider indices
set_initial_conditions(self )
Sets the initial conditions of the rate equations that represent the current reactor model.
The volume is set to the value derived from the ideal gas law, using the user-defined pressure, temperature,
and the number of moles of initial species.
The species moles array (y0) is set to the values stored in the initial mole fractions dictionary.
The initial species concentration is computed and stored in the coreSpeciesConcentrations array.
set_initial_derivative(self )
Sets the derivative of the species moles with respect to the independent variable (time) equal to the residual.
set_initial_reaction_thresholds(self )
simulate(self, list coreSpecies, list coreReactions, list edgeSpecies, list edgeReactions, list surface-
Species, list surfaceReactions, list pdepNetworks=None, bool prune=False, bool sensitiv-
ity=False, list sensWorksheet=None, modelSettings=None, simulatorSettings=None, dict con-
ditions=None)
Simulate the reaction system with the provided reaction model, consisting of lists of core species, core re-
actions, edge species, and edge reactions. As the simulation proceeds the system is monitored for validity.
If the model becomes invalid (e.g. due to an excessively large edge flux), the simulation is interrupted and
the object causing the model to be invalid is returned. If the simulation completes to the desired termination
criteria and the model remains valid throughout, None is returned.
snapshots
list
Type snapshots
speciesIndex
dict
Type speciesIndex
specificColliderSpecies
list
Type specificColliderSpecies
step()
Perform one simulation step from the current value of the independent variable toward (but not past) a
specified value tout. The resulting values of 𝑡, y, and 𝑑y
𝑑𝑡 can then be accessed via the t, y, and dydt
attributes.
surfaceReactionIndices
numpy.ndarray
Type surfaceReactionIndices
surfaceSpeciesIndices
numpy.ndarray
Type surfaceSpeciesIndices
t0
‘float’
Type t0
termination
list
Type termination
trimolecular
‘bool’
Type trimolecular
trimolecularThreshold
numpy.ndarray
Type trimolecularThreshold
unimolecularThreshold
numpy.ndarray
Type unimolecularThreshold
validLayeringIndices
numpy.ndarray
Type validLayeringIndices
y0
numpy.ndarray
Type y0
rmgpy.solver.LiquidReactor
Type Trange
V
‘double’
Type V
addReactionsToSurface(self, list newSurfaceReactions, list newSurfaceReactionInds, list surface-
Species, list surfaceReactions, list edgeSpecies)
moves new surface reactions to the surface done after the while loop before the simulate call ends
advance()
Simulate from the current value of the independent variable to a specified value tout, taking as many steps
as necessary. The resulting values of 𝑡, y, and 𝑑y
𝑑𝑡 can then be accessed via the t, y, and dydt attributes.
atol_array
numpy.ndarray
Type atol_array
bimolecularThreshold
numpy.ndarray
Type bimolecularThreshold
computeRateDerivative(self )
Returns derivative vector df/dk_j where dy/dt = f(y, t, k) and k_j is the rate parameter for the jth core
reaction.
compute_network_variables(self, pdepNetworks=None)
Initialize the arrays containing network information:
• NetworkLeakCoefficients is a n x 1 array with n the number of pressure-dependent networks.
• NetworkIndices is a n x 3 matrix with n the number of pressure-dependent networks and 3 the
maximum number of molecules allowed in either the reactant or product side of a reaction.
constSPCIndices
list
Type constSPCIndices
constSPCNames
list
Type constSPCNames
constantVolume
‘bool’
Type constantVolume
convertInitialKeysToSpeciesObjects(self, speciesDict)
Convert the initialConcentrations dictionary from species names into species objects, using the given dic-
tionary of species.
coreReactionRates
numpy.ndarray
Type coreReactionRates
coreSpeciesConcentrations
numpy.ndarray
Type coreSpeciesConcentrations
coreSpeciesConsumptionRates
numpy.ndarray
Type coreSpeciesConsumptionRates
coreSpeciesProductionRates
numpy.ndarray
Type coreSpeciesProductionRates
coreSpeciesRates
numpy.ndarray
Type coreSpeciesRates
dydt0
numpy.ndarray
Type dydt0
edgeReactionRates
numpy.ndarray
Type edgeReactionRates
edgeSpeciesRates
numpy.ndarray
Type edgeSpeciesRates
generate_rate_coefficients(self, coreReactions, edgeReactions)
Populates the forwardRateCoefficients, reverseRateCoefficients and equilibriumConstants arrays with the
values computed at the temperature and (effective) pressure of the reacion system.
generate_reactant_product_indices(self, coreReactions, edgeReactions)
Creates a matrix for the reactants and products.
generate_reaction_indices(self, coreReactions, edgeReactions)
Assign an index to each reaction (core first, then edge) and store the (reaction, index) pair in a dictionary.
generate_species_indices(self, coreSpecies, edgeSpecies)
Assign an index to each species (core first, then edge) and store the (species, index) pair in a dictionary.
getLayeringIndices(self )
determines the edge reaction indices that indicate reactions that are valid for movement from edge to
surface based on the layering constraint
get_constSPCIndices(self, coreSpecies)
Allow to identify constant Species position in solver
get_species_index(self, spc)
Retrieves the index that is associated with the parameter species from the species index dictionary.
get_threshold_rate_constants(self, modelSettings)
Get the threshold rate constants for reaction filtering.
modelSettings is not used here, but is needed so that the method matches the one in simpleReactor.
initialConcentrations
dict
Type initialConcentrations
initialize()
Initialize the DASPK solver by setting the initial values of the independent variable t0, dependent variables
y0, and first derivatives dydt0. If provided, the derivatives must be consistent with the other initial condi-
tions; if not provided, DASPK will attempt to estimate a consistent set of initial values for the derivatives.
You can also set the absolute and relative tolerances atol and rtol, respectively, either as single values for
all dependent variables or individual values for each dependent variable.
initializeModel(self, list coreSpecies, list coreReactions, list edgeSpecies, list edgeReactions,
list surfaceSpecies=None, list surfaceReactions=None, list pdepNetworks=None,
atol=1e-16, rtol=1e-8, sensitivity=False, sens_atol=1e-6, sens_rtol=1e-4, filterRe-
actions=False, dict conditions=None)
Initialize a simulation of the liquid reactor using the provided kinetic model.
initialize_solver(self )
initialize_surface(self, list coreSpecies, list coreReactions, list surfaceSpecies, list surfaceReac-
tions)
removes surfaceSpecies and surfaceReactions from until they are self consistent:
1) every reaction has one species in the surface
2) every species participates in a surface reaction
initiate_tolerances(self, atol=1e-16, rtol=1e-8, sensitivity=False, sens_atol=1e-6, sens_rtol=1e-
4)
Computes the number of differential equations and initializes the tolerance arrays.
jacobian(self, double t, ndarray y, ndarray dydt, double cj, ndarray senpar=numpy.zeros(1,
numpy.float64))
Return the analytical Jacobian for the reaction system.
jacobianMatrix
numpy.ndarray
Type jacobianMatrix
kb
numpy.ndarray
Type kb
kf
numpy.ndarray
Type kf
logConversions(self, speciesIndex, y0)
Log information about the current conversion values.
logRates(self, double charRate, species, double speciesRate, double maxDifLnAccumNum, network,
double networkRate)
Log information about the current maximum species and network rates.
maxEdgeSpeciesRateRatios
numpy.ndarray
Type maxEdgeSpeciesRateRatios
maxNetworkLeakRateRatios
numpy.ndarray
Type maxNetworkLeakRateRatios
nSims
‘int’
Type nSims
neq
‘int’
Type neq
networkIndices
numpy.ndarray
Type networkIndices
networkLeakCoefficients
numpy.ndarray
Type networkLeakCoefficients
networkLeakRates
numpy.ndarray
Type networkLeakRates
numCoreReactions
‘int’
Type numCoreReactions
numCoreSpecies
‘int’
Type numCoreSpecies
numEdgeReactions
‘int’
Type numEdgeReactions
numEdgeSpecies
‘int’
Type numEdgeSpecies
numPdepNetworks
‘int’
Type numPdepNetworks
numSurfaceReactions
‘int’
Type numSurfaceReactions
numSurfaceSpecies
‘int’
Type numSurfaceSpecies
productIndices
numpy.ndarray
Type productIndices
prunableNetworkIndices
numpy.ndarray
Type prunableNetworkIndices
prunableNetworks
list
Type prunableNetworks
prunableSpecies
list
Type prunableSpecies
prunableSpeciesIndices
numpy.ndarray
Type prunableSpeciesIndices
reactantIndices
numpy.ndarray
Type reactantIndices
reactionIndex
dict
Type reactionIndex
reset_max_edge_species_rate_ratios(self )
This function sets maxEdgeSpeciesRateRatios back to zero for pruning of ranged reactors it is important
to avoid doing this every initialization
residual(self, double t, ndarray y, ndarray dydt, ndarray senpar=numpy.zeros(1, numpy.float64))
Return the residual function for the governing DAE system for the liquid reaction system.
rtol_array
numpy.ndarray
Type rtol_array
sensConditions
dict
Type sensConditions
sensitiveSpecies
list
Type sensitiveSpecies
sensitivityCoefficients
numpy.ndarray
Type sensitivityCoefficients
sensitivityThreshold
‘double’
Type sensitivityThreshold
set_initial_conditions(self )
Sets the initial conditions of the rate equations that represent the current reactor model.
The volume is set to the value in m3 required to contain one mole total of core species at start.
The coreSpeciesConcentrations array is set to the values stored in the initial concentrations dictionary.
The initial number of moles of a species j is computed and stored in the y0 instance attribute.
set_initial_derivative(self )
Sets the derivative of the species moles with respect to the independent variable (time) equal to the residual.
set_initial_reaction_thresholds(self )
Type validLayeringIndices
viscosity
‘double’
Type viscosity
y0
numpy.ndarray
Type y0
Termination criteria
class rmgpy.solver.TerminationTime
Represent a time at which the simulation should be terminated. This class has one attribute: the termination
time in seconds.
class rmgpy.solver.TerminationConversion
Represent a conversion at which the simulation should be terminated. This class has two attributes: the species
to monitor and the fractional conversion at which to terminate.
The rmgpy.species subpackage contains classes and functions for working with chemical species.
1.13.1 Species
Class Description
Species A chemical species
Class Description
TransitionState A transition state
rmgpy.species.Species
Attribute Description
index A unique nonnegative integer index
label A descriptive string label
thermo The heat capacity model for the species
conformer The molecular conformer for the species
molecule A list of the Molecule objects describing the molec-
ular structure
transportData A set of transport collision parameters
molecularWeight The molecular weight of the species
energyTransferModel The collisional energy transfer model to use
reactive
True if the species participates in reaction families, False if not
Reaction libraries and seed mechanisms that
include the species are always considered
regardless of this variable
InChI
InChI string representation of this species. Read-only.
SMILES
SMILES string representation of this species. Read-only.
Note that SMILES representations for different resonance structures of the same species may be different.
aug_inchi
str
Type aug_inchi
calculateCp0(self ) → double
Return the value of the heat capacity at zero temperature in J/mol*K.
calculateCpInf(self ) → double
Return the value of the heat capacity at infinite temperature in J/mol*K.
conformer
rmgpy.statmech.conformer.Conformer
Type conformer
containsSurfaceSite(self ) → bool
Return True if the species is adsorbed on a surface (or is itself a site), else False.
copy(self, bool deep=False) → Species
Create a copy of the current species. If the kw argument ‘deep’ is True, then a deep copy will be made of
the Molecule objects in self.molecule.
For other complex attributes, a deep copy will always be made.
creationIteration
‘int’
Type creationIteration
energyTransferModel
object
Type energyTransferModel
explicitlyAllowed
‘bool’
Type explicitlyAllowed
fingerprint
Fingerprint of this species, taken from molecule attribute. Read-only.
fromAdjacencyList(self, adjlist)
Load the structure of a species as a Molecule object from the given adjacency list adjlist and store it as the
first entry of a list in the molecule attribute. Does not generate resonance isomers of the loaded molecule.
fromSMILES(self, smiles)
Load the structure of a species as a Molecule object from the given SMILES string smiles and store it
as the first entry of a list in the molecule attribute. Does not generate resonance isomers of the loaded
molecule.
generateEnergyTransferModel(self )
Generate the collisional energy transfer model parameters for the species. This “algorithm” is very much
in need of improvement.
generateStatMech(self )
Generate molecular degree of freedom data for the species. You must have already provided a thermody-
namics model using e.g. generateThermoData().
generateTransportData(self )
Generate the transportData parameters for the species.
generate_aug_inchi(self )
getResonanceHybrid(self )
Returns a molecule object with bond orders that are the average of all the resonance structures.
getSumOfStates(self, ndarray Elist) → ndarray
Return the sum of states 𝑁 (𝐸) at the specified energies Elist in J/mol.
getSymmetryNumber(self )
Get the symmetry number for the species, which is the highest symmetry number amongst its resonance
isomers and the resonance hybrid. This function is currently used for website purposes and testing only as
it requires additional calculateSymmetryNumber calls.
getThermoData(self, solventName=”)
Returns a thermoData object of the current Species object.
If the thermo object already exists, it is either of the (Wilhoit, ThermoData) type, or it is a Future.
If the type of the thermo attribute is Wilhoit, or ThermoData, then it is converted into a NASA format.
If it is a Future, then a blocking call is made to retrieve the NASA object. If the thermo object did not exist
yet, the thermo object is generated.
getTransportData(self )
Returns the transport data associated with this species, and calculates it if it is not yet available.
hasStatMech(self ) → bool
Return True if the species has statistical mechanical parameters, or False otherwise.
hasThermo(self ) → bool
Return True if the species has thermodynamic parameters, or False otherwise.
has_reactive_molecule(self ) → bool
True if the species has at least one reactive molecule, False otherwise
index
‘int’
Type index
isIdentical(self, other, bool strict=True) → bool
Return True if at least one molecule of the species is identical to other, which can be either a Molecule
object or a Species object.
If strict=False, performs the check ignoring electrons and resonance structures.
isIsomorphic(self, other, bool generateInitialMap=False, bool strict=True) → bool
Return True if the species is isomorphic to other, which can be either a Molecule object or a Species
object.
Parameters
• generateInitialMap (bool, optional) – If True, make initial map by matching
labeled atoms
• strict (bool, optional) – If False, perform isomorphism ignoring electrons.
isSolvent
‘bool’
Type isSolvent
isSurfaceSite(self ) → bool
Return True if the species is a vacant surface site.
rmgpy.species.TransitionState
Attribute TDescription
label A descriptive string label
conformer The molecular degrees of freedom model for the species
frequency The negative frequency of the first-order saddle point
tunneling The type of tunneling model to use for tunneling through the reaction barrier
degeneracy The reaction path degeneracy
tunneling
rmgpy.kinetics.model.TunnelingModel
Type tunneling
The rmgpy.statmech subpackage contains classes that represent various statistical mechanical models of molecular
degrees of freedom. These models enable the computation of macroscopic parameters (e.g. thermodynamics, kinetics,
etc.) from microscopic parameters.
A molecular system consisting of 𝑁 atoms is described by 3𝑁 molecular degrees of freedom. Three of these modes
involve translation of the system as a whole. Another three of these modes involve rotation of the system as a whole,
unless the system is linear (e.g. diatomics), for which there are only two rotational modes. The remaining 3𝑁 − 6
(or 3𝑁 − 5 if linear) modes involve internal motion of the atoms within the system. Many of these modes are well-
described as harmonic oscillations, while others are better modeled as torsional rotations around a bond within the
system.
Molecular degrees of freedom are mathematically represented using the Schrodinger equation 𝐻Ψ ˆ = 𝐸Ψ. By solving
the Schrodinger equation, we can determine the available energy states of the molecular system, which enables com-
putation of macroscopic parameters. Depending on the temperature of interest, some modes (e.g. vibrations) require
a quantum mechanical treatment, while others (e.g. translation, rotation) can be described using a classical solution.
Class Description
IdealGasTranslation A model of three-dimensional translation of an ideal gas
Class Description
LinearRotor A model of two-dimensional rigid rotation of a linear molecule
NonlinearRotor A model of three-dimensional rigid rotation of a nonlinear molecule
KRotor A model of one-dimensional rigid rotation of a K-rotor
SphericalTopRotor A model of three-dimensional rigid rotation of a spherical top molecule
Class Description
HarmonicOscillator A model of a set of one-dimensional harmonic oscillators
Class Description
HinderedRotor A model of a one-dimensional hindered rotation
Class Description
getPartitionFunction()
Calculate the partition function at a given temperature from energy levels and degen-
eracies
getHeatCapacity() Calculate the dimensionless heat capacity at a given temperature from energy levels
and degeneracies
getEnthalpy() Calculate the enthalpy at a given temperature from energy levels and degeneracies
getEntropy() Calculate the entropy at a given temperature from energy levels and degeneracies
getSumOfStates() Calculate the sum of states for a given energy domain from energy levels and degen-
eracies
getDensityOfStates() Calculate the density of states for a given energy domain from energy levels and de-
generacies
1.14.6 Convolution
Class Description
convolve() Return the convolution of two arrays
convolveBS() Convolve a degree of freedom into a density or sum of states using the Beyer-Swinehart (BS) direct
count algorithm
convolveBSSR()
Convolve a degree of freedom into a density or sum of states using the Beyer-Swinehart-Stein-
Rabinovitch (BSSR) direct count algorithm
Class Description
Conformer A model of a molecular conformation
Attribute Description
mass The mass of the translating object
quantum True to use the quantum mechanical model, False to use the classical model
Translational energies are much smaller than 𝑘B 𝑇 except for temperatures approaching absolute zero, so a
classical treatment of translation is more than adequate.
The translation of an ideal gas – a gas composed of randomly-moving, noninteracting particles of negligible
size – in three dimensions can be modeled using the particle-in-a-box model. In this model, a gas particle is
confined to a three-dimensional box of size 𝐿𝑥 𝐿𝑦 𝐿𝑧 = 𝑉 with the following potential:
{︃
0 0 ≤ 𝑥 ≤ 𝐿𝑥 , 0 ≤ 𝑦 ≤ 𝐿𝑦 , 0 ≤ 𝑧 ≤ 𝐿𝑧
𝑉 (𝑥, 𝑦, 𝑧) =
∞ otherwise
The time-independent Schrodinger equation for this system (within the box) is given by
~2
(︂ 2
𝜕2 𝜕2
)︂
𝜕
− + 2 + 2 Ψ(𝑥, 𝑦, 𝑧) = 𝐸Ψ(𝑥, 𝑦, 𝑧)
2𝑀 𝜕𝑥2 𝜕𝑦 𝜕𝑧
where 𝑀 is the total mass of the particle. Because the box is finite in all dimensions, the solution of the above
is quantized with the following energy levels:
[︃(︂ )︂2 (︂ )︂2 (︂ )︂2 ]︃
~2 𝑛𝑥 𝜋 𝑛𝑦 𝜋 𝑛𝑧 𝜋
𝐸𝑛𝑥 ,𝑛𝑦 ,𝑛𝑧 = + + 𝑛𝑥 , 𝑛𝑦 , 𝑛𝑧 = 1, 2, . . .
2𝑀 𝐿𝑥 𝐿𝑦 𝐿𝑧
Above we have introduced 𝑛𝑥 , 𝑛𝑦 , and 𝑛𝑧 as quantum numbers. The quantum mechanical partition function is
obtained by summing over the above energy levels:
∞ ∑︁
∞ ∑︁
∞ (︂ )︂
∑︁ 𝐸𝑛 ,𝑛 ,𝑛
𝑄trans (𝑇 ) = exp − 𝑥 𝑦 𝑧
𝑛𝑥 =1 𝑛𝑦 =1 𝑛𝑧 =1
𝑘B 𝑇
In almost all cases the temperature of interest is large relative to the energy spacing; in this limit we can obtain
a closed-form analytical expression for the translational partition function in the classical limit:
(︂ )︂3/2
2𝜋𝑀 𝑘B 𝑇
𝑄cl
trans (𝑇 ) = 𝑉
ℎ2
For a constant-pressure problem we can use the ideal gas law to replace 𝑉 with 𝑘B 𝑇 /𝑃 . This gives the partition
function a temperature dependence of 𝑇 5/2 .
as_dict(self ) → dict
A helper function for dumping objects as dictionaries for YAML files
Returns A dictionary representation of the object
Return type dict
getDensityOfStates(self, ndarray Elist, ndarray densStates0=None) → ndarray
Return the density of states 𝜌(𝐸) 𝑑𝐸 at the specified energies Elist in J/mol above the ground state. If an
initial density of states densStates0 is given, the rotor density of states will be convoluted into these states.
getEnthalpy(self, double T ) → double
Return the enthalpy in J/mol for the degree of freedom at the specified temperature T in K.
getEntropy(self, double T ) → double
Return the entropy in J/mol*K for the degree of freedom at the specified temperature T in K.
getHeatCapacity(self, double T ) → double
Return the heat capacity in J/mol*K for the degree of freedom at the specified temperature T in K.
getPartitionFunction(self, double T ) → double
Return the value of the partition function 𝑄(𝑇 ) at the specified temperature T in K.
getSumOfStates(self, ndarray Elist, ndarray sumStates0=None) → ndarray
Return the sum of states 𝑁 (𝐸) at the specified energies Elist in J/mol above the ground state. If an initial
sum of states sumStates0 is given, the rotor sum of states will be convoluted into these states.
make_object(self, dict data, dict class_dict)
A helper function for constructing objects from a dictionary (used when loading YAML files)
Parameters
• data (dict) – The dictionary representation of the object
• class_dict (dict) – A mapping of class names to the classes themselves
Returns None
mass
The mass of the translating object.
quantum
‘bool’
Type quantum
rmgpy.statmech.LinearRotor
Attribute Description
inertia The moment of inertia of the rotor
rotationalConstant The rotational constant of the rotor
symmetry The symmetry number of the rotor
quantum True to use the quantum mechanical model, False to use the classical model
Note that the moment of inertia and the rotational constant are simply two ways of representing the same
quantity; only one of these can be specified independently.
In the majority of chemical applications, the energies involved in the rigid rotor place it very nearly in the
classical limit at all relevant temperatures; therefore, the classical model is used by default.
A linear rigid rotor is modeled as a pair of point masses 𝑚1 and 𝑚2 separated by a distance 𝑅. Since we
are modeling the rotation of this system, we choose to work in spherical coordinates. Following the physics
convention – where 0 ≤ 𝜃 ≤ 𝜋 is the zenith angle and 0 ≤ 𝜑 ≤ 2𝜋 is the azimuth – the Schrodinger equation
for the rotor is given by
~2 1 𝜕2
[︂ (︂ )︂ ]︂
1 𝜕 𝜕
− sin 𝜃 + Ψ(𝜃, 𝜑) = 𝐸Ψ(𝜃, 𝜑)
2𝐼 sin 𝜃 𝜕𝜃 𝜕𝜃 sin2 𝜃 𝜕𝜑2
where 𝐼 ≡ 𝜇𝑅2 is the moment of inertia of the rotating body, and 𝜇 ≡ 𝑚1 𝑚2 /(𝑚1 + 𝑚2 ) is the reduced mass.
Note that there is no potential term in the above expression; for this reason, a rigid rotor is often referred to as a
free rotor. Solving the Schrodinger equation gives the energy levels 𝐸𝐽 and corresponding degeneracies 𝑔𝐽 for
the linear rigid rotor as
𝐸𝐽 = 𝐵𝐽(𝐽 + 1) 𝐽 = 0, 1, 2, . . .
𝑔𝐽 = 2𝐽 + 1
where 𝐽 is the quantum number for the rotor – sometimes called the total angular momentum quantum number
– and 𝐵 ≡ ~2 /2𝐼 is the rotational constant.
Using these expressions for the energy levels and corresponding degeneracies, we can evaluate the partition
function for the linear rigid rotor:
∞
1 ∑︁
𝑄rot (𝑇 ) = (2𝐽 + 1)𝑒−𝐵𝐽(𝐽+1)/𝑘B 𝑇
𝜎
𝐽=0
In many cases the temperature of interest is large relative to the energy spacing; in this limit we can obtain a
closed-form analytical expression for the linear rotor partition function in the classical limit:
1 8𝜋 2 𝐼𝑘B 𝑇
𝑄cl
rot (𝑇 ) =
𝜎 ℎ2
Above we have also introduced 𝜎 as the symmetry number of the rigid rotor.
as_dict(self ) → dict
A helper function for dumping objects as dictionaries for YAML files
Returns A dictionary representation of the object
Return type dict
getDensityOfStates(self, ndarray Elist, ndarray densStates0=None) → ndarray
Return the density of states 𝜌(𝐸) 𝑑𝐸 at the specified energies Elist in J/mol above the ground state. If an
initial density of states densStates0 is given, the rotor density of states will be convoluted into these states.
getEnthalpy(self, double T ) → double
Return the enthalpy in J/mol for the degree of freedom at the specified temperature T in K.
getEntropy(self, double T ) → double
Return the entropy in J/mol*K for the degree of freedom at the specified temperature T in K.
getHeatCapacity(self, double T ) → double
Return the heat capacity in J/mol*K for the degree of freedom at the specified temperature T in K.
getLevelDegeneracy(self, int J ) → int
Return the degeneracy of level J.
getLevelEnergy(self, int J ) → double
Return the energy of level J in kJ/mol.
getPartitionFunction(self, double T ) → double
Return the value of the partition function 𝑄(𝑇 ) at the specified temperature T in K.
getSumOfStates(self, ndarray Elist, ndarray sumStates0=None) → ndarray
Return the sum of states 𝑁 (𝐸) at the specified energies Elist in J/mol above the ground state. If an initial
sum of states sumStates0 is given, the rotor sum of states will be convoluted into these states.
inertia
The moment of inertia of the rotor.
make_object(self, data, class_dict)
quantum
‘bool’
Type quantum
rotationalConstant
The rotational constant of the rotor.
symmetry
‘int’
Type symmetry
rmgpy.statmech.NonlinearRotor
Attribute Description
inertia The moments of inertia of the rotor
rotationalConstant The rotational constants of the rotor
symmetry The symmetry number of the rotor
quantum True to use the quantum mechanical model, False to use the classical model
Note that the moments of inertia and the rotational constants are simply two ways of representing the same
quantity; only one set of these can be specified independently.
In the majority of chemical applications, the energies involved in the rigid rotor place it very nearly in the
classical limit at all relevant temperatures; therefore, the classical model is used by default. In the current
implementation, the quantum mechanical model has not been implemented, and a NotImplementedError
will be raised if you try to use it.
A nonlinear rigid rotor is the generalization of the linear rotor to a nonlinear polyatomic system. Such a system
is characterized by three moments of inertia 𝐼A , 𝐼B , and 𝐼C instead of just one. The solution to the Schrodinger
equation for the quantum nonlinear rotor is not well defined, so we will simply show the classical result instead:
)︂3/2 √︀
𝜋 1/2
(︂
8𝑘B 𝑇
𝑄cl
rot (𝑇 ) = 𝐼A 𝐼B 𝐼C
𝜎 ℎ2
as_dict(self ) → dict
A helper function for dumping objects as dictionaries for YAML files
Returns A dictionary representation of the object
Return type dict
getDensityOfStates(self, ndarray Elist, ndarray densStates0=None) → ndarray
Return the density of states 𝜌(𝐸) 𝑑𝐸 at the specified energies Elist in J/mol above the ground state. If an
initial density of states densStates0 is given, the rotor density of states will be convoluted into these states.
getEnthalpy(self, double T ) → double
Return the enthalpy in J/mol for the degree of freedom at the specified temperature T in K.
getEntropy(self, double T ) → double
Return the entropy in J/mol*K for the degree of freedom at the specified temperature T in K.
getHeatCapacity(self, double T ) → double
Return the heat capacity in J/mol*K for the degree of freedom at the specified temperature T in K.
getPartitionFunction(self, double T ) → double
Return the value of the partition function 𝑄(𝑇 ) at the specified temperature T in K.
getSumOfStates(self, ndarray Elist, ndarray sumStates0=None) → ndarray
Return the sum of states 𝑁 (𝐸) at the specified energies Elist in J/mol above the ground state. If an initial
sum of states sumStates0 is given, the rotor sum of states will be convoluted into these states.
inertia
The moments of inertia of the rotor.
make_object(self, data, class_dict)
quantum
‘bool’
Type quantum
rotationalConstant
The rotational constant of the rotor.
symmetry
‘int’
Type symmetry
rmgpy.statmech.KRotor
Attribute Description
inertia The moment of inertia of the rotor in amu*angstrom^2
rotationalConstant The rotational constant of the rotor in cm^-1
symmetry The symmetry number of the rotor
quantum True to use the quantum mechanical model, False to use the classical model
Note that the moment of inertia and the rotational constant are simply two ways of representing the same
quantity; only one of these can be specified independently.
In the majority of chemical applications, the energies involved in the K-rotor place it very nearly in the classical
limit at all relevant temperatures; therefore, the classical model is used by default.
The energy levels 𝐸𝐾 of the K-rotor are given by
𝐸𝐾 = 𝐵𝐾 2 𝐾 = 0, ±1, ±2, . . .
where 𝐾 is the quantum number for the rotor and 𝐵 ≡ ~2 /2𝐼 is the rotational constant.
Using these expressions for the energy levels and corresponding degeneracies, we can evaluate the partition
function for the K-rotor:
∞
(︃ )︃
1 ∑︁
−𝐵𝐾 2 /𝑘B 𝑇
𝑄rot (𝑇 ) = 1+ 2𝑒
𝜎
𝐾=1
In many cases the temperature of interest is large relative to the energy spacing; in this limit we can obtain a
closed-form analytical expression for the linear rotor partition function in the classical limit:
)︂1/2
8𝜋 2 𝐼𝑘B 𝑇
(︂
1
𝑄cl
rot (𝑇 ) =
𝜎 ℎ2
rmgpy.statmech.SphericalTopRotor
Attribute Description
inertia The moment of inertia of the rotor
rotationalConstant The rotational constant of the rotor
symmetry The symmetry number of the rotor
quantum True to use the quantum mechanical model, False to use the classical model
Note that the moment of inertia and the rotational constant are simply two ways of representing the same
quantity; only one of these can be specified independently.
In the majority of chemical applications, the energies involved in the rigid rotor place it very nearly in the
classical limit at all relevant temperatures; therefore, the classical model is used by default.
A spherical top rotor is simply the three-dimensional equivalent of a linear rigid rotor. Unlike the nonlinear
rotor, all three moments of inertia of a spherical top are equal, i.e. 𝐼A = 𝐼B = 𝐼C = 𝐼. The energy levels 𝐸𝐽
and corresponding degeneracies 𝑔𝐽 of the spherial top rotor are given by
𝐸𝐽 = 𝐵𝐽(𝐽 + 1) 𝐽 = 0, 1, 2, . . .
2
𝑔𝐽 = (2𝐽 + 1)
where 𝐽 is the quantum number for the rotor and 𝐵 ≡ ~2 /2𝐼 is the rotational constant.
Using these expressions for the energy levels and corresponding degeneracies, we can evaluate the partition
function for the spherical top rotor:
∞
1 ∑︁
𝑄rot (𝑇 ) = (2𝐽 + 1)2 𝑒−𝐵𝐽(𝐽+1)/𝑘B 𝑇
𝜎
𝐽=0
In many cases the temperature of interest is large relative to the energy spacing; in this limit we can obtain a
closed-form analytical expression for the linear rotor partition function in the classical limit:
)︂3/2
8𝜋 2 𝐼𝑘B 𝑇
(︂
1
𝑄cl
rot (𝑇 ) =
𝜎 ℎ2
where 𝜎 is the symmetry number of the spherical top. Note that the above differs from the nonlinear rotor
partition function by a factor of 𝜋.
as_dict(self ) → dict
A helper function for dumping objects as dictionaries for YAML files
Returns A dictionary representation of the object
Return type dict
getDensityOfStates(self, ndarray Elist, ndarray densStates0=None) → ndarray
Return the density of states 𝜌(𝐸) 𝑑𝐸 at the specified energies Elist in J/mol above the ground state. If an
initial density of states densStates0 is given, the rotor density of states will be convoluted into these states.
getEnthalpy(self, double T ) → double
Return the enthalpy in J/mol for the degree of freedom at the specified temperature T in K.
getEntropy(self, double T ) → double
Return the entropy in J/mol*K for the degree of freedom at the specified temperature T in K.
getHeatCapacity(self, double T ) → double
Return the heat capacity in J/mol*K for the degree of freedom at the specified temperature T in K.
getLevelDegeneracy(self, int J ) → int
Return the degeneracy of level J.
getLevelEnergy(self, int J ) → double
Return the energy of level J in kJ/mol.
getPartitionFunction(self, double T ) → double
Return the value of the partition function 𝑄(𝑇 ) at the specified temperature T in K.
getSumOfStates(self, ndarray Elist, ndarray sumStates0=None) → ndarray
Return the sum of states 𝑁 (𝐸) at the specified energies Elist in J/mol above the ground state. If an initial
sum of states sumStates0 is given, the rotor sum of states will be convoluted into these states.
inertia
The moment of inertia of the rotor.
make_object(self, data, class_dict)
quantum
‘bool’
Type quantum
rotationalConstant
The rotational constant of the rotor.
symmetry
‘int’
Type symmetry
rmgpy.statmech.HarmonicOscillator
Attribute Description
frequencies The vibrational frequencies of the oscillators
quantum True to use the quantum mechanical model, False to use the classical model
In the majority of chemical applications, the energy levels of the harmonic oscillator are of similar magnitude to
𝑘B 𝑇 , requiring a quantum mechanical treatment. Fortunately, the harmonic oscillator has an analytical quantum
mechanical solution.
Many vibrational motions are well-described as one-dimensional quantum harmonic oscillators. The time-
independent Schrodinger equation for such an oscillator is given by
~2 𝜕 2 1
− 2
Ψ(𝑥) + 𝑚𝜔 2 𝑥2 Ψ(𝑥) = 𝐸Ψ(𝑥)
2𝑚 𝜕𝑥 2
where 𝑚 is the total mass of the particle. The harmonic potential results in quantized solutions to the above with
the following energy levels:
(︂ )︂
1
𝐸𝑛 = 𝑛 + ~𝜔 𝑛 = 0, 1, 2, . . .
2
Above we have introduced 𝑛 as the quantum number. Note that, even in the ground state (𝑛 = 0), the harmonic
oscillator has an energy that is not zero; this energy is called the zero-point energy.
The harmonic oscillator partition function is obtained by summing over the above energy levels:
∞
(︃ (︀ )︀ )︃
∑︁ 𝑛 + 21 ~𝜔
𝑄vib (𝑇 ) = exp −
𝑛=0
𝑘B 𝑇
This summation can be evaluated explicitly to give a closed-form analytical expression for the vibrational parti-
tion function of a quantum harmonic oscillator:
𝑒−~𝜔/2𝑘B 𝑇
𝑄vib (𝑇 ) =
1 − 𝑒−~𝜔/𝑘B 𝑇
In RMG the convention is to place the zero-point energy in with the ground-state energy of the system instead
of the numerator of the vibrational partition function, which gives
1
𝑄vib (𝑇 ) =
1 − 𝑒−~𝜔/𝑘B 𝑇
The energy levels of the harmonic oscillator in chemical systems are often significant compared to the tem-
perature of interest, so we usually use the quantum result. However, the classical limit is provided here for
completeness:
𝑘B 𝑇
𝑄cl
vib (𝑇 ) =
~𝜔
as_dict(self ) → dict
A helper function for dumping objects as dictionaries for YAML files
Attribute Description
inertia The moment of inertia of the rotor
rotationalConstant The rotational constant of the rotor
symmetry The symmetry number of the rotor
fourier The 2𝑥𝑁 array of Fourier series coefficients
barrier The barrier height of the cosine potential
quantum True to use the quantum mechanical model, False to use the classical model
semiclassical True to use the semiclassical correction, False otherwise
Note that the moment of inertia and the rotational constant are simply two ways of representing the same
quantity; only one of these can be specified independently.
The Schrodinger equation for a one-dimensional hindered rotor is given by
~2 𝑑 2
− Ψ(𝜑) + 𝑉 (𝜑)Ψ(𝜑) = 𝐸Ψ(𝜑)
2𝐼 𝑑𝜑2
where 𝐼 is the reduced moment of inertia of the torsion and 𝑉 (𝜑) describes the potential of the torsion. There
are two common forms for the potential: a simple cosine of the form
1
𝑉 (𝜑) = 𝑉0 (1 − cos 𝜎𝜑)
2
where 𝑉0 is the barrier height and 𝜎 is the symmetry number, or a more general Fourier series of the form
𝐶
∑︁
𝑉 (𝜑) = 𝐴 + (𝑎𝑘 cos 𝑘𝜑 + 𝑏𝑘 sin 𝑘𝜑)
𝑘=1
where 𝐴, 𝑎𝑘 and 𝑏𝑘 are fitted coefficients. Both potentials are typically defined such that the minimum of the
potential is zero and is found at 𝜑 = 0.
For either the cosine or Fourier series potentials, the energy levels of the quantum hindered rotor must be
determined numerically. The cosine potential does permit a closed-form representation of the classical partition
function, however:
(︂ )︂1/2 (︂ )︂ (︂ )︂
2𝜋𝐼𝑘B 𝑇 2𝜋 𝑉0 𝑉0
𝑄cl
hind (𝑇 ) = exp − 𝐼0
ℎ2 𝜎 2𝑘B 𝑇 2𝑘B 𝑇
A semiclassical correction to the above is usually required to provide a reasonable estiamate of the partition
function:
𝑄quant
vib (𝑇 ) cl
𝑄semi
hind (𝑇 ) = 𝑄hind (𝑇 )
𝑄cl
vib (𝑇 )
(︂ )︂1/2 (︂ )︂ (︂ )︂
ℎ𝜈 1 2𝜋𝐼𝑘B 𝑇 2𝜋 𝑉0 𝑉0
= exp − 𝐼0
𝑘B 𝑇 1 − exp (−ℎ𝜈/𝑘B 𝑇 ) ℎ2 𝜎 2𝑘B 𝑇 2𝑘B 𝑇
as_dict(self ) → dict
A helper function for dumping objects as dictionaries for YAML files
Returns A dictionary representation of the object
Return type dict
barrier
The barrier height of the cosine potential.
energies
numpy.ndarray
Type energies
Type quantum
rotationalConstant
The rotational constant of the rotor.
semiclassical
‘bool’
Type semiclassical
solveSchrodingerEquation(self, int Nbasis=401) → ndarray
Solves the one-dimensional time-independent Schrodinger equation to determine the energy levels of a
one-dimensional hindered rotor with a Fourier series potential using Nbasis basis functions. For the pur-
poses of this function it is usually sufficient to use 401 basis functions (the default). Returns the energy
eigenvalues of the Hamiltonian matrix in J/mol.
symmetry
‘int’
Type symmetry
rmgpy.statmech.schrodinger
The rmgpy.statmech.schrodinger module contains functionality for working with the Schrodinger equation and
its solution. In particular, it contains functions for using the energy levels and corresponding degeneracies obtained
from solving the Schrodinger equation to compute various thermodynamic and statistical mechanical properties, such
as heat capacity, enthalpy, entropy, partition function, and the sum and density of states.
rmgpy.statmech.schrodinger.convolve(ndarray rho1, ndarray rho2)
Return the convolution of two arrays rho1 and rho2.
rmgpy.statmech.schrodinger.convolveBS(ndarray Elist, ndarray rho0, double energy, int degener-
acy=1)
Convolve a molecular degree of freedom into a density or sum of states using the Beyer-Swinehart (BS) direct
count algorithm. This algorithm is suitable for unevenly-spaced energy levels in the array of energy grains Elist
(in J/mol), but assumes the solution of the Schrodinger equation gives evenly-spaced energy levels with spacing
energy in kJ/mol and degeneracy degeneracy.
rmgpy.statmech.schrodinger.convolveBSSR(ndarray Elist, ndarray rho0, energy, degener-
acy=unitDegeneracy, int n0=0)
Convolve a molecular degree of freedom into a density or sum of states using the Beyer-Swinehart-Stein-
Rabinovitch (BSSR) direct count algorithm. This algorithm is suitable for unevenly-spaced energy levels in both
the array of energy grains Elist (in J/mol) and the energy levels corresponding to the solution of the Schrodinger
equation.
rmgpy.statmech.schrodinger.getDensityOfStates(ndarray Elist, energy, degener-
acy=unitDegeneracy, int n0=0, ndarray
densStates0=None) → ndarray
Return the values of the dimensionless density of states 𝜌(𝐸) 𝑑𝐸 for a given set of energies Elist in J/mol above
the ground state using an initial density of states densStates0. The solution to the Schrodinger equation is given
using functions energy and degeneracy that accept as argument a quantum number and return the corresponding
energy in J/mol and degeneracy of that level. The quantum number always begins at n0 and increases by ones.
rmgpy.statmech.schrodinger.getEnthalpy(double T, energy, degeneracy=unitDegeneracy, int n0=0,
int nmax=10000, double tol=1e-12) → double
Return the value of the dimensionless enthalpy 𝐻(𝑇 )/𝑅𝑇 at a given temperature T in K. The solution to the
Schrodinger equation is given using functions energy and degeneracy that accept as argument a quantum number
and return the corresponding energy in J/mol and degeneracy of that level. The quantum number always begins
at n0 and increases by ones. You can also change the relative tolerance tol and the maximum allowed value of
the quantum number nmax.
rmgpy.statmech.schrodinger.getEntropy(double T, energy, degeneracy=unitDegeneracy, int n0=0,
int nmax=10000, double tol=1e-12) → double
Return the value of the dimensionless entropy 𝑆(𝑇 )/𝑅 at a given temperature T in K. The solution to the
Schrodinger equation is given using functions energy and degeneracy that accept as argument a quantum number
and return the corresponding energy in J/mol and degeneracy of that level. The quantum number always begins
at n0 and increases by ones. You can also change the relative tolerance tol and the maximum allowed value of
the quantum number nmax.
rmgpy.statmech.schrodinger.getHeatCapacity(double T, energy, degeneracy=unitDegeneracy, int
n0=0, int nmax=10000, double tol=1e-12) → dou-
ble
Return the value of the dimensionless heat capacity 𝐶v (𝑇 )/𝑅 at a given temperature T in K. The solution to
the Schrodinger equation is given using functions energy and degeneracy that accept as argument a quantum
number and return the corresponding energy in J/mol and degeneracy of that level. The quantum number always
begins at n0 and increases by ones. You can also change the relative tolerance tol and the maximum allowed
value of the quantum number nmax.
rmgpy.statmech.schrodinger.getPartitionFunction(double T, energy, degener-
acy=unitDegeneracy, int n0=0, int
nmax=10000, double tol=1e-12) → double
Return the value of the partition function 𝑄(𝑇 ) at a given temperature T in K. The solution to the Schrodinger
equation is given using functions energy and degeneracy that accept as argument a quantum number and return
the corresponding energy in J/mol and degeneracy of that level. The quantum number always begins at n0 and
increases by ones. You can also change the relative tolerance tol and the maximum allowed value of the quantum
number nmax.
rmgpy.statmech.schrodinger.getSumOfStates(ndarray Elist, energy, degeneracy=unitDegeneracy,
int n0=0, ndarray sumStates0=None) → ndarray
Return the values of the sum of states 𝑁 (𝐸) for a given set of energies Elist in J/mol above the ground state
using an initial sum of states sumStates0. The solution to the Schrodinger equation is given using functions
energy and degeneracy that accept as argument a quantum number and return the corresponding energy in J/mol
and degeneracy of that level. The quantum number always begins at n0 and increases by ones.
rmgpy.statmech.schrodinger.unitDegeneracy(n)
rmgpy.statmech.Conformer
Attribute Description
E0 The ground-state energy (including zero-point energy) of the conformer
modes A list of the molecular degrees of freedom
spinMultiplicity The degeneracy of the electronic ground state
opticalIsomers The number of optical isomers
number An array of atomic numbers of each atom in the conformer
mass An array of masses of each atom in the conformer
coordinates An array of 3D coordinates of each atom in the conformer
Note that the spinMultiplicity reflects the electronic mode of the molecular system.
E0
The ground-state energy (including zero-point energy) of the conformer.
as_dict(self ) → dict
A helper function for dumping objects as dictionaries for YAML files
Returns A dictionary representation of the object
Return type dict
coordinates
An array of 3D coordinates of each atom in the conformer.
getActiveModes(self, bool activeJRotor=False, bool activeKRotor=True) → list
Return a list of the active molecular degrees of freedom of the molecular system.
getCenterOfMass(self, atoms=None) → ndarray
Calculate and return the [three-dimensional] position of the center of mass of the conformer in m. If a list
atoms of atoms is specified, only those atoms will be used to calculate the center of mass. Otherwise, all
atoms will be used.
getDensityOfStates(self, ndarray Elist) → ndarray
Return the density of states 𝜌(𝐸) 𝑑𝐸 at the specified energies Elist above the ground state.
getEnthalpy(self, double T ) → double
Return the enthalpy in J/mol for the system at the specified temperature T in K.
getEntropy(self, double T ) → double
Return the entropy in J/mol*K for the system at the specified temperature T in K.
getFreeEnergy(self, double T ) → double
Return the Gibbs free energy in J/mol for the system at the specified temperature T in K.
getHeatCapacity(self, double T ) → double
Return the heat capacity in J/mol*K for the system at the specified temperature T in K.
getInternalReducedMomentOfInertia(self, pivots, top1, option=3) → double
Calculate and return the reduced moment of inertia for an internal torsional rotation around the axis defined
by the two atoms in pivots. The list top1 contains the atoms that should be considered as part of the rotating
top; this list should contain the pivot atom connecting the top to the rest of the molecule. The procedure
used is that of Pitzer1 , which is described as 𝐼 (2,𝑜𝑝𝑡𝑖𝑜𝑛) by East and Radom2 . In this procedure, the
molecule is divided into two tops: those at either end of the hindered rotor bond. The moment of inertia
of each top is evaluated using an axis determined by option. Finally, the reduced moment of inertia is
evaluated from the moment of inertia of each top via the formula (I1*I2)/(I1+I2).
option is an integer corresponding to one of three possible ways of calculating the internal reduced
moment of inertia, as discussed in East and Radom [2]
option moments of inertia of each rotating group calculated about the axis containing the twisting
=1 bond
option each moment of inertia of each rotating group is calculated about an axis parallel to the
=2 twisting bond and passing through its center of mass
option moments of inertia of each rotating group calculated about the axis passing through the cen-
=3 ters of mass of both groups
1 1 1
= +
𝐼 (2,𝑜𝑝𝑡𝑖𝑜𝑛) 𝐼1 𝐼2
getMomentOfInertiaTensor(self ) → ndarray
Calculate and return the moment of inertia tensor for the conformer in kg*m^2. If the coordinates are not
at the center of mass, they are temporarily shifted there for the purposes of this calculation.
getNumberDegreesOfFreedom(self )
Return the number of degrees of freedom in a species object, which should be 3N, and raises an exception
if it is not.
getPartitionFunction(self, double T ) → double
Return the partition function 𝑄(𝑇 ) for the system at the specified temperature T in K.
getPrincipalMomentsOfInertia(self )
Calculate and return the principal moments of inertia and corresponding principal axes for the conformer.
The moments of inertia are in kg*m^2, while the principal axes have unit length.
getSumOfStates(self, ndarray Elist) → ndarray
Return the sum of states 𝑁 (𝐸) at the specified energies Elist in kJ/mol above the ground state.
getSymmetricTopRotors(self )
Return objects representing the external J-rotor and K-rotor under the symmetric top approximation. For
nonlinear molecules, the J-rotor is a 2D rigid rotor with a rotational constant 𝐵 determined as the geometric
mean of the two most similar rotational constants. The K-rotor is a 1D rigid rotor with a rotational constant
𝐴 − 𝐵 determined by the difference between the remaining molecular rotational constant and the J-rotor
rotational constant.
getTotalMass(self, atoms=None) → double
Calculate and return the total mass of the atoms in the conformer in kg. If a list atoms of atoms is specified,
only those atoms will be used to calculate the center of mass. Otherwise, all atoms will be used.
make_object(self, dict data, dict class_dict)
A helper function for constructing objects from a dictionary (used when loading YAML files)
Parameters
• data (dict) – The dictionary representation of the object
• class_dict (dict) – A mapping of class names to the classes themselves
Returns None
mass
An array of masses of each atom in the conformer.
modes
list
Type modes
number
An array of atomic numbers of each atom in the conformer.
opticalIsomers
‘int’
Type opticalIsomers
spinMultiplicity
‘int’
Type spinMultiplicity
The rmgpy.thermo subpackage contains classes that represent various thermodynamic models of heat capacity.
Class Description
ThermoData A heat capacity model based on a set of discrete heat capacity points
Wilhoit A heat capacity model based on the Wilhoit polynomial
NASA A heat capacity model based on a set of NASA polynomials
NASAPolynomial A heat capacity model based on a single NASA polynomial
rmgpy.thermo.ThermoData
Attribute Description
Tdata An array of temperatures at which the heat capacity is known
Cpdata An array of heat capacities at the given temperatures
H298 The standard enthalpy of formation at 298 K
S298 The standard entropy at 298 K
Tmin The minimum temperature at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature at which the model is valid, or zero if unknown or undefined
E0 The energy at zero Kelvin (including zero point energy)
comment Information about the model (e.g. its source)
Cp0
The heat capacity at zero temperature.
CpInf
The heat capacity at infinite temperature.
Cpdata
An array of heat capacities at the given temperatures.
E0
The ground state energy (J/mol) at zero Kelvin, including zero point energy, or None if not yet specified.
H298
The standard enthalpy of formation at 298 K.
S298
The standard entropy of formation at 298 K.
Tdata
An array of temperatures at which the heat capacity is known.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
as_dict(self ) → dict
A helper function for dumping objects as dictionaries for YAML files
Returns A dictionary representation of the object
Return type dict
comment
str
Type comment
discrepancy(self, HeatCapacityModel other) → double
Return some measure of how dissimilar self is from other.
The measure is arbitrary, but hopefully useful for sorting purposes. Discrepancy of 0 means they are
identical
getEnthalpy(self, double T ) → double
Return the enthalpy in J/mol at the specified temperature T in K.
getEntropy(self, double T ) → double
Return the entropy in J/mol*K at the specified temperature T in K.
getFreeEnergy(self, double T ) → double
Return the Gibbs free energy in J/mol at the specified temperature T in K.
getHeatCapacity(self, double T ) → double
Return the constant-pressure heat capacity in J/mol*K at the specified temperature T in K.
isIdenticalTo(self, HeatCapacityModel other) → bool
Returns True if self and other report very similar thermo values for heat capacity, enthalpy, entropy, and
free energy over a wide range of temperatures, or False otherwise.
isSimilarTo(self, HeatCapacityModel other) → bool
Returns True if self and other report similar thermo values for heat capacity, enthalpy, entropy, and free
energy over a wide range of temperatures, or False otherwise.
isTemperatureValid(self, double T ) → bool
Return True if the temperature T in K is within the valid temperature range of the thermodynamic data,
or False if not. If the minimum and maximum temperature are not defined, True is returned.
label
str
Type label
make_object(self, dict data, dict class_dict)
A helper function for constructing objects from a dictionary (used when loading YAML files)
Parameters
• data (dict) – The dictionary representation of the object
• class_dict (dict) – A mapping of class names to the classes themselves
Returns None
toNASA(self, double Tmin, double Tmax, double Tint, bool fixedTint=False, bool weighting=True, int
continuity=3) → NASA
Convert the object to a NASA object. You must specify the minimum and maximum temperatures of the fit
Tmin and Tmax in K, as well as the intermediate temperature Tint in K to use as the bridge between the
two fitted polynomials. The remaining parameters can be used to modify the fitting algorithm used:
• fixedTint - False to allow Tint to vary in order to improve the fit, or True to keep it fixed
• weighting - True to weight the fit by 𝑇 −1 to emphasize good fit at lower temperatures, or False to
not use weighting
• continuity - The number of continuity constraints to enforce at Tint:
– 0: no constraints on continuity of 𝐶p (𝑇 ) at Tint
– 1: constrain 𝐶p (𝑇 ) to be continous at Tint
𝑑𝐶p
– 2: constrain 𝐶p (𝑇 ) and 𝑑𝑇 to be continuous at Tint
𝑑𝐶p 𝑑2 𝐶p
– 3: constrain 𝐶p (𝑇 ), 𝑑𝑇 , and 𝑑𝑇 2 to be continuous at Tint
2
𝑑𝐶p 𝑑 𝐶p 𝑑3 𝐶p
– 4: constrain 𝐶p (𝑇 ), 𝑑𝑇 , 𝑑𝑇 2 , and 𝑑𝑇 3 to be continuous at Tint
𝑑𝐶p 𝑑2 𝐶p 𝑑3 𝐶p 𝑑4 𝐶p
– 5: constrain 𝐶p (𝑇 ), 𝑑𝑇 , 𝑑𝑇 2 , 𝑑𝑇 3 , and 𝑑𝑇 4 to be continuous at Tint
Note that values of continuity of 5 or higher effectively constrain all the coefficients to be equal and should
be equivalent to fitting only one polynomial (rather than two).
Returns the fitted NASA object containing the two fitted NASAPolynomial objects.
toWilhoit(self, B=None) → Wilhoit
Convert the Benson model to a Wilhoit model. For the conversion to succeed, you must have set the Cp0
and CpInf attributes of the Benson model.
B: the characteristic temperature in Kelvin.
rmgpy.thermo.Wilhoit
Attribute Description
a0 The zeroth-order Wilhoit polynomial coefficient
a1 The first-order Wilhoit polynomial coefficient
a2 The second-order Wilhoit polynomial coefficient
a3 The third-order Wilhoit polynomial coefficient
H0 The integration constant for enthalpy (not H at T=0)
S0 The integration constant for entropy (not S at T=0)
E0 The energy at zero Kelvin (including zero point energy)
B The Wilhoit scaled temperature coefficient in K
Tmin The minimum temperature in K at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature in K at which the model is valid, or zero if unknown or undefined
comment Information about the model (e.g. its source)
The Wilhoit polynomial is an expression for heat capacity that is guaranteed to give the correct limits at zero
and infinite temperature, and gives a very reasonable shape to the heat capacity profile in between:
[︃ 3
]︃
∑︁
2 𝑖
𝐶p (𝑇 ) = 𝐶p (0) + [𝐶p (∞) − 𝐶p (0)] 𝑦 1 + (𝑦 − 1) 𝑎𝑖 𝑦
𝑖=0
Above, 𝑦 ≡ 𝑇 /(𝑇 + 𝐵) is a scaled temperature that ranges from zero to one based on the value of the coefficient
𝐵, and 𝑎0 , 𝑎1 , 𝑎2 , and 𝑎3 are the Wilhoit polynomial coefficients.
The enthalpy is given by
The low-temperature limit 𝐶p (0) is 3.5𝑅 for linear molecules and 4𝑅 for nonlinear molecules.
The high-temperature limit 𝐶p (∞) is taken to be [3𝑁atoms − 1.5] 𝑅 for linear molecules and
[3𝑁atoms − (2 + 0.5𝑁rotors )] 𝑅 for nonlinear molecules, for a molecule composed of 𝑁atoms atoms and 𝑁rotors
internal rotors.
B
The Wilhoit scaled temperature coefficient.
Cp0
The heat capacity at zero temperature.
CpInf
The heat capacity at infinite temperature.
E0
The ground state energy (J/mol) at zero Kelvin, including zero point energy.
For the Wilhoit class, this is calculated as the Enthalpy at 0.001 Kelvin.
H0
The integration constant for enthalpy.
NB. this is not equal to the enthlapy at 0 Kelvin, which you can access via E0
S0
The integration constant for entropy.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
a0
‘double’
Type a0
a1
‘double’
Type a1
a2
‘double’
Type a2
a3
‘double’
Type a3
as_dict(self ) → dict
A helper function for YAML parsing
comment
str
Type comment
copy(self ) → Wilhoit
Return a copy of the Wilhoit object.
discrepancy(self, HeatCapacityModel other) → double
Return some measure of how dissimilar self is from other.
The measure is arbitrary, but hopefully useful for sorting purposes. Discrepancy of 0 means they are
identical
fitToData(self, ndarray Tdata, ndarray Cpdata, double Cp0, double CpInf, double H298, double S298,
double B0=500.0)
Fit a Wilhoit model to the data points provided, allowing the characteristic temperature B to vary so as to
improve the fit. This procedure requires an optimization, using the fminbound function in the scipy.
optimize module. The data consists of a set of heat capacity points Cpdata in J/mol*K at a given set
of temperatures Tdata in K, along with the enthalpy H298 in kJ/mol and entropy S298 in J/mol*K at 298
K. The linearity of the molecule, number of vibrational frequencies, and number of internal rotors (linear,
Nfreq, and Nrotors, respectively) is used to set the limits at zero and infinite temperature.
fitToDataForConstantB(self, ndarray Tdata, ndarray Cpdata, double Cp0, double CpInf, double
H298, double S298, double B)
Fit a Wilhoit model to the data points provided using a specified value of the characteristic temperature
B. The data consists of a set of dimensionless heat capacity points Cpdata at a given set of temperatures
Tdata in K, along with the dimensionless heat capacity at zero and infinite temperature, the dimensionless
enthalpy H298 at 298 K, and the dimensionless entropy S298 at 298 K.
getEnthalpy(self, double T ) → double
Return the enthalpy in J/mol at the specified temperature T in K.
getEntropy(self, double T ) → double
Return the entropy in J/mol*K at the specified temperature T in K.
getFreeEnergy(self, double T ) → double
Return the Gibbs free energy in J/mol at the specified temperature T in K.
getHeatCapacity(self, double T ) → double
Return the constant-pressure heat capacity in J/mol*K at the specified temperature T in K.
isIdenticalTo(self, HeatCapacityModel other) → bool
Returns True if self and other report very similar thermo values for heat capacity, enthalpy, entropy, and
free energy over a wide range of temperatures, or False otherwise.
isSimilarTo(self, HeatCapacityModel other) → bool
Returns True if self and other report similar thermo values for heat capacity, enthalpy, entropy, and free
energy over a wide range of temperatures, or False otherwise.
isTemperatureValid(self, double T ) → bool
Return True if the temperature T in K is within the valid temperature range of the thermodynamic data,
or False if not. If the minimum and maximum temperature are not defined, True is returned.
label
str
Type label
make_object(self, dict data, dict class_dict)
A helper function for constructing objects from a dictionary (used when loading YAML files)
Parameters
• data (dict) – The dictionary representation of the object
• class_dict (dict) – A mapping of class names to the classes themselves
Returns None
toNASA(self, double Tmin, double Tmax, double Tint, bool fixedTint=False, bool weighting=True, int
continuity=3) → NASA
Convert the Wilhoit object to a NASA object. You must specify the minimum and maximum temperatures
of the fit Tmin and Tmax in K, as well as the intermediate temperature Tint in K to use as the bridge
between the two fitted polynomials. The remaining parameters can be used to modify the fitting algorithm
used:
• fixedTint - False to allow Tint to vary in order to improve the fit, or True to keep it fixed
• weighting - True to weight the fit by 𝑇 −1 to emphasize good fit at lower temperatures, or False to
not use weighting
• continuity - The number of continuity constraints to enforce at Tint:
– 0: no constraints on continuity of 𝐶p (𝑇 ) at Tint
– 1: constrain 𝐶p (𝑇 ) to be continous at Tint
𝑑𝐶p
– 2: constrain 𝐶p (𝑇 ) and 𝑑𝑇 to be continuous at Tint
𝑑𝐶p 𝑑2 𝐶p
– 3: constrain 𝐶p (𝑇 ), 𝑑𝑇 , and 𝑑𝑇 2 to be continuous at Tint
2
𝑑𝐶p 𝑑 𝐶p 𝑑3 𝐶p
– 4: constrain 𝐶p (𝑇 ), 𝑑𝑇 , 𝑑𝑇 2 , and 𝑑𝑇 3 to be continuous at Tint
2 3
𝑑𝐶p 𝑑 𝐶p 𝑑 𝐶p 𝑑4 𝐶p
– 5: constrain 𝐶p (𝑇 ), 𝑑𝑇 , 𝑑𝑇 2 , 𝑑𝑇 3 , and 𝑑𝑇 4 to be continuous at Tint
Note that values of continuity of 5 or higher effectively constrain all the coefficients to be equal and should
be equivalent to fitting only one polynomial (rather than two).
Returns the fitted NASA object containing the two fitted NASAPolynomial objects.
toThermoData(self ) → ThermoData
Convert the Wilhoit model to a ThermoData object.
rmgpy.thermo.NASA
Attribute Description
polynomials The list of NASA polynomials to use in this model
Tmin The minimum temperature in K at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature in K at which the model is valid, or zero if unknown or undefined
E0 The energy at zero Kelvin (including zero point energy)
comment Information about the model (e.g. its source)
The NASA polynomial is another representation of the heat capacity, enthalpy, and entropy using seven or nine
coefficients a = [𝑎−2 𝑎−1 𝑎0 𝑎1 𝑎2 𝑎3 𝑎4 𝑎5 𝑎6 ]. The relevant thermodynamic parameters are evaluated via the
expressions
𝐶p (𝑇 )
= 𝑎−2 𝑇 −2 + 𝑎−1 𝑇 −1 + 𝑎0 + 𝑎1 𝑇 + 𝑎2 𝑇 2 + 𝑎3 𝑇 3 + 𝑎4 𝑇 4
𝑅
𝐻(𝑇 ) 1 1 1 1 𝑎5
= −𝑎−2 𝑇 −2 + 𝑎−1 𝑇 −1 ln 𝑇 + 𝑎0 + 𝑎1 𝑇 + 𝑎2 𝑇 2 + 𝑎3 𝑇 3 + 𝑎4 𝑇 4 +
𝑅𝑇 2 3 4 5 𝑇
𝑆(𝑇 ) 1 1 1 1
= − 𝑎−2 𝑇 −2 − 𝑎−1 𝑇 −1 + 𝑎0 ln 𝑇 + 𝑎1 𝑇 + 𝑎2 𝑇 2 + 𝑎3 𝑇 3 + 𝑎4 𝑇 4 + 𝑎6
𝑅 2 2 3 4
In the seven-coefficient version, 𝑎−2 = 𝑎−1 = 0.
As simple polynomial expressions, the NASA polynomial is faster to evaluate when compared to the Wilhoit
model; however, it does not have the nice physical behavior of the Wilhoit representation. Often multiple NASA
polynomials are used to accurately represent the thermodynamics of a system over a wide temperature range.
Cp0
The heat capacity at zero temperature.
CpInf
The heat capacity at infinite temperature.
E0
The ground state energy (J/mol) at zero Kelvin, including zero point energy, or None if not yet specified.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
as_dict(self ) → dict
A helper function for YAML dumping
changeBaseEnthalpy(self, double deltaH ) → NASA
Add deltaH in J/mol to the base enthalpy of formation H298 and return the modified NASA object.
changeBaseEntropy(self, double deltaS) → NASA
Add deltaS in J/molK to the base entropy of formation S298 and return the modified NASA object
comment
str
Type comment
discrepancy(self, HeatCapacityModel other) → double
Return some measure of how dissimilar self is from other.
The measure is arbitrary, but hopefully useful for sorting purposes. Discrepancy of 0 means they are
identical
getEnthalpy(self, double T ) → double
Return the enthalpy 𝐻(𝑇 ) in J/mol at the specified temperature T in K.
getEntropy(self, double T ) → double
Return the entropy 𝑆(𝑇 ) in J/mol*K at the specified temperature T in K.
getFreeEnergy(self, double T ) → double
Return the Gibbs free energy 𝐺(𝑇 ) in J/mol at the specified temperature T in K.
getHeatCapacity(self, double T ) → double
Return the constant-pressure heat capacity 𝐶p (𝑇 ) in J/mol*K at the specified temperature T in K.
entry(
index = 2,
label = "octane",
molecule =
"""
1 C 0 {2,S}
2 C 0 {1,S} {3,S}
3 C 0 {2,S} {4,S}
4 C 0 {3,S} {5,S}
5 C 0 {4,S} {6,S}
6 C 0 {5,S} {7,S}
7 C 0 {6,S} {8,S}
8 C 0 {7,S}
""",
thermo = NASA(
polynomials = [
NASAPolynomial(coeffs=[1.25245480E+01,-1.01018826E-02,2.21992610E-04,-2.84863722E-07,1.
˓→12410138E-10,-2.98434398E+04,-1.97109989E+01], Tmin=(200,'K'), Tmax=(1000,'K')),
NASAPolynomial(coeffs=[2.09430708E+01,4.41691018E-02,-1.53261633E-05,2.30544803E-09,-1.
˓→29765727E-13,-3.55755088E+04,-8.10637726E+01], Tmin=(1000,'K'), Tmax=(6000,'K')),
],
Tmin = (200,'K'),
Tmax = (6000,'K'),
),
reference = Reference(authors=["check on burcat"], title='burcat', year="1999", url="http://www.
˓→me.berkeley.edu/gri-mech/version30/text30.html"),
referenceType = "review",
shortDesc = u"""""",
longDesc =
u"""
""",
)
rmgpy.thermo.NASAPolynomial
Attribute Description
coeffs The seven or nine NASA polynomial coefficients
Tmin The minimum temperature in K at which the model is valid, or zero if unknown or undefined
Tmax The maximum temperature in K at which the model is valid, or zero if unknown or undefined
E0 The energy at zero Kelvin (including zero point energy)
comment Information about the model (e.g. its source)
The NASA polynomial is another representation of the heat capacity, enthalpy, and entropy using seven or nine
coefficients a = [𝑎−2 𝑎−1 𝑎0 𝑎1 𝑎2 𝑎3 𝑎4 𝑎5 𝑎6 ]. The relevant thermodynamic parameters are evaluated via the
expressions
𝐶p (𝑇 )
= 𝑎−2 𝑇 −2 + 𝑎−1 𝑇 −1 + 𝑎0 + 𝑎1 𝑇 + 𝑎2 𝑇 2 + 𝑎3 𝑇 3 + 𝑎4 𝑇 4
𝑅
𝐻(𝑇 ) 1 1 1 1 𝑎5
= −𝑎−2 𝑇 −2 + 𝑎−1 𝑇 −1 ln 𝑇 + 𝑎0 + 𝑎1 𝑇 + 𝑎2 𝑇 2 + 𝑎3 𝑇 3 + 𝑎4 𝑇 4 +
𝑅𝑇 2 3 4 5 𝑇
𝑆(𝑇 ) 1 1 1 1
= − 𝑎−2 𝑇 −2 − 𝑎−1 𝑇 −1 + 𝑎0 ln 𝑇 + 𝑎1 𝑇 + 𝑎2 𝑇 2 + 𝑎3 𝑇 3 + 𝑎4 𝑇 4 + 𝑎6
𝑅 2 2 3 4
In the seven-coefficient version, 𝑎−2 = 𝑎−1 = 0.
As simple polynomial expressions, the NASA polynomial is faster to evaluate when compared to the Wilhoit
model; however, it does not have the nice physical behavior of the Wilhoit representation. Often multiple NASA
polynomials are used to accurately represent the thermodynamics of a system over a wide temperature range;
the NASA class is available for this purpose.
Cp0
The heat capacity at zero temperature.
CpInf
The heat capacity at infinite temperature.
E0
The ground state energy (J/mol) at zero Kelvin, including zero point energy, or None if not yet specified.
Tmax
The maximum temperature at which the model is valid, or None if not defined.
Tmin
The minimum temperature at which the model is valid, or None if not defined.
as_dict(self )
c0
‘double’
Type c0
c1
‘double’
Type c1
c2
‘double’
Type c2
c3
‘double’
Type c3
c4
‘double’
Type c4
c5
‘double’
Type c5
c6
‘double’
Type c6
changeBaseEnthalpy(self, double deltaH )
Add deltaH in J/mol to the base enthalpy of formation H298.
Returns None
This module contains classes which extend Exception for usage in the RMG module
exception rmgpy.exceptions.ActionError
An exception class for errors that occur while applying reaction recipe actions. Pass a string describing the
circumstances that caused the exceptional behavior.
exception rmgpy.exceptions.AtomTypeError
An exception to be raised when an error occurs while working with atom types. Pass a string describing the
circumstances that caused the exceptional behavior.
exception rmgpy.exceptions.ChemicallySignificantEigenvaluesError
An exception raised when the chemically significant eigenvalue method is unsuccessful for any reason. Pass a
string describing the cause of the exceptional behavior.
exception rmgpy.exceptions.ChemkinError
An exception class for exceptional behavior involving Chemkin files. Pass a string describing the circumstances
that caused the exceptional behavior.
exception rmgpy.exceptions.CollisionError
An exception class for when RMG is unable to calculate collision efficiencies for the single exponential down
pressure dependent solver. Pass a string describing the circumstances that caused the exceptional behavior.
exception rmgpy.exceptions.CoreError
An exception raised if there is a problem within the model core
exception rmgpy.exceptions.DatabaseError
A exception that occurs when working with an RMG database. Pass a string giving specifics about the excep-
tional behavior.
exception rmgpy.exceptions.DependencyError
An exception that occurs when an error is encountered with a dependency. Pass a string describing the circum-
stances that caused the exception.
exception rmgpy.exceptions.ElementError
An exception class for errors that occur while working with elements. Pass a string describing the circumstances
that caused the exceptional behavior.
exception rmgpy.exceptions.ForbiddenStructureException
An exception passed when RMG encounters a forbidden structure. These are usually caught and the reaction
that created it is ignored.
exception rmgpy.exceptions.ILPSolutionError
An exception to be raised when solving an integer linear programming problem if a solution could not be found
or the solution is not valid. Can pass a string to indicate the reason that the solution is invalid.
exception rmgpy.exceptions.ImplicitBenzeneError
An exception class when encountering a group with too many implicit benzene atoms. These groups are hard to
create sample molecules and hard for users to interpret. Pass a string describing the limitation.
exception rmgpy.exceptions.InchiException
An exception used when encountering a non-valid Inchi expression are encountered. Pass a string describing
the error.
exception rmgpy.exceptions.InputError
An exception raised when parsing an input file for any module in RMG: mechanism generation, Arkane, con-
former creation, etc. Pass a string describing the error.
exception rmgpy.exceptions.InvalidActionError
An exception to be raised when an invalid action is encountered in a reaction recipe.
exception rmgpy.exceptions.InvalidAdjacencyListError
An exception used to indicate that an RMG-style adjacency list is invalid. Pass a string describing the reason
the adjacency list is invalid
exception rmgpy.exceptions.InvalidMicrocanonicalRateError(message, k_ratio=1.0,
Keq_ratio=1.0)
Used in pressure dependence when the k(E) calculation does not give the correct kf(T) or Kc(T)
badness()
How bad is the error?
Returns the max of the absolute logarithmic errors of kf and Kc
exception rmgpy.exceptions.KekulizationError
An exception to be raised when encountering an error while kekulizing an aromatic molecule. Can pass a string
to indicate the reason for failure.
exception rmgpy.exceptions.KineticsError
An exception class for problems with kinetics. This can be used when finding degeneracy in reaction generation,
modifying KineticsData objects, or finding the kinetics of reactions. Unable Pass a string describing the problem.
exception rmgpy.exceptions.ModifiedStrongCollisionError
An exception raised when the modified strong collision method is unsuccessful for any reason. Pass a string
describing the cause of the exceptional behavior.
exception rmgpy.exceptions.NegativeBarrierException
This Exception occurs when the energy barrier for a hindered Rotor is negative. This can occur if the scan or
fourier fit is poor.
exception rmgpy.exceptions.NetworkError
Raised when an error occurs while working with a pressure-dependent reaction network
exception rmgpy.exceptions.OutputError
This exception is raised whenever an error occurs while saving output information. Pass a string describing the
circumstances of the exceptional behavior.
exception rmgpy.exceptions.PressureDependenceError
An exception class to use when an error involving pressure dependence is encountered. Pass a string describing
the circumstances of the exceptional behavior.
exception rmgpy.exceptions.QuantityError
An exception to be raised when an error occurs while working with physical quantities in RMG. Pass a string
describing the circumstances of the exceptional behavior.
exception rmgpy.exceptions.ReactionError
An exception class for exceptional behavior involving Reaction objects. Pass a string describing the circum-
stances that caused the exceptional behavior.
exception rmgpy.exceptions.ReactionPairsError
An exception to be raised when an error occurs while working with reaction pairs.
exception rmgpy.exceptions.ReservoirStateError
An exception raised when the reservoir state method is unsuccessful for any reason. Pass a string describing the
cause of the exceptional behavior.
exception rmgpy.exceptions.ResonanceError
An exception class for when RMG is unable to generate resonance structures.
exception rmgpy.exceptions.SettingsError
An exception raised when dealing with settings.
exception rmgpy.exceptions.SpeciesError
An exception class for exceptional behavior that occurs while working with chemical species. Pass a string
describing the circumstances that caused the exceptional behavior.
exception rmgpy.exceptions.StatmechError
An exception used when an error occurs in estimating Statmech.
exception rmgpy.exceptions.StatmechFitError
An exception used when attempting to fit molecular degrees of freedom to heat capacity data. Pass a string
describing the circumstances of the exceptional behavior.
exception rmgpy.exceptions.UndeterminableKineticsError(reaction, message=”)
An exception raised when attempts to estimate appropriate kinetic parameters for a chemical reaction are un-
successful.
exception rmgpy.exceptions.UnexpectedChargeError(graph)
An exception class when encountering a group/molecule with unexpected charge Curently in RMG, we never
expect to see -2/+2 or greater magnitude charge, we only except +1/-1 charges on nitrogen, oxygen, sulfur or
specifically carbon monoxide/monosulfide.
Attributes: graph is the molecule or group object with the unexpected charge
exception rmgpy.exceptions.VF2Error
An exception raised if an error occurs within the VF2 graph isomorphism algorithm. Pass a string describing
the error.
269
RMG-Py API Reference, Release 2.4.1
270 Bibliography
PYTHON MODULE INDEX
a
arkane, 3
r
rmgpy.chemkin, 11
rmgpy.constants, 14
rmgpy.data, 15
rmgpy.exceptions, 266
rmgpy.kinetics, 79
rmgpy.molecule, 99
rmgpy.molecule.adjlist, 148
rmgpy.molecule.converter, 146
rmgpy.molecule.kekulize, 142
rmgpy.molecule.pathfinder, 144
rmgpy.molecule.resonance, 139
rmgpy.molecule.translator, 147
rmgpy.pdep, 152
rmgpy.qm, 161
rmgpy.quantity, 179
rmgpy.reaction, 185
rmgpy.rmg, 192
rmgpy.solver, 212
rmgpy.species, 232
rmgpy.statmech, 238
rmgpy.statmech.schrodinger, 251
rmgpy.thermo, 255
271
RMG-Py API Reference, Release 2.4.1
A method), 193
A (rmgpy.kinetics.Arrhenius attribute), 81 addPathReaction() (rmgpy.rmg.pdep.PDepNetwork
a0 (rmgpy.thermo.Wilhoit attribute), 258 method), 200
a1 (rmgpy.thermo.Wilhoit attribute), 258 addReactionLibraryToEdge()
a2 (rmgpy.thermo.Wilhoit attribute), 258 (rmgpy.rmg.model.CoreEdgeReactionModel
a3 (rmgpy.thermo.Wilhoit attribute), 259 method), 193
ActionError, 266 addReactionLibraryToOutput()
activeJRotor (rmgpy.pdep.Configuration attribute), (rmgpy.rmg.model.CoreEdgeReactionModel
156 method), 193
activeKRotor (rmgpy.pdep.Configuration attribute), addReactionsToSurface()
156 (rmgpy.solver.LiquidReactor method), 226
add_allyls (in module rmgpy.molecule.pathfinder), addReactionsToSurface()
144 (rmgpy.solver.ReactionSystem method), 212
add_inverse_allyls (in module addReactionsToSurface()
rmgpy.molecule.pathfinder), 144 (rmgpy.solver.SimpleReactor method), 218
_ _
add unsaturated bonds (in module addReactionToCore()
rmgpy.molecule.pathfinder), 144 (rmgpy.rmg.model.CoreEdgeReactionModel
addAction() (rmgpy.data.kinetics.ReactionRecipe method), 193
method), 51 addReactionToEdge()
addAtom() (rmgpy.molecule.Group method), 132 (rmgpy.rmg.model.CoreEdgeReactionModel
addAtom() (rmgpy.molecule.Molecule method), 118 method), 193
addAtomLabelsForReaction() addReactionToUnimolecularNetworks()
(rmgpy.data.kinetics.KineticsFamily method), (rmgpy.rmg.model.CoreEdgeReactionModel
30 method), 193
addBond() (rmgpy.molecule.Group method), 132 addReverseAttribute()
addBond() (rmgpy.molecule.Molecule method), 118 (rmgpy.data.kinetics.KineticsFamily method),
addEdge() (rmgpy.molecule.graph.Graph method), 103 30
addEdge() (rmgpy.molecule.Group method), 133 addSeedMechanismToCore()
addEdge() (rmgpy.molecule.Molecule method), 119 (rmgpy.rmg.model.CoreEdgeReactionModel
addEntry() (rmgpy.data.kinetics.KineticsFamily method), 193
method), 30 addSpeciesToCore() (rmgpy.rmg.model.CoreEdgeReactionModel
addExplicitLigands() (rmgpy.molecule.Group method), 193
method), 133 addSpeciesToEdge() (rmgpy.rmg.model.CoreEdgeReactionModel
addImplicitAtomsFromAtomType() method), 194
(rmgpy.molecule.Group method), 133 addVertex() (rmgpy.molecule.graph.Graph method),
addImplicitBenzene() (rmgpy.molecule.Group 103
method), 133 addVertex() (rmgpy.molecule.Group method), 133
addKineticsRulesFromTrainingSet() addVertex() (rmgpy.molecule.Molecule method), 119
(rmgpy.data.kinetics.KineticsFamily method), adjustSurface() (rmgpy.rmg.model.CoreEdgeReactionModel
30 method), 194
addNewSurfaceObjects() advance() (rmgpy.solver.LiquidReactor method), 226
(rmgpy.rmg.model.CoreEdgeReactionModel advance() (rmgpy.solver.ReactionSystem method), 212
273
RMG-Py API Reference, Release 2.4.1
274 Index
RMG-Py API Reference, Release 2.4.1
Index 275
RMG-Py API Reference, Release 2.4.1
276 Index
RMG-Py API Reference, Release 2.4.1
Index 277
RMG-Py API Reference, Release 2.4.1
278 Index
RMG-Py API Reference, Release 2.4.1
Index 279
RMG-Py API Reference, Release 2.4.1
280 Index
RMG-Py API Reference, Release 2.4.1
Index 281
RMG-Py API Reference, Release 2.4.1
282 Index
RMG-Py API Reference, Release 2.4.1
Index 283
RMG-Py API Reference, Release 2.4.1
findSubgraphIsomorphisms() fixDiffusionLimitedA()
(rmgpy.molecule.vf2.VF2 method), 106 (rmgpy.rmg.pdep.PDepReaction method),
fingerprint (rmgpy.molecule.Molecule attribute), 120 204
fingerprint (rmgpy.rmg.model.Species attribute), 209 ForbiddenStructureException, 266
fingerprint (rmgpy.species.Species attribute), 234 formBond (rmgpy.molecule.AtomType attribute), 109
finish() (rmgpy.rmg.main.RMG method), 198 fourier (rmgpy.statmech.HinderedRotor attribute), 250
fitCosinePotentialToData() frequencies (rmgpy.statmech.HarmonicOscillator at-
(rmgpy.statmech.HinderedRotor method), tribute), 248
249 frequency (rmgpy.kinetics.Eckart attribute), 99
fitFourierPotentialToData() frequency (rmgpy.kinetics.Wigner attribute), 97
(rmgpy.statmech.HinderedRotor method), frequency (rmgpy.species.TransitionState attribute),
250 237
fitInterpolationModel() frequency (rmgpy.statmech.HinderedRotor attribute),
(arkane.PressureDependenceJob method), 250
10 fromAdjacencyList() (in module
fitInterpolationModels() rmgpy.molecule.adjlist), 150
(arkane.PressureDependenceJob method), fromAdjacencyList() (rmgpy.molecule.Group
10 method), 134
fitStatmechDirect() (in module fromAdjacencyList() (rmgpy.molecule.Molecule
rmgpy.data.statmechfit), 54 method), 120
fitStatmechPseudo() (in module fromAdjacencyList() (rmgpy.rmg.model.Species
rmgpy.data.statmechfit), 55 method), 209
fitStatmechPseudoRotors() (in module fromAdjacencyList() (rmgpy.species.Species
rmgpy.data.statmechfit), 55 method), 234
fitStatmechToHeatCapacity() (in module fromAugmentedInChI (in module
rmgpy.data.statmechfit), 54 rmgpy.molecule.translator), 147
fitToData() (rmgpy.kinetics.Arrhenius method), 81 fromAugmentedInChI() (rmgpy.molecule.Molecule
fitToData() (rmgpy.kinetics.Chebyshev method), 90 method), 120
fitToData() (rmgpy.kinetics.PDepArrhenius method), fromInChI (in module rmgpy.molecule.translator), 147
86 fromInChI() (rmgpy.molecule.Molecule method), 120
fitToData() (rmgpy.thermo.Wilhoit method), 259 fromOBMol (in module rmgpy.molecule.converter), 146
fitToDataForConstantB() (rmgpy.thermo.Wilhoit fromRDKitMol (in module rmgpy.molecule.converter),
method), 259 146
fixBarrierHeight() (rmgpy.data.kinetics.DepositoryReaction
fromSMARTS (in module rmgpy.molecule.translator), 147
method), 20 fromSMARTS() (rmgpy.molecule.Molecule method), 120
fixBarrierHeight() (rmgpy.data.kinetics.LibraryReaction
fromSMILES (in module rmgpy.molecule.translator), 147
method), 46 fromSMILES() (rmgpy.molecule.Molecule method), 121
fixBarrierHeight() (rmgpy.data.kinetics.TemplateReaction
fromSMILES() (rmgpy.rmg.model.Species method), 209
method), 65 fromSMILES() (rmgpy.species.Species method), 234
fixBarrierHeight() (rmgpy.reaction.Reaction fromXYZ() (rmgpy.molecule.Molecule method), 121
method), 188
fixBarrierHeight() (rmgpy.rmg.pdep.PDepReaction G
method), 204 Gaussian (class in rmgpy.qm.gaussian), 167
fixDiffusionLimitedA() GaussianLog (class in arkane.gaussian), 4
(rmgpy.data.kinetics.DepositoryReaction GaussianMol (class in rmgpy.qm.gaussian), 167
method), 20 GaussianMolPM3 (class in rmgpy.qm.gaussian), 169
fixDiffusionLimitedA() GaussianMolPM6 (class in rmgpy.qm.gaussian), 170
(rmgpy.data.kinetics.LibraryReaction method), generate3dTS() (rmgpy.data.kinetics.DepositoryReaction
46 method), 20
fixDiffusionLimitedA() generate3dTS() (rmgpy.data.kinetics.LibraryReaction
(rmgpy.data.kinetics.TemplateReaction method), 46
method), 65 generate3dTS() (rmgpy.data.kinetics.TemplateReaction
fixDiffusionLimitedA() (rmgpy.reaction.Reaction method), 65
method), 188
284 Index
RMG-Py API Reference, Release 2.4.1
Index 285
RMG-Py API Reference, Release 2.4.1
286 Index
RMG-Py API Reference, Release 2.4.1
generateThermoData() get_optical_isomers_and_symmetry_number()
(rmgpy.qm.mopac.MopacMolPM6 method), (arkane.qchem.QChemLog method), 5
176 get_rate_filtered_reactions()
generateThermoData() (rmgpy.rmg.pdep.PDepNetwork method),
(rmgpy.qm.mopac.MopacMolPM7 method), 201
178 get_reduced_mass() (rmgpy.data.kinetics.DepositoryReaction
generateTransportData() method), 22
(rmgpy.rmg.model.Species method), 209 get_reduced_mass() (rmgpy.data.kinetics.LibraryReaction
generateTransportData() (rmgpy.species.Species method), 47
method), 234 get_reduced_mass() (rmgpy.data.kinetics.TemplateReaction
generateTree() (rmgpy.data.kinetics.KineticsFamily method), 66
method), 32 get_reduced_mass() (rmgpy.reaction.Reaction
generic (rmgpy.molecule.AtomType attribute), 109 method), 189
generic_visit() (arkane.output.PrettifyVisitor get_reduced_mass() (rmgpy.rmg.pdep.PDepReaction
method), 8 method), 205
Geometry (class in rmgpy.qm.molecule), 163 get_species_index() (rmgpy.solver.LiquidReactor
get_bond_string() (rmgpy.molecule.Bond method), method), 227
117 get_species_index() (rmgpy.solver.ReactionSystem
get_constSPCIndices() method), 214
(rmgpy.solver.LiquidReactor method), 227 get_species_index() (rmgpy.solver.SimpleReactor
get_descriptor() (rmgpy.molecule.Atom method), method), 220
114 get_thermo_data_from_ml()
get_edges_in_cycle() (rmgpy.data.thermo.ThermoDatabase method),
(rmgpy.molecule.graph.Graph method), 70
104 get_threshold_rate_constants()
get_edges_in_cycle() (rmgpy.molecule.Group (rmgpy.solver.LiquidReactor method), 227
method), 136 get_threshold_rate_constants()
get_edges_in_cycle() (rmgpy.molecule.Molecule (rmgpy.solver.SimpleReactor method), 220
method), 123 getActiveModes() (rmgpy.statmech.Conformer
get_element_count() (rmgpy.molecule.Group method), 253
method), 136 getAllCycles() (rmgpy.molecule.graph.Graph
get_element_count() (rmgpy.molecule.Molecule method), 103
method), 124 getAllCycles() (rmgpy.molecule.Group method), 134
get_energy_filtered_reactions() getAllCycles() (rmgpy.molecule.Molecule method),
(rmgpy.rmg.pdep.PDepNetwork method), 121
201 getAllCyclesOfSize()
get_mean_sigma_and_epsilon() (rmgpy.molecule.graph.Graph method),
(rmgpy.data.kinetics.DepositoryReaction 103
method), 22 getAllCyclesOfSize() (rmgpy.molecule.Group
get_mean_sigma_and_epsilon() method), 134
(rmgpy.data.kinetics.LibraryReaction method), getAllCyclesOfSize() (rmgpy.molecule.Molecule
47 method), 121
get_mean_sigma_and_epsilon() getAllCyclicVertices()
(rmgpy.data.kinetics.TemplateReaction (rmgpy.molecule.graph.Graph method),
method), 66 103
get_mean_sigma_and_epsilon() getAllCyclicVertices() (rmgpy.molecule.Group
(rmgpy.reaction.Reaction method), 189 method), 134
get_mean_sigma_and_epsilon() getAllCyclicVertices() (rmgpy.molecule.Molecule
(rmgpy.rmg.pdep.PDepReaction method), method), 121
205 getAllEdges() (rmgpy.molecule.graph.Graph
get_optical_isomers_and_symmetry_number() method), 103
(arkane.gaussian.GaussianLog method), 4 getAllEdges() (rmgpy.molecule.Group method), 134
get_optical_isomers_and_symmetry_number() getAllEdges() (rmgpy.molecule.Molecule method),
(arkane.molpro.MolproLog method), 6 121
Index 287
RMG-Py API Reference, Release 2.4.1
getAllPolycyclicVertices() method), 96
(rmgpy.molecule.graph.Graph method), getCenterOfMass() (rmgpy.statmech.Conformer
104 method), 253
getAllPolycyclicVertices() getChargeSpan() (rmgpy.molecule.Molecule method),
(rmgpy.molecule.Group method), 134 122
getAllPolycyclicVertices() getConversionFactorFromSI()
(rmgpy.molecule.Molecule method), 121 (rmgpy.quantity.ArrayQuantity method),
getAllRules() (rmgpy.data.kinetics.KineticsRules 183
method), 42 getConversionFactorFromSI()
getAllSimpleCyclesOfSize() (rmgpy.quantity.ScalarQuantity method),
(rmgpy.molecule.graph.Graph method), 181
104 getConversionFactorFromSItoCmMolS()
getAllSimpleCyclesOfSize() (rmgpy.quantity.ArrayQuantity method),
(rmgpy.molecule.Group method), 134 183
getAllSimpleCyclesOfSize() getConversionFactorFromSItoCmMolS()
(rmgpy.molecule.Molecule method), 121 (rmgpy.quantity.ScalarQuantity method),
getAllSpecies() (rmgpy.pdep.Network method), 159 181
getAllSpecies() (rmgpy.rmg.pdep.PDepNetwork getConversionFactorToSI()
method), 201 (rmgpy.quantity.ArrayQuantity method),
getAllThermoData() (rmgpy.data.thermo.ThermoDatabase 183
method), 70 getConversionFactorToSI()
getAlpha() (rmgpy.pdep.SingleExponentialDown (rmgpy.quantity.ScalarQuantity method),
method), 154 181
getAromaticRings() (rmgpy.molecule.Molecule getCrudeMolFilePath()
method), 121 (rmgpy.qm.molecule.Geometry method),
getAtomType() (in module rmgpy.molecule), 110 163
getAugmentedInChI() (rmgpy.rmg.model.Species getDensityOfStates() (in module
method), 209 rmgpy.statmech.schrodinger), 251
getAugmentedInChI() (rmgpy.species.Species getDensityOfStates() (rmgpy.rmg.model.Species
method), 234 method), 209
getBackboneRoots() (rmgpy.data.kinetics.KineticsFamilygetDensityOfStates() (rmgpy.species.Species
method), 32 method), 234
getBDE() (rmgpy.molecule.Bond method), 116 getDensityOfStates()
getBond() (rmgpy.molecule.Group method), 135 (rmgpy.species.TransitionState method),
getBond() (rmgpy.molecule.Molecule method), 121 237
getBondOrdersForAtom() (rmgpy.molecule.Atom getDensityOfStates() (rmgpy.statmech.Conformer
method), 114 method), 253
getBonds() (rmgpy.molecule.Group method), 135 getDensityOfStates()
getBonds() (rmgpy.molecule.Molecule method), 122 (rmgpy.statmech.HarmonicOscillator method),
getCanteraEfficiencies() 248
(rmgpy.kinetics.Chebyshev method), 90 getDensityOfStates()
getCanteraEfficiencies() (rmgpy.statmech.HinderedRotor method),
(rmgpy.kinetics.Lindemann method), 94 250
getCanteraEfficiencies() getDensityOfStates()
(rmgpy.kinetics.MultiPDepArrhenius method), (rmgpy.statmech.IdealGasTranslation method),
88 240
getCanteraEfficiencies() getDensityOfStates() (rmgpy.statmech.KRotor
(rmgpy.kinetics.PDepArrhenius method), method), 244
86 getDensityOfStates() (rmgpy.statmech.LinearRotor
getCanteraEfficiencies() method), 242
(rmgpy.kinetics.PDepKineticsData method), 84 getDensityOfStates()
getCanteraEfficiencies() (rmgpy.statmech.NonlinearRotor method),
(rmgpy.kinetics.ThirdBody method), 92 243
getCanteraEfficiencies() (rmgpy.kinetics.Troe getDensityOfStates()
288 Index
RMG-Py API Reference, Release 2.4.1
Index 289
RMG-Py API Reference, Release 2.4.1
290 Index
RMG-Py API Reference, Release 2.4.1
Index 291
RMG-Py API Reference, Release 2.4.1
292 Index
RMG-Py API Reference, Release 2.4.1
Index 293
RMG-Py API Reference, Release 2.4.1
294 Index
RMG-Py API Reference, Release 2.4.1
method), 38 235
getSpecies() (rmgpy.data.kinetics.KineticsLibrary getSumOfStates() (rmgpy.species.TransitionState
method), 40 method), 237
getSpecies() (rmgpy.data.kinetics.KineticsRules getSumOfStates() (rmgpy.statmech.Conformer
method), 42 method), 254
getSpecies() (rmgpy.data.statmech.StatmechDepository getSumOfStates() (rmgpy.statmech.HarmonicOscillator
method), 53 method), 248
getSpecies() (rmgpy.data.statmech.StatmechGroups getSumOfStates() (rmgpy.statmech.HinderedRotor
method), 59 method), 250
getSpecies() (rmgpy.data.statmech.StatmechLibrary getSumOfStates() (rmgpy.statmech.IdealGasTranslation
method), 61 method), 240
getSpecies() (rmgpy.data.thermo.ThermoDepository getSumOfStates() (rmgpy.statmech.KRotor method),
method), 72 245
getSpecies() (rmgpy.data.thermo.ThermoGroups getSumOfStates() (rmgpy.statmech.LinearRotor
method), 75 method), 242
getSpecies() (rmgpy.data.thermo.ThermoLibrary getSumOfStates() (rmgpy.statmech.NonlinearRotor
method), 77 method), 243
getSpeciesIdentifier() (in module getSumOfStates() (rmgpy.statmech.SphericalTopRotor
rmgpy.chemkin), 14 method), 246
getStatmechData() (rmgpy.data.statmech.StatmechDatabase
getSurfaceRateCoefficient()
method), 51 (rmgpy.data.kinetics.DepositoryReaction
getStatmechData() (rmgpy.data.statmech.StatmechGroups method), 22
method), 59 getSurfaceRateCoefficient()
getStatmechDataFromDepository() (rmgpy.data.kinetics.LibraryReaction method),
(rmgpy.data.statmech.StatmechDatabase 47
method), 51 getSurfaceRateCoefficient()
getStatmechDataFromGroups() (rmgpy.data.kinetics.TemplateReaction
(rmgpy.data.statmech.StatmechDatabase method), 66
method), 51 getSurfaceRateCoefficient()
getStatmechDataFromLibrary() (rmgpy.reaction.Reaction method), 189
(rmgpy.data.statmech.StatmechDatabase getSurfaceRateCoefficient()
method), 51 (rmgpy.rmg.pdep.PDepReaction method),
getStoichiometricCoefficient() 205
(rmgpy.data.kinetics.DepositoryReaction getSymmetricTopRotors()
method), 22 (rmgpy.statmech.Conformer method), 254
getStoichiometricCoefficient() getSymmetryNumber() (rmgpy.molecule.Molecule
(rmgpy.data.kinetics.LibraryReaction method), method), 123
47 getSymmetryNumber() (rmgpy.rmg.model.Species
getStoichiometricCoefficient() method), 210
(rmgpy.data.kinetics.TemplateReaction getSymmetryNumber() (rmgpy.species.Species
method), 66 method), 235
getStoichiometricCoefficient() getThermoData() (rmgpy.data.thermo.ThermoDatabase
(rmgpy.reaction.Reaction method), 189 method), 70
getStoichiometricCoefficient() getThermoData() (rmgpy.qm.main.QMCalculator
(rmgpy.rmg.pdep.PDepReaction method), method), 163
205 getThermoData() (rmgpy.rmg.model.Species method),
getStoichiometryMatrix() 210
(rmgpy.rmg.model.CoreEdgeReactionModel getThermoData() (rmgpy.species.Species method), 235
method), 195 getThermoDataForSurfaceSpecies()
getSumOfStates() (in module (rmgpy.data.thermo.ThermoDatabase method),
rmgpy.statmech.schrodinger), 252 70
getSumOfStates() (rmgpy.rmg.model.Species getThermoDataFromDepository()
method), 210 (rmgpy.data.thermo.ThermoDatabase method),
getSumOfStates() (rmgpy.species.Species method), 70
Index 295
RMG-Py API Reference, Release 2.4.1
296 Index
RMG-Py API Reference, Release 2.4.1
Index 297
RMG-Py API Reference, Release 2.4.1
298 Index
RMG-Py API Reference, Release 2.4.1
Index 299
RMG-Py API Reference, Release 2.4.1
300 Index
RMG-Py API Reference, Release 2.4.1
Index 301
RMG-Py API Reference, Release 2.4.1
K L
k_effective_cache (rmgpy.data.kinetics.DepositoryReaction
label (rmgpy.data.kinetics.DepositoryReaction at-
attribute), 23 tribute), 23
_ _
k effective cache (rmgpy.data.kinetics.LibraryReaction label (rmgpy.data.kinetics.LibraryReaction attribute),
attribute), 48 48
k_effective_cache (rmgpy.data.kinetics.TemplateReactionlabel (rmgpy.data.kinetics.TemplateReaction attribute),
attribute), 67 68
_ _
k effective cache (rmgpy.reaction.Reaction at- label (rmgpy.molecule.Atom attribute), 115
tribute), 190 label (rmgpy.molecule.AtomType attribute), 109
_ _
k effective cache (rmgpy.rmg.pdep.PDepReaction label (rmgpy.molecule.GroupAtom attribute), 130
attribute), 206 label (rmgpy.reaction.Reaction attribute), 190
kb (rmgpy.solver.LiquidReactor attribute), 228 label (rmgpy.rmg.model.Species attribute), 211
kb (rmgpy.solver.ReactionSystem attribute), 214 label (rmgpy.rmg.pdep.PDepNetwork attribute), 201
kb (rmgpy.solver.SimpleReactor attribute), 221 label (rmgpy.rmg.pdep.PDepReaction attribute), 206
kdata (rmgpy.kinetics.KineticsData attribute), 80 label (rmgpy.species.Species attribute), 236
kdata (rmgpy.kinetics.PDepKineticsData attribute), 85 label (rmgpy.species.TransitionState attribute), 237
KekulizationError, 267 label (rmgpy.thermo.NASA attribute), 262
kekulize() (in module rmgpy.molecule.kekulize), 144 label (rmgpy.thermo.NASAPolynomial attribute), 265
kekulize() (rmgpy.molecule.kekulize.AromaticRing label (rmgpy.thermo.ThermoData attribute), 256
method), 143 label (rmgpy.thermo.Wilhoit attribute), 259
kekulize() (rmgpy.molecule.Molecule method), 125 LibraryReaction (class in rmgpy.data.kinetics), 44
Keq (rmgpy.solver.LiquidReactor attribute), 225 Lindemann (class in rmgpy.kinetics), 93
Keq (rmgpy.solver.ReactionSystem attribute), 212 LinearRotor (class in rmgpy.statmech), 241
Keq (rmgpy.solver.SimpleReactor attribute), 218 LiquidReactor (class in rmgpy.solver), 225
keywords (rmgpy.qm.gaussian.GaussianMolPM3 load() (arkane.StatMechJob method), 11
attribute), 170 load() (rmgpy.data.base.Database method), 17
keywords (rmgpy.qm.gaussian.GaussianMolPM6 load() (rmgpy.data.kinetics.KineticsDatabase method),
attribute), 171 26
keywords (rmgpy.qm.mopac.MopacMol attribute), 174 load() (rmgpy.data.kinetics.KineticsFamily method), 34
kf (rmgpy.solver.LiquidReactor attribute), 228 load() (rmgpy.data.kinetics.KineticsGroups method),
kf (rmgpy.solver.ReactionSystem attribute), 214 38
kf (rmgpy.solver.SimpleReactor attribute), 221 load() (rmgpy.data.kinetics.KineticsRules method), 42
kinetics (rmgpy.data.kinetics.DepositoryReaction at- load() (rmgpy.data.statmech.StatmechDatabase
tribute), 23 method), 51
302 Index
RMG-Py API Reference, Release 2.4.1
Index 303
RMG-Py API Reference, Release 2.4.1
40 method), 38
loadOldDictionary() loadOldTree() (rmgpy.data.kinetics.KineticsLibrary
(rmgpy.data.kinetics.KineticsRules method), 43 method), 40
loadOldDictionary() loadOldTree() (rmgpy.data.kinetics.KineticsRules
(rmgpy.data.statmech.StatmechDepository method), 43
method), 53 loadOldTree() (rmgpy.data.statmech.StatmechDepository
loadOldDictionary() method), 53
(rmgpy.data.statmech.StatmechGroups loadOldTree() (rmgpy.data.statmech.StatmechGroups
method), 59 method), 60
loadOldDictionary() loadOldTree() (rmgpy.data.statmech.StatmechLibrary
(rmgpy.data.statmech.StatmechLibrary method), 62
method), 62 loadOldTree() (rmgpy.data.thermo.ThermoDepository
loadOldDictionary() method), 73
(rmgpy.data.thermo.ThermoDepository loadOldTree() (rmgpy.data.thermo.ThermoGroups
method), 73 method), 75
loadOldDictionary() loadOldTree() (rmgpy.data.thermo.ThermoLibrary
(rmgpy.data.thermo.ThermoGroups method), method), 77
75 loadRecipe() (rmgpy.data.kinetics.KineticsFamily
loadOldDictionary() method), 35
(rmgpy.data.thermo.ThermoLibrary method), loadRecommendedFamiliesList()
77 (rmgpy.data.kinetics.KineticsDatabase
loadOldLibrary() (rmgpy.data.base.Database method), 27
method), 17 loadRestartFile() (rmgpy.rmg.main.RMG method),
loadOldLibrary() (rmgpy.data.kinetics.KineticsDepository 198
method), 28 loadRMGJavaInput() (rmgpy.rmg.main.RMG
loadOldLibrary() (rmgpy.data.kinetics.KineticsFamily method), 198
method), 35 loadScanEnergies() (arkane.gaussian.GaussianLog
loadOldLibrary() (rmgpy.data.kinetics.KineticsGroups method), 5
method), 38 loadScanEnergies() (arkane.molpro.MolproLog
loadOldLibrary() (rmgpy.data.kinetics.KineticsLibrary method), 6
method), 40 loadScanEnergies() (arkane.qchem.QChemLog
loadOldLibrary() (rmgpy.data.kinetics.KineticsRules method), 5
method), 43 loadSpeciesDictionary() (in module
loadOldLibrary() (rmgpy.data.statmech.StatmechDepository rmgpy.chemkin), 12
method), 53 loadTemplate() (rmgpy.data.kinetics.KineticsFamily
loadOldLibrary() (rmgpy.data.statmech.StatmechGroups method), 35
method), 60 loadThermoData() (rmgpy.qm.gaussian.GaussianMol
loadOldLibrary() (rmgpy.data.statmech.StatmechLibrary method), 168
method), 62 loadThermoData() (rmgpy.qm.gaussian.GaussianMolPM3
loadOldLibrary() (rmgpy.data.thermo.ThermoDepository method), 170
method), 73 loadThermoData() (rmgpy.qm.gaussian.GaussianMolPM6
loadOldLibrary() (rmgpy.data.thermo.ThermoGroups method), 171
method), 75 loadThermoData() (rmgpy.qm.molecule.QMMolecule
loadOldLibrary() (rmgpy.data.thermo.ThermoLibrary method), 165
method), 77 loadThermoData() (rmgpy.qm.mopac.MopacMol
loadOldTemplate() (rmgpy.data.kinetics.KineticsFamily method), 174
method), 35 loadThermoData() (rmgpy.qm.mopac.MopacMolPM3
loadOldTree() (rmgpy.data.base.Database method), method), 175
18 loadThermoData() (rmgpy.qm.mopac.MopacMolPM6
loadOldTree() (rmgpy.data.kinetics.KineticsDepository method), 177
method), 28 loadThermoData() (rmgpy.qm.mopac.MopacMolPM7
loadOldTree() (rmgpy.data.kinetics.KineticsFamily method), 178
method), 35 loadThermoInput() (rmgpy.rmg.main.RMG method),
loadOldTree() (rmgpy.data.kinetics.KineticsGroups 198
304 Index
RMG-Py API Reference, Release 2.4.1
Index 305
RMG-Py API Reference, Release 2.4.1
306 Index
RMG-Py API Reference, Release 2.4.1
Index 307
RMG-Py API Reference, Release 2.4.1
308 Index
RMG-Py API Reference, Release 2.4.1
parseOldLibrary() (rmgpy.data.statmech.StatmechLibrary
poly1 (rmgpy.thermo.NASA attribute), 262
method), 62 poly2 (rmgpy.thermo.NASA attribute), 262
parseOldLibrary() (rmgpy.data.thermo.ThermoDepository
poly3 (rmgpy.thermo.NASA attribute), 262
method), 73 polynomials (rmgpy.thermo.NASA attribute), 262
parseOldLibrary() (rmgpy.data.thermo.ThermoGroups populate_resonance_algorithms (in module
method), 76 rmgpy.molecule.resonance), 142
parseOldLibrary() (rmgpy.data.thermo.ThermoLibrary Prange (rmgpy.solver.SimpleReactor attribute), 218
method), 78 PressureDependenceError, 267
Pdata (rmgpy.kinetics.PDepKineticsData attribute), 84 PressureDependenceJob (class in arkane), 9
PDepArrhenius (class in rmgpy.kinetics), 85 pressures (rmgpy.kinetics.PDepArrhenius attribute),
pdepColliderKinetics (rmgpy.solver.SimpleReactor 87
attribute), 222 prettify() (in module arkane.output), 8
pdepColliderReactionIndices PrettifyVisitor (class in arkane.output), 8
(rmgpy.solver.SimpleReactor attribute), 222 printEnlargeSummary()
PDepKineticsData (class in rmgpy.kinetics), 83 (rmgpy.rmg.model.CoreEdgeReactionModel
PDepNetwork (class in rmgpy.rmg.pdep), 200 method), 195
PDepReaction (class in rmgpy.rmg.pdep), 202 printSummary() (rmgpy.pdep.Network method), 159
pdepSpecificColliderKinetics printSummary() (rmgpy.rmg.pdep.PDepNetwork
(rmgpy.solver.SimpleReactor attribute), 222 method), 201
pdepSpecificColliderReactionIndices prioritizeThermo() (rmgpy.data.thermo.ThermoDatabase
(rmgpy.solver.SimpleReactor attribute), 223 method), 71
pickWildcards() (rmgpy.molecule.Group method), process_bonds() (rmgpy.molecule.kekulize.AromaticRing
137 method), 143
Plist (arkane.PressureDependenceJob attribute), 9 processNewReactions()
plot() (arkane.KineticsJob method), 7 (rmgpy.rmg.model.CoreEdgeReactionModel
plot() (arkane.PressureDependenceJob method), 10 method), 195
plot() (arkane.ThermoJob method), 11 processOldLibraryEntry()
plotHinderedRotor() (arkane.StatMechJob method), (rmgpy.data.kinetics.KineticsRules method), 43
11 processOldLibraryEntry()
Pmax (arkane.PressureDependenceJob attribute), 9 (rmgpy.data.statmech.StatmechGroups
Pmax (rmgpy.kinetics.Arrhenius attribute), 81 method), 60
Pmax (rmgpy.kinetics.Chebyshev attribute), 89 processOldLibraryEntry()
Pmax (rmgpy.kinetics.KineticsData attribute), 79 (rmgpy.data.statmech.StatmechLibrary
Pmax (rmgpy.kinetics.Lindemann attribute), 93 method), 62
Pmax (rmgpy.kinetics.MultiArrhenius attribute), 82 processOldLibraryEntry()
Pmax (rmgpy.kinetics.MultiPDepArrhenius attribute), 87 (rmgpy.data.thermo.ThermoGroups method),
Pmax (rmgpy.kinetics.PDepArrhenius attribute), 85 76
Pmax (rmgpy.kinetics.PDepKineticsData attribute), 84 processOldLibraryEntry()
Pmax (rmgpy.kinetics.ThirdBody attribute), 91 (rmgpy.data.thermo.ThermoLibrary method),
Pmax (rmgpy.kinetics.Troe attribute), 95 78
Pmin (arkane.PressureDependenceJob attribute), 9 processPdepNetworks() (rmgpy.rmg.main.RMG
Pmin (rmgpy.kinetics.Arrhenius attribute), 81 method), 199
Pmin (rmgpy.kinetics.Chebyshev attribute), 89 processProfileStats() (in module
Pmin (rmgpy.kinetics.KineticsData attribute), 80 rmgpy.rmg.main), 199
Pmin (rmgpy.kinetics.Lindemann attribute), 93 processReactionsToSpecies()
Pmin (rmgpy.kinetics.MultiArrhenius attribute), 82 (rmgpy.rmg.main.RMG method), 199
Pmin (rmgpy.kinetics.MultiPDepArrhenius attribute), 87 processToSpeciesNetworks()
Pmin (rmgpy.kinetics.PDepArrhenius attribute), 86 (rmgpy.rmg.main.RMG method), 199
Pmin (rmgpy.kinetics.PDepKineticsData attribute), 84 productIndices (rmgpy.solver.LiquidReactor at-
Pmin (rmgpy.kinetics.ThirdBody attribute), 91 tribute), 229
Pmin (rmgpy.kinetics.Troe attribute), 95 productIndices (rmgpy.solver.ReactionSystem at-
PointGroup (class in rmgpy.qm.symmetry), 166 tribute), 216
PointGroupCalculator (class in productIndices (rmgpy.solver.SimpleReactor at-
rmgpy.qm.symmetry), 166 tribute), 223
Index 309
RMG-Py API Reference, Release 2.4.1
310 Index
RMG-Py API Reference, Release 2.4.1
Index 311
RMG-Py API Reference, Release 2.4.1
312 Index
RMG-Py API Reference, Release 2.4.1
S saveDictionary() (rmgpy.data.kinetics.KineticsLibrary
S0 (rmgpy.thermo.Wilhoit attribute), 258 method), 41
S298 (rmgpy.thermo.ThermoData attribute), 255 saveDictionary() (rmgpy.data.kinetics.KineticsRules
saturate_radicals() (rmgpy.molecule.Molecule method), 44
method), 126 saveDictionary() (rmgpy.data.statmech.StatmechDepository
saturate_unfilled_valence() method), 54
(rmgpy.molecule.Molecule method), 126 saveDictionary() (rmgpy.data.statmech.StatmechGroups
save() (arkane.KineticsJob method), 7 method), 60
save() (arkane.PressureDependenceJob method), 10 saveDictionary() (rmgpy.data.statmech.StatmechLibrary
save() (arkane.StatMechJob method), 11 method), 63
save() (arkane.ThermoJob method), 11 saveDictionary() (rmgpy.data.thermo.ThermoDepository
save() (rmgpy.data.base.Database method), 18 method), 74
save() (rmgpy.data.kinetics.KineticsDatabase method), saveDictionary() (rmgpy.data.thermo.ThermoGroups
27 method), 76
save() (rmgpy.data.kinetics.KineticsDepository saveDictionary() (rmgpy.data.thermo.ThermoLibrary
method), 29 method), 78
save() (rmgpy.data.kinetics.KineticsFamily method), 36 saveDiffHTML() (in module rmgpy.rmg.output), 200
save() (rmgpy.data.kinetics.KineticsGroups method), saveEntry() (rmgpy.data.kinetics.KineticsDepository
39 method), 29
save() (rmgpy.data.kinetics.KineticsLibrary method), saveEntry() (rmgpy.data.kinetics.KineticsFamily
41 method), 36
save() (rmgpy.data.kinetics.KineticsRules method), 44 saveEntry() (rmgpy.data.kinetics.KineticsLibrary
save() (rmgpy.data.statmech.StatmechDatabase method), 41
method), 52 saveEntry() (rmgpy.data.kinetics.KineticsRules
save() (rmgpy.data.statmech.StatmechDepository method), 44
method), 54 saveEntry() (rmgpy.data.statmech.StatmechDepository
save() (rmgpy.data.statmech.StatmechGroups method), method), 54
60 saveEntry() (rmgpy.data.statmech.StatmechGroups
save() (rmgpy.data.statmech.StatmechLibrary method), method), 61
63 saveEntry() (rmgpy.data.statmech.StatmechLibrary
save() (rmgpy.data.thermo.ThermoDatabase method), method), 63
71 saveEntry() (rmgpy.data.thermo.ThermoDepository
save() (rmgpy.data.thermo.ThermoDepository method), method), 74
74 saveEntry() (rmgpy.data.thermo.ThermoGroups
save() (rmgpy.data.thermo.ThermoGroups method), 76 method), 76
save() (rmgpy.data.thermo.ThermoLibrary method), 78 saveEntry() (rmgpy.data.thermo.ThermoLibrary
saveChemkinFile() (in module rmgpy.chemkin), 13 method), 78
saveCoordinatesFromQMData() saveEverything() (rmgpy.rmg.main.RMG method),
(rmgpy.qm.molecule.Geometry method), 199
164 saveFamilies() (rmgpy.data.kinetics.KineticsDatabase
saveDepository() (rmgpy.data.kinetics.KineticsFamily method), 27
method), 36 saveGeneratedTree()
saveDepository() (rmgpy.data.statmech.StatmechDatabase (rmgpy.data.kinetics.KineticsFamily method),
method), 52 36
saveDepository() (rmgpy.data.thermo.ThermoDatabasesaveGroups() (rmgpy.data.kinetics.KineticsFamily
method), 71 method), 36
saveDictionary() (rmgpy.data.base.Database saveGroups() (rmgpy.data.statmech.StatmechDatabase
method), 18 method), 52
saveGroups()
saveDictionary() (rmgpy.data.kinetics.KineticsDepository (rmgpy.data.thermo.ThermoDatabase
method), 29 method), 71
saveDictionary() (rmgpy.data.kinetics.KineticsFamily saveHTMLFile() (in module rmgpy.chemkin), 13
method), 36 saveInput() (rmgpy.rmg.main.RMG method), 199
saveDictionary() (rmgpy.data.kinetics.KineticsGroups saveInputFile() (arkane.PressureDependenceJob
method), 39 method), 10
Index 313
RMG-Py API Reference, Release 2.4.1
314 Index
RMG-Py API Reference, Release 2.4.1
Index 315
RMG-Py API Reference, Release 2.4.1
316 Index
RMG-Py API Reference, Release 2.4.1
Index 317
RMG-Py API Reference, Release 2.4.1
318 Index
RMG-Py API Reference, Release 2.4.1
Index 319
RMG-Py API Reference, Release 2.4.1
unimolecularThreshold validLayeringIndices
(rmgpy.solver.SimpleReactor attribute), 225 (rmgpy.solver.ReactionSystem attribute),
uniqueID (rmgpy.qm.molecule.Geometry attribute), 164 218
uniqueID (rmgpy.qm.symmetry.SymmetryJob attribute), validLayeringIndices (rmgpy.solver.SimpleReactor
166 attribute), 225
uniqueIDlong (rmgpy.qm.molecule.Geometry at- value (rmgpy.quantity.ArrayQuantity attribute), 184
tribute), 164 value (rmgpy.quantity.ScalarQuantity attribute), 182
unitDegeneracy() (in module value_si (rmgpy.quantity.ArrayQuantity attribute), 184
rmgpy.statmech.schrodinger), 252 value_si (rmgpy.quantity.ScalarQuantity attribute),
units (rmgpy.quantity.ArrayQuantity attribute), 184 182
units (rmgpy.quantity.ScalarQuantity attribute), 182 verifyOutputFile() (rmgpy.qm.gaussian.Gaussian
unresolved (rmgpy.molecule.kekulize.AromaticRing at- method), 167
tribute), 143 verifyOutputFile() (rmgpy.qm.gaussian.GaussianMol
update() (rmgpy.molecule.Group method), 139 method), 168
update() (rmgpy.molecule.kekulize.AromaticBond verifyOutputFile() (rmgpy.qm.gaussian.GaussianMolPM3
method), 143 method), 170
update() (rmgpy.molecule.kekulize.AromaticRing verifyOutputFile() (rmgpy.qm.gaussian.GaussianMolPM6
method), 143 method), 172
update() (rmgpy.molecule.Molecule method), 128 verifyOutputFile() (rmgpy.qm.mopac.Mopac
update() (rmgpy.rmg.pdep.PDepNetwork method), 202 method), 172
update_charge() (rmgpy.molecule.Group method), verifyOutputFile() (rmgpy.qm.mopac.MopacMol
139 method), 174
updateAtomTypes() (rmgpy.molecule.Molecule verifyOutputFile() (rmgpy.qm.mopac.MopacMolPM3
method), 128 method), 175
updateCharge() (rmgpy.molecule.Atom method), 116 verifyOutputFile() (rmgpy.qm.mopac.MopacMolPM6
updateConfigurations() method), 177
(rmgpy.rmg.pdep.PDepNetwork method), verifyOutputFile() (rmgpy.qm.mopac.MopacMolPM7
202 method), 179
updateConnectivityValues() Vertex (class in rmgpy.molecule.graph), 101
(rmgpy.molecule.graph.Graph method), vertex1 (rmgpy.molecule.Bond attribute), 117
106 vertex1 (rmgpy.molecule.graph.Edge attribute), 102
updateConnectivityValues() vertex1 (rmgpy.molecule.GroupBond attribute), 132
(rmgpy.molecule.Group method), 139 vertex2 (rmgpy.molecule.Bond attribute), 117
updateConnectivityValues() vertex2 (rmgpy.molecule.graph.Edge attribute), 102
(rmgpy.molecule.Molecule method), 128 vertex2 (rmgpy.molecule.GroupBond attribute), 132
updateFingerprint() (rmgpy.molecule.Group vertices (rmgpy.molecule.graph.Graph attribute), 106
method), 139 vertices (rmgpy.molecule.Group attribute), 139
updateLonePairs() (rmgpy.molecule.Molecule vertices (rmgpy.molecule.Molecule attribute), 128
method), 128 VF2 (class in rmgpy.molecule.vf2), 106
updateMultiplicity() (rmgpy.molecule.Molecule VF2Error, 268
method), 128 viscosity (rmgpy.solver.LiquidReactor attribute), 232
updateReactionThresholdAndReactFlags() visit() (arkane.output.PrettifyVisitor method), 8
(rmgpy.rmg.main.RMG method), 199 visit_Call() (arkane.output.PrettifyVisitor method), 8
updateUnimolecularReactionNetworks() visit_Dict() (arkane.output.PrettifyVisitor method), 8
(rmgpy.rmg.model.CoreEdgeReactionModel visit_List() (arkane.output.PrettifyVisitor method), 8
method), 196 visit_Num() (arkane.output.PrettifyVisitor method), 8
usePolar (rmgpy.qm.mopac.Mopac attribute), 172 visit_Str() (arkane.output.PrettifyVisitor method), 8
visit_Tuple() (arkane.output.PrettifyVisitor method),
V 8
V (rmgpy.solver.LiquidReactor attribute), 226
V (rmgpy.solver.SimpleReactor attribute), 218 W
validLayeringIndices (rmgpy.solver.LiquidReactor Wigner (class in rmgpy.kinetics), 97
attribute), 231 Wilhoit (class in rmgpy.thermo), 257
320 Index
RMG-Py API Reference, Release 2.4.1
writeInputFile() (rmgpy.qm.gaussian.GaussianMol
method), 169
writeInputFile() (rmgpy.qm.gaussian.GaussianMolPM3
method), 170
writeInputFile() (rmgpy.qm.gaussian.GaussianMolPM6
method), 172
writeInputFile() (rmgpy.qm.mopac.MopacMol
method), 174
writeInputFile() (rmgpy.qm.mopac.MopacMolPM3
method), 176
writeInputFile() (rmgpy.qm.mopac.MopacMolPM6
method), 177
writeInputFile() (rmgpy.qm.mopac.MopacMolPM7
method), 179
writeInputFile() (rmgpy.qm.symmetry.SymmetryJob
method), 167
writeKineticsEntry() (in module rmgpy.chemkin),
14
writeThermoEntry() (in module rmgpy.chemkin), 14
Y
y0 (rmgpy.solver.LiquidReactor attribute), 232
y0 (rmgpy.solver.ReactionSystem attribute), 218
y0 (rmgpy.solver.SimpleReactor attribute), 225
Index 321