gap-system / gap

Main development repository for GAP - Groups, Algorithms, Programming, a System for Computational Discrete Algebra
https://www.gap-system.org
GNU General Public License v2.0
815 stars 161 forks source link

Document requirements for SemiSimpleType #2570

Open ProfDema opened 6 years ago

ProfDema commented 6 years ago

Please use the following template to submit an issue (you may delete lines which are not used). Thank You!

Observed behaviour

gap> Display(sp2);
Algebra( <algebraic extension over the Rationals of degree 2>, 
[ LieObject( [ [ !0, !1 ], [ !0, !0 ] ] ), 
  LieObject( [ [ !0, !0 ], [ !1, !0 ] ] ), 
  LieObject( [ [ !1, !0 ], [ !0, !-1 ] ] ) ] )
gap> SemiSimpleType(sp2);
Error, DenominatorRat: <rat> must be a rational (not a object (positional)) in
  den := DenominatorRat( T[i][j][2][k] )
 ; at /Users/ilirdema/math/gap-4.9.1/lib/alglie.gi:2412 called from 
<function "unknown">( <arguments> )
 called from read-eval loop at *stdin*:53
you can replace <rat> via 'return <rat>;'
brk> 

Expected behaviour

Copy and paste GAP banner (to tell us about your setup)

ProfDema commented 6 years ago

It looks like the following code segment needs work for any field:

  denoms:=[];
  for i in [1..Dimension(L)] do
    for j in [1..Dimension(L)] do
      for k in [1..Length(T[i][j][2])] do
         den:= DenominatorRat( T[i][j][2][k] );
         if (den <> 1) and (not den in denoms) then
           Add( denoms, den );
         fi;
      od;
    od;
  od;

Is there a version of DenominatorRat that works for any field? Also, should den<>1 be replaced by den <> One(F) ?

olexandr-konovalov commented 6 years ago

@ProfDema thanks you for reporting this. Could you please also provide the input needed to construct sp2 from the example? Thanks.

ProfDema commented 6 years ago
ComplexBuilder := function()
    local _x, _p;
    _x := X(Rationals, "x");
    _p := _x^2+1;
    return AlgebraicExtension(Rationals, _p);
end;

Eij := function(f, n, i, j)
    #
    # return: elementary matrix Eij
    # f: field of coefficients
    # n: dimension of the matrix
    #
    local _e;
    _e := NullMat(n, n);
    _e[i][j] := 1;
    return _e * One(f);
end;  

SymplecticLieAlgebra := function(fld, n)
    #
    # return: Symplectic Lie Algebra gl(2n, fld) whose elements are 2x2 matrices
    # [[A, B], [C,-transpose(A)]] where A,B,C,D are in gl(n,fld) and B,C are symmetric 
    # fld: field of coefficients
    # n: dimension
    #
    local _i, e, f, h, _gens;
    _gens := [];
    for _i in [1..(n-1)] do 
        e := Eij(fld, 2*n, _i, _i+1) - Eij(fld, 2*n, n+_i+1, n+1);
        f := Eij(fld, 2*n, _i+1, _i) - Eij(fld, 2*n, n+_i, n+_i+1);
        h := Eij(fld, 2*n, _i, _i) - Eij(fld, 2*n, _i+1, _i+1);
        h := h - Eij(fld, 2*n, n+_i, n+_i) + Eij(fld, 2*n, n+_i+1, n+_i+1);
        Add(_gens, e);
        Add(_gens, f);
        Add(_gens, h);
    od;
    e := Eij(fld, 2*n, n, 2*n);
    f := Eij(fld, 2*n, 2*n, n);
    h := Eij(fld, 2*n, n, n) - Eij(fld, 2*n, 2*n, 2*n);
    Add(_gens, e);
    Add(_gens, f);
    Add(_gens, h);
    return LieAlgebra(fld, _gens);
end;

gap> Complex := ComplexBuilder();
<algebraic extension over the Rationals of degree 2>
gap> sp8 := SymplecticLieAlgebra(Complex, 4);
<Lie algebra over <algebraic extension over the Rationals of degree 2>, with 
12 generators>
gap> SemiSimpleType(sp8);
Error, DenominatorRat: <rat> must be a rational (not a object (positional)) in
  den := DenominatorRat( T[i][j][2][k] )
 ; at /Users/ilirdema/math/gap-4.9.1/lib/alglie.gi:2412 called from 
<function "unknown">( <arguments> )
 called from read-eval loop at *stdin*:71
you can replace <rat> via 'return <rat>;'
brk> 
olexandr-konovalov commented 6 years ago

Thank you - I've notified @willemdegraaf and he will hopefully comment here in a couple of days.

willemdegraaf commented 6 years ago

Hello,

This function only works over the rationals, as the algorithm reduces the structure constants modulo a prime. This probably should be mentioned in the manual.

In your case you can compute the root system (RootSystem(sp8);), and then it turns out that the Lie algebra is of type A7.

Alternatively, if you want to use complex numbers, then you can use the field CF(4) and everything is much faster. Also the function SemiSimpleType will work in that case because the structure constants of the algebra are rationals.

Willem

ProfDema commented 6 years ago

Thank you.

olexandr-konovalov commented 6 years ago

TODO as a result of this issue: as @willemdegraaf explained, "This function only works over the rationals, as the algorithm reduces the structure constants modulo a prime. This probably should be mentioned in the manual."