diff --git a/experimental/LieAlgebras/src/iso_oscar_gap.jl b/experimental/LieAlgebras/src/iso_oscar_gap.jl index b01734970c02..106241ba0204 100644 --- a/experimental/LieAlgebras/src/iso_oscar_gap.jl +++ b/experimental/LieAlgebras/src/iso_oscar_gap.jl @@ -7,7 +7,7 @@ function _iso_oscar_gap_lie_algebra_functions( LO::LieAlgebra{C}, LG::GapObj, coeffs_iso::MapFromFunc ) where {C<:FieldElem} - basis_LG = GAPWrap.Basis(LG) + basis_LG = GAPWrap.Basis(LG, GAPWrap.GeneratorsOfAlgebra(LG)) f = function (x::LieAlgebraElem{C}) cfs = GAP.Obj([coeffs_iso(c) for c in coefficients(x)]) @@ -34,8 +34,7 @@ function _iso_oscar_gap(LO::LinearLieAlgebra; set_attributes::Bool=true) if set_attributes && has_root_system(LO) # we need to construct the root system in GAP as otherwise it may detect a different order of simple roots - RO = root_system(LO) - _iso_oscar_gap_set_root_system(LG, RO) + _iso_oscar_gap_set_root_system(LO, LG, f) end return MapFromFunc(LO, LG, f, finv) @@ -64,14 +63,14 @@ function _iso_oscar_gap(LO::AbstractLieAlgebra; set_attributes::Bool=true) if set_attributes && has_root_system(LO) # we need to construct the root system in GAP as otherwise it may detect a different order of simple roots - RO = root_system(LO) - _iso_oscar_gap_set_root_system(LG, RO) + _iso_oscar_gap_set_root_system(LO, LG, f) end return MapFromFunc(LO, LG, f, finv) end -function _iso_oscar_gap_set_root_system(LG::GapObj, RO::RootSystem) +function _iso_oscar_gap_set_root_system(LO::LieAlgebra, LG::GapObj, LO_to_LG::Function) + RO = root_system(LO) RG = GAP.Globals.Objectify( GAP.Globals.NewType( GAP.Globals.NewFamily(GAP.Obj("RootSystemFam"), GAP.Globals.IsObject), @@ -84,10 +83,10 @@ function _iso_oscar_gap_set_root_system(LG::GapObj, RO::RootSystem) GAP.Globals.SetPositiveRoots(RG, GAP.Obj(transform_root.(positive_roots(RO)))) GAP.Globals.SetNegativeRoots(RG, GAP.Obj(transform_root.(negative_roots(RO)))) GAP.Globals.SetSimpleSystem(RG, GAP.Obj(transform_root.(simple_roots(RO)))) - can_basisG = GAP.Globals.CanonicalBasis(LG) - pos_root_vectorsG = can_basisG[1:n_positive_roots(RO)] - neg_root_vectorsG = can_basisG[(n_positive_roots(RO) + 1):(2 * n_positive_roots(RO))] - csa_basisG = can_basisG[(2 * n_positive_roots(RO) + 1):end] + chev_basisL = chevalley_basis(LO) + pos_root_vectorsG = GAP.Obj(LO_to_LG.(chev_basisL[1])) + neg_root_vectorsG = GAP.Obj(LO_to_LG.(chev_basisL[2])) + csa_basisG = GAP.Obj(LO_to_LG.(chev_basisL[3])) GAP.Globals.SetPositiveRootVectors(RG, pos_root_vectorsG) GAP.Globals.SetNegativeRootVectors(RG, neg_root_vectorsG) GAP.Globals.SetCanonicalGenerators( diff --git a/experimental/LieAlgebras/test/LieAlgebraModule-test.jl b/experimental/LieAlgebras/test/LieAlgebraModule-test.jl index a42995b68eb7..fbd3f6bb6279 100644 --- a/experimental/LieAlgebras/test/LieAlgebraModule-test.jl +++ b/experimental/LieAlgebras/test/LieAlgebraModule-test.jl @@ -5,12 +5,14 @@ L = special_linear_lie_algebra(QQ, 2) V = trivial_module(L, 0) lie_algebra_module_conformance_test(L, V) + @test dim(V) == 0 end @testset "3-dim trivial module of so_3(QQ)" begin L = special_orthogonal_lie_algebra(QQ, 2) V = trivial_module(L, 3) lie_algebra_module_conformance_test(L, V) + @test dim(V) == 3 end @testset "V of sl_2(QQ) using structure constants" begin @@ -25,30 +27,35 @@ L = special_linear_lie_algebra(QQ, 2) V = abstract_module(L, 2, sc) lie_algebra_module_conformance_test(L, V) + @test dim(V) == 2 end @testset "λ = [1,1,0] of sl_4(QQ)" begin L = special_linear_lie_algebra(QQ, 4) V = simple_module(L, [1, 1, 0]) lie_algebra_module_conformance_test(L, V) + @test dim(V) == 20 end - @testset "λ = [1,1,0,0] of so_4(CF(4))" begin + @testset "λ = [1,1] of so_4(CF(4))" begin L = special_orthogonal_lie_algebra(cyclotomic_field(4)[1], 4) - V = simple_module(L, [1, 1, 0, 0]) + V = simple_module(L, [1, 1]) lie_algebra_module_conformance_test(L, V) + @test dim(V) == 4 end @testset "λ = [0,1] of A_2(QQ)" begin L = lie_algebra(QQ, :A, 2) V = simple_module(L, [0, 1]) lie_algebra_module_conformance_test(L, V) + @test dim(V) == 3 end @testset "λ = [0,1,1] of B_3(QQ)" begin L = lie_algebra(QQ, :B, 3) V = simple_module(L, [0, 1, 1]) lie_algebra_module_conformance_test(L, V) + @test dim(V) == 112 end @testset "V of sl_4(QQ)" begin diff --git a/experimental/LieAlgebras/test/iso_oscar_gap-test.jl b/experimental/LieAlgebras/test/iso_oscar_gap-test.jl index 06682e11a2bf..88df3b23f9de 100644 --- a/experimental/LieAlgebras/test/iso_oscar_gap-test.jl +++ b/experimental/LieAlgebras/test/iso_oscar_gap-test.jl @@ -1,6 +1,6 @@ import Oscar: GAPWrap -function test_iso_oscar_gap(LO::LieAlgebra; num_random_tests::Int=10) +function test_iso_oscar_gap(LO::LieAlgebra; num_random_tests::Int=25) iso = Oscar.iso_oscar_gap(LO) @test domain(iso) === LO LG = codomain(iso) @@ -54,6 +54,7 @@ end lie_algebra(RO, sl2_struct_consts(RO), ["e", "f", "h"]), lie_algebra(RO, :A, 3), lie_algebra(RO, :B, 2), + (L0 = lie_algebra(RO, :B, 5); root_system(L0); L0), ] @testset for LO in lie_algebras @@ -67,6 +68,7 @@ end special_linear_lie_algebra(RO, 3), special_orthogonal_lie_algebra(RO, 4), symplectic_lie_algebra(RO, 6), + (LO = special_linear_lie_algebra(RO, 4); root_system(LO); LO), ] @testset for LO in lie_algebras diff --git a/src/GAP/wrappers.jl b/src/GAP/wrappers.jl index ad77d4248daf..ee1ab6bfdb4f 100644 --- a/src/GAP/wrappers.jl +++ b/src/GAP/wrappers.jl @@ -108,6 +108,7 @@ GAP.@wrap FreeGroupOfFpGroup(x::GapObj)::GapObj GAP.@wrap FusionCharTableTom(x::GapObj, y::GapObj)::GapObj GAP.@wrap FusionConjugacyClasses(x::GapObj, y::GapObj)::GapObj GAP.@wrap GaloisCyc(x::GAP.Obj, GapInt)::GAP.Obj +GAP.@wrap GeneratorsOfAlgebra(x::GapObj)::GapObj GAP.@wrap GeneratorsOfField(x::GapObj)::GapObj GAP.@wrap GeneratorsOfGroup(x::GapObj)::GapObj GAP.@wrap GenExpList(x::GapObj)::GapObj