Quaternions in the quantum world.
Quaternions are four-component numbers that make rotations composable and elegant. Their most useful connection to ordinary quantum computing is the exact bridge between unit quaternions, spin, the Bloch sphere, Pauli matrices, and single-qubit gates.
From a line, to a plane, to rotations.
A quaternion is a scalar plus a three-dimensional imaginary vector. Multiplication carries orientation information, which makes unit quaternions exceptionally useful for rotations.
Real numbers
One coordinate on a line. Multiplication scales.
Complex numbers
Two coordinates. Multiplication can scale and rotate a plane.
Quaternions
Four coordinates. A unit quaternion encodes a three-dimensional rotation.
Think of a unit quaternion as a rotation instruction.
The real component controls the rotation angle. The three imaginary coefficients point along the rotation axis. Multiplying two unit quaternions composes two rotations into one. The half-angle in the formula is essential: q and −q represent the same physical 3D rotation.
A number system born from a rotation problem.
Quaternions were not invented as a quantum formalism. They emerged from Hamilton's search for a multiplication rule capable of representing spatial rotations.
Hamilton's breakthrough
William Rowan Hamilton formulates quaternions and the relation i² = j² = k² = ijk = −1.
Geometric development
Hamilton and Tait develop quaternion methods for geometry and mechanics.
Vector analysis
Gibbs and Heaviside extract vector algebra, which becomes dominant in physics education.
Quantum mechanics
Complex Hilbert spaces, spinors, and Pauli matrices become central to quantum theory.
Rotations and quantum gates
Quaternions remain important in attitude control, graphics, robotics, and the geometry of single-qubit operations.
The algebra, carefully.
A quaternion q = a + bi + cj + dk has one real component a and a vector part (b,c,d). Quaternion multiplication is associative and distributive, but generally not commutative.
Basis multiplication
| × | 1 | i | j | k |
|---|---|---|---|---|
| 1 | 1 | i | j | k |
| i | i | −1 | k | −j |
| j | j | −k | −1 | i |
| k | k | j | −i | −1 |
Notice ij = k but ji = −k. Reversing order reverses orientation.
Core operations
The dot product contributes to the scalar part; the cross product contributes to the vector part.
Encoding and applying a rotation
- Choose a unit axis n̂ = (nₓ,nᵧ,n_z) and a rotation angle θ.
- Build a unit quaternion: q = cos(θ/2) + (nₓi + nᵧj + n_zk)sin(θ/2).
- Embed the vector: v = (vₓ,vᵧ,v_z) becomes the pure quaternion 0 + vₓi + vᵧj + v_zk.
- Rotate: v′ = qvq*. For a unit quaternion, q* = q⁻¹.
Quaternion, vector, spinor, or matrix?
These objects are related, but they answer different questions. Confusing them is a common source of errors.
| Object | Components | Primary meaning | Rotation role | Important caution |
|---|---|---|---|---|
| 3D vector | (x,y,z) | Magnitude and direction | The object being rotated | A vector does not by itself encode a full rotation. |
| Unit quaternion | (a,b,c,d), norm 1 | Axis and angle | Compact rotation operator | q and −q encode the same SO(3) rotation. |
| Rotation matrix | 3×3 real matrix | Linear map on ℝ³ | Acts directly on vectors | Nine entries obey six constraints. |
| Qubit state | Two complex amplitudes | Quantum state ray | Point on Bloch sphere after removing global phase | Global phase is physically unobservable for an isolated state. |
| SU(2) operator | 2×2 complex unitary, det = 1 | Single-qubit rotation | Acts on a spinor/qubit | SU(2) double-covers SO(3). |
Unit quaternions and SU(2) are the same rotation geometry.
Every unit quaternion can be mapped to a special unitary 2×2 complex matrix. This is why quaternion language appears naturally when studying spin-½ particles and single-qubit gates.
Unit quaternion
a²+b²+c²+d²=1
Pauli matrices
The imaginary quaternion units can be represented by −i times the Pauli matrices, with a consistent sign convention. Their multiplication mirrors quaternion multiplication.
Double cover
Unit quaternions form a 3-sphere. Two antipodal quaternions q and −q map to the same physical rotation in SO(3), just as U and −U act identically on Bloch vectors.
Quantum gates
A rotation around axis n̂ has the same half-angle structure as the corresponding unit quaternion.
Experiment with the mathematics.
All calculations run locally in this HTML file. Change the values and compare the results.
Quaternion algebra workbench
Enter q and r. Compare qr with rq to see noncommutativity directly.
Axis–angle rotation and quantum-gate converter
Choose a rotation axis, vector, and angle. The calculator builds the unit quaternion, rotates the vector, and shows the equivalent SU(2) matrix.
X, Y, Z, and H presets match the familiar gates up to a physically irrelevant global phase. S and T are z-axis rotations up to global phase. Controlled operations require more careful phase bookkeeping.
Move a pure qubit on the Bloch sphere
After normalization and global phase are removed, a pure qubit needs two real angles. A unit quaternion needs three parameters, so it naturally describes a rotation acting on the qubit—not a unique qubit state.
Short conceptual review.
Open each item after forming your own answer.
Why is quaternion multiplication noncommutative?
The vector part includes a cross product. Reversing the operands reverses the cross product's sign, so pq and qp generally differ.
Why does the rotation quaternion use θ/2?
Unit quaternions and SU(2) double-cover the ordinary rotation group SO(3). The half-angle produces the correct physical rotation after the sandwich operation qvq*.
Does a quantum computer normally store amplitudes as quaternions?
No. Standard quantum mechanics uses complex Hilbert spaces. Quaternions are a powerful representation of the SU(2) rotations that act on a qubit.
Why do q and −q represent the same 3D rotation?
In (−q)v(−q)* the two minus signs cancel, producing qvq*. They are antipodal points on the unit 3-sphere that map to the same SO(3) rotation.
Continue learning.
These links cover history, quantum computation, visualization, and quaternionic extensions of quantum mechanics.