Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: use group algebra for characters #4334

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions experimental/BasisLieHighestWeight/src/MainAlgorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function basis_lie_highest_weight_compute(

# save computations from recursions
calc_highest_weight = Dict{WeightLatticeElem,Set{ZZMPolyRingElem}}(
zero(WeightLatticeElem, R) => Set([ZZx(1)])
zero(weight_lattice(R)) => Set([ZZx(1)])
)
# save all highest weights, for which the Minkowski-sum did not suffice to gain all monomials
no_minkowski = Set{WeightLatticeElem}()
Expand Down Expand Up @@ -98,7 +98,7 @@ function basis_coordinate_ring_kodaira_compute(

# save computations from recursions
calc_highest_weight = Dict{WeightLatticeElem,Set{ZZMPolyRingElem}}(
zero(WeightLatticeElem, R) => Set([ZZx(1)])
zero(weight_lattice(R)) => Set([ZZx(1)])
)

# save all highest weights, for which the Minkowski-sum did not suffice to gain all monomials
Expand Down Expand Up @@ -362,12 +362,12 @@ function add_by_hand(
matrices_of_operators = tensor_matrices_of_operators(
L, highest_weight, operators_as_roots(birational_seq)
)
space = Dict(zero(WeightLatticeElem, R) => sparse_matrix(QQ)) # span of basis vectors to keep track of the basis
space = Dict(zero(weight_lattice(R)) => sparse_matrix(QQ)) # span of basis vectors to keep track of the basis
v0 = sparse_row(ZZ, [(1, 1)]) # starting vector v

push!(basis, ZZx(1))
# required monomials of each weightspace
weightspaces = _character(R, highest_weight)
weightspaces = Dict{WeightLatticeElem,Int}(_character(R, highest_weight))
# sort the monomials from the minkowski-sum by their weightspaces
monomials_in_weightspace = Dict{WeightLatticeElem,Set{ZZMPolyRingElem}}()
for (weight_w, _) in weightspaces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ end
sub_weights_proper = BasisLieHighestWeight.sub_weights_proper
R = root_system(:B, 3)

w_zero = zero(WeightLatticeElem, R)
w_zero = zero(weight_lattice(R))
@test issetequal(sub_weights(w_zero), [w_zero])
@test isempty(sub_weights_proper(w_zero))

Expand Down
1 change: 1 addition & 0 deletions experimental/LieAlgebras/docs/doc.main
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"module_homs.md",
"cartan_matrix.md",
"root_systems.md",
"weight_lattices.md",
"weyl_groups.md",
],
]
45 changes: 2 additions & 43 deletions experimental/LieAlgebras/docs/src/root_systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Root systems in this module are meant to be abstract root systems, i.e. they are
The relevant types around root systems are:
- `RootSystem` for the root system itself,
- `RootSpaceElem` for elements in the root space, i.e. roots and linear combinations thereof,
- `DualRootSpaceElem` for elements in the dual root space, i.e. coroots and linear combinations thereof,
- `WeightLatticeElem` for elements in the weight lattice, i.e. weights and linear combinations thereof.
- `DualRootSpaceElem` for elements in the dual root space, i.e. coroots and linear combinations thereof.

!!! warning
Most functionality around root systems is currently only intended to be used with root systems of finite type.
Expand Down Expand Up @@ -46,6 +45,7 @@ rank(::RootSystem)
cartan_matrix(::RootSystem)
```
```@docs; canonical=false
weight_lattice(::RootSystem)
weyl_group(::RootSystem)
```

Expand Down Expand Up @@ -180,44 +180,3 @@ is_positive_coroot_with_index(::DualRootSpaceElem)
is_negative_coroot(::DualRootSpaceElem)
is_negative_coroot_with_index(::DualRootSpaceElem)
```


## Weight lattice elements

```@docs
WeightLatticeElem(::RootSystem, ::Vector{<:IntegerUnion})
WeightLatticeElem(::RootSystem, ::ZZMatrix)
WeightLatticeElem(::RootSpaceElem)
zero(::Type{WeightLatticeElem}, ::RootSystem)
```

```@docs
root_system(::WeightLatticeElem)
```

Basic arithmetic operations like `zero`, `+`, `-`, `*` (with integer scalars), and `==` are supported.

```@docs
coeff(::WeightLatticeElem, ::Int)
coefficients(::WeightLatticeElem)
```

```@docs
iszero(::WeightLatticeElem)
is_dominant(::WeightLatticeElem)
is_fundamental_weight(::WeightLatticeElem)
is_fundamental_weight_with_index(::WeightLatticeElem)
```

### Reflections
```@docs
reflect(::WeightLatticeElem, ::Int)
reflect!(::WeightLatticeElem, ::Int)
```

### Conjugate dominant weight
```@docs
conjugate_dominant_weight(::WeightLatticeElem)
conjugate_dominant_weight_with_left_elem(::WeightLatticeElem)
conjugate_dominant_weight_with_right_elem(::WeightLatticeElem)
```
71 changes: 71 additions & 0 deletions experimental/LieAlgebras/docs/src/weight_lattices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
```@meta
CurrentModule = Oscar
DocTestSetup = Oscar.doctestsetup()
```

# Weight lattices

TODO


## Table of contents

```@contents
Pages = ["weight_lattices.md"]
Depth = 2:5
```

## Constructing weight lattices

TODO



## Properties of weight lattices

TODO




## Weight lattice elements

```@docs
WeightLatticeElem(::WeightLattice, ::Vector{<:IntegerUnion})
WeightLatticeElem(::RootSystem, ::Vector{<:IntegerUnion})
WeightLatticeElem(::WeightLattice, ::ZZMatrix)
WeightLatticeElem(::RootSystem, ::ZZMatrix)
WeightLatticeElem(::RootSpaceElem)
zero(::WeightLattice)
```

```@docs
parent(::WeightLatticeElem)
```

Basic arithmetic operations like `zero`, `+`, `-`, `*` (with integer scalars), and `==` are supported.

```@docs
coeff(::WeightLatticeElem, ::Int)
coefficients(::WeightLatticeElem)
```

```@docs
iszero(::WeightLatticeElem)
is_dominant(::WeightLatticeElem)
is_fundamental_weight(::WeightLatticeElem)
is_fundamental_weight_with_index(::WeightLatticeElem)
```

### Reflections
```@docs
reflect(::WeightLatticeElem, ::Int)
reflect!(::WeightLatticeElem, ::Int)
```

### Conjugate dominant weight
```@docs
conjugate_dominant_weight(::WeightLatticeElem)
conjugate_dominant_weight_with_left_elem(::WeightLatticeElem)
conjugate_dominant_weight_with_right_elem(::WeightLatticeElem)
```
40 changes: 14 additions & 26 deletions experimental/LieAlgebras/src/LieAlgebraModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1454,14 +1454,14 @@ See [MP82](@cite) for details and the implemented algorithm.
julia> L = lie_algebra(QQ, :B, 3);

julia> dominant_weights(L, [1, 0, 3])
7-element Vector{Vector{Int64}}:
[1, 0, 3]
[1, 1, 1]
[0, 0, 3]
[2, 0, 1]
[0, 1, 1]
[1, 0, 1]
[0, 0, 1]
7-element Vector{WeightLatticeElem}:
w_1 + 3*w_3
w_1 + w_2 + w_3
3*w_3
2*w_1 + w_3
w_2 + w_3
w_1 + w_3
w_3
```
"""
function dominant_weights(T::Type, L::LieAlgebra, hw::Vector{<:IntegerUnion})
Expand All @@ -1470,7 +1470,8 @@ function dominant_weights(T::Type, L::LieAlgebra, hw::Vector{<:IntegerUnion})
end

function dominant_weights(L::LieAlgebra, hw::Vector{<:IntegerUnion})
return dominant_weights(Vector{Int}, L, hw)
R = root_system(L)
return dominant_weights(R, hw)
end

function dominant_weights(T::Type, L::LieAlgebra, hw::WeightLatticeElem)
Expand All @@ -1479,7 +1480,8 @@ function dominant_weights(T::Type, L::LieAlgebra, hw::WeightLatticeElem)
end

function dominant_weights(L::LieAlgebra, hw::WeightLatticeElem)
return dominant_weights(Vector{Int}, L, hw)
R = root_system(L)
return dominant_weights(R, hw)
end

@doc raw"""
Expand All @@ -1498,11 +1500,7 @@ This function uses an optimized version of the Freudenthal formula, see [MP82](@
julia> L = lie_algebra(QQ, :A, 3);

julia> dominant_character(L, [2, 1, 0])
Dict{Vector{Int64}, Int64} with 4 entries:
[2, 1, 0] => 1
[1, 0, 1] => 2
[0, 0, 0] => 3
[0, 2, 0] => 1
3*e(0) + e(2*w_1 + w_2) + e(2*w_2) + 2*e(w_1 + w_3)
```
"""
function dominant_character(L::LieAlgebra, hw::Vector{<:IntegerUnion})
Expand Down Expand Up @@ -1530,17 +1528,7 @@ The return type may change in the future.
julia> L = lie_algebra(QQ, :A, 3);

julia> character(L, [2, 0, 0])
Dict{Vector{Int64}, Int64} with 10 entries:
[0, 1, 0] => 1
[0, -2, 2] => 1
[0, 0, -2] => 1
[-1, 1, -1] => 1
[-2, 2, 0] => 1
[1, -1, 1] => 1
[1, 0, -1] => 1
[-1, 0, 1] => 1
[0, -1, 0] => 1
[2, 0, 0] => 1
e(2*w_1) + e(w_2) + e(-2*w_1 + 2*w_2) + e(-2*w_2 + 2*w_3) + e(-2*w_3) + e(w_1 - w_2 + w_3) + e(-w_1 + w_3) + e(w_1 - w_3) + e(-w_1 + w_2 - w_3) + e(-w_2)
```
"""
function character(L::LieAlgebra, hw::Vector{<:IntegerUnion})
Expand Down
2 changes: 2 additions & 0 deletions experimental/LieAlgebras/src/LieAlgebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import ..Oscar:
inv,
is_abelian,
is_finite,
is_gen,
is_isomorphism,
is_nilpotent,
is_perfect,
Expand Down Expand Up @@ -124,6 +125,7 @@ include("Util.jl")
include("CartanMatrix.jl")
include("CoxeterGroup.jl")
include("RootSystem.jl")
include("WeightLattice.jl")
include("DynkinDiagram.jl")
include("WeylGroup.jl")

Expand Down
Loading
Loading