RMG-Py API Reference ⇌Release 2.0.0
Total Page:16
File Type:pdf, Size:1020Kb
RMG RMG-Py API Reference ⇌Release 2.0.0 William H. Green, Richard H. West, and the RMG Team Sep 16, 2016 CONTENTS 1 RMG API Reference 3 1.1 CanTherm (rmgpy.cantherm).....................................3 1.2 Chemkin files (rmgpy.chemkin).................................... 10 1.3 Physical constants (rmgpy.constants)................................ 13 1.4 Database (rmgpy.data)......................................... 13 1.5 Kinetics (rmgpy.kinetics)...................................... 64 1.6 Molecular representations (rmgpy.molecule)............................. 84 1.7 Pressure dependence (rmgpy.pdep).................................. 108 1.8 QMTP (rmgpy.qm)........................................... 118 1.9 Physical quantities (rmgpy.quantity)................................. 136 1.10 Reactions (rmgpy.reaction)..................................... 140 1.11 Reaction mechanism generation (rmgpy.rmg)............................. 143 1.12 Reaction system simulation (rmgpy.solver)............................. 157 1.13 Species (rmgpy.species)....................................... 160 1.14 Statistical mechanics (rmgpy.statmech)............................... 163 1.15 Thermodynamics (rmgpy.thermo)................................... 178 Bibliography 189 Python Module Index 191 Index 193 i ii RMG-Py API Reference, Release 2.0.0 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.0.0 2 CONTENTS CHAPTER ONE RMG API REFERENCE 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 rmgpy.cantherm 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 1.1 CanTherm (rmgpy.cantherm) The rmgpy.cantherm subpackage contains the main functionality for CanTherm, a tool for computing thermody- namic and kinetic properties of chemical species and reactions. 1.1.1 Reading Gaussian log files Class Description GaussianLog Extract chemical parameters from Gaussian log files 1.1.2 Geometry Class Description Geometry The three-dimensional geometry of a molecular conformation 3 RMG-Py API Reference, Release 2.0.0 1.1.3 Input Function Description loadInputFile() Load a CanTherm job input file 1.1.4 Job classes Class Description CanTherm Main class for CanTherm 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 PressureDependenceJobCompute the phenomenological pressure-dependent rate coefficients k(T;P ) for a unimolecular reaction network 1.1.5 Exceptions Exception Description GaussianError Raised when an error occurs while working with a Gaussian log file rmgpy.cantherm.gaussian.GaussianLog class rmgpy.cantherm.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 CanTherm classes and/or NumPy arrays. getNumberOfAtoms() Return the number of atoms in the molecular configuration used in the Gaussian log file. loadConformer(symmetry=None, spinMultiplicity=None, opticalIsomers=1) 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(frequencyScaleFactor=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. 4 Chapter 1. RMG API Reference RMG-Py API Reference, Release 2.0.0 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. rmgpy.cantherm.geometry.Geometry class rmgpy.cantherm.geometry.Geometry(coordinates, number, mass) The three-dimensional geometry of a molecular configuration. The attributes are: Attribute Type Description coordinates numpy.ndarray An N x 3 array containing the 3D coordinates of each atom number numpy.ndarray An array containing the integer atomic number of each atom mass numpy.ndarray An array containing the atomic mass in kg/mol of each atom The integer index of each atom is consistent across all three attributes. getCenterOfMass(atoms=None) Calculate and return the [three-dimensional] position of the center of mass of the current geometry. 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. getInternalReducedMomentOfInertia(pivots, top1) 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 Pitzer 1, which is described as I(2;3) by East and Radom 2. 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 passing through the center of mass of both tops. Finally, the reduced moment of inertia is evaluated from the moment of inertia of each top via the formula 1 1 1 = + (2;3) I I1 I2 getMomentOfInertiaTensor() Calculate and return the moment of inertia tensor for the current geometry 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. getPrincipalMomentsOfInertia() Calculate and return the principal moments of inertia and corresponding principal axes for the current geometry. The moments of inertia are in kg*m^2, while the principal axes have unit length. getTotalMass(atoms=None) Calculate and return the total mass of the atoms in the geometry in kg/mol. 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. CanTherm input files rmgpy.cantherm.input.loadInputFile(path) Load the CanTherm input file located at path on disk, and return a list of the jobs defined in that file. 1 Pitzer, K. S. J. Chem. Phys. 14, p. 239-243 (1946). 2 East, A. L. L. and Radom, L. J. Chem. Phys. 106, p. 6655-6674 (1997). 1.1. CanTherm (rmgpy.cantherm) 5 RMG-Py API Reference, Release 2.0.0 rmgpy.cantherm.KineticsJob class rmgpy.cantherm.KineticsJob(reaction, Tmin=None, Tmax=None, Tlist=None, Tcount=0) A representation of a CanTherm kinetics job. This job is used to compute and save the high-pressure-limit kinetics information for a single reaction. 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. execute(outputFile=None, plot=False) Execute the kinetics job, saving