Skip to content

Units

Almost all values in model attributes are stored in atomic units. Attributes that represent dimensioned quantities can be specified as a string with units attached for ease of use:

from codex.models.components import CoordinateConstraint

print(CoordinateConstraint(indices=[0, 1], value=2.0).value)
#> 2.0
print(CoordinateConstraint(indices=[0, 1], value="2.0 bohr").value)
#> 2.0
print(CoordinateConstraint(indices=[0, 1], value="1.0583 angstrom").value)
#> 1.99989715769145
print(CoordinateConstraint(indices=[0, 1], value="0.10583 nanometers").value)
#> 1.99989715769145

Reference units

Sierra follows Hartree atomic units for all quantities except:

  • ArcQuantity - degree
  • MassQuantity - amu
  • TemperatureQuantity - kelvin

Standard atomic unit Quantity types:

  • LengthQuantity - bohr
  • EnergyQuantity - hartree
  • TimeQuantity - au_time

Conversion

Unit conversion can be accomplished by using Sierra's conversion functions:

import codex

print(codex.constants.cf("bohr", "Angstrom"))
#> 0.529177210903
print(codex.constants.cf("hartree", "kcal / mol"))
#> 627.5094740630558