Skip to content

Reaction Workflow

This workflow provides a tool to calculate the reaction energies from reactants and products.

In this first example, the the energy of forming a water molecule from atoms is calculated using GFN1-xTB level of theory:

import sierra
from sierra.inputs import *

method = XTBMethod()

water = Molecule(pubchem="water")
products = [water]

hydrogen = Molecule(data="H 0 0 0")
oxygen = Molecule(data="O 0 0 0")
reactants = [oxygen, hydrogen, hydrogen]

input = ReactionInput(reactants=reactants, products=products, method=method)

result = sierra.run(input)

print(f"Reaction energy: {result.energy:.6f} Hartree")
#> Reaction energy: -0.612930 Hartree
print(f"Summary: {result.string_summary()}")
#> Summary: O + H + H → H₂O  ΔE = -384.619 kcal/mol

Here the ReactionInput is configured with the reactants, products and energy method. The reactants and products are a list of Molecule objects. Energies for each of these are computed using the supplied method.

To avoid repeated calculations, it is also possible to supply a factor for each molecule. In the example above we could use reactants = [oxygen, (hydrogen, 2)].

The ReactionResult contains the energy and a convenience function .string_summary() can be used for display.

ReactionInput

Fields

method

Energy method

products

List of products

reactants

List of reactants

ReactionResult

Fields

All of the attributes in ReactionInput and the following:

computations

List of the results of the single point energy calculations

energy

Reaction energy

  • Type: float