Lie Algebra on SO3 Groups in Python
Patrick Nicolas
Director Data Engineering @ aidéo technologies |software & data engineering, operations, and machine learning.
Curious about manifolds and the SO(3) Lie group??
Your next step is to explore its associated Lie algebra, which lies in the tangent space. This algebra is a linear space with the same dimension as the Lie group, closed under a bilinear alternating operation known as the Lie bracket. The Lie algebra of SO(3), denoted as so3, consists of all 3x3 skew-symmetric matrices.
Lie algebra on SO3
Implementation
Setup
Projector operator
Lie bracket
References
What you will learn:?How to compute SO3 rotation matrices from tangent vector and extract Lie algebra from points on SO3 manifolds.
Notes:?
Disclaimer?:?A thorough tutorial and explanation of Lie groups, Lie algebras, and geometric priors for deep learning models is beyond the scope of this article. Instead, the following sections concentrate on experimenting with the Lie Algebra on 3-dimension Special Orthogonal manifolds using the?#Geomstats?Python library [ref?6].
Lie algebra on?SO3
As a reminder ....
A?smooth manifold?is a topological space that locally resembles Euclidean space and allows for smooth (infinitely differentiable) transitions between local coordinate systems. This structure allows for the use of calculus on the manifold.?
The?tangent space?at a point on a manifold is the set of tangent vectors at that point, like a line tangent to a circle or a plane tangent to a surface.
Tangent vectors?can act as directional derivatives, where you can apply specific formulas to characterize these derivatives.
A Lie algebra is a vector space g and a bilinear operator known as Lie bracket or?Lie commutator defined as:
with the properties
?
Examples
Let's consider the n-dimension General Linear Group on complex numbers?GL(n, C) of n x n invertible matrices. The Lie algebra is defined as
The?Special Orthogonal Group?in 3 dimensions,?SO(3)?is the group of all rotation matrices in 3 spatial dimensions.
The Lie bracket for the SO3 group is defined as the matrix commutator of two vectors?X, Y on base point P. [X,Y] = X.Y-Y.X with the basis elements:
Implementation
Setup
Geomstats?is a free, open-source Python library designed for conducting machine learning on data situated on nonlinear manifolds, an area known as Geometric Learning. This library offers object-oriented, thoroughly unit-tested features for fundamental manifolds, operations, and learning algorithms, compatible with various execution environments, including?NumPy,?PyTorch, and?TensorFlow?(Overview Geomstats library).
We leverage the class?LieSO3Group?defined in the previous article (?Operations on SO3 Lie Groups in Python - Implementation).
The Lie algebra for the Special Orthogonal Group SO3 for a given tangent vector and base point is implemented through the logarithmic map in the method?lie_algebra?using the?SpecialOrthogonal.log?method in Geomstats.
The algebra matrix is computed from a given fundamental rotation generator along Y-axis at identity in the SO3 manifold.
领英推荐
As expected the Lie algebra of the Lie group point is identical to the original tangent vector.
Algebra element:
[[ 0. 0. 1.]
[ 0. 0. 0.]
[-1. 0. 0.]]
SO3 group element:
[[ 9.19666190e-01 0.00000000e+00 9.97270378e-01]
[ 0.00000000e+00 1.00000000e+00 0.00000000e+00]
[-9.97270378e-01 -3.85335888e-17 9.19666190e-01]]
Computed algebra element:
[[ 3.25136469e-17 0.00000000e+00 1.00000000e+00]
[ 0.00000000e+00 0.00000000e+00 0.00000000e+00]
[-1.00000000e+00 -5.55111512e-17 1.62568234e-17]]
Projector operator
The Lie group projection operator approach is an iterative scheme usually applied to continuous-time optimal control problems on Lie groups. It is mentioned here for reference.
We use the same tangent vector and base point on SO3 manifold to compute the projected matrix.
Projected point with identity:
[[ 2.00000000e+00 0.00000000e+00 0.00000000e+00]
[-5.16112858e-17 1.63116493e+00 -7.78920352e-01]
[-1.03222572e-16 7.78920352e-01 1.63116493e+00]]
Projected point reference
[[ 0. 0. 0.]
[ 0. 0. -1.]
[ 0. 1. 0.]]:
[[ 1.2515165 0.40011923 0.88372822]
[ 0.43685048 1.72667917 -0.53434116]
[-0.85660137 0.51784353 1.00875279]]
Lie Bracket
Finally, we compute the bracket for this element,?self.algebra_element?with another element,?element.
Let first try to compute the bracket of a SO3 rotation (skew matrix) with itself.
Algebra element:
[[ 0. 0. 0.]
[ 0. 0. -1.]
[ 0. 1. 0.]]
SO3 element
[[ 1. 0. 0. ]
[ 0. 0.92 -0.997]
[ 0. 0.997 0.92 ]]
Bracket [x,x]:
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
Now Let's compute the Lie bracket of two tangent vectors, one for SO3 rotation along X axis and the other along Y axis.
[[ 1. 0. 0. ]
[ 0. 0.91966619 -0.99727038]
[ 0. 0.99727038 0.91966619]]
Bracket:
[[ 0. -1. 0.]
[ 1. 0. 0.]
[ 0. 0. 0.]]
The Lie bracket of a rotation along X axis and a rotation along Y axis is a rotation along the Z axis; [lx, ly] = lz
Thanks for reading. For comprehensive topics on geometric learning, including detailed analysis, reviews and exercises, subscribe to Hands-on Geometric Deep Learning
References
Patrick Nicolas has over 25 years of experience in software and data engineering, architecture design and end-to-end deployment and support with extensive knowledge in machine learning.? He has been director of data engineering at Aideo Technologies since 2017 and he is the?author of "Scala for Machine Learning", Packt Publishing ISBN 978-1-78712-238-3 and?Hands-on Geometric Deep Learning newsletter.
#LieGroup #SO3 #LieAlgebra #Manifold #GeometricLearning #Geomstats
Dir. Scientifique IA @ Quarks || Consultant IA | Conférencier
4 个月thank you for your qualitative post! Concerning those groups I have 2 questions: - is there an interest to try to identify such geometry in realistic datasets? - maybe could you share an industrial use case application ?