Single Point
Single-point calculations include evaluation of the energy, nuclear gradients, Hessian, and properties at a single molecular geometry.
The input for performing a single-point calculation is created via the SingleInput
object, which specifies the molecular structure, the energy method, and the type of the calculation.
By default, the energy is computed and stored in the SingleResult
object; the gradient or Hessian can also be computed by specifying the corresponding result_type
in SingleInput
. The results of a higher-order energy derivative calculation automatically contain the lower-order derivatives.
Example
The following examples demonstrate how to perform a range of single-point calculations:
import sierra
from sierra.inputs import *
from sierra import constants
import numpy as np
water = Molecule(pubchem="water")
# Perform a single-point energy calculation at DFT B3LYP/Def2-SVP level of
# theory
dft_input = SingleInput(
molecule=water,
result_type="energy",
method=DFTMethod(xc="B3LYP", ao="def2-svp"),
)
dft_result = sierra.run(dft_input)
print(f"DFT B3LYP/Def2-SVP energy: {dft_result.energy:.6f} Hartree")
#> DFT B3LYP/Def2-SVP energy: -76.321152 Hartree
# Perform a single-point hessian calculation at GFN1-xTB level of theory
# Note that the energy and gradient are automatically computed.
xtb_input = SingleInput(
molecule=water, result_type="hessian", method=XTBMethod(model="GFN1")
)
xtb_result = sierra.run(xtb_input)
xtb_energy = xtb_result.energy
print(f"XTB Energy: {xtb_energy:.6f} Hartree")
#> XTB Energy: -5.768441 Hartree
xtb_gradient = xtb_result.gradient
xtb_max_abs_gradient = np.abs(xtb_gradient).max()
print(f"XTB Max Absolute Gradient: {xtb_max_abs_gradient:.6f} Hartree/Bohr")
#> XTB Max Absolute Gradient: 0.011685 Hartree/Bohr
# Get the vibrational frequencies
# Note that they are stored in the `extras` field
freqs = xtb_result.extras["frequencies"] * constants.cf("hartree", "wavenumber")
print(f"XTB Largest Vib. Frequency: {freqs.max():.3f} cm^(-1)")
#> XTB Largest Vib. Frequency: 3641.967 cm^(-1)
SingleInput
Fields
molecule
-
The molecule the result is computed with
- Type:
Molecule
- Type:
method
-
The method for the single point evaluation.
- Type: One of:
[
XTBMethod
,
HFMethod
,
DFTMethod
,
EMFTMethod
,
OrbNetMethod
]
- Type: One of:
result_type
-
The maximum derivative computed with this call
- Type:
ResultType
- Default:
energy
- The value must be one of
energy
gradient
hessian
- Type:
details
- Additional detail parameters to supply to the computation
SingleResult
Fields
A SingleResult
contains all of the fields in SingleInput and the following result fields:
energy
-
The energy of the given method
- Type:
float
- Type:
extras
-
Additional key/value pairs generated during the computation
- Type:
Mapping[str, Any]
- Default:
{}
- Type:
gradient
-
The nuclear gradient of the given method
- Type:
Optional[Array]
- Additional Details: shape:
(-1, 3)
- Type:
hessian
-
The nuclear Hessian of the given method
- Type:
Optional[Array]
- Type: