kabsch_align

qcelemental.molutil.kabsch_align(rgeom, cgeom, weight=None)[source]

Finds optimal translation and rotation to align cgeom onto rgeom via Kabsch algorithm by minimizing the norm of the residual, \(|| R - U * C ||\).

Parameters
  • rgeom (ndarray) – (nat, 3) array of reference/target/unchanged geometry. Assumed [a0] for RMSD purposes.

  • cgeom (ndarray) – (nat, 3) array of concern/changeable geometry. Assumed [a0] for RMSD purposes. Must have same Natom, units, and 1-to-1 atom ordering as rgeom.

  • weight (Optional[ndarray]) – (nat,) array of weights applied to rgeom. Note that definitions of weights (nothing to do with atom masses) are several, and I haven’t seen one yet that can make centroid the center-of-mass and also make the RMSD match the usual mass-wtd-RMSD definition. Also, only one weight vector used rather than split btwn R & C, which may be invalid if not 1-to-1. Weighting is not recommended.

Returns

First item is RMSD [A] between rgeom and the optimally aligned geometry computed. Second item is (3, 3) rotation matrix to optimal alignment. Third item is (3,) translation vector [a0] to optimal alignment.

Return type

float, ndarray, ndarray

Notes

Author: dsirianni