|
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 orientation of three-dimensional space. Unit quaternions will later be used to represent finite rotations, 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 make clear which familiar algebraic rules remain valid and which do not.
The convention issues that arise in engineering applications are treated in the preceding PhysicsLibrary entry, Quaternions for Physics and Engineering: Orientation, Notation, and Conventions. The present entry uses the PhysicsLibrary/Hamilton convention throughout.
The set of Hamilton quaternions is denoted by
A quaternion is an expression
 |
(1) |
where
The four basis elements are
Therefore the same quaternion may be represented as the ordered four-tuple
or, in the scalar-first column-vector 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 coefficients of the quaternion. It is not an ordinary four-dimensional vector multiplication rule. Quaternion multiplication is defined by the special products of
developed below.
It is useful to separate a quaternion into a real scalar part and a three-component vector part:
 |
(3) |
where
PhysicsLibrary will use
 |
(4) |
when a named scalar or vector part is useful. Historical quaternion texts often write and for the same ideas. Joly, for example, defines a quaternion as the sum of a scalar and a vector, while Kelland and Tait explicitly decompose products into scalar and vector parts.
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 exactly 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.
Addition is componentwise. If
and
then
 |
(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, equation (10) determines the familiar multiplication table.
First, the squares are already known:
 |
(11) |
To obtain
, start from
Multiply on the right by
. Because
associativity gives
 |
(12) |
Cyclically,
 |
(13) |
Reversing the order changes the sign:
 |
(14) |
Hamilton emphasized this failure of the commutative law while retaining the associative law. Joly likewise develops the multiplication of mutually orthogonal unit vectors and shows that the resulting quaternion multiplication is associative.
The complete basis table is therefore
 |
(15) |
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 the cycle
 |
(16) |
Following the arrows gives a positive product; going against them gives the negative of the remaining basis element.
The mnemonic is convenient, but equation (15) is the actual definition to use when checking an unfamiliar convention. Some engineering literature uses a flipped multiplication in which the signs of the cross-like products are reversed. PhysicsLibrary does not use that multiplication unless explicitly stated.
Let
and
Quaternion multiplication is distributive, so expand as in ordinary algebra, but do not reorder quaternion factors:
Use equations (11)–(14), then collect the coefficients of
:
In scalar-first component form,
![$\displaystyle \boxed{ [pq]_\mathrm{PL} = \begin{bmatrix} p_wq_w-p_xq_x-p_yq_y-p... ...\ 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 \boxed{ [pq]_\mathrm{PL} = \begin{bmatrix} p_wq_w-p_xq_x-p_yq_y-p... ...\ 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) |
(19) |
Equation (19) is the component formula most often implemented in software. It should never be copied into a program without also documenting the component ordering and multiplication convention.
A more compact scalar–vector form of the same product will be derived in the next PhysicsLibrary quaternion entry. That form exposes the dot and cross products hidden inside equation (18).
Using the basis products,
Hence
 |
(20) |
One counterexample is sufficient to show that multiplication in
is not commutative.
This is not a defect. Three-dimensional finite rotations themselves do not in general commute, so a noncommutative product is exactly the sort of algebraic structure needed to encode ordered rotations.
For two general quaternions and , one should therefore expect
 |
(21) |
The difference
![$\displaystyle [p,q]\equiv pq-qp$ $\displaystyle [p,q]\equiv pq-qp$](https://images.physicslibrary.org/cache/objects/1091/l2h/img47.png) |
(22) |
is called their commutator. When , the two particular quaternions commute even though the algebra as a whole is noncommutative.
Although commutativity fails, the two other familiar multiplication laws remain valid.
Quaternion multiplication is associative:
 |
(23) |
It is also distributive over addition:
 |
(24) |
 |
(25) |
These properties are essential. 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:
 |
(26) |
The zero quaternion
is the additive identity:
 |
(27) |
It also satisfies
 |
(28) |
Every nonzero Hamilton quaternion has a multiplicative inverse. This makes
a noncommutative division algebra over the real numbers. The conjugate, norm, and explicit inverse formula are developed in a later entry 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 , or, as will be shown later, any unit pure quaternion.
This observation is useful in rotation problems: rotation about one fixed axis behaves much like complex multiplication in the plane perpendicular to that axis. The genuinely quaternionic behavior appears when different spatial axes interact.
Compute
Distribute without changing the factor order:
Reverse the two factors:
The products differ only in the sign of the term, but that difference is enough to demonstrate noncommutativity.
Let
Using equation (18), the scalar coefficient is
The coefficient is
The coefficient is
The coefficient is
Therefore
 |
(31) |
If the factors are reversed, equation (18) gives
 |
(32) |
The scalar parts happen to agree in this example, but the vector parts are very different. The general reason for this will become transparent in the scalar–vector product formula developed in Q02.
Let
First group the left pair:
 |
(33) |
Now group the right pair:
Both groupings give the same quaternion, as required by associativity.
Consider
Then
Each reversed pair cancels:
with analogous cancellation for the other pairs. Hence
 |
(35) |
Thus behaves algebraically like an imaginary unit even though it points in an arbitrary three-dimensional direction. The general result for an arbitrary unit pure quaternion is proved in Exercise 8.
- 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 componentwise.
- Inferring the product convention from scalar-first or scalar-last storage. Component order and multiplication law are separate choices.
- Calling every four-vector a quaternion. A quaternion is not merely four numbers; it is four real coefficients together with the multiplication law of
.
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
using equation (18).
- 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 would give 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 quaternions 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 equations (13)–(14),
Also,
whereas
Componentwise addition gives
Subtraction gives
Finally,
For
equation (18) 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 be combined as
. Quaternion multiplication instead gives
.
Using
and the fact that real scalars commute,
Reversing the factors produces
which is the same result because are real. Thus 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. Quaternions permit the former but not the latter.
Expand
Each mixed pair cancels because reversing two distinct basis factors changes its sign. Therefore
With
,
This result is one of the algebraic reasons arbitrary spatial axes can play the role of an imaginary unit in quaternion rotation 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
identifies a multiplication law whose orientation is flipped relative to the PhysicsLibrary/Hamilton rule
. The storage order did not cause the sign change.
Equation (18) is correct and useful, but its pattern of signs can look arbitrary. The next PhysicsLibrary entry rewrites
and derives the compact Hamilton product
That scalar–vector form explains the entire multiplication table through the dot and cross products of ordinary three-dimensional vector analysis and is the main bridge from quaternion algebra to mechanics and rigid-body rotations.
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 later A Manual of Quaternions gives a compact development beginning from the scalar and vector parts of a quaternion and explicitly proves associativity. 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 exercise sets on the fundamental basis relations. The Wikibooks quaternion article provides a modern openly licensed four-tuple definition and elementary multiplication exercises.
The notation and pedagogical organization of this PhysicsLibrary entry are modernized for physics and engineering use; the text and worked solutions above 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 copy
- 4
- A. S. Hathaway, A Primer of Quaternions, 1896. Public-domain text; Project Gutenberg edition and LATEX source available. Project Gutenberg edition
- 5
- Wikibooks contributors, “Abstract Algebra/Quaternions.” Openly licensed instructional source; consult the current page history and license notice for attribution requirements. Wikibooks quaternion article
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution–ShareAlike 4.0 International license.
|