Skip to content

Commit

Permalink
Add weyl_group(::Matrix{<:IntegerUnion}) convenience constructor (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored Feb 4, 2025
1 parent 069bd41 commit e881004
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/LieTheory/RootSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@doc raw"""
root_system(cartan_matrix::ZZMatrix; check::Bool=true, detect_type::Bool=true) -> RootSystem
root_system(cartan_matrix::Matrix{<:Integer}; check::Bool=true, detect_type::Bool=true) -> RootSystem
root_system(cartan_matrix::Matrix{<:IntegerUnion}; check::Bool=true, detect_type::Bool=true) -> RootSystem
Construct the root system defined by the given (generalized) Cartan matrix.
Expand All @@ -32,7 +32,7 @@ function root_system(cartan_matrix::ZZMatrix; check::Bool=true, detect_type::Boo
return RootSystem(cartan_matrix; check, detect_type)
end

function root_system(cartan_matrix::Matrix{<:Integer}; kwargs...)
function root_system(cartan_matrix::Matrix{<:IntegerUnion}; kwargs...)
return root_system(matrix(ZZ, cartan_matrix); kwargs...)
end

Expand Down
13 changes: 10 additions & 3 deletions src/LieTheory/WeylGroup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@
###############################################################################

@doc raw"""
weyl_group(cartan_matrix::ZZMatrix) -> WeylGroup
weyl_group(cartan_matrix::ZZMatrix; check::Bool=true) -> WeylGroup
weyl_group(cartan_matrix::Matrix{<:IntegerUnion}; check::Bool=true) -> WeylGroup
Construct the Weyl group defined by the given (generalized) Cartan matrix.
If `check=true` the function will verify that `cartan_matrix` is indeed a generalized Cartan matrix.
"""
function weyl_group(cartan_matrix::ZZMatrix)
return weyl_group(root_system(cartan_matrix))
function weyl_group(cartan_matrix::ZZMatrix; kwargs...)
return weyl_group(root_system(cartan_matrix; kwargs...))
end

function weyl_group(cartan_matrix::Matrix{<:IntegerUnion}; kwargs...)
return weyl_group(root_system(cartan_matrix; kwargs...))
end

@doc raw"""
Expand Down
12 changes: 12 additions & 0 deletions test/LieTheory/WeylGroup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
end

@testset "constructors" begin
@testset "weyl_group(::Matrix{<:IntegerUnion})" begin
W = weyl_group([2 -1; -1 2]) # Matrix{Int}
@test ngens(W) == 2
@test order(W) == 6
@test isfinite(W) == true

W = weyl_group(ZZ.([2 -1; -1 2])) # Matrix{ZZRingElem}
@test ngens(W) == 2
@test order(W) == 6
@test isfinite(W) == true
end

@testset "weyl_group(::ZZMatrix)" begin
W = weyl_group(cartan_matrix(:A, 2))
@test isfinite(W) == true
Expand Down

0 comments on commit e881004

Please sign in to comment.