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

Simple Lie algebras and root systems #2572

Merged
merged 171 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 170 commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
41b3211
Add files via upload
voggesbe Jun 27, 2023
6e06fd1
Update root_systems.jl
voggesbe Jun 27, 2023
d214e55
Update introduction.md
voggesbe Jun 27, 2023
1e0470d
Update root_systems.jl
voggesbe Jul 5, 2023
a367e65
Update root_systems.jl
voggesbe Jul 5, 2023
2942a9b
Update SimpleLieAlgebra.jl
voggesbe Jul 5, 2023
0e6ecca
Update SimpleLieAlgebra.jl
voggesbe Jul 6, 2023
b2b86e7
Update SimpleLieAlgebra.jl
voggesbe Jul 12, 2023
1f2b0e0
Update SimpleLieAlgebra.jl
voggesbe Jul 12, 2023
a093878
Update LieAlgebras.jl
voggesbe Jul 12, 2023
7f0ab1a
Rename SimpleLieAlgebra.jl to simple_lie_algebra.jl
voggesbe Jul 12, 2023
5186267
Update simple_lie_algebra.jl
voggesbe Jul 12, 2023
abc12b7
Update root_systems.jl
voggesbe Jul 12, 2023
28e4d04
Update root_systems.jl
voggesbe Jul 12, 2023
b673f0d
Update root_systems.jl
voggesbe Jul 14, 2023
bc5746e
Update simple_lie_algebra.jl
voggesbe Jul 14, 2023
fb0cae8
Update simple_lie_algebra.jl
voggesbe Jul 14, 2023
126ae36
Update root_systems.jl
voggesbe Jul 14, 2023
ac13add
Update Oscar.jl
voggesbe Jul 14, 2023
49356cd
Update LieAlgebras.jl
voggesbe Jul 14, 2023
b60143a
Update simple_lie_algebra.jl
voggesbe Jul 14, 2023
bd5037e
Create root_systems-test.jl
voggesbe Jul 14, 2023
ee5ee35
Update root_systems.jl
voggesbe Jul 14, 2023
6b905cb
Update simple_lie_algebra.jl
voggesbe Jul 14, 2023
b81e6bd
Update simple_lie_algebra.jl
voggesbe Jul 18, 2023
18c25ae
Update root_systems.jl
voggesbe Jul 18, 2023
e359ad4
Update root_systems.jl
voggesbe Jul 18, 2023
ff14d60
Update simple_lie_algebra.jl
voggesbe Jul 18, 2023
f4fddcb
updated LieAlgebras.jl by adding functions to be exported
voggesbe Jul 19, 2023
bf7ce4a
changes to LieAlgebras export, added tests
voggesbe Jul 19, 2023
ba68c8c
added tests for root_systems
voggesbe Jul 19, 2023
29f301d
created simple_lie_algebra-test.jl, fixes to simple_lie_algebra.jl, u…
voggesbe Jul 19, 2023
c60c2ba
modified LieAlgebras.jl and runtests.jl, fixes to simple_lie_algebra.jl
voggesbe Jul 19, 2023
9a7a0e1
updated LieAlgebras.jl and root_systems.jl
voggesbe Jul 19, 2023
f9bd99f
updated root_systems.jl
voggesbe Jul 19, 2023
39313b3
updated LieAlgebras.jl, root_systems.jl, simple_lie_algebra.jlm root_…
voggesbe Jul 19, 2023
e7a88ca
Update root_systems-test.jl
voggesbe Jul 20, 2023
94b5ed3
Update root_systems-test.jl
voggesbe Jul 20, 2023
c82979e
updated simple_lie_algebra.jl
voggesbe Jul 20, 2023
39a8571
changed to rebase to master
voggesbe Aug 1, 2023
4d65d79
Add files via upload
voggesbe Jun 27, 2023
74c5ef7
Update SimpleLieAlgebra.jl
voggesbe Jul 5, 2023
7253709
Update SimpleLieAlgebra.jl
voggesbe Jul 6, 2023
19708f7
Update SimpleLieAlgebra.jl
voggesbe Jul 12, 2023
fbc29c6
Update SimpleLieAlgebra.jl
voggesbe Jul 12, 2023
96cf97a
minor updates to simple_lie_algebra.jl and simple_lie_algebra-test.jl
voggesbe Jul 19, 2023
ac00f7d
addressed comments in pull-request, some major changes to simple_lie_…
voggesbe Aug 1, 2023
947d76a
changed a function call to root_system
voggesbe Aug 1, 2023
77eef40
Add files via upload
voggesbe Jun 27, 2023
ae651b9
Update root_systems.jl
voggesbe Jun 27, 2023
24979b8
Update root_systems.jl
voggesbe Jul 5, 2023
538d979
Update root_systems.jl
voggesbe Jul 5, 2023
6fcba5a
Update root_systems.jl
voggesbe Jul 12, 2023
95671f9
Update root_systems.jl
voggesbe Jul 14, 2023
c2e7bcc
Update simple_lie_algebra.jl
voggesbe Jul 14, 2023
d4f4291
Create root_systems-test.jl
voggesbe Jul 14, 2023
aed70ba
Update simple_lie_algebra.jl
voggesbe Jul 14, 2023
50b9613
Update simple_lie_algebra.jl
voggesbe Jul 18, 2023
ea21162
Update root_systems.jl
voggesbe Jul 18, 2023
9c23da6
updated LieAlgebras.jl by adding functions to be exported
voggesbe Jul 19, 2023
a3194ee
changes to LieAlgebras export, added tests
voggesbe Jul 19, 2023
ace1670
created simple_lie_algebra-test.jl, fixes to simple_lie_algebra.jl, u…
voggesbe Jul 19, 2023
16ca99d
updated LieAlgebras.jl and root_systems.jl
voggesbe Jul 19, 2023
8461935
updated LieAlgebras.jl, root_systems.jl, simple_lie_algebra.jlm root_…
voggesbe Jul 19, 2023
461b08d
changed to rebase to master
voggesbe Aug 1, 2023
0d6a22e
Add files via upload
voggesbe Jun 27, 2023
a04648d
Update SimpleLieAlgebra.jl
voggesbe Jul 5, 2023
8381e45
Update SimpleLieAlgebra.jl
voggesbe Jul 6, 2023
3d088b2
Update SimpleLieAlgebra.jl
voggesbe Jul 12, 2023
620c777
Update SimpleLieAlgebra.jl
voggesbe Jul 12, 2023
a2708d7
Rename SimpleLieAlgebra.jl to simple_lie_algebra.jl
voggesbe Jul 12, 2023
64f6d78
Update simple_lie_algebra.jl
voggesbe Jul 14, 2023
dce33dc
Update LieAlgebras.jl
voggesbe Jul 14, 2023
0082d7c
changes to LieAlgebras export, added tests
voggesbe Jul 19, 2023
e9e1632
fixes for simple_lie_algebra.jl, updated LieAlgebras.jl and simple_li…
voggesbe Jul 19, 2023
e2e624e
minor updates to simple_lie_algebra.jl and simple_lie_algebra-test.jl
voggesbe Jul 19, 2023
77fad4a
updated LieAlgebras.jl and root_systems.jl
voggesbe Jul 19, 2023
daf92ca
updated root_systems.jl
voggesbe Jul 19, 2023
7253db1
updated LieAlgebras.jl, root_systems.jl, simple_lie_algebra.jlm root_…
voggesbe Jul 19, 2023
363562c
Fixed the tab problem
voggesbe Jul 20, 2023
9bdf4d0
updated root_systems.jl and simple_lie_algebra-test.jl
voggesbe Jul 20, 2023
75dbd69
addressed comments in pull-request, some major changes to simple_lie_…
voggesbe Aug 1, 2023
4ab1bf1
added new root_system.jl
voggesbe Aug 1, 2023
b184879
Add files via upload
voggesbe Jun 27, 2023
e692e21
Update root_systems.jl
voggesbe Jul 5, 2023
d78907a
Update SimpleLieAlgebra.jl
voggesbe Jul 5, 2023
f75ca24
Update SimpleLieAlgebra.jl
voggesbe Jul 6, 2023
d772c0f
Update SimpleLieAlgebra.jl
voggesbe Jul 12, 2023
252b7fc
Update SimpleLieAlgebra.jl
voggesbe Jul 12, 2023
0e43fb0
Rename SimpleLieAlgebra.jl to simple_lie_algebra.jl
voggesbe Jul 12, 2023
d43c7ae
Update root_systems.jl
voggesbe Jul 12, 2023
635f561
Update simple_lie_algebra.jl
voggesbe Jul 14, 2023
fa2c0e4
updated LieAlgebras.jl by adding functions to be exported
voggesbe Jul 19, 2023
a959886
changes to LieAlgebras export, added tests
voggesbe Jul 19, 2023
13e93d5
created simple_lie_algebra-test.jl, fixes to simple_lie_algebra.jl, u…
voggesbe Jul 19, 2023
f137266
updated root_systems.jl
voggesbe Jul 19, 2023
92d92dc
updated LieAlgebras.jl, root_systems.jl, simple_lie_algebra.jlm root_…
voggesbe Jul 19, 2023
0d50fee
Update root_systems-test.jl
voggesbe Jul 20, 2023
c146b93
Update root_systems-test.jl
voggesbe Jul 20, 2023
249bb42
updated simple_lie_algebra.jl
voggesbe Jul 20, 2023
96bcdae
changed to rebase to master
voggesbe Aug 1, 2023
c94ada5
Add files via upload
voggesbe Jun 27, 2023
d144e87
Update SimpleLieAlgebra.jl
voggesbe Jul 5, 2023
a1e62f9
Update SimpleLieAlgebra.jl
voggesbe Jul 6, 2023
ef4530b
Update SimpleLieAlgebra.jl
voggesbe Jul 12, 2023
ca7076c
Update SimpleLieAlgebra.jl
voggesbe Jul 12, 2023
e457b88
Add files via upload
voggesbe Jun 27, 2023
ce8e702
Update root_systems.jl
voggesbe Jun 27, 2023
7e38af3
Update root_systems.jl
voggesbe Jul 5, 2023
2d186ba
Update root_systems.jl
voggesbe Jul 12, 2023
de95ec0
Update root_systems.jl
voggesbe Jul 12, 2023
c149ebf
Update root_systems.jl
voggesbe Jul 14, 2023
8b4a2b7
Update simple_lie_algebra.jl
voggesbe Jul 14, 2023
2945c6d
addressed comments in pull-request, some major changes to simple_lie_…
voggesbe Aug 1, 2023
f9d29c7
Update root_systems-test.jl
voggesbe Aug 2, 2023
0d5b2df
addressed comments, fixed problem with structure constants and some m…
voggesbe Sep 20, 2023
d3c412e
Merge branch 'master' into master
voggesbe Sep 20, 2023
14b05ed
Update Oscar.jl to include the `sla` - package for GAP
voggesbe Sep 20, 2023
155b6e7
changed the printing for compact format
voggesbe Sep 21, 2023
5daf285
created helper function to make a string for a root system
voggesbe Sep 21, 2023
727c219
Merge branch 'master' into vog/master
lgoettgens Oct 12, 2023
b2c706f
Restrict to Lie algebras over fields (oscar-system/Oscar.jl#2901)
lgoettgens Oct 12, 2023
cf8be77
Run formatter
lgoettgens Oct 12, 2023
d2b466e
Fix `characteristic(L::LieAlgebra)`
lgoettgens Oct 12, 2023
0aeaa3a
Merge branch 'master' into master
lgoettgens Oct 19, 2023
0d950a4
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
9ed8e4f
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
a7f8f3f
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
4e03748
Update experimental/LieAlgebras/src/LieAlgebras.jl
voggesbe Oct 19, 2023
9ce05f3
Update experimental/LieAlgebras/src/LieAlgebras.jl
voggesbe Oct 19, 2023
2f74fa8
Update experimental/LieAlgebras/src/LieAlgebras.jl
voggesbe Oct 19, 2023
d5e38bf
Update experimental/LieAlgebras/src/LieAlgebras.jl
voggesbe Oct 19, 2023
c33679a
Update experimental/LieAlgebras/src/LieAlgebras.jl
voggesbe Oct 19, 2023
8783fb3
Update experimental/LieAlgebras/src/LieAlgebras.jl
voggesbe Oct 19, 2023
c1c38fe
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
a7a8e57
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
b583bff
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
81f7907
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
9922ac1
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
9121c9d
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
c13e7c2
Update root_systems.jl
voggesbe Oct 19, 2023
b44d0c7
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
e4758c5
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
3a2a62d
Update root_systems.jl
voggesbe Oct 19, 2023
82dc8ea
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
07d8e60
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
8745f1e
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
75e1f7f
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
216b09f
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
d09d09d
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
024a2ed
Update experimental/LieAlgebras/src/root_systems.jl
voggesbe Oct 19, 2023
33f9cac
Update root_systems.jl
voggesbe Oct 19, 2023
45dd6bf
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
4e856cb
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
056aa4e
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
448627c
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
14f31ba
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
eca05d2
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
ea4180b
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
08a2479
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
74749d6
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
c5c12cd
Update experimental/LieAlgebras/test/root_systems-test.jl
voggesbe Oct 19, 2023
522170d
Update experimental/LieAlgebras/test/runtests.jl
voggesbe Oct 19, 2023
3d4b6d3
Update experimental/LieAlgebras/test/simple_lie_algebra-test.jl
voggesbe Oct 19, 2023
2150fe2
Update experimental/LieAlgebras/test/simple_lie_algebra-test.jl
voggesbe Oct 19, 2023
b8cfb8a
Update experimental/LieAlgebras/test/simple_lie_algebra-test.jl
voggesbe Oct 19, 2023
ee3b165
Update experimental/LieAlgebras/src/simple_lie_algebra.jl
voggesbe Oct 19, 2023
1ed8059
Update experimental/LieAlgebras/src/LieAlgebras.jl
voggesbe Oct 19, 2023
cd50777
Small fixes
lgoettgens Oct 19, 2023
aad5d32
Try to temporarily make docs work
lgoettgens Oct 19, 2023
e766b79
Next try to get docs working
lgoettgens Oct 19, 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
1 change: 1 addition & 0 deletions experimental/LieAlgebras/docs/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This part of OSCAR is in an experimental state; please see [Adding new projects

Please direct questions about this part of OSCAR to the following people:
* [Lars Göttgens](https://lgoe.li/)
* [Laura Voggesberger](https://www.ruhr-uni-bochum.de/ffm/Lehrstuehle/Lehrstuhl-VI/voggesberger.html)

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

Expand Down
1 change: 1 addition & 0 deletions experimental/LieAlgebras/docs/src/lie_algebras.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ coefficients(::LieAlgebraElem)
coeff(::LieAlgebraElem, ::Int)
getindex(::LieAlgebraElem, ::Int)
symbols(::LieAlgebra)
characteristic(L::LieAlgebra)
```

## Special functions for `LinearLieAlgebra`s
Expand Down
7 changes: 7 additions & 0 deletions experimental/LieAlgebras/src/LieAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ function basis(L::LieAlgebra, i::Int)
return L([(j == i ? one(R) : zero(R)) for j in 1:dim(L)])
end

@doc raw"""
characteristic(L::LieAlgebra) -> Int

Return the characteristic of the coefficient ring of the Lie algebra `L`.
"""
characteristic(L::LieAlgebra) = characteristic(coefficient_ring(L))

@doc raw"""
zero(L::LieAlgebra{C}) -> LieAlgebraElem{C}

Expand Down
21 changes: 21 additions & 0 deletions experimental/LieAlgebras/src/LieAlgebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import ..Oscar:
canonical_projections,
center,
centralizer,
characteristic,
coeff,
coefficient_ring,
coefficients,
Expand Down Expand Up @@ -72,17 +73,23 @@ export LieSubalgebra
export LieAlgebraModule, LieAlgebraModuleElem
export LieAlgebraModuleHom
export LinearLieAlgebra, LinearLieAlgebraElem
export RootSystem
export SimpleLieAlgebra, SimpleLieAlgebraElem

export abelian_lie_algebra
export abstract_module
export base_lie_algebra
export base_module
export base_modules
export bracket
export cartan_matrix
export chevalley_basis
export coefficient_vector
export coerce_to_lie_algebra_elem
export combinations
export derived_algebra
export dynkin_diagram
export exterior_power
export general_linear_lie_algebra
export highest_weight_module
export hom_direct_sum
Expand All @@ -97,8 +104,11 @@ export is_tensor_product
export lie_algebra
export matrix_repr_basis
export multicombinations
export number_of_roots
export permutations
export permutations_with_sign
export root_system
export root_system_type
export special_linear_lie_algebra
export special_orthogonal_lie_algebra
export standard_module
Expand All @@ -120,6 +130,8 @@ include("LieAlgebraModuleHom.jl")
include("iso_oscar_gap.jl")
include("iso_gap_oscar.jl")
include("GapWrapper.jl")
include("root_systems.jl")
include("simple_lie_algebra.jl")

end

Expand All @@ -133,15 +145,21 @@ export LieAlgebraModule, LieAlgebraModuleElem
export LieAlgebraModuleHom
export LieSubalgebra
export LinearLieAlgebra, LinearLieAlgebraElem
export RootSystem
export SimpleLieAlgebra, SimpleLieAlgebraElem

export abelian_lie_algebra
export abstract_module
export base_lie_algebra
export base_module
export base_modules
export bracket
export cartan_matrix
export chevalley_basis
export coerce_to_lie_algebra_elem
export derived_algebra
export dynkin_diagram
export exterior_power
export general_linear_lie_algebra
export highest_weight_module
export hom_direct_sum
Expand All @@ -155,6 +173,9 @@ export is_tensor_power
export is_tensor_product
export lie_algebra
export matrix_repr_basis
export number_of_roots
export root_system
export root_system_type
export special_linear_lie_algebra
export special_orthogonal_lie_algebra
export standard_module
Expand Down
237 changes: 237 additions & 0 deletions experimental/LieAlgebras/src/root_systems.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
mutable struct RootSystem
roots::Vector{Vector{Int}}
simple_roots::Vector{Vector{Int}}
positive_roots::Vector{Vector{Int}}
root_system_type::Tuple{Symbol,Int}
GAP_root_system::GAP.GapObj
function RootSystem(S::Symbol, n::Int)
# S is a symbol detailing the type of the indecomposable root system
# e.g. "A", "B", "C",... and n is an integer for the number of simple roots
S1 = GAP.Obj(S)
RS = GAP.Globals.RootSystem(S1, n)
sR = Vector{Vector{Int}}(GAP.Globals.SimpleSystem(RS))
Ro1 = Vector{Vector{Int}}(GAP.Globals.PositiveRoots(RS))
Ro2 = Vector{Vector{Int}}(GAP.Globals.NegativeRoots(RS))
Ro = vcat(Ro1, Ro2)
t = (S, n)
return new(Ro, sR, Ro1, t, RS)
end
end

###############################################################################
#
# Basic manipulation
#
###############################################################################
@doc raw"""
number_of_roots(R::RootSystem)

Return the numbers of roots in the root system `R`.
"""
number_of_roots(R::RootSystem) = size(R.roots)[1]

@doc raw"""
number_of_roots(S::Symbol, n::Int)

Return the numbers of roots in the root system of type `S`
"""
number_of_roots(S::Symbol, n::Int) = number_of_roots(root_system(S, n))

@doc raw"""
getindex(R::RootSystem, r::Int)

Return the `r`-th root of the root system `R`.
"""
getindex(R::RootSystem, r::Int) = getindex(R.roots, r)

@doc raw"""
root_system_type(R::RootSystem)

Return the Dynkin type of the root system `R`.
"""
root_system_type(R::RootSystem) = R.root_system_type

voggesbe marked this conversation as resolved.
Show resolved Hide resolved
root_system_type_string(R::RootSystem) =
string(R.root_system_type[1]) * string(R.root_system_type[2])

###############################################################################
#
# String I/O
#
###############################################################################

function Base.show(io::IO, R::RootSystem)
print(io, "Root system of type $(root_system_type_string(R))")
end

###############################################################################
#
# Comparison
#
###############################################################################

function Base.:(==)(R1::RootSystem, R2::RootSystem)
return R1.root_system_type == R2.root_system_type && R1.roots == R2.roots
end

function Base.hash(R::RootSystem, h::UInt)
b = 0x9d96557cb5f07773 % UInt
h = hash(R.root_system_type, h)
h = hash(R.roots, h)
return xor(h, b)
end
###############################################################################
#
# Constructor
#
###############################################################################

@doc raw"""
root_system(S::Symbol, n::Int) -> RootSystem

Return the root system of type `Sn` where `S` is a symbol consisting out of
a single letter `A`, `B`, `C`, `D`, `E`, `F`, `G`.
The allowed values for `n` depend on the choice of `S`.
"""
function root_system(S::Symbol, n::Int)
@req _root_system_type_supported_by_GAP(S, n) "Unknown Dynkin type or not supported by GAP"
return RootSystem(S, n)
end

###############################################################################
#
# further functions
#
###############################################################################

function _root_system_type_supported_by_GAP(S, n)
S in [:A, :B, :C, :D, :E, :F, :G] || return false
n >= 1 || return false
S == :D && n < 4 && return false
S == :E && !(n in [6, 7, 8]) && return false
S == :F && n != 4 && return false
S == :G && n != 2 && return false
return true
end

@doc raw"""
cartan_matrix(S::Symbol, n::Int) -> Matrix{QQFieldElem}

Return the Cartan matrix of the root system of type `Sn`.
For the semantics of the arguments, refer to [`root_system(S::Symbol, n::Int)`](ref).
lgoettgens marked this conversation as resolved.
Show resolved Hide resolved
"""
function cartan_matrix(S::Symbol, n::Int)
return cartan_matrix(root_system(S, n))
end

@doc raw"""
cartan_matrix(R::RootSystem) -> Matrix{QQFieldElem}

Return the Cartan matrix of the root system `R`.
"""
function cartan_matrix(R::RootSystem)
RS = R.GAP_root_system
CG = GAP.Globals.CartanMatrix(RS)
C = matrix(QQ, CG)
return C
end

@doc raw"""
dynkin_diagram(S::Symbol, n::Int)

Return the Dynkin diagram of the root system of type `Sn`.
For the semantics of the arguments, refer to [`root_system(S::Symbol, n::Int)`](ref).
lgoettgens marked this conversation as resolved.
Show resolved Hide resolved
"""
function dynkin_diagram(S::Symbol, n::Int)
@req _root_system_type_supported_by_GAP(S, n) "Unknown Dynkin type or not supported by GAP"
D = ""

if S == :A
for i in 1:(n - 1)
D = D * string(i) * " - "
end
D = D * string(n)

elseif S == :B
if n == 1
D = string(n)
else
for i in 1:(n - 2)
D = D * string(i) * " - "
end
D = D * string(n - 1) * " >=> " * string(n)
end

elseif S == :C
if n == 1
D = string(n)
else
for i in 1:(n - 2)
D = D * string(i) * " - "
end
D = D * string(n - 1) * " <=< " * string(n)
end

elseif S == :D
if n >= 4
for i in 1:(4 * n - 10)
D = D * " "
end
D = D * string(n - 1) * "\n"
for i in 1:(4 * n - 11)
D = D * " "
end
D = D * "/\n"
for i in 1:(n - 3)
D = D * string(i) * " - "
end
D = D * string(n - 2) * "\n"
for i in 1:(4 * n - 12)
D = D * " "
end
D = D * " \\ \n"
for i in 1:(4 * n - 10)
D = D * " "
end
D = D * string(n)
else
error("This root system doesn't exist.")
end

elseif S == :E
if n == 6
D = "1 - 3 - 4 - 5 - 6\n |\n 2"
elseif n == 7
D = "1 - 3 - 4 - 5 - 6 - 7\n |\n 2"
elseif n == 8
D = "1 - 3 - 4 - 5 - 6 - 7 - 8\n |\n 2"
else
error("This root system doesn't exist.")
end

elseif S == :F
if n == 4
D = "1 - 2 >=> 3 - 4"
else
error("This root system doesn't exist.")
end
elseif S == :G
if n == 2
D = "1 >>> 2"
else
error("This root system doesn't exist.")
end
else
error("This root system doesn't exist.")
end
print(D)
end

@doc raw"""
dynkin_diagram(R::RootSystem)

Return the Dynkin diagram of the root system `R`
"""
function dynkin_diagram(R::RootSystem)
return dynkin_diagram(R.root_system_type...)
end
Loading
Loading