You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Correct over-squaring in internal coordinate objective function for adding an atom to XYZ (#802)
The objective function for adding a new atom previously led to
over-penalization of angular errors (effectively minimizing the error to
the fourth power). This was due to the angular constraint functions
(g_theta and g_phi) already returning squared errors, which were then
squared again in the final objective function.
This commit refactors the constraint functions to return the linear
error or linear error magnitude:
- `angle_constraint`: Now returns the linear difference (calc_angle -
target_angle).
- `dihedral_constraint`: Now returns the magnitude of the sine/cosine
error vector (square root of the squared sum).
The main objective function remains structurally the same (sum of
squared, scaled terms), but now correctly implements a standard
**relative squared error** minimization.
0 commit comments