Open ProfDema opened 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) ?
@ProfDema thanks you for reporting this. Could you please also provide the input needed to construct sp2
from the example? Thanks.
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>
Thank you - I've notified @willemdegraaf and he will hopefully comment here in a couple of days.
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
Thank you.
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."
Please use the following template to submit an issue (you may delete lines which are not used). Thank You!
Observed behaviour
Expected behaviour
Copy and paste GAP banner (to tell us about your setup)