Skip to content

Commit

Permalink
some tests and figuring out
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Oct 28, 2023
1 parent e729f03 commit 46680df
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
33 changes: 31 additions & 2 deletions src/groups/group_operation_action.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function adjoint_apply_diff_group(A::GroupOperationAction, a, X, p)
G,
p,
a,
inv_diff(G, a, X),
inv_diff(G, apply(A, a, p), X),
(direction(A), switch_side(action_side(A))),
)
end
Expand All @@ -90,7 +90,7 @@ function adjoint_apply_diff_group!(A::GroupOperationAction, Y, a, X, p)
Y,
p,
a,
inv_diff(G, a, X),
inv_diff(G, apply(A, a, p), X),
(direction(A), switch_side(action_side(A))),
)
end
Expand Down Expand Up @@ -118,6 +118,35 @@ function apply_diff!(A::GroupOperationAction, Y, a, p, X)
return translate_diff!(A.group, Y, a, p, X, direction_and_side(A))
end

@doc raw"""
apply_diff_group(A::GroupOperationAction, a, X, p)
Compute differential of [`GroupOperationAction`](@ref) `A` with respect to group element
at tangent vector `X`:
````math
(\mathrm{d}τ^p) : T_{a} \mathcal G → T_{τ_a p} \mathcal M
````
There are four cases:
* left action from the left side: ``L_a: p ↦ a \circ p``, where
````math
(\mathrm{d}L_a) : T_{a} \mathcal G → T_{a \circ p} \mathcal M.
````
* right action from the left side: ``L'_a: p ↦ a^{-1} \circ p``, where
````math
(\mathrm{d}L'_a) : T_{a} \mathcal G → T_{a^{-1} \circ p} \mathcal M.
````
* right action from the right side: ``R_a: p ↦ p \circ a``, where
````math
(\mathrm{d}R_a) : T_{a} \mathcal G → T_{p \circ a} \mathcal M.
````
* left action from the right side: ``R'_a: p ↦ p \circ a^{-1}``, where
````math
(\mathrm{d}R'_a) : T_{a} \mathcal G → T_{p \circ a^{-1}} \mathcal M.
````
"""
function apply_diff_group(A::GroupOperationAction, a, X, p)
G = base_group(A)
if direction_and_side(A) === LeftForwardAction() ||
Expand Down
1 change: 1 addition & 0 deletions test/groups/circle_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ using Manifolds:
test_invariance=true,
test_lie_bracket=true,
test_adjoint_action=true,
test_inv_diff=true,
)
end

Expand Down
9 changes: 9 additions & 0 deletions test/groups/group_operation_action.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,14 @@ using Manifolds:
adjoint_apply_diff_group!(A_left_fwd, Y, a_pts[1], X_pts[1], m_pts[1])
@test Y
inverse_translate_diff(G, a_pts[1], m_pts[1], X_pts[1], RightBackwardAction())

@test adjoint_apply_diff_group(A_right_fwd, a_pts[1], X_pts[1], m_pts[1])
inverse_translate_diff(
G,
m_pts[1],
a_pts[1],
inv_diff(G, a_pts[1], X_pts[1]),
RightBackwardAction(),
)
end
end

0 comments on commit 46680df

Please sign in to comment.