Skip to content

Commit

Permalink
Make weighted orderings work
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 25, 2023
1 parent 9222f5a commit 67c891f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module BasisLieHighestWeight

using ..Oscar
using ..Oscar: GAPWrap, IntegerUnion
using ..Oscar: GAPWrap, IntegerUnion, isweighted

using AbstractAlgebra.PrettyPrinting

Expand Down
2 changes: 1 addition & 1 deletion experimental/BasisLieHighestWeight/src/MainAlgorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function basis_lie_highest_weight_compute(
)

ZZx, _ = PolynomialRing(ZZ, length(operators)) # for our monomials
monomial_ordering_lt = get_monomial_ordering_lt(monomial_ordering, ZZx) # less than function to sort monomials by order
monomial_ordering_lt = get_monomial_ordering_lt(monomial_ordering, ZZx, weights_alpha) # less than function to sort monomials by order

# save computations from recursions
calc_highest_weight = Dict{Vector{ZZRingElem},Set{ZZMPolyRingElem}}(
Expand Down
8 changes: 7 additions & 1 deletion experimental/BasisLieHighestWeight/src/MonomialOrder.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
function get_monomial_ordering_lt(
ordering_input::Union{Symbol,Function}, ZZx::ZZMPolyRing
ordering_input::Union{Symbol,Function},
ZZx::ZZMPolyRing,
weights_alpha::Vector{Vector{QQFieldElem}},
)::Function
"""
Returns the desired monomial_ordering function less than, i.e. return true <=> mon1 < mon2
"""
if isa(ordering_input, Function)
choosen_monomial_order = ordering_input
elseif isweighted(ordering_input)
choosen_monomial_order = monomial_ordering(
ZZx, ordering_input, Int[Int(sum(w)) for w in weights_alpha]
)
else
choosen_monomial_order = monomial_ordering(ZZx, ordering_input)
end
Expand Down
19 changes: 4 additions & 15 deletions experimental/BasisLieHighestWeight/src/UserFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Computes a monomial basis for the highest weight module with highest weight
- `reduced_expression`: list of operators, either "regular" or integer array. The functionality of choosing a random longest word
is currently not implemented, because we used https://github.com/jmichel7/Gapjm.jl to work with coxeter
groups need a method to obtain all non left descending elements to extend a word
- `monomial_ordering`: monomial order in which our basis gets defined with regards to our operators
- `monomial_ordering`: monomial order in which our basis gets defined with regards to our operators.
If this is a weighted ordering, the height of the corresponding root is used as weight.
# Examples
```jldoctest
Expand Down Expand Up @@ -112,21 +113,10 @@ end
# Examples
```jldoctest
julia> base = BasisLieHighestWeight.basis_lie_highest_weight_lustzig(:D, 4, [1,1,1,1]; reduced_expression=[4,3,2,4,3,2,1,2,4,3,2,1])
ERROR: not working currently
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] basis_lie_highest_weight_lustzig(type::Symbol, rank::Int64, highest_weight::Vector{Int64}; reduced_expression::Vector{Int64})
@ Oscar.BasisLieHighestWeight ~/code/julia/Oscar.jl/experimental/BasisLieHighestWeight/src/UserFunctions.jl:160
[3] top-level scope
@ none:1
```
keep track of correct output:
Monomial basis of a highest weight module
of highest weight [1, 1, 1, 1]
of dimension 4096
with monomial ordering oplex
with monomial ordering wdegrevlex
over lie-Algebra of type D and rank 4
where the birational sequence used consists of operators to the following weights (given as coefficients w.r.t. alpha_i):
[0, 0, 0, 1]
Expand All @@ -147,6 +137,7 @@ over lie-Algebra of type D and rank 4
[0, 0, 1, 0]
[0, 0, 0, 1]
[0, 0, 1, 1]
```
"""
function basis_lie_highest_weight_lustzig(
type::Symbol, rank::Int, highest_weight::Vector{Int}; reduced_expression::Vector{Int}
Expand All @@ -156,9 +147,7 @@ function basis_lie_highest_weight_lustzig(
BasisLieHighestWeight.basis_lie_highest_weight_lustzig(:D, 4, [1,1,1,1], [4,3,2,4,3,2,1,2,4,3,2,1])
"""
# operators = some sequence of the String / Littelmann-Berenstein-Zelevinsky polytope
error("not working currently")
monomial_ordering = :wdegrevlex
# TODO: weighting = height = -sum_i c_i, where root = sum_i c_i alpha_i
lie_algebra, chevalley_basis = lie_algebra_with_basis(type, rank)
operators = get_operators_lustzig(lie_algebra, chevalley_basis, reduced_expression)
return basis_lie_highest_weight_compute(
Expand Down

0 comments on commit 67c891f

Please sign in to comment.