### Real Quaternions

Hamilton's great insight of abandoning the commutative law of multiplication led him to the four-dimensional space of ordered four-tuples of real numbers, [3], and it is in this setting that we will use the computer algebra system Mathematica to deal with quaternions whose name comes from the Latin word quaternio meaning a set of four. Let denote the algebraic system (, +, ·, *) where addition is just vector (i.e., slotwise) addition and multiplication is given as follows.

This definition of multiplication makes it plain why Mathematica will make the exploration of this system much less tedious. The idea of complex conjugation extends to by defining quaternion conjugation * by

and this gives a notion of norm N defined as follows.

We define the magnitude of a quaternion q to be and symbolize this by .

Every nonzero quaternion q has a multiplicative inverse given by . We make contact with Hamilton's relations by defining h = (1, 0, 0, 0), i = (0, 1, 0, 0), j = (0, 0, 1, 0) and k = (0, 0, 0, 1). His relations follow from the multiplication defined above. If we identify a real number a with the quaternion (a, 0, 0, 0) an arbitrary quaternion q = (a, b, c, d) can be written ah + bi + cj + dk, or commonly (a + b) + cJ + dK, as in Mathematica. A complex number a + bI (or a + b) can be identified with the quaternion (a, b, 0, 0). Note that a real scalar a is identified with the quaternion ah, which we call a real quaternion. Although quaternion operations are easily coded in Mathematica, there is currently a standard add-on package that provides many useful quaternion operations. Below we load the package and then provide some examples that demonstrate how some of the commands work.

The following illustrate some calculations with the quaternions A = (29, 34, 0,) = 29h + 34i + k and B = (80, 28, 1, 0) = 80h + 28i + j. First we define some quaternions and illustrate simple operations. The assignment for Q will be convenient.

Here is how to produce a "classic" form of a quaternion.

Computing the norm, magnitude and conjugate are straightforward.

Now let us look at the very important noncommutative quaternion multiplication operator. The next cell shows the long name and a shorter version, using the special operator `**`. Of course, the indicated multiplication is correct symbolically.

The inverse of a nonzero quaternion is simple to compute.

Also, the inverse of a quaternion q is computable via the notation or , yielding the easiest way to carry out this operation.

It is simple to look at powers of quaternions. For nonsymbolic expressions, the process is exactly what one expects.

For symbolic expressions, input format makes a difference. However, a way to make our own power operator `quatpower[`quaternion`,` power`]` for symbolic quaternions is shown.

The quaternions form a noncommutative division ring (skew field) with an involution (i.e., conjugation). It was the noncommutativity of multiplication that held Hamilton back for some time. It is probably difficult for us today to understand the courage it took to abandon the commutative law of multiplication in Hamilton's time.

Without getting into the philosophy of what constitutes a proof, we could easily "verify" various axioms for a division ring and create a series of exploratory examples for classroom use, for example. As an illustration, we look at multiplicative commutators in . This is not the kind of computation the weak of heart would like to do by hand. But with Mathematica, it is a snap. Let us find the general symbolic form of any commutator and check that the norm of the result is one. Note the conversion to `List` forms to expedite the symbolic manipulations.

Obviously, the pedagogical possibilities are endless. For another idea, there is a beautiful connection between quaternion multiplication of pure quaternions (projection on to IJK-space) and the standard vector operations of inner product (dot product) and cross product. For now, however, we have adequate practice using the quaternion package and will move on to concepts related to our main theme of rotations.