# Constructing the automorphism group of an algebra in GAP

First of all, if one needs to run this code correctly, one should read in a file in order to make the command NaturalHomomorphismByIdeal run correctly as explained in the answer here. This is the original setup:

x := X(Rationals, "x");;
y := X(Rationals, "y");;
z := X(Rationals, "z");;
P := PolynomialRing(Rationals, [x,y,z]);;
I := Ideal(P, [ x^3-3*x-1, x^2+x*y+y^2-3, x+y+z ]);;
pr := NaturalHomomorphismByIdeal(P, I);;
Q := Image(pr);;
xx := Image(pr, x);;
yy := Image(pr, y);;
zz := Image(pr, z);;
sig := AlgebraHomomorphismByImages(Q, Q, [xx, yy], [yy, zz]);;


From time to time I issue a command that I think maybe should work but will not scare me if it spits out error messages. But to my astonishment the following worked:

gap> Order(sig);
3
gap> sig^3;
[ (-1)*(z)+(-1)*(y), (y), (3)*(1)+(yz), (-3)*(1)+(z2),
(3)*(1)+(-1)*(z2)+(-1)*(yz), (-1)*(1)+(3)*(y)+(-1)*(yz2) ] ->
[ (-1)*(z)+(-1)*(y), (y), (3)*(1)+(yz), (-3)*(1)+(z2),
(3)*(1)+(-1)*(z2)+(-1)*(yz), (-1)*(1)+(3)*(y)+(-1)*(yz2) ]
gap> sig^0;
IdentityMapping( <ring Rationals,(1),(z),(z2),(y),(yz),(yz2)> )
gap> G := Group(sig);
<group with 1 generators>


Unluckily it seems that $sig^3$ is not recognized as the identity and moreover the following does not give what I expected:

gap> StructureDescription(G);
Error, resulting list would be too large (length infinity) called from
ConstantTimeAccessList( enum
) at /proc/cygdrive/C/gap4r8/lib/coll.gi:506 called from
AsList( l ) at /proc/cygdrive/C/gap4r8/lib/list.gi:612 called from
AsPlist( l ) at /proc/cygdrive/C/gap4r8/lib/list.gi:673 called from
EnumeratorSorted( Enumerator( D )
) at /proc/cygdrive/C/gap4r8/lib/domain.gi:231 called from
EnumeratorSorted(
Union( PreImagesRange( map1 ), PreImagesRange( map2 ) )
) at /proc/cygdrive/C/gap4r8/lib/mapping.gi:1420 called from
...  at line 213 of *stdin*
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk>


Is there a way to construct some group so that it acts on $Q$ by automorphisms?

Actually $sig^3$ is recognized as identity. It just is not represented as identity mapping.

The easiest way of working with a group of algebra automorphisms is probably to calculate the matrix representation from basis images:

gap> bas:=Basis(Q);
CanonicalBasis( <ring Rationals,(1),(z),(z2),(y),(yz),(yz2)> )
gap> mat:=h->List(BasisVectors(bas),x->Coefficients(bas,Image(h,x)));
function( h ) ... end
gap> m:=List(GeneratorsOfGroup(G),mat);
[ [ [ 1, 0, 0, 0, 0, 0 ], [ 0, -1, 0, -1, 0, 0 ], [ 3, 0, 0, 0, 1, 0 ],
[ 0, 1, 0, 0, 0, 0 ], [ 0, 0, -1, 0, -1, 0 ], [ 0, 3, 0, 0, 0, 1 ] ] ]
gap> matgp:=Group(m);
<matrix group with 1 generators>
gap> Size(matgp);
3

• I already did something similar using "generalized" companionmatrices. , but IMHO it's a lot more difficult to find idempotents. I rebuild $Q$ as a matrixalgebra. – Marc Bogaerts Feb 16 '17 at 20:35
• I think this is the best solution. – Marc Bogaerts Feb 16 '17 at 20:46