@@ -24,18 +24,20 @@ class AxesCalculator:
2424 rotation, and handling bead-based representations of molecular systems.
2525
2626 Provides utility methods to:
27- - extract averaged positions,
28- - convert coordinates to spherical systems (future/legacy scope),
29- - compute axes used to rotate forces around,
30- - compute custom moments of inertia,
31- - manipulate vectors under periodic boundary conditions (PBC),
32- - construct custom moment-of-inertia tensors and principal axes.
27+
28+ - Extract averaged positions.
29+ - Convert coordinates to spherical systems (future/legacy scope).
30+ - Compute axes used to rotate forces around.
31+ - Compute custom moments of inertia.
32+ - Manipulate vectors under periodic boundary conditions (PBC).
33+ - Construct custom moment-of-inertia tensors and principal axes.
3334
3435 Notes:
35- This class deliberately does **not**:
36- - compute weighted forces/torques (that belongs in ForceTorqueCalculator),
37- - build covariances,
38- - compute entropies.
36+ This class deliberately does not:
37+
38+ - Compute weighted forces/torques (that belongs in ForceTorqueCalculator).
39+ - Build covariances.
40+ - Compute entropies.
3941 """
4042
4143 def __init__ (self ) -> None :
@@ -363,7 +365,7 @@ def get_vanilla_axes(self, molecule):
363365 Returns:
364366 Tuple[np.ndarray, np.ndarray]:
365367 - principal_axes: (3, 3) axes.
366- - moment_of_inertia: (3,) moments sorted descending by | value| .
368+ - moment_of_inertia: (3,) moments sorted descending by absolute value.
367369 """
368370 moment_of_inertia_tensor = molecule .moment_of_inertia (unwrap = True )
369371 make_whole (molecule .atoms )
@@ -388,13 +390,13 @@ def get_custom_axes(
388390
389391 - axis1: use the normalised vector ab as axis1. If there is more than one
390392 bonded heavy atom (HA), average over all the normalised vectors
391- calculated from b_list and use this as axis1) . b_list contains all the
393+ calculated from b_list and use this as axis1. b_list contains all the
392394 bonded heavy atom coordinates.
393395
394396 - axis2: use the cross product of normalised vector ac and axis1 as axis2.
395397 If there are more than two bonded heavy atoms, then use normalised vector
396- b[0]c to cross product with axis1, this gives the axis perpendicular
397- (represented by |_ symbol below) to axis1.
398+ b[0]c to cross product with axis1. This gives the axis perpendicular
399+ to axis1.
398400
399401 - axis3: the cross product of axis1 and axis2, which is perpendicular to
400402 axis1 and axis2.
@@ -405,12 +407,12 @@ def get_custom_axes(
405407 c: Coordinates of a second heavy atom or a hydrogen atom.
406408 dimensions: Simulation box dimensions (3,).
407409
408- ::
410+ .. code-block:: text
409411
410412 a 1 = norm_ab
411- / \ 2 = |_ norm_ab and norm_ac (use bc if more than 2 HAs)
412- / \ 3 = |_ 1 and 2
413- b c
413+ / \ 2 = perpendicular to norm_ab and norm_ac (or bc if > 2 HAs)
414+ / \ 3 = perpendicular to 1 and 2
415+ b c
414416
415417 Returns:
416418 np.ndarray: (3, 3) array of the axes used to rotate forces.
@@ -458,8 +460,10 @@ def get_custom_moment_of_inertia(
458460 heavy atom position in a UA).
459461
460462 Original behaviour preserved:
463+
461464 - Uses PBC-aware translated coordinates.
462- - Sums contributions from each atom: |axis x r|^2 * mass.
465+ - Sums contributions from each atom using the squared norm of (axis × r)
466+ multiplied by mass.
463467 - Removes the lowest MOI degree of freedom if the UA only has a single
464468 bonded H (i.e. UA has 2 atoms total).
465469
@@ -581,6 +585,7 @@ def get_custom_principal_axes(
581585 built-in MDAnalysis principal_axes() function.
582586
583587 Original behaviour preserved:
588+
584589 - Eigenvalues are sorted by descending absolute magnitude.
585590 - Eigenvectors are transposed so axes are returned as rows.
586591 - Z axis is flipped to enforce the same handedness convention as the
0 commit comments