[GAP Forum] Lie Algebra Commutator Matrix Question

Alan Hylton agh314 at lehigh.edu
Mon May 17 19:14:26 BST 2021


Howdy,

Yes the issue is that it is slow over larger examples. Dima offered a more
graceful solution, but what I did is below, in case anyone was looking for
an appetite suppressant. The variable names have been changed to protect
the innocent, so if there are bugs here it works for me. The idea: treat
the basis vectors as indeterminates, fill them with random numbers, compute
the rank, and do it again until we get two agreeing ranks in a row. This is
because there is a chance for error. I should have made a variable for
Dimension(L), and otherwise optimized. My excuse is that this is me
learning GAP at the same time.

L := < some Lie algebra >

rs1 := RandomSource(IsMersenneTwister);
get_random_list := function()
 local temp, i;
 temp := [];
 for i in [1..Dimension(L)] do
  Add(temp, Random(rs1, -1000, 1000));
 od;
 return temp;
end;

basis := Basis(L);;
SCT     := StructureConstantsTable(basis);;

rank1:=-1;
rank2:=-2;
flag :=1;

while rank1 <> rank2 do
  values  := get_random_list();;
  CommMat := NullMat(Dimension(L), Dimension(L));;
  flag := (flag + 1) mod 2;

  for i in [1..Dimension(L)] do
   for j in [1..Dimension(L)] do
    if SCT[i,j] <> [[],[]] then
     for k in [1..Length(SCT[i,j][2])] do
      CommMat[i, j] := CommMat[i, j] +
SCT[i,j][2][k]*values[SCT[i,j][1][k]];
     od;
   fi;
   od;
  od;

  if flag = 1 then
   rank1 := RankMat(CommMat);
  else
   rank2 := RankMat(CommMat);
  fi;
 od;

Best,
Alan

On Sun, May 16, 2021 at 6:31 AM Bill Allombert <
Bill.Allombert at math.u-bordeaux.fr> wrote:

> On Sun, May 16, 2021 at 01:33:46AM -0400, Alan Hylton wrote:
> > Hi Dima,
> >
> > And thanks for the reply!
> >
> > Yes, this is a bit weird - I admit it. Following some research I've seen
> > into certain index computations, I need to essentially create my
> > multiplication table, and essentially view the vectors as indeterminates.
> > So if I had a Lie algebra spanned by e1 and e2, and [e1, e2] = 2e2, then
> > the multiplication table would be a 2x2 matrix with E_12 = 2e2 and 0's
> > elsewhere. If I view e2 as an indeterminate, then, this matrix has rank
> 1.
>
> So to be sure, you want the rank over the rational function field C(e1,e2),
> and your issue when using Maple on larger example is that such linear
> algebra computation is too slow, or is it computing the matrix ?
>
> Cheers,
> Bill.
>
> _______________________________________________
> Forum mailing list
> Forum at gap-system.org
> https://mail.gap-system.org/mailman/listinfo/forum
>


More information about the Forum mailing list