Message Boards Message Boards


[WSS19] Hypercomplex Numbers Package

Posted 6 months ago
0 Replies
3 Total Likes


Mathematica allows for symbolic manipulation of real and complex numbers natively. Great collective efforts have been done to implement quaternions, but higher dimensional Cayley-Dickson algebras have not been implemented as of now. Previous implementations of quaternions are designed in such a way that extending to octonions for example is not very practical.

Cayley-Dickson Construction

A key feature in mind while developing this package was to have a framework in which all Cayley-Dickson algebras and other future implementations of hypercomplex algebras such as the biquaternions could sit on. The Cayley-Dickson Construction is the way in which Cayley-Dickson hypercomplex numbers are constructed in pure mathematics. The way it works is to define complex numbers as an ordered pair of real numbers, and quaternions as an ordered pair of complex numbers, and octonions as an ordered pair of quaternions and so on. Then, defining addition pointwise and multiplication of two ordered pairs as $$(a,b)(c,d)=(ac-d^{*}b,ad+bc^{*})$$ where multiplication of the ordered pairs and of its elements is not commutative. Hence, if we are multiplying two octonions we represent them as ordered pairs of quaternions and when we have to multiply them we apply the definition again, in each step reducing until we get to the real numbers. So for this reason, I decided to symbolically represent this type of hypercomplex numbers like this.

Symbolic Manipulation

A great feature of this is that the programmer is no longer required to tediously provide the formula for multiplication of hypercomplex numbers. For example for octonionic multiplication one would need to define it like so:

Octonion[{a, b, c, d, e, f, g, h}]\[CenterDot]Octonion[{s, t, u, v, w,
    x, y, z}]

enter image description here

A symbolic approach propagates to a lot of benefits to the user as well:

Exp[Octonion[{a, b, c, d, e, f, g, h}]]

enter image description here

Dimensions higher than sedenions are called with the head Hypercomplex. If Hypercomplex is called with a list of 8 arguments for example, it will output with an Octonion head.

Quaternionic Rotation

The package also provides functions that might be of use. For example this generates a rotation quaternion about the given angle and axis of rotation

RotationQuaternion[\[Pi]/6, {1, 2, 1}]

enter image description here

This function provides the corresponding 3D rotation matrix with the given rotation quaternion:

  RotationQuaternion[\[Pi]/6, {1, 2, 1}]] // TraditionalForm

enter image description here

The inverse is problem of finding the rotation quaternion given a rotation matrix is also handled:

RotationQuaternion[{{1, 0, 0}, {0, Sqrt[3]/2, -(1/2)}, {0, 1/2, Sqrt[

enter image description here

We can easily do some fun stuff with this: enter image description here enter image description here

Cayley Table

When researching algebraic structures a common approach is to produce a Cayley table. The package provides a function that given a $2^n$ dimension gives the Cayley table associated with the Cayley-Dickson algebra of $2^n$ dimensions.


enter image description here

To verify this it might be quite tedious to write down 16 numbers. For this Hypercomplex, apart from being able to take a list of coefficients, it can also take a function and a dimension. The result is a hypercomplex number that takes as its coefficients the function applied to the index of the unit vector the coefficient corresponds to. So, we can verify a value for our Cayley table like this:

e[i_] := Hypercomplex[If[# == i, 1, 0] &, 16]

enter image description here

Further Direction

The previous definition of referring to a hypercomplex number as a function makes me consider the case where the size tends to infinity. I like to call these 'ultracomplex' numbers since they form an infinite-dimensional vector space and they are beyond any hypercomplex number. Future directions would probably include tools to analyze these numbers, although the Wolfram Language already contains various analysis tools that may help in this research. Additionally, Complex[1,2] outputs the number 1+2I. It would be interesting to have a similar notation for hypercomplex numbers. Quaternions are usually written as I,J,K but we might like a more abstract algebraic notation for higher dimensional numbers. Also, there are modified versions of the Cayley-Dickson Construction that give rise to split-quaternions for example. So implementing these would also be a direction to follow. By a similar fashion we also have biquaternions and so on, which are just like we've seen so far but with complex coefficients. Finally, I think hypercomplex numbers should be implemented as natively as complex numbers so that their calculation are improved.

Here is the link to the package's Github repository.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract