rmsd_exposed#

irmsd.api.rmsd_exposed.get_quaternion_rmsd_fortran(atom_numbers1: ndarray, positions1: ndarray, atom_numbers2: ndarray, positions2: ndarray, mask: ndarray | None = None) → Tuple[float, ndarray, ndarray][source]#

Pair API: call the Fortran routine on TWO structures.

Parameters:
  • atom_numbers1 ((N1,) int32-like)

  • positions1 ((N1, 3) float64-like)

  • atom_numbers2 ((N2,) int32-like)

  • positions2 ((N2, 3) float64-like)

  • mask ((N1,) bool-like or None)

Returns:

  • rmsdval (float64)

  • new_positions2 ((N2, 3) float64, (positions2 @ Umat.T))

  • Umat ((3, 3) float64 (Fortran-ordered))

Notes

The returned new_positions2 is aligned onto positions1. 1. If mask is provided, only the atoms where mask==True in structure 1 are used to compute the RMSD. 2. The rotation matrix Umat is Fortran-ordered, i.e., to rotate positions2, do: new_positions2 = positions2 @ Umat.T 3. The returned new_positions2 is also translated to have the same barycenter as positions1.

Raises:

ValueError – If the input arrays do not have the correct shapes or types.