These two are intrinsically connected. Both quaternions and Lie Algebra have their uses in graphics and robotics, but they work best in different situations.
Lie Algebras, which form the underlying mathematical basis of Lie theory, are often favored in mathematical, physical, and robotics contexts because they work well with infinitesimal transformations – small stepwise adjustments that might arise, for example, in the calculations of a robot’s joint movements. These infinitesimally small changes can then be integrated over to give a resultant large transformation. This is crucial when applying control algorithms or optimization techniques. This is not something quaternions can provide due to their structure.
Furthermore, Lie Algebras offer a clear geometrical interpretation, making it easier to understand the rotation and orientation calculations. This is especially important in fields like robotics where real-world geometric interpretation are of high importance.
Also, Lie groups provide a smooth, continuous manifold structure, which enables smooth interpolation and extrapolation in a way that’s not as straightforward with quaternions.
But how are they connected?
The connection between quaternions and Lie groups/algebras lies in the exponential map.
The set of quaternions that represent rotations form a group often denoted by SU(2). The corresponding Lie algebra su(2) is a 3-dimensional vector space. However, the 3D rotations we typically care about form a different group, SO(3), which has the Lie algebra so(3), also a 3-dimensional vector space. Lie algebras essentially describe the space of infinitesimal rotations around each axis.
There exists an important relation between so(3) and su(2) (which is related to quaternions). That is, “su(2) is the double cover of so(3)”. This sounds complicated, but what it essentially means is that every rotation in 3D space (an element of so(3)) corresponds to exactly two quaternions (elements of su(2)).
To connect these two mathematically:
- Given an element of so(3), which is represented as a 3×3 real skew-symmetric matrix, take the matrix exponential to obtain a rotation matrix in SO(3).
- Alternatively, represent the element of so(3) as a 3D vector, interpret it as an imaginary quaternion, and take the quaternion exponential to obtain a unit quaternion.
- Given a rotation matrix or unit quaternion, take the matrix or quaternion logarithm to obtain an element of so(3).
Hence, in this way, quaternions (and the group SU(2)) and Lie algebras (the algebra su(2) and so(3)) are connected through the exponential/logarithm functions. This is often used in practice to interpolate between rotations, to calculate distances and averages of rotations, etc.
Note: The exponential map for matrices (and hence so(3)) can be calculated using the series definition of the exponential function, or Rodrigues’ rotation formula for the special case of rotation matrices (SO(3)). For quaternions, the exponential function also has a straightforward interpretation in terms of rotations.
Asking more specifically, how to express SU(2) using quaternions in which the angle and i, j, k are defined?
The SU(2) group, when represented with quaternions, is commonly done so in terms of unit quaternions, where a unit quaternion q is expressed as:
q = cos(θ/2) + sin(θ/2)(xi + yj + zk)
Where:
- θ is the angle of rotation
- x, y, z form a 3D unit vector indicating the axis of rotation
- i, j, k are the fundamental quaternion units
Any unit quaternion in this form corresponds to a rotation of θ around the vector (x, y, z) in 3D space. Each rotation can be described by a unit quaternion q and its negation -q (since rotation by angle θ along the axis (x, y, z) is the same as rotation by -θ along the axis -x, -y, -z), which is a key aspect of SU(2) being a double cover of SO(3).
Note: The term “SU(2)” stands for “Special Unitary Group of degree 2”, which is a group of 2×2 unitary matrices with determinant 1. There is an isomorphism between the group of unit quaternions and SU(2), which is why we can make this representation.
Now show the isomorphism between the group of unit quaternions and SU(2):
The isomorphism between 2×2 unitary matrices of determinant 1 (SU(2)) and unit quaternions can be expressed as follows:
Given a unit quaternion, which we’ll write in terms of a scalar and a 3D vector:
q = a + bi + cj + d*k = a + v
Where a^2 + b^2 + c^2 + d^2 = 1 since it is a unit quaternion.
We can represent q as a 2×2 matrix using complex numbers:
M = [a + bi -c + di]
[c + di a – bi]
You can easily verify that M is unitary (M * M† = I ) and has determinant of 1 (|M| = 1) i.e., it belongs to SU(2).
The mapping from the quaternion q to the matrix M is homomorphic, i.e. the product of two quaternions corresponds to the product of their associated matrices, which maintains the group structure. Therefore, the space of unit quaternions is isomorphic to SU(2).
The inverse mapping, from SU(2) to the space of unit quaternion, can also be defined for a matrix:
M = [w x]
[-x* w*]
We can get back the quaternion by:
q = Re(w) + Im(w)*i + Re(x)*j – Im(x)*k,
Here, x* and w* represent the complex conjugates of x and w respectively.
Under these mappings, the product and inverse operations of quaternions correspond precisely to those operations for 2×2 matrices of SU(2).
This means that unit quaternions and 2×2 matrices of SU(2) form the same group, just described in different mathematical language – they’re isomorphic.
It is this isomorphism that allows quaternions to be used to represent 3D rotations, as the structure of the SU(2) group under matrix multiplication mirrors the structure of 3D rotations. This is particularly useful in fields such as graphics and robotics.