Skip to content

Commit

Permalink
Lie bracket is zero on so(2) (#761)
Browse files Browse the repository at this point in the history
* Lie bracket is zero on so(2)

* Format

* Faster implementation

Co-authored-by: Mateusz Baran <[email protected]>

---------

Co-authored-by: Mateusz Baran <[email protected]>
  • Loading branch information
olivierverdier and mateuszbaran authored Oct 21, 2024
1 parent b3c0fa4 commit 54c774e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Union type `MatrixGroup`
- Columnwise group action with arbitrary matrix groups
- `uniform_distribution` now has an error hint explaining what has to be done to make it work.
- `lie_bracket` is exactly zero on orthogonal Lie algebra in 2D

## [0.10.3] - 2024-10-04

Expand Down
16 changes: 16 additions & 0 deletions src/groups/general_unitary_groups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,22 @@ function adjoint_action!(G::GeneralUnitaryMultiplicationGroup, Y, p, X, ::RightA
return copyto!(G, Y, inv(G, p) * X * p)
end

function Manifolds.lie_bracket(
G::Manifolds.GeneralUnitaryMultiplicationGroup{ManifoldsBase.TypeParameter{Tuple{2}},ℝ},
X,
::Any,
)
return zero(X)
end
function Manifolds.lie_bracket!(
G::Manifolds.GeneralUnitaryMultiplicationGroup{ManifoldsBase.TypeParameter{Tuple{2}},ℝ},
X,
::Any,
::Any,
)
return fill!(X, 0)
end

function volume_density(M::GeneralUnitaryMultiplicationGroup, p, X)
return volume_density(M.manifold, p, X)
end
9 changes: 9 additions & 0 deletions test/groups/general_unitary_groups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ include("group_utils.jl")
X = [0.0 -0.7071067811865475; 0.7071067811865475 0.0]
@test volume_density(M, p, X) 1.0

@testset "SO(2) Lie Bracket == 0" begin
Y = [0.0 0.7071067811865475; -0.7071067811865475 0.0]
X_ = copy(X)
X_[1, 2] += 1e-16
@test is_vector(M, identity_element(M), X_)
@test lie_bracket(M, X_, Y) == zeros(2, 2)
@test lie_bracket!(M, similar(X_), X_, Y) == zeros(2, 2)
end

M = SpecialOrthogonal(3)
p = [
-0.5908399013383766 -0.6241917041179139 0.5111681988316876
Expand Down

2 comments on commit 54c774e

@mateuszbaran
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/117749

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.4 -m "<description of version>" 54c774e452fce3d6e2dbc74bbd33b94fb6ae669a
git push origin v0.10.4

Please sign in to comment.