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 1 commit
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
36 changes: 36 additions & 0 deletions src/groups/special_euclidean.jl
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,15 @@ function group_log!(G::SpecialEuclidean{3}, X, q)
return X
end

"""
lie_bracket(G::SpecialEuclidean, X::ProductRepr, Y::ProductRepr)
lie_bracket(G::SpecialEuclidean, X::AbstractMatrix, Y::AbstractMatrix)

Calculate the Lie bracket between elements `X` and `Y` of the special Euclidean Lie
algebra. For the matrix representation (which can be obtained using [`screw_matrix`](@ref))
the formula is ``[X, Y] = XY-YX``, while in the [`ProductRepr`](@ref) representation the
formula reads ``[X, Y] = [(t_1, R_1), (t_2, R_2)] = (R_1 t_2 - R_2 t_1, R_1 R_2 - R_2 R_1)``.
"""
function lie_bracket(G::SpecialEuclidean, X::ProductRepr, Y::ProductRepr)
kellertuer marked this conversation as resolved.
Show resolved Hide resolved
nX, hX = submanifold_components(G, X)
nY, hY = submanifold_components(G, Y)
Expand Down Expand Up @@ -494,10 +503,24 @@ const SE_in_GL = EmbeddedManifold{ℝ,<:SpecialEuclidean,<:GeneralLinear}

SE_in_GL(n) = EmbeddedManifold(SpecialEuclidean(n), GeneralLinear(n + 1))

"""
embed(M::SE_in_GL, p)

Embed the point `p` on [`SpecialEuclidean`](@ref) in the [`GeneralLinear`](@ref) group.
The embedding is calculated using [`affine_matrix`](@ref).
"""
function embed(M::SE_in_GL, p)
kellertuer marked this conversation as resolved.
Show resolved Hide resolved
G = M.manifold
return affine_matrix(G, p)
end
"""
embed(M::SE_in_GL, p, X)

Embed the tangent vector X at point `p` on [`SpecialEuclidean`](@ref) in the
[`GeneralLinear`](@ref) group. Point `p` can use any representation valid for
`SpecialEuclidean`. The embedding is similar from the one defined by [`screw_matrix`](@ref)
but the translation part is multiplied by inverse of the rotation part.
"""
function embed(M::SE_in_GL, p, X)
G = M.manifold
np, hp = submanifold_components(G, p)
Expand All @@ -517,11 +540,24 @@ function embed!(M::SE_in_GL, Y, p, X)
return copyto!(Y, embed(M, p, X))
end

"""
project(M::SE_in_GL, p)

Project point `p` in [`GeneralLinear`](@ref) to the [`SpecialEuclidean`](@ref) group.
This is performed by extracting the rotation and translation part as in [`affine_matrix`](@ref).
"""
function project(M::SE_in_GL, p)
kellertuer marked this conversation as resolved.
Show resolved Hide resolved
G = M.manifold
np, hp = submanifold_components(G, p)
return ProductRepr(np, hp)
end
"""
project(M::SE_in_GL, p, X)

Project tangent vector `X` at point `p` in [`GeneralLinear`](@ref) to the
[`SpecialEuclidean`](@ref) Lie algebra.
This reverses the transformation performed by [`embed`](@ref embed(M::SE_in_GL, p, X))
"""
function project(M::SE_in_GL, p, X)
G = M.manifold
np, hp = submanifold_components(G, p)
Expand Down
28 changes: 24 additions & 4 deletions src/manifolds/ConnectionManifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ end
kwargs...,
)

"""
connection(M::ConnectionManifold)

Return the connection associated with [`ConnectionManifold`](@ref) `M`.
"""
connection(M::ConnectionManifold) = M.connection
kellertuer marked this conversation as resolved.
Show resolved Hide resolved

Base.copyto!(M::AbstractConnectionManifold, q, p) = copyto!(M.manifold, q, p)
Expand Down Expand Up @@ -158,6 +163,7 @@ end
gaussian_curvature(M::AbstractManifold, p, B::AbstractBasis; backend::AbstractDiffBackend = diff_backend())

Compute the Gaussian curvature of the manifold `M` at the point `p` using basis `B`.
kellertuer marked this conversation as resolved.
Show resolved Hide resolved
This is equal to half of the scalar Ricci curvature, see [`ricci_curvature`](@ref).
"""
gaussian_curvature(::AbstractManifold, ::Any, ::AbstractBasis)
function gaussian_curvature(M::AbstractManifold, p, B::AbstractBasis; kwargs...)
Expand Down Expand Up @@ -190,6 +196,12 @@ end
ricci_curvature(M::AbstractManifold, p, B::AbstractBasis; backend::AbstractDiffBackend = diff_backend())

Compute the Ricci scalar curvature of the manifold `M` at the point `p` using basis `B`.
The curvature is computed as the trace of the Ricci curvature tensor with respect to
the metric, that is ``R=g^{ij}_R_{ij}`` where ``R`` is the scalar Ricci curvature at `p`,
kellertuer marked this conversation as resolved.
Show resolved Hide resolved
``g^{ij}`` is the inverse local metric (see [`inverse_local_metric`](@ref)) at `p` and
``R_{ij}`` is the Riccie curvature tensor, see [`ricci_tensor`](@ref). Both the tensor and
inverse local metric are expressed in local coordinates defined by `B`, and the formula
uses the Einstein summation convention.
"""
kellertuer marked this conversation as resolved.
Show resolved Hide resolved
ricci_curvature(::AbstractManifold, ::Any, ::AbstractBasis)
function ricci_curvature(
Expand All @@ -215,7 +227,7 @@ end

Compute the Ricci tensor, also known as the Ricci curvature tensor,
of the manifold `M` at the point `p` using basis `B`,
see [https://en.wikipedia.org/wiki/Ricci_curvature#Introduction_and_local_definition](https://en.wikipedia.org/wiki/Ricci_curvature#Introduction_and_local_definition).
see [`https://en.wikipedia.org/wiki/Ricci_curvature#Introduction_and_local_definition`](https://en.wikipedia.org/wiki/Ricci_curvature#Introduction_and_local_definition).
"""
ricci_tensor(::AbstractManifold, ::Any, ::AbstractBasis)
function ricci_tensor(M::AbstractManifold, p, B::AbstractBasis; kwargs...)
Expand All @@ -233,11 +245,19 @@ end
)

@doc raw"""
riemann_tensor(M::AbstractManifold, p, B::AbstractBasis; backend::AbstractDiffBackend = diff_backend())
riemann_tensor(M::AbstractManifold, p, B::AbstractBasis; backend::AbstractDiffBackend=diff_backend())

Compute the Riemann tensor ``R^l_{ijk}``, also known as the Riemann curvature
tensor, at the point `p`. The dimensions of the resulting multi-dimensional
array are ordered ``(l,i,j,k)``.
tensor, at the point `p` in local coordinates defined by `B`. The dimensions of the
resulting multi-dimensional array are ordered ``(l,i,j,k)``.

The function uses the coordinate expression involving the second Christoffel symbol,
see [`https://en.wikipedia.org/wiki/Riemann_curvature_tensor#Coordinate_expression`](https://en.wikipedia.org/wiki/Riemann_curvature_tensor#Coordinate_expression)
for details.

# See also

[`christoffel_symbols_second`], [`christoffel_symbols_second_jacobian`]
"""
riemann_tensor(::AbstractManifold, ::Any, ::AbstractBasis)
function riemann_tensor(
Expand Down