Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lie_bracket and adjoint_action #381

Merged
merged 45 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5e2904d
lie_bracket and adjoint_action
mateuszbaran Jun 10, 2021
22d64b7
fixes
mateuszbaran Jun 11, 2021
7311871
more tests and some comments
mateuszbaran Jun 11, 2021
656cebe
test fixed
mateuszbaran Jun 11, 2021
4149cb3
Apply suggestions from code review
mateuszbaran Jun 11, 2021
d4b7c4a
Update src/groups/group.jl
mateuszbaran Jun 14, 2021
37d0553
modify the default adjoint_action definition, remove an untested meth…
mateuszbaran Jun 14, 2021
c959baf
Update src/groups/group.jl
mateuszbaran Jun 14, 2021
ab56bd9
[not tested] some work on SE(n)
mateuszbaran Jun 14, 2021
f5df573
some work on differential of right translation on semidirect product …
mateuszbaran Jun 18, 2021
ea87859
Apply suggestions from code review
mateuszbaran Jun 18, 2021
ec2f79e
introduction of connection manifolds
mateuszbaran Jun 21, 2021
a3686c9
move gaussian curvature to connection manifolds
mateuszbaran Jun 21, 2021
e610bac
right translate_diff on SE(n)
mateuszbaran Jun 21, 2021
82273a1
Update src/groups/special_euclidean.jl
mateuszbaran Jun 21, 2021
5338ecb
finally correct right translation on SE(n)
mateuszbaran Jun 22, 2021
b1bf4ed
Removed some experimantal code
mateuszbaran Jun 22, 2021
5ffc8e5
mostly more tests
mateuszbaran Jun 23, 2021
1850186
Update test/groups/special_euclidean.jl
mateuszbaran Jun 23, 2021
a3b811b
fixed adjoint action on SE(3)
mateuszbaran Jun 23, 2021
44c7ee5
mostly documentation
mateuszbaran Jun 23, 2021
e1dbba3
Update src/groups/special_euclidean.jl
mateuszbaran Jun 23, 2021
b6cda57
a few docs changes
mateuszbaran Jun 28, 2021
5a8d0b8
mostly docs
mateuszbaran Jun 29, 2021
93435c1
Merge branch 'master' into mbaran/lie-bracket
mateuszbaran Jun 30, 2021
623c84d
formatting
mateuszbaran Jun 30, 2021
d46ab3f
More work on Cartan-Schouten connections
mateuszbaran Jul 1, 2021
b4d00e5
more testing of vector transport on rotations; notation fixes; optimi…
mateuszbaran Jul 2, 2021
ce91fa8
docs, exports, small cleanup
mateuszbaran Jul 3, 2021
61f5b7c
fix test
mateuszbaran Jul 3, 2021
58d567d
one more test
mateuszbaran Jul 3, 2021
a83325e
Update docs/src/manifolds/connection.md
mateuszbaran Jul 6, 2021
c3b3257
Apply suggestions from code review
mateuszbaran Jul 6, 2021
8e8ba4c
documentation
mateuszbaran Jul 7, 2021
6061044
Merge branch 'mbaran/lie-bracket' of https://github.com/JuliaManifold…
mateuszbaran Jul 7, 2021
f3d7c43
new docs
mateuszbaran Jul 8, 2021
9e0090a
documentation fixes
mateuszbaran Jul 8, 2021
0b04c55
scalar Ricci curvature moved back to MetricManifold
mateuszbaran Jul 9, 2021
d0cffd9
documentation improvements
mateuszbaran Jul 9, 2021
744b4b3
SE_in_GL renaming
mateuszbaran Jul 9, 2021
ea2afef
Update src/groups/connections.jl
mateuszbaran Jul 9, 2021
9844441
docs fixes
mateuszbaran Jul 9, 2021
fa7b8a1
Merge branch 'master' into mbaran/lie-bracket
mateuszbaran Jul 9, 2021
b9776a0
bump version
mateuszbaran Jul 9, 2021
2c604ff
disable an ambiguity test bacause it takes way too long
mateuszbaran Jul 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ makedocs(
"Vector bundle" => "manifolds/vector_bundle.md",
],
"Manifold decorators" => [
"Metric manifold" => "manifolds/metric.md",
"Connection manifold" => "manifolds/connection.md",
"Group manifold" => "manifolds/group.md",
"Metric manifold" => "manifolds/metric.md",
],
],
"Features on Manifolds" => [
Expand Down
39 changes: 39 additions & 0 deletions docs/src/manifolds/connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Connection manifold

A connection manifold always consists of a [topological manifold](https://en.wikipedia.org/wiki/Topological_manifold) together with a [connection](https://en.wikipedia.org/wiki/Connection_(mathematics)) $\Gamma$.

However, often there is an implicitly assumed (default) connection, like the [`LeviCivitaConnection`](@ref) connection on a Riemannian manifold.
It is not necessary to use this decorator if you implement just one (or the first) connection.
If you later introduce a second, the old (first) connection can be used with the (non [`AbstractConnectionManifold`](@ref)) [`AbstractManifold`](@ref), i.e. without an explicitly stated connection.

This manifold decorator serves two purposes:

1. to implement different connections (e.g. in closed form) for one [`AbstractManifold`](@ref)
2. to provide a way to compute geodesics on manifolds, where this [`AbstractAffineConnection`](@ref) does not yield a closed formula.

An example of usage can be found in Cartan-Schouten connections, see [`AbstractCartanSchoutenConnection`](@ref).

```@contents
Pages = ["connection.md"]
Depth = 2
```

## Types

```@autodocs
Modules = [Manifolds, ManifoldsBase]
Pages = ["manifolds/ConnectionManifold.jl"]
Order = [:type]
```

## Functions

```@autodocs
Modules = [Manifolds, ManifoldsBase]
Pages = ["manifolds/ConnectionManifold.jl"]
Order = [:function]
```

## [Charts and bases of vector spaces](@id connections_charts)

All connection-related functions take a basis of a vector space as one of the arguments. This is needed because generally there is no way to define these functions without referencing a basis. In some cases there is no need to be explicit about this basis, and then for example a [`DefaultOrthonormalBasis`](@ref) object can be used. In cases where being explicit about these bases is needed, for example when using multiple charts, a basis can be specified, for example using [`induced_basis`](@ref Main.Manifolds.induced_basis).
43 changes: 43 additions & 0 deletions docs/src/manifolds/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,28 @@ Lie groups, groups that are [`AbstractManifold`](@ref)s with a smooth binary gro

The common addition and multiplication group operations of [`AdditionOperation`](@ref) and [`MultiplicationOperation`](@ref) are provided, though their behavior may be customized for a specific group.

There are short introductions at the beginning of each subsection. They briefly mention what is available with links to more detailed descriptions.

#### Contents

```@contents
Pages = ["group.md"]
Depth = 3
```

## Groups

The following operations are available for group manifolds:

* [`identity`](@ref): get the identity of the group.
* [`inv`](@ref): get the inverse of a given element.
* [`compose`](@ref): compose two given elements of a group.

### Group manifold

[`GroupManifold`](@ref) adds a group structure to the wrapped manifold.
It does not affect metric (or connection) structure of the wrapped manifold, however it can to be further wrapped in [`MetricManifold`](@ref) to get invariant metrics, or in a [`ConnectionManifold`](@ref) to equip it with a Cartan-Schouten connection.

```@autodocs
Modules = [Manifolds]
Pages = ["groups/group.jl"]
Expand Down Expand Up @@ -86,6 +98,29 @@ Order = [:type, :function]

## Group actions

Group actions represent actions of a given group on a specified manifold.
The following operations are available:

* [`apply`](@ref): performs given action of an element of the group on an object of compatible type.
* [`apply_diff`](@ref): differential of [`apply`](@ref) with respect to the object it acts upon.
* [`direction`](@ref): tells whether a given action is [`LeftAction`](@ref) or [`RightAction`](@ref).
* [`inverse_apply`](@ref): performs given action of the inverse of an element of the group on an object of compatible type. By default inverts the element and calls [`apply`](@ref) but it may be have a faster implementation for some actions.
* [`inverse_apply_diff`](@ref): counterpart of [`apply_diff`](@ref) for [`inverse_apply`](@ref).
* [`optimal_alignment`](@ref): determine the element of a group that, when it acts upon a point, produces the element closest to another given point in the metric of the G-manifold.

Furthermore, group operation action features the following:

* [`translate`](@ref Main.Manifolds.translate): an operation that performs either left ([`LeftAction`](@ref)) or right ([`RightAction`](@ref)) translation. This is by default performed by calling [`compose`](@ref) with appropriate order of arguments. This function is separated from `compose` mostly to easily represent its differential, [`translate_diff`](@ref).
* [`translate_diff`](@ref): differential of [`translate`](@ref Main.Manifolds.translate) with respect to the point being translated.
* [`adjoint_action`](@ref): adjoint action of a given element of a Lie group on an element of its Lie algebra.
* [`lie_bracket`](@ref): Lie bracket of two vectors from a Lie algebra corresponding to a given group.

The following group actions are available:

* Group operation action [`GroupOperationAction`](@ref) that describes action of a group on itself.
* [`RotationAction`](@ref), that is action of [`SpecialOrthogonal`](@ref) group on different manifolds.
* [`TranslationAction`](@ref), which is the action of [`TranslationGroup`](@ref) group on different manifolds.

```@autodocs
Modules = [Manifolds]
Pages = ["groups/group_action.jl"]
Expand Down Expand Up @@ -123,3 +158,11 @@ Modules = [Manifolds]
Pages = ["groups/metric.jl"]
Order = [:type, :function]
```

## Cartan-Schouten connections

```@autodocs
Modules = [Manifolds]
Pages = ["groups/connections.jl"]
Order = [:type, :function]
```
4 changes: 3 additions & 1 deletion docs/src/manifolds/metric.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Pages = ["metric.md"]
Depth = 2
```

Note that a metric manifold is an [`AbstractConnectionManifold`](@ref) with the [`LeviCivitaConnection`](@ref) of the metric $g$, and thus a large part of metric manifold's functionality relies on this.
kellertuer marked this conversation as resolved.
Show resolved Hide resolved

Let's first look at the provided types.

## Types
Expand Down Expand Up @@ -47,6 +49,6 @@ Order = [:function]

## Metrics, charts and bases of vector spaces

All metric-related functions take a basis of a vector space as one of the arguments. This needed because generally there is no way to define these functions without referencing a basis. In some cases there is no need to be explicit about this basis, and then for example a [`DefaultOrthonormalBasis`](@ref) object can be used. In cases where being explicit about these bases is needed, for example when using multiple charts, a basis can be specified, for example using [`induced_basis`](@ref Main.Manifolds.induced_basis).
Metric-related functions, similarly to connection-related functions, need to operate in a basis of a vector space, see [here](@ref connections_charts).

Metric-related functions can take bases of associated tangent spaces as arguments. For example [`local_metric`](@ref) can take the basis of the tangent space it is supposed to operate on instead of a custom basis of the space of symmetric bilinear operators.
1 change: 1 addition & 0 deletions docs/src/misc/notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Within the documented functions, the utf8 symbols are used whenever possible, as
| Symbol | Description | Also used | Comment |
|:--:|:--------------- |:--:|:-- |
| ``\tau_p`` | action map by group element ``p`` | ``\mathrm{L}_p``, ``\mathrm{R}_p`` | either left or right |
| ``\operatorname{Ad}_p(X)`` | adjoint action of element ``p`` of a Lie group on the element ``X`` of the corresponding Lie algebra | | |
| ``\times`` | Cartesian product of two manifolds | | see [`ProductManifold`](@ref) |
| ``^{\wedge}`` | (n-ary) Cartesian power of a manifold | | see [`PowerManifold`](@ref) |
| ``a`` | coordinates of a point in a chart | | see [`get_parameters`](@ref) |
Expand Down
13 changes: 12 additions & 1 deletion src/Manifolds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ include("manifolds/VectorBundle.jl")
include("distributions.jl")
include("projected_distribution.jl")

include("manifolds/ConnectionManifold.jl")

# It's included early to ensure visibility of `Identity`
include("groups/group.jl")

Expand Down Expand Up @@ -195,6 +197,7 @@ include("manifolds/Multinomial.jl")
include("manifolds/Oblique.jl")
include("manifolds/EssentialManifold.jl")

include("groups/connections.jl")
include("groups/metric.jl")
include("groups/group_action.jl")
include("groups/group_operation_action.jl")
Expand Down Expand Up @@ -352,6 +355,10 @@ export AbstractVectorTransportMethod,
export PoleLadderTransport, SchildsLadderTransport
export PowerVectorTransport, ProductVectorTransport
export AbstractEmbeddedManifold
export AbstractAffineConnection,
AbstractConnectionManifold, ConnectionManifold, LeviCivitaConnection
export AbstractCartanSchoutenConnection,
CartanSchoutenMinus, CartanSchoutenPlus, CartanSchoutenZero
export AbstractMetric,
RiemannianMetric,
LorentzMetric,
Expand Down Expand Up @@ -528,7 +535,9 @@ export AbstractGroupAction,
SpecialOrthogonal,
TranslationGroup,
TranslationAction
export affine_matrix,
export adjoint_action,
adjoint_action!,
affine_matrix,
apply,
apply!,
apply_diff,
Expand Down Expand Up @@ -559,6 +568,8 @@ export affine_matrix,
inverse_translate!,
inverse_translate_diff,
inverse_translate_diff!,
lie_bracket,
lie_bracket!,
make_identity,
optimal_alignment,
optimal_alignment!,
Expand Down
36 changes: 36 additions & 0 deletions src/groups/array_manifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ array_point(p) = ValidationMPoint(p)
array_point(p::ValidationMPoint) = p
array_point(e::Identity) = Identity(e.group, array_point(e.p))

function adjoint_action(M::ValidationManifold, p, X; kwargs...)
is_point(M, p, true; kwargs...)
eM = make_identity(M.manifold, array_value(p))
is_vector(M, eM, X, true; kwargs...)
Y = ValidationTVector(adjoint_action(M.manifold, array_value(p), array_value(X)))
is_vector(M, eM, Y, true; kwargs...)
return Y
end

function adjoint_action!(M::ValidationManifold, Y, p, X; kwargs...)
is_point(M, p, true; kwargs...)
eM = make_identity(M.manifold, array_value(p))
is_vector(M, eM, X, true; kwargs...)
adjoint_action!(M.manifold, array_value(Y), array_value(p), array_value(X))
is_vector(M, eM, Y, true; kwargs...)
return Y
end

function Base.inv(M::ValidationManifold, p; kwargs...)
is_point(M, p, true; kwargs...)
q = array_point(inv(M.manifold, array_value(p)))
Expand Down Expand Up @@ -32,6 +50,24 @@ function identity!(M::ValidationManifold, q, p; kwargs...)
return q
end

function lie_bracket(M::ValidationManifold, X, Y)
eM = make_identity(M.manifold, array_value(X))
is_vector(M, eM, X, true)
is_vector(M, eM, Y, true)
Z = ValidationTVector(lie_bracket(M.manifold, array_value(X), array_value(Y)))
is_vector(M, eM, Z, true)
return Z
end

function lie_bracket!(M::ValidationManifold, Z, X, Y)
eM = make_identity(M.manifold, array_value(X))
is_vector(M, eM, X, true)
is_vector(M, eM, Y, true)
lie_bracket!(M.manifold, array_value(Z), array_value(X), array_value(Y))
is_vector(M, eM, Z, true)
return Z
end

function compose(M::ValidationManifold, p, q; kwargs...)
is_point(M, p, true; kwargs...)
is_point(M, q, true; kwargs...)
Expand Down
8 changes: 8 additions & 0 deletions src/groups/circle_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ invariant_metric_dispatch(::CircleGroup, ::ActionDirection) = Val(true)

default_metric_dispatch(::MetricManifold{ℂ,CircleGroup,EuclideanMetric}) = Val(true)

adjoint_action(::CircleGroup, p, X) = X
kellertuer marked this conversation as resolved.
Show resolved Hide resolved

adjoint_action!(::CircleGroup, Y, p, X) = copyto!(Y, X)

function compose(G::CircleGroup, p::AbstractVector, q::AbstractVector)
return map(compose, repeated(G), p, q)
end
Expand Down Expand Up @@ -46,6 +50,10 @@ function inverse_translate(
return map(/, q, p)
end

lie_bracket(::CircleGroup, X, Y) = zero(X)

lie_bracket!(::CircleGroup, Z, X, Y) = fill!(Z, 0)

translate_diff(::GT, p, q, X, ::ActionDirection) where {GT<:CircleGroup} = map(*, p, X)
function translate_diff(
::GT,
Expand Down
Loading