Group manifolds and actions
Lie groups, groups that are Manifold
s with a smooth binary group operation AbstractGroupOperation
, are implemented as subtypes of AbstractGroupManifold
or by decorating an existing manifold with a group operation using GroupManifold
.
The common addition and multiplication group operations of AdditionOperation
and MultiplicationOperation
are provided, though their behavior may be customized for a specific group.
Contents
Groups
Group manifold
Manifolds.AbstractGroupManifold
โ TypeAbstractGroupManifold{๐ฝ,O<:AbstractGroupOperation} <: AbstractDecoratorManifold{๐ฝ}
Abstract type for a Lie group, a group that is also a smooth manifold with an AbstractGroupOperation
, a smooth binary operation. AbstractGroupManifold
s must implement at least inv
, identity
, compose
, and translate_diff
.
Manifolds.AbstractGroupOperation
โ TypeAbstractGroupOperation
Abstract type for smooth binary operations $โ$ on elements of a Lie group $\mathcal{G}$:
An operation can be either defined for a specific AbstractGroupManifold
over number system ๐ฝ
or in general, by defining for an operation Op
the following methods:
identity!(::AbstractGroupManifold{๐ฝ,Op}, q, q)
identity(::AbstractGroupManifold{๐ฝ,Op}, p)
inv!(::AbstractGroupManifold{๐ฝ,Op}, q, p)
inv(::AbstractGroupManifold{๐ฝ,Op}, p)
compose(::AbstractGroupManifold{๐ฝ,Op}, p, q)
compose!(::AbstractGroupManifold{๐ฝ,Op}, x, p, q)
Note that a manifold is connected with an operation by wrapping it with a decorator, AbstractGroupManifold
. In typical cases the concrete wrapper GroupManifold
can be used.
Manifolds.ActionDirection
โ TypeActionDirection
Direction of action on a manifold, either LeftAction
or RightAction
.
Manifolds.AdditionOperation
โ TypeAdditionOperation <: AbstractGroupOperation
Group operation that consists of simple addition.
Manifolds.GroupExponentialRetraction
โ TypeGroupExponentialRetraction{D<:ActionDirection} <: AbstractRetractionMethod
Retraction using the group exponential group_exp
"translated" to any point on the manifold.
For more details, see retract
.
Constructor
GroupExponentialRetraction(conv::ActionDirection = LeftAction())
Manifolds.GroupLogarithmicInverseRetraction
โ TypeGroupLogarithmicInverseRetraction{D<:ActionDirection} <: AbstractInverseRetractionMethod
Retraction using the group logarithm group_log
"translated" to any point on the manifold.
For more details, see inverse_retract
.
Constructor
GroupLogarithmicInverseRetraction(conv::ActionDirection = LeftAction())
Manifolds.GroupManifold
โ TypeGroupManifold{๐ฝ,M<:Manifold{๐ฝ},O<:AbstractGroupOperation} <: AbstractGroupManifold{๐ฝ,O}
Decorator for a smooth manifold that equips the manifold with a group operation, thus making it a Lie group. See AbstractGroupManifold
for more details.
Group manifolds by default forward metric-related operations to the wrapped manifold.
Constructor
GroupManifold(manifold, op)
Manifolds.Identity
โ TypeIdentity(G::AbstractGroupManifold, p)
The group identity element $e โ \mathcal{G}$ represented by point p
.
Manifolds.LeftAction
โ TypeLeftAction()
Left action of a group on a manifold.
Manifolds.MultiplicationOperation
โ TypeMultiplicationOperation <: AbstractGroupOperation
Group operation that consists of multiplication.
Manifolds.RightAction
โ TypeRightAction()
Right action of a group on a manifold.
Base.identity
โ Methodidentity(G::AbstractGroupManifold, p)
Identity element $e โ \mathcal{G}$, such that for any element $p โ \mathcal{G}$, $p \circ e = e \circ p = p$. The returned element is of a similar type to p
.
Base.inv
โ Methodinv(G::AbstractGroupManifold, p)
Inverse $p^{-1} โ \mathcal{G}$ of an element $p โ \mathcal{G}$, such that $p \circ p^{-1} = p^{-1} \circ p = e โ \mathcal{G}$, where $e$ is the identity
element of $\mathcal{G}$.
Manifolds.base_group
โ Methodbase_group(M::Manifold) -> AbstractGroupManifold
Un-decorate M
until an AbstractGroupManifold
is encountered. Return an error if the base_manifold
is reached without encountering a group.
Manifolds.compose
โ Methodcompose(G::AbstractGroupManifold, p, q)
Compose elements $p,q โ \mathcal{G}$ using the group operation $p \circ q$.
Manifolds.group_exp
โ Methodgroup_exp(G::AbstractGroupManifold, X)
Compute the group exponential of the Lie algebra element X
.
Given an element $X โ ๐ค = T_e \mathcal{G}$, where $e$ is the identity
element of the group $\mathcal{G}$, and $๐ค$ is its Lie algebra, the group exponential is the map
such that for $t,s โ โ$, $ฮณ(t) = \exp (t X)$ defines a one-parameter subgroup with the following properties:
In general, the group exponential map is distinct from the Riemannian exponential map exp
.
group_exp(G::AbstractGroupManifold{๐ฝ,AdditionOperation}, X) where {๐ฝ}
Compute $q = X$.
group_exp(G::AbstractGroupManifold{๐ฝ,MultiplicationOperation}, X) where {๐ฝ}
For Number
and AbstractMatrix
types of X
, compute the usual numeric/matrix exponential,
Manifolds.group_log
โ Methodgroup_log(G::AbstractGroupManifold, q)
Compute the group logarithm of the group element q
.
Given an element $q โ \mathcal{G}$, compute the right inverse of the group exponential map group_exp
, that is, the element $\log q = X โ ๐ค = T_e \mathcal{G}$, such that $q = \exp X$
In general, the group logarithm map is distinct from the Riemannian logarithm map log
.
group_log(G::AbstractGroupManifold{๐ฝ,AdditionOperation}, q) where {๐ฝ}
Compute $X = q$.
group_log(G::AbstractGroupManifold{๐ฝ,MultiplicationOperation}, q) where {๐ฝ}
For Number
and AbstractMatrix
types of q
, compute the usual numeric/matrix logarithm:
where $e$ here is the identity
element, that is, $1$ for numeric $q$ or the identity matrix $I_m$ for matrix $q โ โ^{m ร m}$.
Manifolds.inverse_translate
โ Methodinverse_translate(G::AbstractGroupManifold, p, q)
inverse_translate(G::AbstractGroupManifold, p, q, conv::ActionDirection=LeftAction())
Inverse translate group element $q$ by $p$ with the inverse translation $ฯ_p^{-1}$ with the specified conv
ention, either left ($L_p^{-1}$) or right ($R_p^{-1}$), defined as
Manifolds.inverse_translate_diff
โ Methodinverse_translate_diff(G::AbstractGroupManifold, p, q, X)
inverse_translate_diff(G::AbstractGroupManifold, p, q, X, conv::ActionDirection=LeftAction())
For group elements $p, q โ \mathcal{G}$ and tangent vector $X โ T_q \mathcal{G}$, compute the action on $X$ of the differential of the inverse translation $ฯ_p$ by $p$, with the specified left or right conv
ention. The differential transports vectors:
Manifolds.switch_direction
โ Methodswitch_direction(::ActionDirection)
Returns a RightAction
when given a LeftAction
and vice versa.
Manifolds.translate
โ Methodtranslate(G::AbstractGroupManifold, p, q)
translate(G::AbstractGroupManifold, p, q, conv::ActionDirection=LeftAction()])
Translate group element $q$ by $p$ with the translation $ฯ_p$ with the specified conv
ention, either left ($L_p$) or right ($R_p$), defined as
Manifolds.translate_diff
โ Methodtranslate_diff(G::AbstractGroupManifold, p, q, X)
translate_diff(G::AbstractGroupManifold, p, q, X, conv::ActionDirection=LeftAction())
For group elements $p, q โ \mathcal{G}$ and tangent vector $X โ T_q \mathcal{G}$, compute the action of the differential of the translation $ฯ_p$ by $p$ on $X$, with the specified left or right conv
ention. The differential transports vectors:
ManifoldsBase.inverse_retract
โ Methodinverse_retract(
G::AbstractGroupManifold,
p,
X,
method::GroupLogarithmicInverseRetraction{<:ActionDirection},
)
Compute the inverse retraction using the group logarithm group_log
"translated" to any point on the manifold. With a group translation (translate
) $ฯ_p$ in a specified direction, the retraction is
where $\log$ is the group logarithm (group_log
), and $(\mathrm{d}ฯ_p)_e$ is the action of the differential of translation $ฯ_p$ evaluated at the identity element $e$ (see translate_diff
).
ManifoldsBase.retract
โ Methodretract(
G::AbstractGroupManifold,
p,
X,
method::GroupExponentialRetraction{<:ActionDirection},
)
Compute the retraction using the group exponential group_exp
"translated" to any point on the manifold. With a group translation (translate
) $ฯ_p$ in a specified direction, the retraction is
where $\exp$ is the group exponential (group_exp
), and $(\mathrm{d}ฯ_p^{-1})_p$ is the action of the differential of inverse translation $ฯ_p^{-1}$ evaluated at $p$ (see inverse_translate_diff
).
Product group
Manifolds.ProductGroup
โ MethodProductGroup{๐ฝ,T} <: GroupManifold{๐ฝ,ProductManifold{T},ProductOperation}
Decorate a product manifold with a ProductOperation
.
Each submanifold must also be an AbstractGroupManifold
or a decorated instance of one. This type is mostly useful for equipping the direct product of group manifolds with an Identity
element.
Constructor
ProductGroup(manifold::ProductManifold)
Manifolds.ProductOperation
โ TypeProductOperation <: AbstractGroupOperation
Direct product group operation.
Semidirect product group
Manifolds.SemidirectProductGroup
โ MethodSemidirectProductGroup(N::GroupManifold, H::GroupManifold, A::AbstractGroupAction)
A group that is the semidirect product of a normal group $\mathcal{N}$ and a subgroup $\mathcal{H}$, written $\mathcal{G} = \mathcal{N} โ_ฮธ \mathcal{H}$, where $ฮธ: \mathcal{H} ร \mathcal{N} โ \mathcal{N}$ is an automorphism action of $\mathcal{H}$ on $\mathcal{N}$. The group $\mathcal{G}$ has the composition rule
and the inverse
Manifolds.SemidirectProductOperation
โ TypeSemidirectProductOperation(action::AbstractGroupAction)
Group operation of a semidirect product group. The operation consists of the operation opN
on a normal subgroup N
, the operation opH
on a subgroup H
, and an automorphism action
of elements of H
on N
. Only the action is stored.
Circle group
Manifolds.CircleGroup
โ TypeCircleGroup <: GroupManifold{Circle{โ},MultiplicationOperation}
The circle group is the complex circle (Circle(โ)
) equipped with the group operation of complex multiplication (MultiplicationOperation
).
Special orthogonal group
Manifolds.SpecialOrthogonal
โ TypeSpecialOrthogonal{n} <: GroupManifold{โ,Rotations{n},MultiplicationOperation}
Special orthogonal group $\mathrm{SO}(n)$ represented by rotation matrices.
Constructor
SpecialOrthogonal(n)
Translation group
Manifolds.TranslationGroup
โ TypeTranslationGroup{T<:Tuple,๐ฝ} <: GroupManifold{Euclidean{T,๐ฝ},AdditionOperation}
Translation group $\mathrm{T}(n)$ represented by translation arrays.
Constructor
TranslationGroup(nโ,...,nแตข; field = ๐ฝ)
Generate the translation group on $๐ฝ^{nโ,โฆ,nแตข}$ = Euclidean(nโ,...,nแตข; field = ๐ฝ)
, which is isomorphic to the group itself.
Special Euclidean group
Manifolds.SpecialEuclidean
โ TypeSpecialEuclidean(n)
Special Euclidean group $\mathrm{SE}(n)$, the group of rigid motions.
$\mathrm{SE}(n)$ is the semidirect product of the TranslationGroup
on $โ^n$ and SpecialOrthogonal(n)
where $ฮธ$ is the canonical action of $\mathrm{SO}(n)$ on $\mathrm{T}(n)$ by vector rotation.
This constructor is equivalent to calling
Tn = TranslationGroup(n)
SOn = SpecialOrthogonal(n)
SemidirectProductGroup(Tn, SOn, RotationAction(Tn, SOn))
Points on $\mathrm{SE}(n)$ may be represented as points on the underlying product manifold $\mathrm{T}(n) ร \mathrm{SO}(n)$. For group-specific functions, they may also be represented as affine matrices with size (n + 1, n + 1)
(see affine_matrix
), for which the group operation is MultiplicationOperation
.
Manifolds.affine_matrix
โ Methodaffine_matrix(G::SpecialEuclidean, p) -> AbstractMatrix
Represent the point $p โ \mathrm{SE}(n)$ as an affine matrix. For $p = (t, R) โ \mathrm{SE}(n)$, where $t โ \mathrm{T}(n), R โ \mathrm{SO}(n)$, the affine representation is the $n + 1 ร n + 1$ matrix
See also screw_matrix
for matrix representations of the Lie algebra.
Manifolds.group_exp
โ Methodgroup_exp(G::SpecialEuclidean{2}, X)
Compute the group exponential of $X = (b, ฮฉ) โ ๐ฐ๐ข(2)$, where $b โ ๐ฑ(2)$ and $ฮฉ โ ๐ฐ๐ฌ(2)$:
where $t โ \mathrm{T}(2)$, $R = \exp ฮฉ$ is the group exponential on $\mathrm{SO}(2)$,
and $ฮธ = \frac{1}{\sqrt{2}} \lVert ฮฉ \rVert_e$ (see norm
) is the angle of the rotation.
Manifolds.group_exp
โ Methodgroup_exp(G::SpecialEuclidean{3}, X)
Compute the group exponential of $X = (b, ฮฉ) โ ๐ฐ๐ข(3)$, where $b โ ๐ฑ(3)$ and $ฮฉ โ ๐ฐ๐ฌ(3)$:
where $t โ \mathrm{T}(3)$, $R = \exp ฮฉ$ is the group exponential on $\mathrm{SO}(3)$,
and $ฮธ = \frac{1}{\sqrt{2}} \lVert ฮฉ \rVert_e$ (see norm
) is the angle of the rotation.
Manifolds.group_exp
โ Methodgroup_exp(G::SpecialEuclidean{n}, X)
Compute the group exponential of $X = (b, ฮฉ) โ ๐ฐ๐ข(n)$, where $b โ ๐ฑ(n)$ and $ฮฉ โ ๐ฐ๐ฌ(n)$:
where $t โ \mathrm{T}(n)$ and $R = \exp ฮฉ$ is the group exponential on $\mathrm{SO}(n)$.
In the screw_matrix
representation, the group exponential is the matrix exponential (see group_exp
).
Manifolds.group_log
โ Methodgroup_log(G::SpecialEuclidean{2}, p)
Compute the group logarithm of $p = (t, R) โ \mathrm{SE}(2)$, where $t โ \mathrm{T}(2)$ and $R โ \mathrm{SO}(2)$:
where $b โ ๐ฑ(2)$, $ฮฉ = \log R โ ๐ฐ๐ฌ(2)$ is the group logarithm on $\mathrm{SO}(2)$,
and $ฮธ = \frac{1}{\sqrt{2}} \lVert ฮฉ \rVert_e$ (see norm
) is the angle of the rotation.
Manifolds.group_log
โ Methodgroup_log(G::SpecialEuclidean{3}, p)
Compute the group logarithm of $p = (t, R) โ \mathrm{SE}(3)$, where $t โ \mathrm{T}(3)$ and $R โ \mathrm{SO}(3)$:
where $b โ ๐ฑ(3)$, $ฮฉ = \log R โ ๐ฐ๐ฌ(3)$ is the group logarithm on $\mathrm{SO}(3)$,
and $ฮธ = \frac{1}{\sqrt{2}} \lVert ฮฉ \rVert_e$ (see norm
) is the angle of the rotation.
Manifolds.group_log
โ Methodgroup_log(G::SpecialEuclidean{n}, p) where {n}
Compute the group logarithm of $p = (t, R) โ \mathrm{SE}(n)$, where $t โ \mathrm{T}(n)$ and $R โ \mathrm{SO}(n)$:
where $b โ ๐ฑ(n)$ and $ฮฉ = \log R โ ๐ฐ๐ฌ(n)$ is the group logarithm on $\mathrm{SO}(n)$.
In the affine_matrix
representation, the group logarithm is the matrix logarithm (see group_log
):
Manifolds.screw_matrix
โ Methodscrew_matrix(G::SpecialEuclidean, X) -> AbstractMatrix
Represent the Lie algebra element $X โ ๐ฐ๐ข(n) = T_e \mathrm{SE}(n)$ as a screw matrix. For $X = (b, ฮฉ) โ ๐ฐ๐ข(n)$, where $ฮฉ โ ๐ฐ๐ฌ(n) = T_e \mathrm{SO}(n)$, the screw representation is the $n + 1 ร n + 1$ matrix
See also affine_matrix
for matrix representations of the Lie group.
Group actions
Manifolds.AbstractGroupAction
โ TypeAbstractGroupAction
An abstract group action on a manifold.
Manifolds.apply!
โ Methodapply!(A::AbstractGroupAction, q, a, p)
Apply action a
to the point p
with the rule specified by A
. The result is saved in q
.
Manifolds.apply
โ Methodapply(A::AbstractGroupAction, a, p)
Apply action a
to the point p
using map $ฯ_a$, specified by A
. Unless otherwise specified, the right action is defined in terms of the left action:
Manifolds.apply_diff
โ Methodapply_diff(A::AbstractGroupAction, a, p, X)
For group point $p โ \mathcal M$ and tangent vector $X โ T_p \mathcal M$, compute the action on $X$ of the differential of the action of $a โ \mathcal{G}$, specified by rule A
. Written as $(\mathrm{d}ฯ_a)_p$, with the specified left or right convention, the differential transports vectors
Manifolds.base_group
โ Methodbase_group(A::AbstractGroupAction)
The group that acts in action A
.
Manifolds.center_of_orbit
โ Functioncenter_of_orbit(
A::AbstractGroupAction,
pts,
p,
mean_method::AbstractEstimationMethod = GradientDescentEstimation(),
)
Calculate an action element $a$ of action A
that is the mean element of the orbit of p
with respect to given set of points pts
. The mean
is calculated using the method mean_method
.
The orbit of $p$ with respect to the action of a group $\mathcal{G}$ is the set
This function is useful for computing means on quotients of manifolds by a Lie group action.
Manifolds.direction
โ Methoddirection(::AbstractGroupAction{AD}) -> AD
Get the direction of the action
Manifolds.g_manifold
โ Methodg_manifold(A::AbstractGroupAction)
The manifold the action A
acts upon.
Manifolds.inverse_apply!
โ Methodinverse_apply!(A::AbstractGroupAction, q, a, p)
Apply inverse of action a
to the point p
with the rule specified by A
. The result is saved in q
.
Manifolds.inverse_apply
โ Methodinverse_apply(A::AbstractGroupAction, a, p)
Apply inverse of action a
to the point p
. The action is specified by A
.
Manifolds.inverse_apply_diff
โ Methodinverse_apply_diff(A::AbstractGroupAction, a, p, X)
For group point $p โ \mathcal M$ and tangent vector $X โ T_p \mathcal M$, compute the action on $X$ of the differential of the inverse action of $a โ \mathcal{G}$, specified by rule A
. Written as $(\mathrm{d}ฯ_a^{-1})_p$, with the specified left or right convention, the differential transports vectors
Manifolds.optimal_alignment!
โ Methodoptimal_alignment!(A::AbstractGroupAction, x, p, q)
Calculate an action element of action A
that acts upon p
to produce the element closest to q
. The result is written to x
.
Manifolds.optimal_alignment
โ Methodoptimal_alignment(A::AbstractGroupAction, p, q)
Calculate an action element $a$ of action A
that acts upon p
to produce the element closest to q
in the metric of the G-manifold:
where $\mathcal{G}$ is the group that acts on the G-manifold $\mathcal M$.
Group operation action
Manifolds.GroupOperationAction
โ TypeGroupOperationAction(group::AbstractGroupManifold, AD::ActionDirection = LeftAction())
Action of a group upon itself via left or right translation.
Rotation action
Manifolds.RotationAction
โ TypeRotationAction(
M::Manifold,
SOn::SpecialOrthogonal,
AD::ActionDirection = LeftAction(),
)
Space of actions of the SpecialOrthogonal
group $\mathrm{SO}(n)$ on a Euclidean-like manifold M
of dimension n
.
Translation action
Manifolds.TranslationAction
โ TypeTranslationAction(
M::Manifold,
Rn::TranslationGroup,
AD::ActionDirection = LeftAction(),
)
Space of actions of the TranslationGroup
$\mathrm{T}(n)$ on a Euclidean-like manifold M
.
The left and right actions are equivalent.
Invariant metrics
Manifolds.InvariantMetric
โ TypeInvariantMetric{G<:Metric,D<:ActionDirection} <: Metric
Extend a metric on the Lie algebra of an AbstractGroupManifold
to the whole group via translation in the specified direction.
Given a group $\mathcal{G}$ and a left- or right group translation map $ฯ$ on the group, a metric $g$ is $ฯ$-invariant if it has the inner product
for all $p,q โ \mathcal{G}$ and $X,Y โ T_p \mathcal{G}$, where $(\mathrm{d}ฯ_q)_p$ is the differential of translation by $q$ evaluated at $p$ (see translate_diff
).
InvariantMetric
constructs an (assumed) $ฯ$-invariant metric by extending the inner product of a metric $h_e$ on the Lie algebra to the whole group:
The invariance condition is not checked and must be verified for the entire group. To verify the condition for a set of points numerically, use has_approx_invariant_metric
.
The convenient aliases LeftInvariantMetric
and RightInvariantMetric
are provided.
Constructor
InvariantMetric(metric::Metric, conv::ActionDirection = LeftAction())
Manifolds.LeftInvariantMetric
โ MethodLeftInvariantMetric(metric::Metric)
Alias for a left-InvariantMetric
.
Manifolds.RightInvariantMetric
โ MethodRightInvariantMetric(metric::Metric)
Alias for a right-InvariantMetric
.
Manifolds.biinvariant_metric_dispatch
โ Methodbiinvariant_metric_dispatch(G::AbstractGroupManifold) -> Val
Return Val(true)
if the metric on the manifold is bi-invariant, that is, if the metric is both left- and right-invariant (see invariant_metric_dispatch
).
Manifolds.has_approx_invariant_metric
โ Methodhas_approx_invariant_metric(
G::AbstractGroupManifold,
p,
X,
Y,
qs::AbstractVector,
conv::ActionDirection = LeftAction();
kwargs...,
) -> Bool
Check whether the metric on the group $\mathcal{G}$ is (approximately) invariant using a set of predefined points. Namely, for $p โ \mathcal{G}$, $X,Y โ T_p \mathcal{G}$, a metric $g$, and a translation map $ฯ_q$ in the specified direction, check for each $q โ \mathcal{G}$ that the following condition holds:
This is necessary but not sufficient for invariance.
Optionally, kwargs
passed to isapprox
may be provided.
Manifolds.invariant_metric_dispatch
โ Methodinvariant_metric_dispatch(G::AbstractGroupManifold, conv::ActionDirection) -> Val
Return Val(true)
if the metric on the group $\mathcal{G}$ is invariant under translations by the specified direction, that is, given a group $\mathcal{G}$, a left- or right group translation map $ฯ$, and a metric $g_e$ on the Lie algebra, a $ฯ$-invariant metric at any point $p โ \mathcal{G}$ is defined as a metric with the inner product
for $X,Y โ T_q \mathcal{G}$ and all $q โ \mathcal{G}$, where $(\mathrm{d}ฯ_q)_p$ is the differential of translation by $q$ evaluated at $p$ (see translate_diff
).