narupatools.ase.constraints.constraint

Protocols to act as base classes for ASE constraints.

ASE constraints don’t exist as a base class from which all other constraints subclass. Instead, it is assumed that they have at a minimum an adjust_positions and adjust_forces method, with optional other methods depending on what they alter.

These protocols provide this methods as abstract methods, ensuring that if you include them in your class hierarchy then you have to implement them correctly.

Classes

ASECellConstraint(*args, **kwargs)

Protocol for a constraint that modifies the unit cell.

ASEConstraint(*args, **kwargs)

Protocol describing an ASE Constraint, as ASE uses duck typing.

ASEEnergyConstraint(*args, **kwargs)

Protocol for a constraint that modifies potential energy.

ASEMomentaConstraint(*args, **kwargs)

Protocol for a Constraint that modifies the momenta.

ASEStressConstraint(*args, **kwargs)

Protocol for a constraint that modifies stresses.