kabsch

chemcoord.utilities.kabsch(P, Q)[source]

The optimal rotation matrix U is calculated and then used to rotate matrix P unto matrix Q so the minimum root-mean-square deviation (RMSD) can be calculated.

Using the Kabsch algorithm with two sets of paired point P and Q, centered around the center-of-mass. Each vector set is represented as an NxD matrix, where D is the the dimension of the space.

The algorithm works in three steps: - a translation of P and Q - the computation of a covariance matrix C - computation of the optimal rotation matrix U

http://en.wikipedia.org/wiki/Kabsch_algorithm

Parameters: P – (N, number of points)x(D, dimension) matrix Q – (N, number of points)x(D, dimension) matrix

Returns: U – Rotation matrix