2

I'm currently working on a Quaternion Neural Network and I was wondering if a Quaternion rotation was only defined when a Quaternion $q$ is rotated using an unit quaternion $u$ ($uqu^{-1}$), or if the Hamilton product between two Quaternions was a kind of rotation ? The point is to understand how the Hamilton product can be seen in a 3D space to finally understand how Quaternion Neural Networks can perform better.

Thanks a lot !

  • I think you are asking if the map $q\mapsto uq$ is a rotation? It's a rotation in $\Bbb R^4$ not in $\Bbb R^3$. – Angina Seng Apr 21 '17 at 09:55
  • I'm asking if it's still a rotation if $uq$ is a rotation even if u isn't an unit quaternion ? – Titouan Parcollet Apr 21 '17 at 10:15
  • @TitouanParcollet You mention $p$ once in relation to "$u(uqu^{-1})$" and I don't know what you intended. Can you clarify exactly what you're asking? – rschwieb Apr 21 '17 at 10:51
  • Yes I just changed $p$ to $q$ sorry. I just want to know if the Hamilton product between two non unit quaternions such as $p$ and $q$ ($qp$) can be seen as a rotation. – Titouan Parcollet Apr 21 '17 at 10:54
  • @TitouanParcollet Do you mean the mapping $q\mapsto qp$ and before you meant to write $q\mapsto uqu^{-1}$? – rschwieb Apr 21 '17 at 13:05
  • I took $uqu^{-1}$ as an example because i know that if we do the product between a quaternion $q$ and an unit quaternion $u$, this is called a rotation. I just wanted to know if the produt between two non unit quaternions $q$ and $p$ can still be considered as a rotation ? – Titouan Parcollet Apr 21 '17 at 15:25

2 Answers2

4

In simple terms, a quaternion does not need to be a unit quaternion in order to rotate another quaternion (e.g. by calculating the Hamilton product). But if it is not a unit quaternion, it will cause scaling in addition to rotation, so this will not be a pure rotation.

So, for example, if you want to apply several rotations $q_1,q_2,...$ to a quaternion $p$ (which might represent a point in 3D space), the quaternions $q_i$ representing the individual rotations do not need to be normalized in advance. You can simply multiply all of them, then normalize the result (thus eliminating the unwanted scaling) before using it to rotate the quaternion $p$.

Ovaflo
  • 161
2

The quaternions $\mathbb{H}$ are an algebra containing the reals $\mathbb{R}$ and form a four-dimensional real inner product space, with a norm satisfying $|x|^2:=\langle x,x\rangle$ and $|xy|=|x||y|$.

Thus, if $p,q$ are unit quaternions (with $|p|=|q|=1$), the function $f(x):=pxy$ satisfies

$$ |f(x)|=|pxq|=|p||x||q|=|x|. $$

Since $f$ is $\mathbb{R}$-linear and preserves the norm, it is an isometry, and in fact it is a rotation of $\mathbb{H}$, or in other words of four-dimensional space.

If $pq=1$, so we can write $p=u$ and $q=u^{-1}$, the function $f(x)=uxu^{-1}$ satisfies $f(1)=1$ and hence restricts to a rotation of the orthogonal complement of $1$ inside $\mathbb{H}$, which is the three-dimensional subspace of purely imaginary quaternions.

If $|p|=1,q=1$, then $f(x)=px$ is a left-isoclinic rotation of 4D space, and if $p=1,|q|=1$ then $f(x)=xq$ is a right-isoclinic rotation of 4D space.

If $|p|\ne1,q=1$ then $|f(x)|=|p||x|\ne |x|$ so the function $f(x)=px$ does not preserve the norm, hence is not an isometry, so not a rotation. Similarly if $p=1,|q|\ne1$ then $f(x)=xq$ is not a rotation. On the other hand, if $|p||q|=1$ then $f(x)=pxq$ does preserve the norm, and in that case we can simply normalize $p$ and $q$ to be unit quaternions (replace $p$ with $p/|p|$ and $q$ with $q/|q|$) so there is no generality lost by using unit quaternions.

anon
  • 151,657
  • 1
    Thanks you ! So if I want to preserve the rotation property and thus trully use the quaternion algebra with two non unit quaternions, I have to normalize them before applying the Hamilton product ? Great. Thanks you for this answer ! – Titouan Parcollet Apr 24 '17 at 08:21