Skip to content

Overview

Building blocks form the basis of computations within the Entos software ecosystem.

There are two basic types of building blocks:

  • Computation of wavefunction, energy, gradient and hessian at a single molecular geometry
  • Computation of a trajectory of molecular geometries (e.g., geometry optimizations and molecular dynamics)

Example

Building blocks are easy-to-use tools to quickly write your own workflows.

For example, we can write a simple workflow which optimizes the Molecule and one level of theory and performs a single point computation at a higher level of theory:

import sierra
from sierra.inputs import *

water_initial = Molecule(pubchem="water")

# Perform geometry optimization at GFN1-xTB level of theory
opt_inp = OptimizationInput(
    initial_molecule=water_initial, method=XTBMethod(model="GFN1")
)
opt_result = sierra.run(opt_inp)

water_optimized = opt_result.final_molecule

print("Optimized geometry:")
#> Optimized geometry:
print(water_optimized.geometry)
"""
[[ 0.02588611  0.0191648  -0.01353998]
 [ 0.50827297  1.68803512  0.49634431]
 [ 1.13673676 -0.4701852  -1.35680266]]
"""
print(f"GFN1-xTB energy: {opt_result.energies[-1]:.6f} Hartree")
#> GFN1-xTB energy: -5.768784 Hartree

# Perform a single-point energy calculation at DFT B3LYP/Def2-SVP level of
# theory, at the GFN1-xTB optimized geometry
sp_inp = SingleInput(
    molecule=water_optimized,
    result_type="energy",
    method=DFTMethod(xc="B3LYP", ao="def2-svp"),
)
sp_result = sierra.run(sp_inp)
final_energy = sp_result.energy
print(f"B3LYP/Def2-SVP energy: {final_energy:.6f} Hartree")
#> B3LYP/Def2-SVP energy: -76.320710 Hartree