Skip to content

Constraints

Constraints modify how positions and forces are handled by optimizers and molecular dynamics drivers.

from atomli.constraints import FixAtoms
atoms.set_constraint(FixAtoms(indices=[0, 1]))

Atomli also exposes FixBondLength, FixBondLengths, FixLinearTriatomic, and Hookean.

Set constraints before creating the optimizer or dynamics driver. Confirm that the attached calculator and selected driver support the constrained workflow.