May 14, 2025

Quaternion Operations

 During our recent diversion into imaginary time, we saw that using the imaginary unit to indicate time can simplify our efforts to express spacetime, but we hit the natural problem in that this benefit vanishes when we tried to introduce more than one spatial dimension.  What if, however, we flipped it?  When discussing the geometric meaning of the metric tensor, we noted that we don't need to use a negative time signature, we can also use a negative space signature.  Can we use imaginary space and still have three spatial dimensions?  

  As it happens, there is a four-dimensional extension of complex numbers: Quaternions, first discovered by Irish physicist and mathematician William Rowan Hamilton in 1843.  Hamilton found that he could expand a single imaginary dimension into three:


 Hamilton divided his quaternions into two parts: the scalar, or "real" component; and the vector, or "imaginary" components:


   Hamilton was responsible for introducing the term "vector" to physics and for the popular i, j, k notation used in 3d vectors.  However, quaternion mechanics largely fell by the wayside by the end of the 19th century, in favor of 3d vector notation.

Quaternion Operations

  One huge advantage of quaternions is that multiplication subsumes both dot and cross products from conventional, 3d mechanics, along with scalar multiplication.  Expressing the multiplication of two quaternions, a and b, using vector product notation:


  Note that if there is no zero (scalar) component to the quaternions a and b, meaning that they have only vector components, what Hamilton called "pure quaternions," then we have just the two vector products.  The presence of scalar components adds additional terms to the product.  We should also immediately see that multiplication is not commutative, since the cross product is anti-commutative: 

  The magnitude of a complex number is square root of the number multiplied by its conjugate the same is true of a quaternion.  As we have chosen to represent quaternions with underlining, let's express their conjugate with an overline.  By analogy with complex numbers, we'll find:

 Which, by applying the above rules for multiplication, yields a scalar value, as we should expect:

Rearranging the magnitude, we can find the inverse of a quaternion in terms of the conjugate and magnitude:

 All of this is very simply derived from the core rules outlined above.  It will be helpful later on to consider the case where some quaternion, b, from the left and right by a and its conjugate:

Quaternion Commutators and Anti-Commutators

  We can separate the product into commutative and anti-commutative parts.  The commutator [a,b] shows us the anti-commuting part, because it is zero if a and b commute.  The anti-commutator {a,b} = 0 if a and b anti-commute and shows the commuting part of of the product.  The product of two quaternions can be expressed as the sum (or difference) of the commutator and anti-commutator:

  Let's consider the product of  three quaternions cab in terms of the commutator and anti-commutator:

  It's helpful to look at multiplication using the commutator and anti-commutator, as there are situations where some of these terms will go towards zero.  As it will happen, later we'll want to consider the situation where a = c and:

Quaternion Calculus

  The differential operator can be represented as a quaternion:

So, if we want to express some quaternionic derivative:

Which, we notice subsumes both the concept of the  divergence and curl, as we should expect.  The double derivative is then, and we immediately get to apply the above multiplication (cab) rule above:

  Where we again see familiar vector calculus terms like the vector Laplacian appear.  Note the difference between the two double vector derivatives:

  And, naturally, we quickly see how the complete double-differential can be found by putting these terms together.  Putting everything together, we get the double derivative:


  It can also be easily shown that:


Quaternions As Rotations

  Rather than using 3x3 matrices to represent rotations in three dimensional space, we can use quaternions for that task.  To describe the rotation of some vector v around an axis, k, by some angle, θ:

  Let's look at this problem in a purely vector viewpoint, before considering quaternions.  If we project v onto the axis, that is we take the dot product of v and k, we get the parallel component of the vector.  The perpendicular component is just the difference between v and the parallel component.  We know the parallel component won't change on a rotation about the axis and the perpendicular component is rotated in a plane perpendicular to the rotation axis as shown above.

  Putting the two components back together:

  This looks like what we got when we multiplied some quaternion, b, from either side by some other quaternion and its conjugate.   Define two pure quaternions, v and q:


  Since k is defined as a unit vector, q is a unit quaternion.  This has proven to be one of the most popular modern applications of quaternions, as quaternion rotations don't suffer the sort ambiguities that can arise from traditional Euler angles and rotation matrices.

  Two successive rotations can simply be described by multiplying the quaternions together as:

   Note that, generally speaking, for two vectors the typical scalar multiplication rule does not apply:

  

   We can do this only if the two quaternions commute, which happens if the two vectors are linearly dependent.

Quaternions As Exponential Functions

  It's trivial to convert from polar to Cartesian coordinates, which makes it equally simple to make such a transition in complex number systems.  To represent a 2d polar system using complex numbers we know from Euler's forumula:

  Where the radial distance in the complex plane, r, is the magnitude of the complex number, z.  Extending the idea of polar decomposition into quaternion space suggests: 

  The newly introduced angle, φ, is some direction in 4 dimensional space which distinguishes the scalar axis from the vector axes, just as θ did in the 2d complex plane.  The unit vector, represented by the ^ term above, extends the function of i in the complex plane into quaternionic space.  It's easy to see that the conjugate of a is a transformation of φ → -φ: 


  We can, in turn, represent the unit vector in spherical coordinates:

  The exponential representation gives us a simple method for taking the exponent of a quaternion: 


Four Dimensional Rotations As Quaternion Pairs

  It should be clear, given the similarities between these two descriptions that the quaternion method of describing 3d rotations can be considered a special case of rotation in 4d, where the plane of rotation always includes the scalar axis.  There are three vector axes perpendicular to the scalar axis, leading to three possible planes of rotation.  There are three remaining planes, which allow rotations of the scalar portion and leave two vector axes unchanged.  These, together with the other three rotation planes, for a rotation of some vector v by an angle θ:

  For a basic 3d rotation, the left and right rotations are conjugates but for some general 4d double-rotation they need not have any particular relationship.  Double rotations, with two independent planes of rotation, become possible in 4 or more dimensions.

  In 2d, there is only the plane of rotation and the rotation takes place around a single point that does not move.  In 3d, there is a line, the axis of rotation, that is left unchanged.  In 4 dimensions an entire plane is left independent of the rotation, allowing for a second, completely independent rotation to take place.  Double rotations in four dimensions again leave a single point unchanged.

4d isoclinic rotation of a tesseract

  A special case where the two rotation angles have the same magnitude is termed an isoclinic rotation.  If the rotation angles are equal, it is termed a left isoclinic rotation and if they are opposite, a right isoclinic rotation.  The spatial rotation is a special case where the two axes are also the same and with opposite angles.  In this case, the two planes of rotation are orthogonal, for example a rotation in the (x,y) plane and a simultaneous rotation in the (1,z) plane.

Any four dimensional rotation can be expressed as a pair of isoclinic rotations.

  Imagine a double-rotation composed of a simultaneous rotation by θ in the {1,x} plane and by ϕ in the {y,z} plane.  The four dimensional rotation matrix can be described, in block notation:

where the two square sub-matrices:

Define two new angles:

From these definitions, we can rewrite the rotation matrix as the product of two isoclinic rotations:

where the left and right isoclinic rotation matrices are:

  Performing this rotation R upon some four dimensional vector Q is equivalent to multiplying some quaternion q from the left and right:

Working out both sets of multiplication, with the components of Q and q equated, allows us to solve for the components of the left and right quaternions:

  For some double-rotation taking place in two orthogonal planes {a,b} and {b,c} we can write the same rotation matrix within the {a,b,c,d} coordinate system and convert back to the standard {1,i,j,k} system:

Generally, 4d rotation matrices can be converted into quaternions per:


No comments:

Post a Comment