Skip to content

Commit

Permalink
fix translate_diff on general unitary
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Nov 3, 2023
1 parent cb05433 commit d6e3381
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/groups/general_unitary_groups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ function translate_diff!(
X,
::RightForwardAction,
)
return copyto!(G, Y, X)
copyto!(G, Y, X)
Y .*= -1
return Y

Check warning on line 311 in src/groups/general_unitary_groups.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/general_unitary_groups.jl#L309-L311

Added lines #L309 - L311 were not covered by tests
end
function translate_diff!(
G::GeneralUnitaryMultiplicationGroup,
Expand All @@ -316,7 +318,9 @@ function translate_diff!(
X,
::LeftBackwardAction,
)
return copyto!(G, Y, p * X * inv(G, p))
copyto!(G, Y, p * X * inv(G, p))
Y .*= -1
return Y

Check warning on line 323 in src/groups/general_unitary_groups.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/general_unitary_groups.jl#L321-L323

Added lines #L321 - L323 were not covered by tests
end
function translate_diff!(
G::GeneralUnitaryMultiplicationGroup,
Expand Down
2 changes: 1 addition & 1 deletion test/groups/general_unitary_groups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include("group_utils.jl")
X2 = log_lie(On, p)
e = Identity(MultiplicationOperation())
# They are not yet inverting, p2 is on the “other half”
# but taking the log again should also be X ahain
# but taking the log again should also be X again
@test isapprox(On, e, X2, X)
@test log_lie(On, e) == zeros(n, n)
end
Expand Down
1 change: 1 addition & 0 deletions test/groups/group_operation_action.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@ using Manifolds:

@test apply_diff_group(A_right_fwd, a_pts[1], X_pts[1], m_pts[1])
-m_pts[1] \ X_pts[1] * m_pts[1]
@test apply_diff_group(A_left_back, a_pts[1], X_pts[1], m_pts[1]) -X_pts[1]
end
end

0 comments on commit d6e3381

Please sign in to comment.