Skip to content

Commit

Permalink
Fix reflection for negative roots
Browse files Browse the repository at this point in the history
  • Loading branch information
janikapeters committed Dec 19, 2024
1 parent 3febf7b commit 77c788c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions experimental/LieAlgebras/src/LieAlgebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ import ..Oscar:
parent_type,
permutation_group,
rank,
reflection,
root,
roots,
sub,
Expand Down
3 changes: 2 additions & 1 deletion experimental/LieAlgebras/src/RootSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,9 @@ function reflection(beta::RootSpaceElem)

b, index_of_beta = is_positive_root_with_index(beta)
if !b
index_of_beta = is_root_with_index(beta) - rk
b, index_of_beta = is_negative_root_with_index(beta)
end
@req b "Not a root"

found_simple_root = index_of_beta <= rk
current_index = index_of_beta
Expand Down
4 changes: 2 additions & 2 deletions experimental/LieAlgebras/test/RootSystem-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@
@test r * reflection(r) == -r
end

R = root_system([(:A, 1), (:A, 1)])
R = root_system([(:B, 2), (:A, 2)])
for r in roots(R)
@test r * reflection(r) == -r
for r2 in roots(R)
if r != r2 && r != -r2
if is_zero(dot(r, r2)) #roots are orthogonal
@test r2 * reflection(r) == r2
end
end
Expand Down

0 comments on commit 77c788c

Please sign in to comment.