Quaternion

DOWNLOAD Mathematica Notebook EXPLORE THIS TOPIC IN the MathWorld Classroom

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,

 i^2=j^2=k^2=ijk=-1,
(1)

into the stone of the Brougham bridge (Mishchenko and Solovyov 2000). The set of quaternions is denoted H, H, or Q_8, 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·1+bi, a quaternion can also be written as a linear combination

 H=a·1+bi+cj+dk.
(2)

The quaternion a+bi+cj+dk is implemented as Quaternion[a, b, c, d] in the Wolfram Language package Quaternions` where however a, b, c, and d 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 j=k=0 gives the complex plane, allowing the Mandelbrot set. By fixing j or k at different values, three-dimensional quaternionic fractals have been produced (Sandin et al. , Meyer 2002, Holdaway 2006).

The quaternions can be represented using complex 2×2 matrices

 H=[z w; -w^_ z^_]=[a+ib c+id; -c+id a-ib],
(3)

where z and w are complex numbers, a, b, c, and d are real, and z^_ is the complex conjugate of z.

Quaternions can also be represented using the complex 2×2 matrices

U=[  1   0;   0   1]
(4)
I=[  i   0;   0  -i]
(5)
J=[  0   1;  -1   0]
(6)
K=[  0   i;   i   0]
(7)

(Arfken 1985, p. 185). Note that here U is used to denote the identity matrix, not I. The matrices are closely related to the Pauli matrices sigma_x, sigma_y, and sigma_z combined with the identity matrix.

From the above definitions, it follows that

I^2=-U
(8)
J^2=-U
(9)
K^2=-U.
(10)

Therefore I, J, and K are three essentially different solutions of the matrix equation

 X^2=-U,
(11)

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 R^4, the basis of the quaternions can be given by

i=[ 0  1  0  0; -1  0  0  0;  0  0  0  1;  0  0 -1  0]
(12)
j=[ 0  0  0 -1;  0  0 -1  0;  0  1  0  0;  1  0  0  0]
(13)
k=[ 0  0 -1  0;  0  0  0  1;  1  0  0  0;  0 -1  0  0]
(14)
1=[ 1  0  0  0;  0  1  0  0;  0  0  1  0;  0  0  0  1].
(15)

The quaternions satisfy the following identities, sometimes known as Hamilton's rules,

i^2=j^2=k^2=-1
(16)
ij=-ji=k
(17)
jk=-kj=i
(18)
ki=-ik=j.
(19)

They have the following multiplication table.

1ijk
11ijk
ii-1k-j
jj-k-1i
kkj-i-1

The quaternions +/-1, +/-i, +/-j, and +/-k form a non-Abelian group of order eight (with multiplication as the group operation).

The quaternions can be written in the form

 a=a_1+a_2i+a_3j+a_4k.
(20)

The quaternion conjugate is given by

 a^_=a_1-a_2i-a_3j-a_4k.
(21)

The sum of two quaternions is then

 a+b=(a_1+b_1)+(a_2+b_2)i+(a_3+b_3)j+(a_4+b_4)k,
(22)

and the product of two quaternions is

ab=(a_1b_1-a_2b_2-a_3b_3-a_4b_4)+(a_1b_2+a_2b_1+a_3b_4-a_4b_3)i+(a_1b_3-a_2b_4+a_3b_1+a_4b_2)j+(a_1b_4+a_2b_3-a_3b_2+a_4b_1)k.
(23)

The quaternion norm is therefore defined by

 n(a)=sqrt(a^_a)=sqrt(a_1^2+a_2^2+a_3^2+a_4^2).
(24)

In this notation, the quaternions are closely related to four-vectors.

Quaternions can be interpreted as a scalar plus a vector by writing

 a=a_1+a_2i+a_3j+a_4k=(a_1,a),
(25)

where a=[a_2a_3a_4]. In this notation, quaternion multiplication has the particularly simple form

q_1q_2=(s_1,v_1)·(s_2,v_2)
(26)
=(s_1s_2-v_1·v_2,s_1v_2+s_2v_1+v_1xv_2).
(27)

Division is uniquely defined (except by zero), so quaternions form a division algebra. The inverse (reciprocal) of a quaternion is given by

 a^(-1)=(a^_)/([n(a)]^2),
(28)

and the norm is multiplicative

 n(ab)=n(a)n(b).
(29)

In fact, the product of two quaternion norms immediately gives the Euler four-square identity.

A rotation about the unit vector n^^ by an angle theta can be computed using the quaternion

 q=(s,v)=(cos(1/2theta),n^^sin(1/2theta))
(30)

(Arvo 1994, Hearn and Baker 1996). The components of this quaternion are called Euler parameters. After rotation, a point p=(0,p) is then given by

 p^'=qpq^(-1)=qpq^_,
(31)

since n(q)=1. A concatenation of two rotations, first q_1 and then q_2, can be computed using the identity

 q_2(q_1pq^__1)q^__2=(q_2q_1)p(q^__1q^__2)=(q_2q_1)pq_2q_1^_
(32)

(Goldstein 1980).

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.