SpaceGroupConstraint

class SpaceGroupConstraint(tolerance=PhysicalQuantity(1e-05, Ang))

This constraint will symmeterize the atomic forces and cell stress according to the space group of the lattice. This will ensure that the space group does not change during geometry optimization.

Parameters:tolerance (PhysicalQuantity of type length) – The distance tolerance used when determining the space group.
Default: 1e-5*Angstrom
frozenDegreesOfFreedom(local_atoms=None)
Parameters:local_atoms (list of int | None) – The group of atoms from which the frozen degrees of freedom should be calculated, e.g. a thermalized group of atoms.
Default: All atoms.
Returns:The number of degrees of freedom that are frozen by this constraint object.
Return type:int

Usage Examples

Run a geometry optimization of a rutile crystal with the space group fixed.

constraints = [SpaceGroupConstraint()]

bulk_configuration = OptimizeGeometry(
    bulk_configuration,
    max_forces=0.05*eV/Ang,
    max_stress=0.1*GPa,
    max_steps=200,
    max_step_length=0.2*Ang,
    constraints=constraints,
    trajectory_filename=None,
    optimizer_method=LBFGS(),
)

space_group_constraint.py

Notes

  • SpaceGroupConstraint can be used in OptimizeGeometry to constrain the space group during optimization. This means that the forces and stress are symmetrized according to the space group that is detected.
  • In addition to the atomic number, SpaceGroupConstraint also considers each atom’s initial spin when determining the symmetry operations, so that atoms with different initial spin are not considered symmetrically equivalent.
  • SpaceGroupConstraint constraints cannot be used together with FixAtomConstraints or RigidBody.