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

Experimental: Add BasisLieHighestWeight #2936

Merged
merged 87 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
6dec9fd
Code from BasisLieHighestWeight, Pull request oscar-system/Oscar.jl#2115
BenWilop May 22, 2023
b0e48d4
Removed part of fromGap, gens(ZZx) instaed of x
BenWilop Jul 14, 2023
613f831
Simplified paramters with structures and recomputation
BenWilop Jul 15, 2023
21909b3
TODOs
BenWilop Jul 15, 2023
cae54aa
Added test-files, removed TVec
BenWilop Jul 15, 2023
856d74c
Removed nullSpace()
BenWilop Jul 15, 2023
cab59f4
VectorSpaceBases-test.jl
BenWilop Jul 15, 2023
f68e0be
NewMonomial-test.jl
BenWilop Jul 15, 2023
9ca1a0c
compute_sub_weights
BenWilop Jul 15, 2023
35e0407
Added GAPWrap instead of GAP.Globals where possible
BenWilop Jul 15, 2023
f9d7635
Custom print functions for the structures
BenWilop Jul 15, 2023
15ff68c
tabs to indents
BenWilop Jul 15, 2023
004d992
Doctest basis_lie_highest_weight
BenWilop Jul 15, 2023
aa9c0cd
Changed get_monomial_order_lt to accept name of monomial-order as def…
BenWilop Jul 22, 2023
d96e300
function body of special basis_lie_highest_weight functions
BenWilop Aug 5, 2023
8a1b5b0
.
BenWilop Aug 13, 2023
b314bd1
DemazureOperators
BenWilop Aug 15, 2023
75a1b56
demazure_operators_summary
BenWilop Aug 15, 2023
b1c2441
oplex_lt
BenWilop Aug 24, 2023
c89f9b8
Bugfix ZZ(0) in result instead of ZZ(1)
BenWilop Aug 25, 2023
75f3445
Comments
BenWilop Sep 3, 2023
fc81361
Bugfix demazure_operator order of operators
BenWilop Sep 3, 2023
860ee5a
Root Conversion with QQ
BenWilop Sep 4, 2023
62ca83b
RootConversion-test and -data
BenWilop Sep 13, 2023
5798828
Bugfix rootconverison A
BenWilop Sep 13, 2023
ef8b21b
Bugfix root-conversion D
BenWilop Sep 17, 2023
708ad8f
Bugfix root-conversion F
BenWilop Sep 17, 2023
d37e31f
Bugfix root-conversion E8
BenWilop Sep 17, 2023
40eb331
CalculateBetas, CalculateBetas-test
BenWilop Sep 17, 2023
6a0caa7
root_to_root_vector
BenWilop Sep 24, 2023
bdff013
compute_operators_lustzig_nz
BenWilop Sep 24, 2023
8debb93
Operators as Julia-vectors, find_root_in_chevalley_basis
BenWilop Oct 1, 2023
14d5a9e
basis_lie_highest_weight_lustzig
BenWilop Oct 1, 2023
0fe0f08
Docstring and adapted methods for lustzig, nz, fflv, string
BenWilop Oct 1, 2023
be7fc73
Print Birational-sequence with alpha_i
BenWilop Oct 2, 2023
1e3e63d
Word-calculations only for lustzig
BenWilop Oct 8, 2023
b3c46da
Remove Documenter.jl as dep
lgoettgens Oct 18, 2023
979fd34
Run JuliaFormatter
lgoettgens Oct 18, 2023
78485c5
Fix root conversion
lgoettgens Oct 18, 2023
5b440ee
Make tests green
lgoettgens Oct 19, 2023
d53c1b2
Make RootConversion tests faster
lgoettgens Oct 19, 2023
c3657b7
Use lowercase constructors
lgoettgens Oct 19, 2023
a617724
Refactor root conversion
lgoettgens Oct 19, 2023
1d0bc6d
Remove workaround for old issues
lgoettgens Oct 19, 2023
c9db616
Move some stuff around
lgoettgens Oct 19, 2023
bc35796
Change dynkin type to symbol
lgoettgens Oct 19, 2023
3024eb9
Fix doctests
lgoettgens Oct 19, 2023
60acd9f
Add basic docs
lgoettgens Oct 19, 2023
6b46f95
Excise uses of `gap_to_julia` and `julia_to_gap`
lgoettgens Oct 19, 2023
fc4e052
Enhance printing of output
lgoettgens Oct 20, 2023
8a920f9
Remove `cache_size`
lgoettgens Oct 20, 2023
2e60526
Remove lots of unused code
lgoettgens Oct 20, 2023
3cc7027
Bugfix: Reverse operator list for FFLV
BenWilop Oct 22, 2023
1894b79
User can input reduced expression through sum of roots instead of sea…
lgoettgens Oct 23, 2023
a76cb5c
Refactor polyhedral code
lgoettgens Oct 20, 2023
7906b0e
Change `get_lattice_points_of_weightspace` to accept input in alpha_i
lgoettgens Oct 23, 2023
2f7f5c6
Excise all uses of weights in eps_i basis
lgoettgens Oct 23, 2023
5952ecb
Change monomial ordering inputs to symbols
lgoettgens Oct 23, 2023
da01078
`order` -> `ordering`
lgoettgens Oct 23, 2023
c17b4be
Refactor passing around lie_algebra
lgoettgens Oct 24, 2023
0b28288
Move user facing functions to separate file
lgoettgens Oct 24, 2023
5926d29
Adapt input to Ghislain's whishes
lgoettgens Oct 25, 2023
5aef659
Make weighted orderings work
lgoettgens Oct 24, 2023
c6f7811
Add function to print operators
lgoettgens Oct 25, 2023
027f96d
Replace all uses of `convert`
lgoettgens Oct 25, 2023
d17f03c
Refactor algorithm input and some Lie algebra stuff
lgoettgens Oct 27, 2023
944dbf6
More random refactoring
lgoettgens Oct 27, 2023
6695adf
More monomial ordering changes
lgoettgens Oct 27, 2023
f5dc7b0
Excise `SparseVectorSpaceBasis`
lgoettgens Oct 27, 2023
efa4451
Fix spelling [skip ci]
lgoettgens Oct 27, 2023
f1b2914
`isweighted` -> `_is_weighted`
lgoettgens Oct 30, 2023
083ec19
Fix doctests
lgoettgens Oct 30, 2023
123c942
Skip sorting of monomials
lgoettgens Nov 3, 2023
bd11db1
Merge branch 'master' into gf/BasisLieHighestWeight
lgoettgens Nov 5, 2023
ff01ab8
Fix printing
lgoettgens Nov 6, 2023
19b2c3f
Merge remote-tracking branch 'origin/gf/BasisLieHighestWeight' into g…
lgoettgens Nov 6, 2023
b2b9373
Fix deprecation warning
lgoettgens Nov 6, 2023
40800a8
Add docstrings to `UserFunctions.jl`
lgoettgens Nov 6, 2023
4f827fb
Add tests against Xin's output
lgoettgens Nov 6, 2023
e79a64a
Remove unnecessary printings
lgoettgens Nov 6, 2023
eb5494f
Add exports
lgoettgens Nov 6, 2023
62f83cf
Adjust printing to Ghislain's whishes
lgoettgens Nov 6, 2023
8ce5c19
Apply suggestions from code review
lgoettgens Nov 6, 2023
68539ae
Fix typo in printing
lgoettgens Nov 6, 2023
1d85a83
Merge remote-tracking branch 'origin/gf/BasisLieHighestWeight' into g…
lgoettgens Nov 6, 2023
f6c3319
Fix visibility issue
lgoettgens Nov 6, 2023
99f833a
Add all documented functions to docs
lgoettgens Nov 23, 2023
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
3 changes: 3 additions & 0 deletions experimental/BasisLieHighestWeight/docs/doc.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"introduction.md"
]
25 changes: 25 additions & 0 deletions experimental/BasisLieHighestWeight/docs/src/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
```@meta
CurrentModule = Oscar
DocTestSetup = quote
using Oscar
end
```

# Introduction

This subproject contains the code for the OSCAR book chapter by Ghislain Fourier and Xin Fang on the bases of highest weight modules.

## Status

This part of OSCAR is in an experimental state; please see [Adding new projects to experimental](@ref) for what this means.
More documentation is to come in the future.

## Contact

Please direct questions about this part of OSCAR to the following people:
* [Ghislain Fourier](https://www.art.rwth-aachen.de/cms/~rnko/)
* [Lars Göttgens](https://lgoe.li/)

You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack).

Alternatively, you can [raise an issue on github](https://www.oscar-system.org/community/#how-to-report-issues).
59 changes: 59 additions & 0 deletions experimental/BasisLieHighestWeight/src/BasisLieHighestWeight.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module BasisLieHighestWeight

using ..Oscar
using ..Oscar: GAPWrap, IntegerUnion, _is_weighted

using AbstractAlgebra.PrettyPrinting

import Oscar: dim, monomial_ordering, monomials

import Base: length

# TODO: Test if ZZx should be a graded_polynomial_ring with weights_w as weights

# TODO (?) Maybe export and docstring:
# get_dim_weightspace
# orbit_weylgroup
# get_lattice_points_of_weightspace
# convert_lattice_points_to_monomials
# convert_monomials_to_lattice_points
# action_matrices_of_operators
# weights_for_operators

# TODO Use Oscar-Lie-Algebra type instead of LieAlgebra
# TODO Data-Type for weights of Lie-Algebras? Two types, in alpha_i and w_i, conversion is defined in RootConversion
# w_to_aplha
# alpha_to_w

# TODO GAPWrap-wrappers are missing

include("LieAlgebras.jl")
include("BirationalSequence.jl")
include("MonomialBasis.jl")
include("NewMonomial.jl")
include("TensorModels.jl")
include("MonomialOrder.jl")
include("RootConversion.jl")
include("WeylPolytope.jl")
include("MainAlgorithm.jl")
include("UserFunctions.jl")

export basis_lie_highest_weight_operators
export basis_lie_highest_weight
export basis_lie_highest_weight_lusztig
export basis_lie_highest_weight_nz
export basis_lie_highest_weight_pbw
export basis_lie_highest_weight_string

end

using .BasisLieHighestWeight

export BasisLieHighestWeight

export basis_lie_highest_weight_operators
export basis_lie_highest_weight
export basis_lie_highest_weight_lusztig
export basis_lie_highest_weight_nz
export basis_lie_highest_weight_pbw
export basis_lie_highest_weight_string
12 changes: 12 additions & 0 deletions experimental/BasisLieHighestWeight/src/BirationalSequence.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
struct BirationalSequence
operators::Vector{GAP.Obj}
operators_vectors::Vector{Vector{Any}}
weights_w::Vector{Vector{ZZRingElem}}
weights_alpha::Vector{Vector{QQFieldElem}}
end

function Base.show(io::IO, birational_sequence::BirationalSequence)
println(io, "BirationalSequence")
println(io, "Operators: ", birational_sequence.operators)
print(io, "Weights in alpha_i:", birational_sequence.weights_alpha)
end
83 changes: 83 additions & 0 deletions experimental/BasisLieHighestWeight/src/LieAlgebras.jl
Copy link
Member

@micjoswig micjoswig Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, there is an experimental LieAlgebra type, and now there is also LieAlgebraStructure. This looks a bit weird to me. Please enlighten me about your goals.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LieAlgebraStructure is only there to exist temporarily (as a thin wrapper around), as LieAlgebra currently does not support everything that is needed here. As already noted in #2936 (comment), this is on the todo-list to merge. But as that involves more work of different people (e.g. @felix-roehrich), and is mostly unrelated to the stuff here, I would like to move that piece of work to a future PR.

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
@attributes mutable struct LieAlgebraStructure
lie_type::Symbol
rank::Int
lie_algebra_gap::GAP.Obj
chevalley_basis::NTuple{3,Vector{GAP.Obj}}

function LieAlgebraStructure(lie_type::Symbol, rank::Int)
lie_algebra_gap = GAP.Globals.SimpleLieAlgebra(
GAP.Obj(lie_type), rank, GAP.Globals.Rationals
)
chevalley_basis = NTuple{3,Vector{GAP.Obj}}(GAP.Globals.ChevalleyBasis(lie_algebra_gap))
return new(lie_type, rank, lie_algebra_gap, chevalley_basis)
end
end

rank(L::LieAlgebraStructure) = L.rank

@attr QQMatrix function cartan_matrix(L::LieAlgebraStructure)
R = GAP.Globals.RootSystem(L.lie_algebra_gap)
C = matrix(QQ, GAP.Globals.CartanMatrix(R))
return C
end

@attr QQMatrix function inv_cartan_matrix(L::LieAlgebraStructure)
return inv(cartan_matrix(L))
end

function Base.show(io::IO, L::LieAlgebraStructure)
io = pretty(io)
print(io, LowercaseOff(), "Lie algebra of type $(L.lie_type)$(L.rank)")
end

function lie_algebra(type::Symbol, rk::Int)
return LieAlgebraStructure(type, rk)
end

function chevalley_basis_gap(L::LieAlgebraStructure)
return L.chevalley_basis
end

function cartan_sub_basis(L::LieAlgebraStructure)
return L.chevalley_basis[3]
end

function root_system_gap(L::LieAlgebraStructure)
return GAP.Globals.RootSystem(L.lie_algebra_gap)
end

function num_positive_roots(L::LieAlgebraStructure)
return length(GAP.Globals.PositiveRoots(root_system_gap(L)))
end

function matrices_of_operators_gap(
L::LieAlgebraStructure, highest_weight::Vector{ZZRingElem}, operators::Vector{GAP.Obj}
)
"""
used to create action_matrices_of_operators
"""
M = GAP.Globals.HighestWeightModule(L.lie_algebra_gap, GAP.Obj(Int.(highest_weight)))
matrices_of_operators = [
sparse_matrix(transpose(matrix(QQ, GAP.Globals.MatrixOfAction(GAPWrap.Basis(M), o)))) # TODO: remove transpose?
for o in operators
]
denominators = map(y -> denominator(y[2]), union(union(matrices_of_operators...)...))
common_denominator = lcm(denominators)# // 1
matrices_of_operators =
(A -> change_base_ring(ZZ, common_denominator * A)).(matrices_of_operators)
return matrices_of_operators
end

function weight(L::LieAlgebraStructure, operator::GAP.Obj)
"""
Calculates the weight in w_i for operator
"""
@req !iszero(operator) "Operators should be non-zero"
basis = GAP.Globals.Basis(L.lie_algebra_gap)
basis_ind = GAP.Globals.Position(basis, operator)
denom = GAP.Globals.Coefficients(basis, operator)[basis_ind]
return [
ZZ(GAP.Globals.Coefficients(basis, h * operator)[basis_ind]//denom) for
h in cartan_sub_basis(L)
]
end
Loading
Loading