Skip to content

Commit

Permalink
Fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Nov 6, 2024
1 parent 20328ca commit fe0e885
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 40 deletions.
2 changes: 2 additions & 0 deletions experimental/LieAlgebras/src/AbstractLieAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ For the used notation and the definition of extraspecial pairs, see [CMT04](@cit
```jldoctest
julia> L = lie_algebra(QQ, root_system(:B, 4))
Abstract Lie algebra
of type B4
of dimension 36
over rational field
```
Expand Down Expand Up @@ -459,6 +460,7 @@ The internally used basis of this Lie algebra is the Chevalley basis.
```jldoctest
julia> L = lie_algebra(QQ, :C, 4)
Abstract Lie algebra
of type C4
of dimension 36
over rational field
```
Expand Down
1 change: 1 addition & 0 deletions experimental/LieAlgebras/src/LinearLieAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ julia> root_system(L);
julia> L
Linear Lie algebra with 3x3 matrices
of type A1
of dimension 3
over rational field
Expand Down
74 changes: 35 additions & 39 deletions experimental/LieAlgebras/src/RootSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,16 @@ Passing `detect_type=false` will skip the detection of the root system type.
# Examples
```jldoctest
julia> root_system([2 -1; -1 2])
Root system defined by Cartan matrix
[ 2 -1]
[-1 2]
Root system of rank 2
of type A2
julia> root_system(matrix(ZZ, 2, 2, [2, -1, -1, 2]); detect_type=false)
Root system defined by Cartan matrix
[ 2 -1]
[-1 2]
Root system of rank 2
of unknown type
julia> root_system(matrix(ZZ, [2 -1 -2; -1 2 0; -1 0 2]))
Root system defined by Cartan matrix
[ 2 -1 -2]
[-1 2 0]
[-1 0 2]
Root system of rank 3
of type C3 (with non-canonical ordering of simple roots)
```
"""
function root_system(cartan_matrix::ZZMatrix; check::Bool=true, detect_type::Bool=true)
Expand All @@ -47,9 +43,8 @@ Construct the root system of the given type. See `cartan_matrix(fam::Symbol, rk:
# Examples
```jldoctest
julia> root_system(:A, 2)
Root system defined by Cartan matrix
[ 2 -1]
[-1 2]
Root system of rank 2
of type A2
```
"""
function root_system(fam::Symbol, rk::Int)
Expand All @@ -67,17 +62,12 @@ Construct the root system of the given type. See `cartan_matrix(fam::Symbol, rk:
# Examples
```jldoctest
julia> root_system([(:A, 2), (:F, 4)])
Root system defined by Cartan matrix
[ 2 -1 0 0 0 0]
[-1 2 0 0 0 0]
[ 0 0 2 -1 0 0]
[ 0 0 -1 2 -1 0]
[ 0 0 0 -2 2 -1]
[ 0 0 0 0 -1 2]
Root system of rank 6
of type A2 x F4
julia> root_system(Tuple{Symbol,Int}[])
Root system defined by Cartan matrix
0 by 0 empty matrix
Root system of rank 0
of type []
```
"""
function root_system(type::Vector{Tuple{Symbol,Int}})
Expand Down Expand Up @@ -226,8 +216,8 @@ Return the fundamental weights corresponding to the `simple_roots` of `R`.
```jldoctest
julia> fundamental_weights(root_system(:A, 2))
2-element Vector{WeightLatticeElem}:
w1
w2
w_1
w_2
```
"""
function fundamental_weights(R::RootSystem)
Expand Down Expand Up @@ -282,9 +272,9 @@ Also see: `negative_root`.
```jldoctest
julia> negative_roots(root_system(:A, 2))
3-element Vector{RootSpaceElem}:
RootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [-1 0])
RootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [0 -1])
RootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [-1 -1])
-a_1
-a_2
-a_1 - a_2
```
"""
function negative_roots(R::RootSystem)
Expand Down Expand Up @@ -324,9 +314,9 @@ Also see: `negative_coroot`.
```jldoctest
julia> negative_coroots(root_system(:A, 2))
3-element Vector{DualRootSpaceElem}:
DualRootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [-1 0])
DualRootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [0 -1])
DualRootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [-1 -1])
-a^v_1
-a^v_2
-a^v_1 - a^v_2
```
"""
function negative_coroots(R::RootSystem)
Expand Down Expand Up @@ -400,9 +390,9 @@ Also see: `positive_root`, `number_of_positive_roots`.
```jldoctest
julia> positive_roots(root_system(:A, 2))
3-element Vector{RootSpaceElem}:
RootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [1 0])
RootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [0 1])
RootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [1 1])
a_1
a_2
a_1 + a_2
```
"""
function positive_roots(R::RootSystem)
Expand Down Expand Up @@ -442,9 +432,9 @@ Also see: `positive_coroots`.
```jldoctest
julia> positive_coroots(root_system(:A, 2))
3-element Vector{DualRootSpaceElem}:
DualRootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [1 0])
DualRootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [0 1])
DualRootSpaceElem(Root system defined by Cartan matrix [2 -1; -1 2], [1 1])
a^v_1
a^v_2
a^v_1 + a^v_2
```
"""
function positive_coroots(R::RootSystem)
Expand Down Expand Up @@ -606,13 +596,19 @@ Return the Weyl group of `R`.
# Examples
```jldoctest
julia> weyl_group(root_system([2 -1; -1 2]))
Weyl group for root system defined by Cartan matrix [2 -1; -1 2]
Weyl group
of root system of rank 2
of type A2
julia> weyl_group(root_system(matrix(ZZ, 2, 2, [2, -1, -1, 2]); detect_type=false))
Weyl group for root system defined by Cartan matrix [2 -1; -1 2]
Weyl group
of root system of rank 2
of unknown type
julia> weyl_group(root_system(matrix(ZZ, [2 -1 -2; -1 2 0; -1 0 2])))
Weyl group for root system defined by Cartan matrix [2 -1 -2; -1 2 0; -1 0 2]
Weyl group
of root system of rank 3
of type C3 (with non-canonical ordering of simple roots)
```
"""
function weyl_group(R::RootSystem)
Expand Down
4 changes: 3 additions & 1 deletion experimental/LieAlgebras/src/WeylGroup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ Returns the Weyl group of the given type. See `cartan_matrix(fam::Symbol, rk::In
# Examples
```jldoctest
julia> weyl_group(:A, 2)
Weyl group for root system defined by Cartan matrix [2 -1; -1 2]
Weyl group
of root system of rank 2
of type A2
```
"""
function weyl_group(fam::Symbol, rk::Int)
Expand Down

0 comments on commit fe0e885

Please sign in to comment.