Skip to content

Commit

Permalink
Move dim_of_simple_module to the root system
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Aug 20, 2024
1 parent 764a62a commit 746ac41
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 13 deletions.
15 changes: 4 additions & 11 deletions experimental/LieAlgebras/src/LieAlgebraModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,8 @@ end
@doc raw"""
dim_of_simple_module([T = Int], L::LieAlgebra{C}, hw::Vector{<:IntegerUnion}) -> T
Computes the dimension of the simple module of the Lie algebra `L` with highest weight `hw`.
Compute the dimension of the simple module of the Lie algebra `L` with highest weight `hw`
using Weyl's dimension formula.
The return value is of type `T`.
# Example
Expand All @@ -1441,19 +1442,11 @@ julia> dim_of_simple_module(L, [1, 1, 1])
```
"""
function dim_of_simple_module(T::Type, L::LieAlgebra, hw::Vector{<:IntegerUnion})
@req is_dominant_weight(hw) "Not a dominant weight."
if has_root_system(L)
R = root_system(L)
rho = weyl_vector(R)
hw_rho = WeightLatticeElem(R, hw) + rho
num = one(ZZ)
den = one(ZZ)
for alpha in positive_roots(R)
num *= ZZ(dot(hw_rho, alpha))
den *= ZZ(dot(rho, alpha))
end
return T(div(num, den))
return dim_of_simple_module(T, R, hw)
else # TODO: remove branch once root system detection is implemented
@req is_dominant_weight(hw) "Not a dominant weight."
return T(
GAPWrap.DimensionOfHighestWeightModule(
codomain(Oscar.iso_oscar_gap(L)), GAP.Obj(hw; recursive=true)
Expand Down
1 change: 1 addition & 0 deletions experimental/LieAlgebras/src/LieAlgebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import ..Oscar:
inv,
is_abelian,
is_finite,
is_integral,
is_isomorphism,
is_nilpotent,
is_perfect,
Expand Down
50 changes: 50 additions & 0 deletions experimental/LieAlgebras/src/RootSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,10 @@ function is_dominant(w::WeightLatticeElem)
return all(>=(0), coefficients(w))
end

function is_integral(w::WeightLatticeElem)
return all(is_integer, coefficients(w))
end

@doc raw"""
reflect(w::WeightLatticeElem, s::Int) -> WeightLatticeElem
Expand All @@ -906,6 +910,9 @@ function root_system(w::WeightLatticeElem)
return w.root_system
end

###############################################################################
# more functions

function dot(r::RootSpaceElem, w::WeightLatticeElem)
@req root_system(r) === root_system(w) "parent root system mismatch"

Expand All @@ -920,6 +927,49 @@ function dot(w::WeightLatticeElem, r::RootSpaceElem)
return dot(r, w)
end

@doc raw"""
dim_of_simple_module([T = Int], R::RootSystem, hw::WeightLatticeElem -> T
dim_of_simple_module([T = Int], R::RootSystem, hw::Vector{<:IntegerUnion}) -> T
Compute the dimension of the simple module of the Lie algebra defined by the root system `R`
with highest weight `hw` using Weyl's dimension formula.
The return value is of type `T`.
# Example
```jldoctest
julia> R = root_system(:B, 2);
julia> dim_of_simple_module(R, [1, 0])
5
```
"""
function dim_of_simple_module(T::Type, R::RootSystem, hw::WeightLatticeElem)
@req root_system(hw) === R "parent root system mismatch"
@req is_dominant(hw) "not a dominant weight"
@req is_integral(hw) "not an integral weight"
rho = weyl_vector(R)
hw_rho = hw + rho
num = one(ZZ)
den = one(ZZ)
for alpha in positive_roots(R)
num *= ZZ(dot(hw_rho, alpha))
den *= ZZ(dot(rho, alpha))
end
return T(div(num, den))
end

function dim_of_simple_module(T::Type, R::RootSystem, hw::Vector{<:IntegerUnion})
return dim_of_simple_module(T, R, WeightLatticeElem(R, hw))
end

function dim_of_simple_module(R::RootSystem, hw::Vector{<:IntegerUnion})
return dim_of_simple_module(Int, R, hw)
end

function dim_of_simple_module(R::RootSystem, hw::WeightLatticeElem)
return dim_of_simple_module(Int, R, hw)
end

###############################################################################
# internal helpers

Expand Down
4 changes: 2 additions & 2 deletions experimental/LieAlgebras/test/LieAlgebraModule-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,9 @@
@test dim == 393513120
end

let L = lie_algebra(QQ, :B, 7)
let R = root_system(:B, 7)
dim = @inferred dim_of_simple_module(
ZZRingElem, L, [7, 2, 5, 1, 0, 2, 6]
ZZRingElem, R, [7, 2, 5, 1, 0, 2, 6]
)
@test dim isa ZZRingElem
@test dim == 307689492858882008424585750
Expand Down

0 comments on commit 746ac41

Please sign in to comment.