Code Structure#
Overview#
The autodE code base is structured around a Reaction class, due to
the initial singular goal of calculating reaction profiles.
The key attributes include reacs and prods as individual molecules
comprising the reactants and products of the reaction. Transition states connecting
reactants and products are held in tss. From these, property attributes are generated,
including reactant and product, which are the corresponding
association complexes of all reactants and products. The ts property is
simply the lowest energy transition state and None if
len(reaction.tss) == 0.
Overall class structure#
Zooming out, the composition and inheritance between of some of the
classes arising from Reaction (center) is shown below.
Species#
Individual atoms are collected into a Atoms class which becomes an
(effective) attribute of an AtomCollection, which serves as a base
class for all objects with associated atoms. A Species adds
a molecular graph, solvent and name attributes and is the parent class of
a Molecule, Complex and TransitionState.
Values#
Quantities with associated units e.g. an angle or energy are subclasses of
autode.values.Value, which facilitate the conversion between units
(using value.to()). For example, species.energy returns a
PotentialEnergy instance (if the energy has been calculated with e.g.
species.single_point()).
Solvent#
Species in the gas phase have species.solvent == None while solvated
ones have an instance of either ImplicitSolvent or ExplicitSolvent,
inheriting from the base autode.solvent.Solvent class. Explicit solvent
contains defined atoms, thus inherits also from AtomCollecion.
Calculation#
Energies and derivatives thereof are obtained but running calculations using
external QM packages (e.g. Gaussian, etc.) through a Calculation instance.
A Calculation is initialised with a Species, using a
Method and Keywords describing the type of calculation to
perform. Please reach out via email or slack to add a a new method.
calculate_reaction_profile#
From the description of a reaction (e.g SMILES strings), autodE can generate
the reaction profile. It starts by building a Reaction instance,
describing the reactants/products involved (see Molecule) as well as
the transition states (see TransitionStates). Calling the
calculate_reaction_profile method on the reaction instance first locates
the lowest energy conformers of each reactant and product
(species.find_lowest_energy_conformer()). The intermediate optimisations
are performed using a Calculation instance, which is responsible for calling
a specified QM package (e.g. XTB or Gaussian) with calculation.run().
The generated output is then parsed and the output available from the calculation
instance e.g. calculation.get_final_atoms(). A Calculation
is constructed with a Method, which serves as the QM wrapper. From
optimised reactants and products a transition state (TS) search is performed
by constructing association complexes of reactants and products, then searching
over bond additions and deletions to traverse a reasonable path. Once the
TransitionStates instance has been populated the lowest is selected to
perform a conformer search. If required, the conformational space of the
ReactantComplex and ProductComplex attributes of the reaction
are optimised. Hessian calculations are performed if the thermochemical contributions
to the energy are required, followed by single-point energy evaluations on the
final geometries.