The quaternions are members of a noncommutative division algebra first invented by William Rowan Hamilton. The idea for quaternions occurred to him while he was walking along the Royal Canal on his way to a meeting of the Irish Academy, and Hamilton was so pleased with his discovery that he scratched the fundamental formula of quaternion algebra,
into the stone of the Brougham bridge (Mishchenko and Solovyov 2000). The set of quaternions is denoted , , or , and the quaternions are a single example of a more general class of hypercomplex numbers discovered by Hamilton. While the quaternions are not commutative, they are associative, and they form a group known as the quaternion group.
By analogy with the complex numbers being representable as a sum of real and imaginary parts, , a quaternion can also be written as a linear combination
The quaternion is implemented as Quaternion[a, b, c, d] in the Wolfram Language package Quaternions` where however , , , and must be explicit real numbers. Note also that NonCommutativeMultiply (i.e., **) must be used for multiplication of these objects rather than usual multiplication (i.e., *).
A variety of fractals can be explored in the space of quaternions. For example, fixing gives the complex plane, allowing the Mandelbrot set. By fixing or at different values, three-dimensional quaternionic fractals have been produced (Sandin et al. , Meyer 2002, Holdaway 2006).
The quaternions can be represented using complex matrices
where and are complex numbers, , , , and are real, and is the complex conjugate of .
Quaternions can also be represented using the complex matrices
(Arfken 1985, p. 185). Note that here is used to denote the identity matrix, not . The matrices are closely related to the Pauli matrices , , and combined with the identity matrix.
From the above definitions, it follows that
Therefore , , and are three essentially different solutions of the matrix equation
which could be considered the square roots of the negative identity matrix. A linear combination of basis quaternions with integer coefficients is sometimes called a Hamiltonian integer.
In , the basis of the quaternions can be given by
The quaternions satisfy the following identities, sometimes known as Hamilton'srules,
They have the following multiplication table.
The quaternions , , , and form a non-Abelian group of order eight (with multiplication as the group operation).
The quaternions can be written in the form
The quaternion conjugate is given by
The sum of two quaternions is then
and the product of two quaternions is
The quaternion norm is therefore defined by
In this notation, the quaternions are closely related to four-vectors.
Quaternions can be interpreted as a scalar plus a vectorby writing
where . In this notation, quaternion multiplication has the particularly simple form
Division is uniquely defined (except by zero), so quaternions form a divisionalgebra. The inverse (reciprocal) of a quaternion is given by
and the norm is multiplicative
In fact, the product of two quaternion norms immediately gives the Eulerfour-square identity.
A rotation about the unit vector by an angle can be computed using the quaternion
(Arvo 1994, Hearn and Baker 1996). The components of this quaternion are called Euler parameters. After rotation, a point is then given by
since . A concatenation of two rotations, first and then , can be computed using the identity