> < ^ Date: Mon, 03 Apr 2000 17:59:26 +0100
> < ^ From: Willem de Graaf <degraaf@math.uu.nl >
< ^ Subject: Jennings algebra

Dear Laurent Bartholdi,

Thank you for your message. The error occurred in the function
`JenningsLieAlgebra'. Below I append a fixed version of this
function; this bug will also be fixed in the next bugfix.
If you encounter any more problems, please ask.

Best wishes,

Willem de Graaf

====================================================================


#############################################################################
##
#M  JenningsLieAlgebra( <G> )
##
##  The Jennings Lie algebra of the p-group G. 
##
##

InstallMethod( JenningsLieAlgebra,
                "for a p-group",
                 true,
                 [IsGroup], 0,
function ( G )
local J,         # Jennings series of G
      Homs,      # Homomorphisms of J[i] onto the quotient J[i]/J[i+1] 
      grades,    # List of the full images of the maps in Homs
      gens,      # List of the generators of the quotients J[i]/J[i+1],
                 # i.e., a basis of the Lie algebra.
      pos,       # list of positions: if pos[j] = p, then the element
                 # gens[i] belongs to grades[p]
      i,j,k,     # loop variables
      tempgens,
      t,         # integer
      T,         # multiplication table of the Lie algebra
      dim,       # dimension of the Lie algebra
      a,b,c,f,   # group elements
      e,         # ext rep of a group element
      co,        # entry of the multiplication table
      p,         # the prime of G
      F,         # ground field 
      L,         # the Lie algebra to be constructed
      pimgs,     # pth-power images
      B,         # Basis of L 
      vv, x,     # elements of L
      comp,      # homogeneous component
      grading,   # list of homogeneous components 
      pcgps,     # list of pc groups, isom to the elts of `grades'.
      hom_pcg;   # list of isomomorphisms of `grades[i]' to `pcgps[i]'. 

# We do not know the characteristic if `G' is trivial.
if IsTrivial( G ) then
Error( "<G> must be a nontrivial p-group" );
fi;

# Construct the homogeneous components of `L':

J:=JenningsSeries ( G );
Homs:= List ( [1..Length(J)-1] , x -> 
              NaturalHomomorphismByNormalSubgroup ( J[x], J[x+1] ));
grades := List ( Homs , Range );
hom_pcg:= List( grades, IsomorphismPcGroup );
pcgps:= List( hom_pcg, Range );
gens := [];
pos := [];
for i in [1.. Length(grades)] do
    tempgens:= GeneratorsOfGroup( pcgps[i] );
    Append ( gens , tempgens);
    Append ( pos , List ( tempgens , x-> i ) );
od;

# Construct the field and the multiplication table:

dim:= Length(gens);
p:= PrimePGroup( G );
F:= GF( p );
T:= EmptySCTable( dim , Zero(F) , "antisymmetric" );
pimgs := [];
for i in [1..dim] do
    a:= PreImagesRepresentative( Homs[pos[i]] , 
                PreImagesRepresentative( hom_pcg[pos[i]], gens[i] ) );

># calculate the p-th power image of `a':

if pos[i]*p <= Length(Homs) then
    Add( pimgs, Image( hom_pcg[pos[i]*p], 
            Image( Homs[pos[i]*p], a^p) ) );
else
    Add( pimgs, "zero" );
fi;

for j in [i+1.. dim] do
    if pos[i]+pos[j] <= Length( Homs ) then

>>># Calculate the commutator [a,b], and map the result into
>>># the correct homogeneous component.

    b:= PreImagesRepresentative( Homs[pos[j]], 
             PreImagesRepresentative( hom_pcg[pos[j]], gens[j] ));
    c:= Image( hom_pcg[pos[i] + pos[j]], 
               Image(Homs[pos[i] + pos[j]], a^-1*b^-1*a*b) );
    e:= ExtRepOfObj(c);
    co:=[];
    for k in [1,3..Length(e)-1] do
        f:= GeneratorsOfGroup( pcgps[pos[i]+pos[j]] )[e[k]];
        t:= Position( gens, f );
        Add( co, One( F )*e[k+1] );
        Add( co, t );
    od;
    SetEntrySCTable( T, i, j, co );
fi;
    od;
od;

L:= LieAlgebraByStructureConstants( F, T );

B:= Basis( L );

# Now we compute the natural grading of `L'.

grading:= [ ];
k:= 1;
while k <= Length( pos ) do
  x:= pos[k];
  comp:= [ ];
  while k <= Length( pos ) and pos[k] = x do
    Add( comp, B[k] );
    k:= k+1;
  od;
  Add( grading, VectorSpace( F, comp ) );
od;

Add( grading, Subspace( L, [ ] ) );

SetGrading( L, rec( min_degree:= 1, 
                    max_degree:= Length( grading ) - 1,
                    source:= Integers,
                    hom_components:= function( d )
                                        if d in [1..Length(grading)] then
                                          return grading[d];
                                        else
                                          return grading[Length(grading)];
                                        fi;
                                     end
                  )
          );

vv:= BasisVectors( B );

# Set the pth-power images of the basis elements of `B':

for i in [1..Length(pimgs)] do
    if pimgs[i] = "zero" then
        pimgs[i]:= Zero( L );
    else
        e:= ExtRepOfObj( pimgs[i] );
        x:= Zero( L );
        for k in [1,3..Length(e)-1] do
            f:= GeneratorsOfGroup( pcgps[pos[i]*p] )[e[k]];
            t:= Position( gens, f );
            x:= x+ One( F )*e[k+1]*vv[t];
        od;
        pimgs[i]:= x;
    fi;
od;
SetPthPowerImages( B, pimgs );

return L;

end );

> < [top]