[GAP Forum] two gap functions

Alexander Hulpke ahulpke at gmail.com
Thu Nov 26 19:40:02 GMT 2009

Dear Forum,

On Nov 26, 2009, at 12:15 AM, Alec Makosi wrote:
> what's wrong in the following two examples of GAP code:
> G  := AlternatingGroup(12);
> gens := StraightLineProgGens(GeneratorsOfGroup(G));
> G  := Group(gens);
> A  := AutomorphismGroup(G);

Why do you pack the permutations of A12 as straight line programs? For so low degree the memory savings are neglegible, possibly even negative, but you will be paying an enormous performance penalty.
Calculating the Automorphism group of AlternatingGroup(12) will be *much* faster, you then could use for example
`EpimorphismFromFreeGroup' to decompose elements of A12 as words in generators (in case that was the aim).

(Straight line program elements were intended for the case that it simpl would not be feasible to store many group elements for memory reasons.)

> CyclePermInt: <perm> must be a permutation (not a object (positional)) at ...
> called from CycleStructurePerm( e[i] ) called from ...

The error message you got is because not all permutation code has been translated to straight line program elements. Adding the following three commands (which will be in the next release) should help, however still they will not help with the overall abysmal runtime.

InstallOtherMethod( CycleStructurePerm, "straight line program perms", true,
  [ IsPerm and IsStraightLineProgElm ],1,
  return CycleStructurePerm(EvalStraightLineProgElm(p));

InstallOtherMethod( SignPerm, "straight line program perms", true,
  [ IsPerm and IsStraightLineProgElm ],1, 
  return SignPerm(EvalStraightLineProgElm(p));

InstallOtherMethod( RestrictedPermNC, "straight line program perms", true,
  [ IsPerm and IsStraightLineProgElm,IsList ],1,
  return RestrictedPermNC(EvalStraightLineProgElm(p),l);


   Alexander Hulpke

-- Colorado State University, Department of Mathematics,
Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA
email: hulpke at math.colostate.edu, Phone: ++1-970-4914288

More information about the Forum mailing list