Quantumania 25 - Irritating Conveyor Belts
Quantumania (25 of 25)
What we’re going to do with our solid United Nations-slash-Flerfer map is use it to represent both operations-on-things and things-being-operated-on. To do this, we’ll stick strictly to unit quaternions, which have modulus and are a closed set under multiplication: if you multiply two unit quaternions, the result is a unit quaternion. The things-being-operated-on are points in space, and the operations-on-things are rotations, and they are both simply points in our solid ball map. In fact, they are the only kind of quaternions in our map.
The unit quaternions describe all the possible pure rotations (with no scaling) that can be performed on a 3D space, just as unit complex numbers describe all pure rotations (with no scaling) on the complex plane. I can think of two possible nagging objections you might feel about this.
First, why does it need to have parameters if it’s a rotation in 3D space? Well, it sort of doesn’t: the constraint where their squares must sum to
means that if you know three of them, the fourth is tied down to no more than two possible values, positive or negative:
The role of the coordinate being thus diminished, our map almost insults it, giving the three spatial directions of the map space to the other three coordinates.
This is also important because it means that points in the northern (positive ) and southern (negative
) hemispheres of the unit quaternion 3-sphere are paired up. Once you pick values for
, there are only two points on the unit quaternion 3-sphere that you could be talking about. Or to refer to our ball-map, there’s a matching pair of points in the inner core and the outer shell.
Second, surely we only need two parameters to specify a point on a 2-sphere? Yes, but we also need to say how much to rotate by (and which of two ways, clockwise or anticlockwise). This works very much like complex rotation. The complex value is the identity operation, having no effect at all. The value
rotates
, and
rotates
. In general, a pure rotation
by angle
is given by:
(Often an arbitrary complex number is labelled but I’ve switched to
as we’ve been using
for one of the ordinary spatial coordinates.)
So as increases from
, the real part gradually falls as the imaginary part rises, and the two parts, interpreted as coordinates in a plane, describe a circular path. Such a complex number can be multiplied with any other complex number to move it around the origin by the angle
, so we can think of it applying as an operator to all complex numbers, i.e. it rotates the entire plane.
So now we need to figure out the same thing for the quaternion space: what is the action of a unit quaternion on all the points in that space? So that we can see the results on our solid model, which only contains unit quaternions, we’ll restrict our space of points to be operated on to the unit quaternions with zero scalar part, which sit on the 2-sphere boundary between the inner core and the outer shell. That way we can visualise points moving around on our map.
It turns out to be not quite as simple and convenient as the complex numbers, but in a way that is easily fixed. First, we’ll use as our rotation, and apply it to various test quaternions using the rules we listed last time:
These evidently are working as a cycle: the output of each stage becomes the input to the next stage. As ,
and
are acting as basis vectors for 3D space, we effectively visit these points in the coordinate system, starting at
:
So looks like a very helpful rotation in the -plane, around the
-axis, in
increments, and certainly if the
-coordinate is zero then it stays zero. By symmetry we can similarly rotate the
-plane around the
-axis by multiplying repeatedly by
, or the
-plane around the
-axis by multiplying repeatedly by
.
So it sounds like we can perform rotations around all three axes, using their basis vectors. Which ever imaginary quaternion you choose to rotate by, the other two imaginary components are affected. Also by reducing the strength of the imaginary components (and making a compensating increase to the real component to keep it a unit quaternion) you can reduce the angle by which it rotates from to whatever angle you require.
Hence, a first guess at a general formula, the angle determining the mix between real and imaginary, and the imaginary part being simply a unit vector imported from 3D space:
But before we celebrate too much, we need to see what happens to points that aren’t on the one specific circle of points we’ve tested so far. If we apply as the operator to a test quaternion that has a non-zero
component,
, what happens? It’s not good news. Clearly, like in regular complex numbers, if we apply
to itself we get
, and so on:
This is a rotation alright, at least in quaternion-space, but on our 3D map, referring to our test input, it looks more like a conveyor belt, carrying points in a straight line along the -axis, passing through
(the centre of the map),
(on the equator, or the spherical boundary between the inner core and the outer shell),
(the outer shell, where it teleports to the opposite side of the ball-map), continuing through
before returning to
and repeating the cycle.
This looks exactly like ordinary complex rotation, interchanging between the real number line and whichever imaginary component we chose to multiply by, but the effect of it on our ball-map is to drag anything not on the circle around in a kind of weird cycle that includes an apparently discontinuous flip from positive
to negative
. Really of course this discontinuity is a side-effect of our projection to 3D. The unit quaternions with positive and negative
are really two halves of the hypersphere surface.
In your mind, set the and
coordinates of a test quaternion to zero, while allowing
and
(the real, scalar coordinate) to cycle around the surface. The test quaternion travels through the North Pole (
) smoothly and without incident. Why can’t it do the same at the South Pole? It can, and does! It passes through (
) just as smoothly. It’s just that in our projection to 3D, we exploded the South Pole into the outermost sphere, the 3D ice wall of our 3D United Nations map, where all points have coordinates
. So anything that passes through the South Pole appears, on our projection, to discontinuously teleport. When
has a tiny positive value, it’s right next to the ice wall on one side of the outer sphere, and when it passes through
to become slightly negative, it’s then just inside the ice wall on the opposite side.
Despite this, our projection still makes sense because the kinds of rotation we want are interchanges between imaginary pairs like , which look like well-behaved rotations in the projection space. But an interchange between an imaginary component and the real number line totally destroys this neat picture.
The one saving grace is that, because we’re always acting with unit quaternions on test subjects that are also unit quaternions, the product is always another unit quaternion, so at least they don’t disappear from the map entirely. Our map has no place for non-unit quaternions. It’s just a unit-only slice of the space of all possible quaternions, as we threw away non-unit quaternions to achieve a 3D projection. Any operation on a test quaternion that moves it away from the surface of the unit hypersphere will make it vanish entirely from our map, “into the fourth dimension”! A somewhat science-fictiony phrase that isn’t particularly helpful, because if something exists in a 4D space then obviously it has always been somewhere in the fourth dimension, just as it has always been somewhere in the other three. But it would no longer be sitting in the one 3D slice visible in our map.
So the action of a quaternion with an imaginary component, such as , is in effect two simultaneous rotations:
- the one we want: the quaternion
defines an axis around which the other two imaginary components rotate, so the
plane tumbles nicely around it.
- the one we don’t want: complex real-imaginary interchange that our projection converts into cyclical discontinuous teleportation through the ice wall.
Fortunately there’s a simple trick that fixes this. Quaternion multiplication is anti-commutative:
We can apply a quaternion as a rotation operator on the left side and the right, and they have different effects. What we want to do is reinforce the good rotation (involving interchange between the imaginary components) and cancel out the unhelpful rotation (involving interchange with the real, scalar component).
Let’s see what happens when we multiply a general quaternion on the left by
:
Notice how the effect of on the
coordinate, as it’s just a real, will not depend on which side we multiplied
on. Real/imaginary multiplication is commutative. But also notice how the same is true for the
coordinate, because there we just multiply
by itself, so switching left and right can’t make any difference. It’s just
.
Whereas for the remaining two coordinates, they now scale the products of two different imaginary units, and
, and we know that such products are anti-commutative: switching sides would switch signs. So substituting these identities:
On that last line we just put the components in the usual order. Just to show explicitly how multiplying on the right disagrees:
We can see how the two simultaneous rotations performed by are affected by the switching of sides. Or rather, only of them is affected: the rotation in the real/
-plane stays exactly the same. The other one, the useful one, is sadly reversed. This means that if we performed both actions, multiplying by
on both sides:
then the useful -plane rotation would be undone, and the irritating crazy conveyor belt effect would be reinforced. How infuriating. But if we knew how to make the multiplicative inverse of any quaternion, that would reverse both rotations. Then then we could multiply by the inverse on the right, and we would reinforce the useful rotation and cancel the irritating one! So we just need to know how to find the inverse of a quaternion.
Hamilton already figured this stuff out with algebra. He wanted quaternions to behave like numbers, so he needed to be able to divide as well as multiply, so given a quaternion he wanted to find
such that
. What he discovered was that, exactly like conjugation with complex numbers, we can form the conjugate of a quaternion by flipping the sign of the imaginary parts:
And as you’d expect, if we multiply them, we get a purely real value, the modulus-squared:
So to scale this back to , we just need to divide by the modulus-squared, giving:
But we’re describing rotations with unit quaternions, so the modulus is always , and thus for our purposes we can use conjugation to get the inverse. This is extremely reminiscent of how the inverse of a unitary operator in matrix form can be found by the conjugate transpose, isn’t it?
So to perform a rotation by , on the left we use
and on the right we use its conjugate,
, which can be found by flipping the signs of all the imaginary terms in
. This cancels out the unwanted conveyor belt effect along the direction of
, leaving just the desired proper rotation in the plane perpendicular to
’s vector part. Although now we’ve applied that rotation twice, and this explains the factor of
on the angle in the formula for building a general quaternion to rotate by:
So the full recipe to use to rotate a point in 3D space is as follows. Represent that point
as a quaternion using the imaginary units to carry the point’s coordinates:
and then make a sandwich:
where is just
with a minus sign on the vector terms, i.e.
This is probably enough mid-18th century geometry for now.
Not yet regretting the time you've spent here?
Keep reading: