Skip to main content
← OpenMECP Documentation

Module constraints

Module constraints 

Source
Expand description

Geometric constraint system for molecular optimization.

This module provides geometric constraints for MECP calculations.

Enumsยง

Constraint
Represents a geometric constraint that can be applied during optimization.
ConstraintError
Error type for constraint-related operations.

Functionsยง

add_constraint_lagrange
Applies constraint forces using the Lagrange multiplier method.
build_constraint_jacobian
Builds the constraint Jacobian matrix (C). Each row is the gradient of a single constraint (โˆ‡gแตข). Dimensions: (num_constraints, 3 * num_atoms)
calculate_angle_gradient ๐Ÿ”’
calculate_bond_angle ๐Ÿ”’
Calculates the current bond angle between three atoms.
calculate_bond_distance ๐Ÿ”’
Calculates the current bond distance between two atoms.
calculate_bond_gradient ๐Ÿ”’
calculate_dihedral
Calculate the dihedral angle between four atoms in radians.
calculate_dihedral_gradient
Calculate the analytical gradient of a dihedral angle with respect to atomic coordinates.
cross_product ๐Ÿ”’
Helper function to compute cross product of two 3D vectors.
dot_product ๐Ÿ”’
Helper function to compute dot product of two 3D vectors.
evaluate_constraints
Calculates the current value of each constraint. A positive value means the constraint is violated (e.g., bond is too long).
report_constraint_status
Reports the current status of all constraints during optimization.
validate_constraints
Validates constraint specifications for correctness.