pub fn calculate_dihedral_gradient(
geometry: &Geometry,
a1: usize,
a2: usize,
a3: usize,
a4: usize,
) -> ([f64; 3], [f64; 3], [f64; 3], [f64; 3])Expand description
Calculate the analytical gradient of a dihedral angle with respect to atomic coordinates.
This function computes the partial derivatives of the dihedral angle φ with respect to the coordinates of all four atoms involved. The gradients represent the force vectors that would most effectively change the dihedral angle.
Uses the formula from Grigoryan lab reference.
§Arguments
geometry- The molecular geometrya1- Index of first atoma2- Index of second atoma3- Index of third atoma4- Index of fourth atom
§Returns
A tuple of four 3D gradient vectors, one for each atom’s coordinates. Each gradient is in units of radians per unit distance.