[GAP Forum] three remarks

Laurent Bartholdi laurent.bartholdi at gmail.com
Fri Mar 17 22:37:21 GMT 2006


hi again, gap world,
1) it would be very nice, i think, if LowerCentralSeries() accepted a second
argument, which is the length of the series to be computed. There are
sometimes groups for which the whole computation is very long, but only
the first few terms are needed.
2) It would also be nice (in terms of shortening code) that if L is a list, then
  L[infinity] returns the last element. I tried
InstallOtherMethod(\[\],[IsList,IsInfinity],100,function(l,i)return
l[Length(l)];end);
  but it doesn't seem to work.
3) AlgebraHomomorphismByImages is very slow, and I don't see why. I have
  finite-dimensional algebras, and it seems, to me, that to check whether a
  mapping (on generators) is a homomorphism amounts to finding a basis, and
  checking the homomorphism on the basis. Therefore I would use
f := AlgebraHomomorphismByImagesNC(source,range,gens,images);
CheckIsAlgebraHomorphism(f);
  using the code

CheckIsAlgebraHomomorphism := function(f)
  local S,R,V,i,added;

  S := Source(f);
  R := Range(f);
  B := ShallowCopy(MappingGeneratorsImages(f)[1]);
  C := ShallowCopy(MappingGeneratorsImages(f)[2]);
  V := VectorSpace(LeftActingDomain(S),B);
  while V <> S do
    added := false;
    for i in Tuples([1..Length(B)],2) do
      if not B[i[1]]*B[i[2]] in V then
        Add(B,B[i[1]]*B[i[2]]);
        Add(C,C[i[1]]*C[i[2]]);
        V := VectorSpace(LeftActingDomain(S),B);
        added := true;
      fi;
    od;
    if not added then return fail; fi; # does not generate
  od;
  B := Basis(S,B);
  return ForAll(Tuples([1..Length(B)],2),
    i->LinearCombination(C,Coefficients(B,B[i[1]]*B[i[2]]))=C[i[1]]*C[i[2]]);
end;

--
Laurent Bartholdi          \  laurent.bartholdi<at>gmail<dot>com
EPFL SB SMA IMB MAD         \    Téléphone: +41 21-6935458
Station 8                    \ Secrétaire: +41 21-6935501
CH-1015 Lausanne, Switzerland \      Fax: +41 21-6930339



More information about the Forum mailing list