diff --git a/ext/ManifoldsTestExt/tests_group.jl b/ext/ManifoldsTestExt/tests_group.jl index 1b6023ff4..ed913dd07 100644 --- a/ext/ManifoldsTestExt/tests_group.jl +++ b/ext/ManifoldsTestExt/tests_group.jl @@ -534,10 +534,19 @@ function test_group( adjoint_action(G, g_pts[2], adjoint_action(G, inv(G, g_pts[2]), X)), X, ) + # right adjoint action + Test.@test isapprox( + G, + e, + adjoint_action(G, g_pts[2], adjoint_action(G, g_pts[2], X, RightAction())), + X, + ) if test_mutating Z = allocate(X) adjoint_action!(G, Z, g_pts[2], X) Test.@test isapprox(G, e, Z, adjoint_action(G, g_pts[2], X)) + adjoint_action!(G, Z, g_pts[2], X, RightAction()) + Test.@test isapprox(G, e, Z, adjoint_action(G, g_pts[2], X, RightAction())) end # interaction with Lie bracket diff --git a/src/groups/circle_group.jl b/src/groups/circle_group.jl index 0a249b8de..884d99fe2 100644 --- a/src/groups/circle_group.jl +++ b/src/groups/circle_group.jl @@ -26,8 +26,11 @@ Base.show(io::IO, ::CircleGroup) = print(io, "CircleGroup()") adjoint_action(::CircleGroup, p, X, ::LeftAction) = X adjoint_action(::CircleGroup, ::Identity, X, ::LeftAction) = X +adjoint_action(::CircleGroup, p, X, ::RightAction) = X +adjoint_action(::CircleGroup, ::Identity, X, ::RightAction) = X adjoint_action!(::CircleGroup, Y, p, X, ::LeftAction) = copyto!(Y, X) +adjoint_action!(::CircleGroup, Y, p, X, ::RightAction) = copyto!(Y, X) function compose( ::MultiplicationGroupTrait, diff --git a/test/groups/product_group.jl b/test/groups/product_group.jl index b1e1f7e97..7b1853d5a 100644 --- a/test/groups/product_group.jl +++ b/test/groups/product_group.jl @@ -30,7 +30,7 @@ using RecursiveArrayTools end pts = [ArrayPartition(tp...) for tp in tuple_pts] - X_pts = [ArrayPartition(tuple_v...)] + X_pts = [ArrayPartition(tuple_v...), ArrayPartition(tuple_v...)] @testset "setindex! and getindex" begin p1 = pts[1] @@ -53,6 +53,7 @@ using RecursiveArrayTools test_vee_hat_from_identity=true, test_inv_diff=true, test_adjoint_inv_diff=true, + test_adjoint_action=true, ) @test isapprox( G, @@ -94,7 +95,7 @@ using RecursiveArrayTools @test compose(G, pts[1], Identity(G)) == pts[1] @test compose(G, Identity(G), pts[1]) == pts[1] - test_group(G, pts, X_pts, X_pts; test_diff=true, test_mutating=false) + test_group(G, pts, X_pts, X_pts; test_diff=true, test_mutating=false, test_adjoint_action=true) test_manifold(G, pts; is_mutating=false) @test isapprox( G,