Talk:Kabsch algorithm

=error in text= The text refers to computing "d" which determines if it needs to be flipped to make a non-inverting rotation. However the presentation doesn't actually say what you check (answer: the sign of d) and then what you do about it (answer: change sign on eigen vector).

=foo= As a mathematician I must say this article is horribly vaguely written.


 * The Kabsch algorithm is a method for calculating the optimal alignment of two sets of points.

Vague, but one hopes it will be defined below.


 * The algorithm works by calculating a matrix of multiplied components. The destination matrix, A, is a 3 &times; 3 matrix with x, y and z components for each side. The source is two sets of paired points, V1 and V2.

I'm guessing the "destination matrix" is supposed to be the algorithm's output, but I'm not sure.

"Two sets of paired points". Sets? Or tuples? Or matrices in which each row is one of the points? Does it mean "two paired sets of points" or "two sets of paired points" (what is a paired point)?


 * $$ A_{ij} = \sum_i V_{1i} V_{2j} $$
 * (sum over the points and multiply components).
 * (sum over the points and multiply components).

"Sum over points" could mean the index of summation is a variable representing points and runs through the whole set of points. But the notation suggests something else is meant. It looks as if the ij entry in the matrix is a dot product of the ith and jth points.


 * The formula is
 * : $$ (A^t A)^{1/2}A^{-1} $$
 * : $$ (A^t A)^{1/2}A^{-1} $$

Formula for what? What is this result supposed to be?


 * The algorithm calculates only the rotation matix.

What rotation matrix?? Nowhere has the article told us that we're trying to find a rotation.

And what does "optimal alignment" mean?

I am very good at deciphering things like this, and I can't make any sense of this. Michael Hardy 03:35, 19 July 2007 (UTC)

The external link seems much clearer. More later.... Michael Hardy 03:38, 19 July 2007 (UTC)

The algorithm as described assumes the bottom right singular value is the smallest one. Many numerical packages ensure it is. Many don't. It is not part of the definition of SVD that this is the case. So the algorithm is incorrect. Sigfpe (talk) 22:19, 24 June 2011 (UTC)

Mystery of the matrices
Any offers on what matrices P and Q might be ? — Preceding unsigned comment added by Eep1mp (talk • contribs) 12:21, 29 February 2012 (UTC)

Recurrence in introduction
In the introduction the named application of the algorithm in chem- and bioinformatics are almost redundant, as the term protein structure is a subset to molecular structure. In addition the application lies in the overlap of the strongly related disciplines chem- and bioinformatics, the differentiation doesn't make sense in this case. Maybe one can find more diverse applications. — Preceding unsigned comment added by Tmartin kl (talk • contribs) 10:35, 6 October 2015 (UTC)

"Goes back to"
"Expressing the optimal rotation matrix with a quaternion goes back to 1999" - I'm a bit skeptical about this date. "Closed Form Solution of Absolute Orientation using Unit Quaternions" by Horn in 1987 seems to be just that.

Nh2-wiki (talk) 22:45, 9 September 2016 (UTC)

Horn's 1987 article does appear to be the correct reference here. The language stating that "Coutsias, Seok, and Dill have found an equivalent method that uses quaternions" is also not correct; their article relates the method described by Horn, making no claim of discovery.

2603:3024:E00:9100:ADF5:9BE9:7BDB:BF62 (talk) 01:56, 8 February 2017 (UTC)

d parameter
Is there any special reason why the following line:


 * $$ d = \operatorname{sign}(\det(W V^T)) \, \cdot 1 $$

couldn't be simplified to this?


 * $$ d = \det(W V^T) $$

W and V being orthogonal matrices, their determinant is either +1 or -1, so the sign function is superfluous, not to mention the multiplication by 1.

Needs a clear problem statement
There are numerous problems with this article, as noted by Michael Hardy's comment, but the biggest omission seems to be a clear statement of what the algorithm computes. We need a clear problem statement for what is being solved. I assume it is some sort of optimization problem, but I don't know the topic well enough to add it. The-erinaceous-one (talk) 00:28, 11 October 2023 (UTC)

Wrong rotation - should be inverse
This wikipedia page states that the algorithm described rotates Q into P. I implemented the algorithm and found that it rotates P into Q. This is aligned with https://hunterheidenreich.com/posts/kabsch_algorithm/ and https://zpl.fi/aligning-point-patterns-with-kabsch-umeyama-algorithm/. Do you agree that the text should be changed from "We want to find the transformation from Q to P" to "We want to find the transformation from P to Q"? Mariussimonsen (talk) 13:20, 14 March 2024 (UTC)