Skip to content

Commit

Permalink
Adapt input to Ghislain's whishes
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 24, 2023
1 parent df15207 commit 39572a2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 60 deletions.
1 change: 1 addition & 0 deletions experimental/BasisLieHighestWeight/src/MainAlgorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ function add_new_monomials!(
w_to_alpha(lie_algebra, convert(Vector{QQFieldElem}, weight_w)),
),
)
isempty(poss_mon_in_weightspace) && error("The input seems to be invalid.")
#println("before sort")
#flush(stdout)
poss_mon_in_weightspace = sort(poss_mon_in_weightspace; lt=monomial_ordering_lt)
Expand Down
38 changes: 1 addition & 37 deletions experimental/BasisLieHighestWeight/src/MonomialOrder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,8 @@ function get_monomial_ordering_lt(
if isa(ordering_input, Function)
choosen_monomial_order = ordering_input
else
if ordering_input == :oplex
return oplex_lt
else
choosen_monomial_order = monomial_ordering(ZZx, ordering_input)
end
choosen_monomial_order = monomial_ordering(ZZx, ordering_input)
end
return (mon1::ZZMPolyRingElem, mon2::ZZMPolyRingElem) ->
(cmp(choosen_monomial_order, mon1, mon2) < 0)
end

function oplex_lt(mon1::ZZMPolyRingElem, mon2::ZZMPolyRingElem)
"""
Less-than function for monomials in oplex order
(mon1, mon2) -> (mon1 < mon2)
"""
deg1 = degrees(mon1)
deg2 = degrees(mon2)

# Start comparing, starting with the first degree
for i in 1:length(deg1)
diff = deg1[i] - deg2[i]

if diff != 0
return diff > 0 # return mon1 < mon2 if first non-zero of difference is positive
end
end

return false # mon1 == mon2 and therefore not <
end

#function oplex_lt(ZZx::ZZMPolyRing, mon1::ZZMPolyRingElem, mon2::ZZMPolyRingElem)
# # opposite of lex, return true if first non-zero if - is positive.
# if degrees(mon1) == degrees(mon2)
# return false
# else
# x = gens(ZZx)
# lex_order = eval(Symbol("lex"))(x)
# return (cmp(lex_order, mon1, mon2) == 1)
# end
# return false
#end
55 changes: 32 additions & 23 deletions experimental/BasisLieHighestWeight/src/UserFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ over lie-Algebra of type A and rank 3
[0, 1, 0]
[0, 0, 1]
julia> base = BasisLieHighestWeight.basis_lie_highest_weight(:A, 2, [1, 0]; reduced_expression = [1,2,1])
julia> base = BasisLieHighestWeight.basis_lie_highest_weight(:A, 2, [1, 0]; birational_sequence=[1,2,1])
Monomial basis of a highest weight module
of highest weight [1, 0]
of dimension 3
Expand Down Expand Up @@ -95,14 +95,14 @@ function basis_lie_highest_weight(
type::Symbol,
rank::Int,
highest_weight::Vector{Int};
reduced_expression::Union{String,Vector{Int},Vector{GAP.GapObj},Any}="regular",
birational_sequence::Union{String,Vector{Int},Vector{GAP.GapObj},Any}="regular", # regular = all pos. roots in order of GAP
monomial_ordering::Union{Symbol,Function}=:degrevlex,
)
"""
Standard function with all options
"""
lie_algebra, chevalley_basis = lie_algebra_with_basis(type, rank)
operators = get_operators_normal(lie_algebra, chevalley_basis, reduced_expression)
operators = get_operators_normal(lie_algebra, chevalley_basis, birational_sequence)
return basis_lie_highest_weight_compute(
lie_algebra, chevalley_basis, highest_weight, operators, monomial_ordering
)
Expand All @@ -111,7 +111,18 @@ end
@doc """
# Examples
```jldoctest
julia> base = BasisLieHighestWeight.basis_lie_highest_weight_lustzig(:D, 4, [1,1,1,1], [4,3,2,4,3,2,1,2,4,3,2,1])
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
Expand All @@ -136,20 +147,18 @@ 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};
monomial_ordering::Union{Symbol,Function}=:oplex,
type::Symbol, rank::Int, highest_weight::Vector{Int}; reduced_expression::Vector{Int}
)
"""
Lustzig polytope
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 All @@ -160,11 +169,11 @@ end
@doc """
# Examples
```jldoctest
julia> BasisLieHighestWeight.basis_lie_highest_weight_string(:B, 3, [1,1,1], [3,2,3,2,1,2,3,2,1])
julia> BasisLieHighestWeight.basis_lie_highest_weight_string(:B, 3, [1,1,1]; reduced_expression=[3,2,3,2,1,2,3,2,1])
Monomial basis of a highest weight module
of highest weight [1, 1, 1]
of dimension 512
with monomial ordering oplex
with monomial ordering neglex
over lie-Algebra of type B and rank 3
where the birational sequence used consists of operators to the following weights (given as coefficients w.r.t. alpha_i):
[0, 0, 1]
Expand All @@ -183,7 +192,7 @@ over lie-Algebra of type B and rank 3
```
"""
function basis_lie_highest_weight_string(
type::Symbol, rank::Int, highest_weight::Vector{Int}, reduced_expression::Vector{Int};
type::Symbol, rank::Int, highest_weight::Vector{Int}; reduced_expression::Vector{Int}
)
"""
String / Littelmann-Berenstein-Zelevinsky polytope
Expand All @@ -192,7 +201,7 @@ function basis_lie_highest_weight_string(
BasisLieHighestWeight.basis_lie_highest_weight_string(:A, 4, [1,1,1,1], [4,3,2,1,2,3,4,3,2,3])
"""
# reduced_expression = some sequence of the String / Littelmann-Berenstein-Zelevinsky polytope
monomial_ordering = :oplex
monomial_ordering = :neglex
lie_algebra, chevalley_basis = lie_algebra_with_basis(type, rank)
operators = get_operators_normal(lie_algebra, chevalley_basis, reduced_expression)
return basis_lie_highest_weight_compute(
Expand All @@ -203,11 +212,11 @@ end
@doc """
# Examples
```jldoctest
julia> BasisLieHighestWeight.basis_lie_highest_weight_fflv(:A, 3, [1,1,1])
julia> BasisLieHighestWeight.basis_lie_highest_weight_pbw(:A, 3, [1,1,1])
Monomial basis of a highest weight module
of highest weight [1, 1, 1]
of dimension 64
with monomial ordering oplex
with monomial ordering neglex
over lie-Algebra of type A and rank 3
where the birational sequence used consists of operators to the following weights (given as coefficients w.r.t. alpha_i):
[1, 1, 1]
Expand All @@ -222,12 +231,12 @@ over lie-Algebra of type A and rank 3
[0, 0, 1]
```
"""
function basis_lie_highest_weight_fflv(type::Symbol, rank::Int, highest_weight::Vector{Int})
function basis_lie_highest_weight_pbw(type::Symbol, rank::Int, highest_weight::Vector{Int})
"""
Feigin-Fourier-Littelmann-Vinberg polytope
BasisLieHighestWeight.basis_lie_highest_weight_fflv(:A, 3, [1,1,1])
BasisLieHighestWeight.basis_lie_highest_weight_pbw(:A, 3, [1,1,1])
"""
monomial_ordering = :oplex
monomial_ordering = :neglex
lie_algebra, chevalley_basis = lie_algebra_with_basis(type, rank)
operators = reverse(get_operators_normal(lie_algebra, chevalley_basis, "regular"))
return basis_lie_highest_weight_compute(
Expand All @@ -238,11 +247,11 @@ end
@doc """
# Examples
```jldoctest
julia> BasisLieHighestWeight.basis_lie_highest_weight_nz(:C, 3, [1,1,1], [3,2,3,2,1,2,3,2,1])
julia> BasisLieHighestWeight.basis_lie_highest_weight_nz(:C, 3, [1,1,1]; reduced_expression=[3,2,3,2,1,2,3,2,1])
Monomial basis of a highest weight module
of highest weight [1, 1, 1]
of dimension 512
with monomial ordering lex
with monomial ordering degrevlex
over lie-Algebra of type C and rank 3
where the birational sequence used consists of operators to the following weights (given as coefficients w.r.t. alpha_i):
[0, 0, 1]
Expand All @@ -261,14 +270,14 @@ over lie-Algebra of type C and rank 3
```
"""
function basis_lie_highest_weight_nz(
type::Symbol, rank::Int, highest_weight::Vector{Int}, reduced_expression::Vector{Int};
type::Symbol, rank::Int, highest_weight::Vector{Int}; reduced_expression::Vector{Int}
)
"""
Nakashima-Zelevinsky polytope
BasisLieHighestWeight.basis_lie_highest_weight_nz(:C, 3, [1,1,1], [3,2,3,2,1,2,3,2,1])
BasisLieHighestWeight.basis_lie_highest_weight_nz(:A, 4, [1,1,1,1], [4,3,2,1,2,3,4,3,2,3])
"""
monomial_ordering = :lex
monomial_ordering = :degrevlex
lie_algebra, chevalley_basis = lie_algebra_with_basis(type, rank)
operators = get_operators_normal(lie_algebra, chevalley_basis, reduced_expression)
return basis_lie_highest_weight_compute(
Expand Down

0 comments on commit 39572a2

Please sign in to comment.