|
A quaternion is a four component number that extends the real and complex numbers while preserving addition, multiplication, and division by any nonzero element. Quaternions are especially important in physics and engineering because their multiplication law naturally encodes the ordered geometry of three dimensional space. Unit quaternions will later be used to represent frame orientation, rigid body attitude, and angular kinematics.
This entry develops only the algebra needed before those applications. The main goals are to define a quaternion precisely, derive Hamilton's multiplication table, derive the component formula for a product, and identify which familiar algebraic rules remain valid and which do not.
The convention issues that arise in engineering applications are treated in the preceding PhysicsLibrary article Quaternions for Physics and Engineering: Orientation, Notation, and Conventions. The present article uses Hamilton multiplication throughout. The later PhysicsLibrary attitude articles use passive coordinate transformations, but that application convention does not alter the algebra developed here.
The set of Hamilton quaternions is denoted by
. A quaternion is an expression
 |
(1) |
where
The four basis elements are
The same quaternion may therefore be represented as the ordered four tuple
In the scalar first column notation used in this series,
![$\displaystyle [q]_{\mathrm{PL}} = \begin{bmatrix} q_w\ q_x\ q_y\ q_z \end{bmatrix}.$ $\displaystyle [q]_{\mathrm{PL}} = \begin{bmatrix} q_w\ q_x\ q_y\ q_z \end{bmatrix}.$](https://images.physicslibrary.org/cache/objects/1091/l2h/img6.png) |
(2) |
Equation (2) is a representation of the four real coefficients. It does not mean that quaternion multiplication is ordinary four dimensional vector multiplication. Quaternion multiplication is defined by the special products of , , and developed below.
It is useful to separate a quaternion into a real scalar part and a three component vector part:
 |
(3) |
where
PhysicsLibrary uses
 |
(4) |
when a named scalar or vector part is useful.
A quaternion with zero vector part,
is simply a real number embedded in
. A quaternion with zero scalar part,
 |
(5) |
is called a pure quaternion. Ordinary three dimensional vectors will later be embedded into quaternion calculations in this form.
Two quaternions are equal if and only if all four corresponding real coefficients are equal:
 |
(6) |
Thus one quaternion equation generally represents four scalar equations.
Let
and
Addition is componentwise:
 |
(7) |
Subtraction is defined similarly. For a real scalar ,
 |
(8) |
Real scalars commute with every quaternion:
 |
(9) |
With addition and real scalar multiplication,
is a four dimensional real vector space. Quaternion multiplication gives this vector space additional algebraic structure.
Hamilton's fundamental relation is
 |
(10) |
Together with associativity, this determines the standard Hamilton multiplication table.
The squares are
 |
(11) |
To obtain
, begin with
Multiply on the right by
. Since
associativity gives
 |
(12) |
The cyclic positive products are therefore
 |
(13) |
Reversing the order changes the sign:
 |
(14) |
This failure of the commutative law is a defining feature of quaternion multiplication. Hamilton multiplication remains associative.
The complete basis table is
where the entry in a row is the row factor multiplied on the left by the column factor on the right.
A useful mnemonic for the positive products is
Following the arrows gives a positive product. Going against the arrows gives the negative of the remaining basis element.
The mnemonic is convenient, but the multiplication table is the actual rule to use when checking an unfamiliar convention. Some engineering literature uses a flipped multiplication in which the signs of these cross like products are reversed. PhysicsLibrary uses Hamilton multiplication unless an article explicitly states otherwise.
Let
and
Quaternion multiplication is distributive, so expand as in ordinary algebra but do not reorder quaternion factors:
Using Hamilton's basis products and collecting the coefficients of
gives
In scalar first component form,
![$\displaystyle [pq]_{\mathrm{PL}} = \begin{bmatrix} p_wq_w-p_xq_x-p_yq_y-p_zq_z\... ..._y\ p_wq_y-p_xq_z+p_yq_w+p_zq_x\ p_wq_z+p_xq_y-p_yq_x+p_zq_w \end{bmatrix}.$ $\displaystyle [pq]_{\mathrm{PL}} = \begin{bmatrix} p_wq_w-p_xq_x-p_yq_y-p_zq_z\... ..._y\ p_wq_y-p_xq_z+p_yq_w+p_zq_x\ p_wq_z+p_xq_y-p_yq_x+p_zq_w \end{bmatrix}.$](https://images.physicslibrary.org/cache/objects/1091/l2h/img40.png) |
(16) |
This component formula is often implemented directly in software. It should never be copied into a program without also documenting the component ordering and multiplication convention.
The next PhysicsLibrary quaternion article develops the same result in compact scalar vector form. That form exposes the ordinary dot and cross products hidden inside this component expression.
Using the basis products,
Therefore
 |
(17) |
One counterexample is enough to show that multiplication in
is not commutative.
This is not a defect. Ordered spatial transformations do not generally commute, so a noncommutative algebra is naturally suited to later orientation applications.
For two general quaternions and , one should therefore expect
 |
(18) |
The difference
![$\displaystyle [p,q]\equiv pq-qp$ $\displaystyle [p,q]\equiv pq-qp$](https://images.physicslibrary.org/cache/objects/1091/l2h/img47.png) |
(19) |
is called the commutator. When , those two particular quaternions commute even though the algebra as a whole is noncommutative.
Although commutativity fails, two other familiar multiplication laws remain valid.
Quaternion multiplication is associative:
 |
(20) |
It is distributive over addition:
 |
(21) |
and
 |
(22) |
Associativity means that an unparenthesized product such as has a unique value. What cannot be done is to exchange the order of the factors.
For example,
while
Thus associativity works. But interchanging and gives
which is different.
The real number is the multiplicative identity:
 |
(23) |
The zero quaternion
is the additive identity:
 |
(24) |
It also satisfies
 |
(25) |
Every nonzero Hamilton quaternion has a multiplicative inverse. Therefore
is a noncommutative division algebra over the real numbers.
The conjugate, norm, and explicit inverse formula are developed in later PhysicsLibrary entries so that the present article can concentrate on the fundamental product.
The real numbers occur inside the quaternions as
They commute with all quaternions.
If only one imaginary basis direction is used, for example
then multiplication behaves exactly like ordinary complex number multiplication because
and there are no or factors to introduce noncommutativity. Thus
is a copy of the complex numbers inside
.
The same is true using , , or any unit pure quaternion. This observation becomes useful in later orientation problems because a fixed spatial axis behaves algebraically like an imaginary unit.
Compute
Distribute without changing factor order:
Reverse the two factors:
The products differ only in the sign of the term, but that is enough to demonstrate noncommutativity.
Let
Using the general component formula,
 |
(26) |
Reversing the order gives
 |
(27) |
Hence .
For the basis elements,
The product is associative. But
so it is not commutative.
Consider
Then
Expanding without reordering gives diagonal square terms and reversed mixed pairs. The mixed pairs cancel:
with analogous cancellation for the other pairs. Therefore
 |
(28) |
Thus a unit pure quaternion in an arbitrary three dimensional direction can behave algebraically like an imaginary unit.
- Reordering factors as if they were real variables. In general
. Do not sort terms alphabetically during an expansion.
- Confusing associativity with commutativity. Parentheses may be moved according to
, but factors may not be exchanged.
- Forgetting the negative squares. The Hamilton basis satisfies
.
- Using the multiplication table backward.
, but
.
- Treating a four component storage array as an ordinary vector. Quaternion addition is componentwise, but quaternion multiplication is not.
- Inferring multiplication convention from storage order. Scalar first and scalar last describe only component layout. They do not determine whether the multiplication law is Hamilton or flipped.
- Calling every four component array a quaternion. A quaternion is not merely four numbers. It is four real coefficients together with the multiplication law of
.
- Changing the later active or passive attitude convention and then changing Hamilton's algebra as well. These are separate choices. PhysicsLibrary's move to passive coordinate transformations does not change the Q01 multiplication table.
The exercises are stated first so that the article can be used for self study. Complete solutions follow in the next section.
- Basis multiplication. Evaluate
- Addition and scalar multiplication. For
find
, , and .
- General quaternion product. Let
Compute
.
- Order matters. For the quaternions in Exercise 3, compute
and the commutator
.
- A cancellation identity. Show directly from the multiplication table that
Explain why treating
and as commuting symbols gives the wrong intermediate expression.
- Complex numbers inside the quaternions. Let
where
are real. Show that
and verify that for this restricted pair.
- Associativity versus commutativity. Verify explicitly that
but
State in words what the two calculations demonstrate.
- Arbitrary unit pure quaternion. Let
Expand
using only the multiplication table and prove that .
- Identify a convention error. An engineer writes quaternion components in scalar first order and states
. A colleague claims that the minus sign must be caused by scalar first storage. Is that explanation correct? Identify what the equation actually reveals.
From the Hamilton table,
and
Also,
whereas
Componentwise addition gives
Subtraction gives
Finally,
With
the general product formula gives
Reversing the factors gives
Therefore
The nonzero commutator confirms that these two quaternions do not commute.
Expand without reordering factors:
If the symbols were incorrectly assumed to commute, the two middle terms would instead be combined as
. Quaternion multiplication gives
.
Using
,
Reversing the factors produces
which is the same result because are real. This two dimensional subalgebra is commutative and isomorphic to the complex numbers.
The left grouping gives
The right grouping gives
Hence multiplication is associative for these basis elements. But
so multiplication is not commutative. Associativity permits regrouping; commutativity would permit reordering.
Expand
Grouping reversed mixed pairs gives
Each mixed pair cancels, so
Since
,
 |
(29) |
This result is one of the algebraic reasons arbitrary spatial axes can play the role of an imaginary unit in later quaternion orientation formulas.
The colleague's explanation is incorrect. Scalar first versus scalar last specifies only the order in which the four real coefficients are displayed or stored.
The equation
instead identifies a multiplication law whose orientation is flipped relative to the PhysicsLibrary Hamilton rule
The storage order did not cause the sign change.
The component product derived above is correct and useful, but its pattern of signs can look arbitrary. The next PhysicsLibrary quaternion entry rewrites
and derives the compact Hamilton scalar vector product
 |
(30) |
That form explains the multiplication table through the dot and cross products of ordinary three dimensional vector analysis and is the principal bridge from quaternion algebra to mechanics and later passive frame orientation.
Hamilton's Elements of Quaternions is the primary historical source for the relations among
, including the failure of the commutative law and preservation of associativity.
Joly's A Manual of Quaternions gives a compact development beginning from the scalar and vector parts of a quaternion and explicitly discusses the algebraic properties of the product. Kelland and Tait likewise separate products into scalar and vector parts and provide extensive examples. Hathaway's A Primer of Quaternions was written as an elementary treatment and contains exercises on the fundamental basis relations.
The Wikibooks quaternion article provides a modern openly licensed elementary reference. The notation and organization of this PhysicsLibrary entry are modernized for physics and engineering use; the exposition and worked solutions here are newly written rather than transcribed from the historical sources.
- 1
- W. R. Hamilton, Elements of Quaternions, 2nd ed., edited by C. J. Joly, Longmans, Green, and Co., 1899. Public domain historical source. Internet Archive scan
- 2
- C. J. Joly, A Manual of Quaternions, Macmillan and Co., London, 1905. Public domain historical source. Internet Archive search
- 3
- P. Kelland and P. G. Tait, Introduction to Quaternions, with Numerous Examples, 2nd ed., Macmillan and Co., London, 1882. Public domain historical source. HathiTrust catalog search
- 4
- A. S. Hathaway, A Primer of Quaternions, 1896. Public domain historical source. Project Gutenberg edition
- 5
- Wikibooks contributors, “Abstract Algebra/Quaternions.” Openly licensed instructional source. Wikibooks quaternion article
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution ShareAlike 4.0 International license.
|