[GAP Forum] Generating group products including ZS products

Rudolf Zlabinger Rudolf.Zlabinger at chello.at
Fri May 18 23:39:03 BST 2007


Dear Forum,

At 29.12.2006 Professor Burkhard Höfling wrote about ZS Products:

> Note that in both cases, it would be nearly impossible to tell if h  
> and k indeed satisfy the properties required by the definition of the  
> Zappa Szep product.
> In particular, I don't think that it would be computationally  
> feasible to list all possible Zappa Szep product of two given groups,  
> except for ridiculously small examples.

Now I developed a function GenerateGroupProducts that produces group products from two groups and two homomorphisms from one group to the automorphism group to the another.
These group products include also Zappa-Szep-Products for suiting pairs of Automorphism Homomorphisms. For two trivial homomorphisms the result is a direct product, for one trivial homomorphism
it is a semidirect product, of course.

The function file itself is included along with a drivnig function SomeZSProducts included in the file "Functions", that loops over pairs of representative automorphism homomorphisms, which are tested by function GenerateGroupProducts for giving raise to a ZS - product, and returns a representative number of ZS - product samples.

By extending this loop over pairs of representative automorphism homomorphisms to the full subgroup conjugacy classes it would be theoretically possible to generate all ZS products of two groups.

You can test function GenerateGroupProducts by reading in the file "Functions" and by reading in the driving file "StartGroupProducts". To test "SomeZSProducts" you can call it directly after reading in the file "Functions" giving two permutation groups. The functions should run properly up to a product size of the two groups of 10000. 

"SessionGroupProducts" is a session example.

yours sincerely, Rudolf Zlabinger  
-------------- next part --------------
# V0030 for GenerateGroupProducts V0030

s3:=		SymmetricGroup(3);
a4:=		AlternatingGroup(4);
auts3:=		AutomorphismGroup(s3);
auta4:=		AutomorphismGroup(a4);
homss3:=	AllGroupHomomorphismsRepresentative(s3,auta4);
homsa4:=	AllGroupHomomorphismsRepresentative(a4,auts3);
nullgensauts3:=	[One(auts3),One(auts3)];
nullgensauta4:=	[One(auta4),One(auta4)];
genss3:=	GeneratorsOfGroup(s3);
gensa4:=	GeneratorsOfGroup(a4);
lefthom0010:=	GroupHomomorphismByImages(s3,auta4,genss3,nullgensauta4);
righthom0010:=	homsa4[1][1];
righthom0020:=	GroupHomomorphismByImages(a4,auts3,gensa4,nullgensauts3);
lefthom0020:=	homss3[1][1];




# Test SemidirectProduct(a4,righthom0010,s3)
groups0010:=	GenerateGroupProducts(s3,a4,lefthom0010,righthom0010);
group0010:=     groups0010.product;
sd0010:=	SemidirectProduct(a4,righthom0010,s3);
iso0010:=	IsomorphismGroups(group0010,sd0010);

# Test SemidirectProduct(s3,lefthom0020,a4)
groups0020:=	GenerateGroupProducts(s3,a4,lefthom0020,righthom0020);
group0020:=     groups0020.product;
sd0020:=	SemidirectProduct(s3,lefthom0020,a4);
iso0020:=	IsomorphismGroups(group0020,sd0020);

# Test ZS Product righthom0010 lefthom0020
groups0030:=	GenerateGroupProducts(s3,a4,lefthom0020,righthom0010);


homss3f:=Flat(homss3);

lefthom0040:=homss3f[2];
# Test ZS Product righthom0010 lefthom0040
groups0040:=	GenerateGroupProducts(s3,a4,lefthom0040,righthom0010);


lefthom0050:=homss3f[3];
# Test ZS Product righthom0010 lefthom0050
groups0050:=	GenerateGroupProducts(s3,a4,lefthom0050,righthom0010);
-------------- next part --------------

#_______________________________________________________________________
#_______________________________________________________________________

AllGroupHomomorphismsRepresentative:=function(fromgroup,togroup)

 
 local nfromgroup,hfromgroup,ffromgroup,isgfromgrouptogroup,isgfromgrouptogroupp,homslist
 ; 

 nfromgroup:=NormalSubgroups(fromgroup);;
 nfromgroup:=Filtered(nfromgroup,x->x<>fromgroup);;             # the trivial homomorphism is not returned
 
 if nfromgroup = [] then return []; fi;                       # the trivial homomorphism is not returned
 
 ffromgroup:=List(nfromgroup,x->FactorGroup(fromgroup,x));;
 hfromgroup:=List(nfromgroup,x->NaturalHomomorphismByNormalSubgroup(fromgroup,x));;
 isgfromgrouptogroup:=List(ffromgroup,x->IsomorphicSubgroups(togroup,x));
 isgfromgrouptogroupp:=Filtered([1..Length(isgfromgrouptogroup)],x->isgfromgrouptogroup[x]<>[]);
 
 if isgfromgrouptogroupp = [] then return []; fi; 
 
 isgfromgrouptogroup:=isgfromgrouptogroup{isgfromgrouptogroupp};
 hfromgroup:=hfromgroup{isgfromgrouptogroupp};
 homslist:=List([1..Length(hfromgroup)],x->hfromgroup[x]*isgfromgrouptogroup[x]);
 
 return homslist;

end;

#_______________________________________________________
#_______________________________________________________

Array:=function(bounds)

# creates an array of empty lists of arbitrary nesting levels (dimensions)
# and bounds for each level
# bounds is a list of positive integers determining the length of each dimension
# the length of bounds is the dimension of the array

# at element level the dimension of the array is 1 higher, 
# as the last level are also empty lists

local array,IterateArray;

IterateArray:=function(array,bounds) 

# iterative call for decreasing levels of array and bounds

local i,dim,boundsrecall;

# i.. index, 
# dim the recent level of bounds, 
# boundsrecall.. shortened bounds for recalls

dim:=Length(bounds);                   # the varying length of bounds

for i in [1..bounds[1]] do              # 1 recallcascade for one add

  Add(array,[]);                         # enlarging the recent level of array
 
  if dim>1 then                          # dim=1 is the last level

    boundsrecall:=bounds{[2..dim]};        # shorten bounds for next level  
    IterateArray(array[i],boundsrecall);   # recursion for the next lower level of array   

  fi;                                    # end of dimension > 1 clause

od;                                    # end of bound loop

return array;
end;


array:=[];


array:=IterateArray(array,bounds);      # starting call of add cascade 


return array;
end;

#___________________________________________________
#___________________________________________________

# composes matrices to a compound matrix
# mats is a list of lists of matrices; 
# the lists have to be of same length
# the sum of the lengths of of the rows of matrices has to be the same in each list
# the number of rows of the matrices in one list has to be the same

MatrixArranged:=function(mats)
local matrix,dim,x,y,z,rows,prerows,trans;
dim:=[];
trans:=StructuralCopy(mats); # only to create an array of same bounds and dims of mats
                             # without destroying mats
prerows:=[];
dim[1]:=Length(mats[1]);
dim[2]:=Length(mats);
for x in [1..dim[2]] do;
for y in [1..dim[1]] do;
trans[x][y]:=TransposedMatMutable(mats[x][y]); #as concatenation processes rows matwise
od;
od;
for x in [1..dim[2]] do;
prerows[x]:=Concatenation(trans[x]);
prerows[x]:=TransposedMatMutable(prerows[x]); #to revert to original orientation
od;
matrix:=Concatenation(prerows);
return matrix;
end;

#____________________________________________________
#_____________________________________________________



# GenerateGroupProducts V0030
# complete with GenerateGroups

GenerateGroupProducts:=function(leftgroup,rightgroup,lefthom,righthom)

local 	GenerateRoot,GenerateLeftCosets,CompleteRoot,GenerateGroups,
      	sizeleft,sizeright,sizesum,sizetotal,sizerest,sizenewelms,
	root,subgroupsrows,groups,selectorperm,
	positionsinrightcosets,rootdata,elmsleftgroup,elmsrightgroup,
	gensleftgroup,gensrightgroup,posgenslg,posgensrg,
        data
;



#_____________________________________________
# Internal Procedures
#_____________________________________________
 
#__________________________________________________________
 GenerateRoot:= function()

  local leftcosets,rightcosets,newelm,cosetcolumn,cosetrow,
	leftmt,rightmt,rightrow,rightcolumn,roworcolumn,rightmtred,
	root,rootdata,positionsinrightcosets
  ;
  

  leftcosets:=  		Array([sizeright-1,sizeleft]); 
  rightcosets:= 		Array([sizeleft,sizeright-1]);
  positionsinrightcosets:=	Array([sizenewelms,3]);

  rootdata:=rec(); 

  newelm:=sizesum-1;


  for cosetrow in [2..sizeleft]     		do
   for  cosetcolumn in [1..sizeright-1]		do
    newelm:=					newelm+1;
    rightcosets[cosetrow][cosetcolumn]:=	newelm;
    positionsinrightcosets[newelm-sizesum+1][1]:=newelm;
    positionsinrightcosets[newelm-sizesum+1][2]:=cosetrow;
    positionsinrightcosets[newelm-sizesum+1][3]:=cosetcolumn+sizeleft; 
   od; # cosetrow
  od;  # cosetcolumn


  leftmt:=		MultiplicationTable(leftgroup);
  leftmt:=		MutableCopyMat(leftmt);

  rightmt:=		MultiplicationTable(rightgroup);
  rightmt:=		MutableCopyMat(rightmt);

  rightmt:=		rightmt +(sizeleft-1);

  for rightrow in [1..sizeright] 		do
   for rightcolumn in [1..sizeright] 		do
    if rightmt[rightrow][rightcolumn] = 	sizeleft 
    then rightmt[rightrow][rightcolumn]:=	1;
    fi;
   od; # rightcolumn
  od; # rightrow


  for roworcolumn in [1..sizeright-1] do
   rightcosets[1][roworcolumn]:=rightmt[1][roworcolumn+1];
   leftcosets [roworcolumn][1]:=rightmt[roworcolumn+1][1]; 
  od; # i

  rightmtred:=rightmt{[2..sizeright]}{[2..sizeright]};

  
  rootdata.root:=MatrixArranged([[leftmt,rightcosets],[leftcosets,rightmtred]]);
  rootdata.positions:=positionsinrightcosets;
  
  return rootdata;

 end;

#____________________________________________________________________

 GenerateLeftCosets:=function(root,lefthom,righthom)

  local leftcosetrow,leftcosetcolumn,
	CalculateLeftElm,
        leftcosetelm
  ;

 #___________________________________________________________________
 # Inner procedures of GenerateLeftCosets
 #___________________________________________________________________

 #__________________________________________________________________

  CalculateLeftElm:=function()

   local leftcosetelm,elmleftgroup,elmrightgroup,autleftgroup,
         autrightgroup,rightcosetrowelm,rightcosetcolumnelm,
         rightcosetcolumn,rightcosetrow 
   ;

   
   elmleftgroup:=		elmsleftgroup[leftcosetcolumn];
   elmrightgroup:=		elmsrightgroup[leftcosetrow-sizeleft+1];

   autleftgroup:=		Image(righthom,elmrightgroup)^-1;
   autrightgroup:=		Image(lefthom,elmleftgroup);

   rightcosetcolumnelm:=	elmrightgroup^autrightgroup;
   rightcosetrowelm:=		elmleftgroup ^autleftgroup;

   rightcosetcolumn:=	Position(elmsrightgroup,rightcosetcolumnelm)   + sizeleft - 1;
   rightcosetrow:=	Position(elmsleftgroup,rightcosetrowelm);
  
   leftcosetelm:=	root[rightcosetrow][rightcosetcolumn];	   

   return leftcosetelm;
  
  end; # of inner procedure CalculateLeftPosition
 #___________________________________________________________________

 #___________________________________________________________________
 # Mainline of function GenerateLeftCosets
 #___________________________________________________________________    
  
  
    
  for leftcosetrow in posgensrg 			do

   for leftcosetcolumn in [2..sizeleft]			do

    leftcosetelm:=				CalculateLeftElm();
    
    root[leftcosetrow][leftcosetcolumn]:=	leftcosetelm;
        
   od; #leftcosetcolumn

  od;  #leftcosetrow 
  
  return root;

 end; # of function GenerateLeft Cosets


#____________________________________________________________________

 CompleteRoot:=function(root)
 
  local	subgroupsrows,restrows,i,j,p2,genpositions,
	CalculateRight,CalculateLeft
  ; 



 #____________________________________________________________________
 # Internal Procedures
 #____________________________________________________________________
 #____________________________________
  CalculateLeft:=function(product,leftfactor)

   # a is in leftgroup, we form the product of poducts element by a

   # product by a:  a2 * p1 = (a2 * a1) * b1 = a3 * b1 = p2 

   # 1. lookup p1 = a1 * b1
   # 2. lookup a2 * a1 = a3
   # 3. lookup p2 = a3 * b1

   local a1,a2,a3,b1,p1,p2
   ;

   a2:=leftfactor;
   a1:=positionsinrightcosets[product-sizesum +1][2];
   a3:=root[a2][a1];
   b1:=positionsinrightcosets[product-sizesum +1][3];
   p2:=root[a3][b1];

   return p2;
 
  end; # CalculateLeft
 #_______________________________________________

 #_______________________________________________
 CalculateRight:=function(product,rightfactor)

  # b is in rightgroup, we form the product of poducts element by b

  # product by b:  b2 * p1 = (b2 * a1) * b1 = p2 * b1 = a3 * (b3 * b1) = a3 * b4 = p3 

  # 1. lookup p1 = a1 * b1
  # 2. lookup b2 * a1 = p2
  # 3. lookup p2 = a3 * b3  
  # 4. lookup b3 * b1 = b4 
  # 5. lookup p3 = a3 * b4

  local b1,b2,b3,b4,a1,a3,p2,p3
  ;

  a1:=positionsinrightcosets[product-sizesum+1][2];
  b1:=positionsinrightcosets[product-sizesum+1][3];
  b2:=rightfactor;
  p2:=root[b2][a1];
  a3:=positionsinrightcosets[p2-sizesum +1][2];
  b3:=positionsinrightcosets[p2-sizesum +1][3];
  b4:=root[b3][b1];
  p3:=root[a3][b4];

  return p3;
 
 end; # CalculateRight 



 #____________________________________________________________________
 # Mainline
 #____________________________________________________________________


  restrows:=Array([sizesum-1,sizenewelms]);
  for i in [1..sizenewelms] do
   restrows[1][i] := i + sizesum - 1;
  od;

     
  for i in [1..sizenewelms]   	do 
   for j in posgenslg     	do 
    p2:=CalculateLeft(restrows[1][i],j);
    restrows[j][i]:=p2;
   od; #i
  od; #j

  for i in [1..sizenewelms] 	do    
   for j in posgensrg     	do 
    p2:=CalculateRight(restrows[1][i],j);
    restrows[j][i]:=p2;
   od; #i
  od; #j 

  subgroupsrows:=MatrixArranged([[root,restrows]]);


  return subgroupsrows;

 end; # of internal procedure CompleteRoot

#____________________________________________________________________

#____________________________________________________________________

 GenerateGroups:= function(subgroupsrows)

  local groups,positionslg,positionsrg,positionsall,genslg,gensrg,gensall,
        embeddedlgp,embeddedlg,embeddedrgp,embeddedrg,productp,product,
        smdegprod
  ; 

  groups:=rec();

  positionslg:=		Concatenation([1],posgenslg);
  genslg:=		subgroupsrows{positionslg};
  embeddedlgp:=		List(genslg,x->PermListList(genslg[1],x));
  embeddedlg:=          Group(embeddedlgp);

  positionsrg:=		Concatenation([1],posgensrg);
  gensrg:=		subgroupsrows{positionsrg};
  embeddedrgp:=		List(gensrg,x->PermListList(gensrg[1],x));
  embeddedrg:=		Group(embeddedrgp);

  positionsall:=	Concatenation([1],posgenslg,posgensrg);
  gensall:=		subgroupsrows{positionsall};
  productp:=		List(gensall,x->PermListList(gensall[1],x));
  product:=		Group(productp);


  if Size(product) = sizetotal then
   
   smdegprod:=			SmallerDegreePermutationRepresentation(product);
   product:=			Image(smdegprod);
   embeddedlg:=			Image(smdegprod,embeddedlg);
   embeddedrg:=			Image(smdegprod,embeddedrg);   

   groups.embeddedleftgroup:=	embeddedlg;
   groups.embeddedrightgroup:=	embeddedrg;
   groups.product:=		product;

  else groups:=fail;
  fi;
   
  return groups;

 end; 

#_____________________________________________
# Mainline
#_____________________________________________


# Global Variables

sizeleft:=	Size(leftgroup);
sizeright:=	Size(rightgroup);
sizesum:=	sizeleft+sizeright;
sizetotal:=     sizeleft*sizeright;
sizerest:=      sizetotal-sizesum;
sizenewelms:= 	(sizeleft-1)*(sizeright-1);

# End of global variables

rootdata:=			GenerateRoot();

positionsinrightcosets:=	rootdata.positions;

root:=				rootdata.root;

elmsleftgroup:=			AsSortedList(leftgroup);
elmsrightgroup:=		AsSortedList(rightgroup);
gensleftgroup:=			GeneratorsOfGroup(leftgroup);
gensrightgroup:=		GeneratorsOfGroup(rightgroup);
posgenslg:=		List(gensleftgroup, x->Position(elmsleftgroup,x));
posgensrg:=		List(gensrightgroup,x->Position(elmsrightgroup,x));
posgensrg:=		posgensrg + sizeleft -1;		

root:=				GenerateLeftCosets(root,lefthom,righthom);

subgroupsrows:=			CompleteRoot(root);

groups:=			GenerateGroups(subgroupsrows);

return groups;



end;

#_____________________________________________________
#_____________________________________________________

SomeZSProducts:=		function(leftgroup,rightgroup)

local autleftgroup,autrightgroup,homsleftl,homsrightl,homsleft,homsright,
      homsprod,homspair,groups,groupstable
;

groupstable:=[];

autleftgroup:=		AutomorphismGroup(leftgroup);
autrightgroup:=		AutomorphismGroup(rightgroup);

homsleftl:=		AllGroupHomomorphismsRepresentative(leftgroup,autrightgroup);
homsrightl:=		AllGroupHomomorphismsRepresentative(rightgroup,autleftgroup);

homsleft:=		Flat(homsleftl);
homsright:=		Flat(homsrightl);

homsprod:=		Cartesian(homsleft,homsright);

Print("Number of pairs of Homomorphisms: ",Length(homsprod),"\n");

for homspair in homsprod do

 groups:=		GenerateGroupProducts(leftgroup,rightgroup,homspair[1],homspair[2]);
 if groups <> fail then Add(groupstable,groups);fi;

od; #homspair

return groupstable;

end;
-------------- next part --------------
# GenerateGroupProducts V0030
# complete with GenerateGroups

GenerateGroupProducts:=function(leftgroup,rightgroup,lefthom,righthom)

local 	GenerateRoot,GenerateLeftCosets,CompleteRoot,GenerateGroups,
      	sizeleft,sizeright,sizesum,sizetotal,sizerest,sizenewelms,
	root,subgroupsrows,groups,selectorperm,
	positionsinrightcosets,rootdata,elmsleftgroup,elmsrightgroup,
	gensleftgroup,gensrightgroup,posgenslg,posgensrg,
        data
;



#_____________________________________________
# Internal Procedures
#_____________________________________________
 
#__________________________________________________________
 GenerateRoot:= function()

  local leftcosets,rightcosets,newelm,cosetcolumn,cosetrow,
	leftmt,rightmt,rightrow,rightcolumn,roworcolumn,rightmtred,
	root,rootdata,positionsinrightcosets
  ;
  

  leftcosets:=  		Array([sizeright-1,sizeleft]); 
  rightcosets:= 		Array([sizeleft,sizeright-1]);
  positionsinrightcosets:=	Array([sizenewelms,3]);

  rootdata:=rec(); 

  newelm:=sizesum-1;


  for cosetrow in [2..sizeleft]     		do
   for  cosetcolumn in [1..sizeright-1]		do
    newelm:=					newelm+1;
    rightcosets[cosetrow][cosetcolumn]:=	newelm;
    positionsinrightcosets[newelm-sizesum+1][1]:=newelm;
    positionsinrightcosets[newelm-sizesum+1][2]:=cosetrow;
    positionsinrightcosets[newelm-sizesum+1][3]:=cosetcolumn+sizeleft; 
   od; # cosetrow
  od;  # cosetcolumn


  leftmt:=		MultiplicationTable(leftgroup);
  leftmt:=		MutableCopyMat(leftmt);

  rightmt:=		MultiplicationTable(rightgroup);
  rightmt:=		MutableCopyMat(rightmt);

  rightmt:=		rightmt +(sizeleft-1);

  for rightrow in [1..sizeright] 		do
   for rightcolumn in [1..sizeright] 		do
    if rightmt[rightrow][rightcolumn] = 	sizeleft 
    then rightmt[rightrow][rightcolumn]:=	1;
    fi;
   od; # rightcolumn
  od; # rightrow


  for roworcolumn in [1..sizeright-1] do
   rightcosets[1][roworcolumn]:=rightmt[1][roworcolumn+1];
   leftcosets [roworcolumn][1]:=rightmt[roworcolumn+1][1]; 
  od; # i

  rightmtred:=rightmt{[2..sizeright]}{[2..sizeright]};

  
  rootdata.root:=MatrixArranged([[leftmt,rightcosets],[leftcosets,rightmtred]]);
  rootdata.positions:=positionsinrightcosets;
  
  return rootdata;

 end;

#____________________________________________________________________

 GenerateLeftCosets:=function(root,lefthom,righthom)

  local leftcosetrow,leftcosetcolumn,
	CalculateLeftElm,
        leftcosetelm
  ;

 #___________________________________________________________________
 # Inner procedures of GenerateLeftCosets
 #___________________________________________________________________

 #__________________________________________________________________

  CalculateLeftElm:=function()

   local leftcosetelm,elmleftgroup,elmrightgroup,autleftgroup,
         autrightgroup,rightcosetrowelm,rightcosetcolumnelm,
         rightcosetcolumn,rightcosetrow 
   ;

   
   elmleftgroup:=		elmsleftgroup[leftcosetcolumn];
   elmrightgroup:=		elmsrightgroup[leftcosetrow-sizeleft+1];

   autleftgroup:=		Image(righthom,elmrightgroup)^-1;
   autrightgroup:=		Image(lefthom,elmleftgroup);

   rightcosetcolumnelm:=	elmrightgroup^autrightgroup;
   rightcosetrowelm:=		elmleftgroup ^autleftgroup;

   rightcosetcolumn:=	Position(elmsrightgroup,rightcosetcolumnelm)   + sizeleft - 1;
   rightcosetrow:=	Position(elmsleftgroup,rightcosetrowelm);
  
   leftcosetelm:=	root[rightcosetrow][rightcosetcolumn];	   

   return leftcosetelm;
  
  end; # of inner procedure CalculateLeftPosition
 #___________________________________________________________________

 #___________________________________________________________________
 # Mainline of function GenerateLeftCosets
 #___________________________________________________________________    
  
  
    
  for leftcosetrow in posgensrg 			do

   for leftcosetcolumn in [2..sizeleft]			do

    leftcosetelm:=				CalculateLeftElm();
    
    root[leftcosetrow][leftcosetcolumn]:=	leftcosetelm;
        
   od; #leftcosetcolumn

  od;  #leftcosetrow 
  
  return root;

 end; # of function GenerateLeft Cosets


#____________________________________________________________________

 CompleteRoot:=function(root)
 
  local	subgroupsrows,restrows,i,j,p2,genpositions,
	CalculateRight,CalculateLeft
  ; 



 #____________________________________________________________________
 # Internal Procedures
 #____________________________________________________________________
 #____________________________________
  CalculateLeft:=function(product,leftfactor)

   # a is in leftgroup, we form the product of poducts element by a

   # product by a:  a2 * p1 = (a2 * a1) * b1 = a3 * b1 = p2 

   # 1. lookup p1 = a1 * b1
   # 2. lookup a2 * a1 = a3
   # 3. lookup p2 = a3 * b1

   local a1,a2,a3,b1,p1,p2
   ;

   a2:=leftfactor;
   a1:=positionsinrightcosets[product-sizesum +1][2];
   a3:=root[a2][a1];
   b1:=positionsinrightcosets[product-sizesum +1][3];
   p2:=root[a3][b1];

   return p2;
 
  end; # CalculateLeft
 #_______________________________________________

 #_______________________________________________
 CalculateRight:=function(product,rightfactor)

  # b is in rightgroup, we form the product of poducts element by b

  # product by b:  b2 * p1 = (b2 * a1) * b1 = p2 * b1 = a3 * (b3 * b1) = a3 * b4 = p3 

  # 1. lookup p1 = a1 * b1
  # 2. lookup b2 * a1 = p2
  # 3. lookup p2 = a3 * b3  
  # 4. lookup b3 * b1 = b4 
  # 5. lookup p3 = a3 * b4

  local b1,b2,b3,b4,a1,a3,p2,p3
  ;

  a1:=positionsinrightcosets[product-sizesum+1][2];
  b1:=positionsinrightcosets[product-sizesum+1][3];
  b2:=rightfactor;
  p2:=root[b2][a1];
  a3:=positionsinrightcosets[p2-sizesum +1][2];
  b3:=positionsinrightcosets[p2-sizesum +1][3];
  b4:=root[b3][b1];
  p3:=root[a3][b4];

  return p3;
 
 end; # CalculateRight 



 #____________________________________________________________________
 # Mainline
 #____________________________________________________________________


  restrows:=Array([sizesum-1,sizenewelms]);
  for i in [1..sizenewelms] do
   restrows[1][i] := i + sizesum - 1;
  od;

     
  for i in [1..sizenewelms]   	do 
   for j in posgenslg     	do 
    p2:=CalculateLeft(restrows[1][i],j);
    restrows[j][i]:=p2;
   od; #i
  od; #j

  for i in [1..sizenewelms] 	do    
   for j in posgensrg     	do 
    p2:=CalculateRight(restrows[1][i],j);
    restrows[j][i]:=p2;
   od; #i
  od; #j 

  subgroupsrows:=MatrixArranged([[root,restrows]]);


  return subgroupsrows;

 end; # of internal procedure CompleteRoot

#____________________________________________________________________

#____________________________________________________________________

 GenerateGroups:= function(subgroupsrows)

  local groups,positionslg,positionsrg,positionsall,genslg,gensrg,gensall,
        embeddedlgp,embeddedlg,embeddedrgp,embeddedrg,productp,product,
        smdegprod
  ; 

  groups:=rec();

  positionslg:=		Concatenation([1],posgenslg);
  genslg:=		subgroupsrows{positionslg};
  embeddedlgp:=		List(genslg,x->PermListList(genslg[1],x));
  embeddedlg:=          Group(embeddedlgp);

  positionsrg:=		Concatenation([1],posgensrg);
  gensrg:=		subgroupsrows{positionsrg};
  embeddedrgp:=		List(gensrg,x->PermListList(gensrg[1],x));
  embeddedrg:=		Group(embeddedrgp);

  positionsall:=	Concatenation([1],posgenslg,posgensrg);
  gensall:=		subgroupsrows{positionsall};
  productp:=		List(gensall,x->PermListList(gensall[1],x));
  product:=		Group(productp);


  if Size(product) = sizetotal then
   
   smdegprod:=			SmallerDegreePermutationRepresentation(product);
   product:=			Image(smdegprod);
   embeddedlg:=			Image(smdegprod,embeddedlg);
   embeddedrg:=			Image(smdegprod,embeddedrg);   

   groups.embeddedleftgroup:=	embeddedlg;
   groups.embeddedrightgroup:=	embeddedrg;
   groups.product:=		product;

  else groups:=fail;
  fi;
   
  return groups;

 end; 

#_____________________________________________
# Mainline
#_____________________________________________


# Global Variables

sizeleft:=	Size(leftgroup);
sizeright:=	Size(rightgroup);
sizesum:=	sizeleft+sizeright;
sizetotal:=     sizeleft*sizeright;
sizerest:=      sizetotal-sizesum;
sizenewelms:= 	(sizeleft-1)*(sizeright-1);

# End of global variables

rootdata:=			GenerateRoot();

positionsinrightcosets:=	rootdata.positions;

root:=				rootdata.root;

elmsleftgroup:=			AsSortedList(leftgroup);
elmsrightgroup:=		AsSortedList(rightgroup);
gensleftgroup:=			GeneratorsOfGroup(leftgroup);
gensrightgroup:=		GeneratorsOfGroup(rightgroup);
posgenslg:=		List(gensleftgroup, x->Position(elmsleftgroup,x));
posgensrg:=		List(gensrightgroup,x->Position(elmsrightgroup,x));
posgensrg:=		posgensrg + sizeleft -1;		

root:=				GenerateLeftCosets(root,lefthom,righthom);

subgroupsrows:=			CompleteRoot(root);

groups:=			GenerateGroups(subgroupsrows);

return groups;



end;
-------------- next part --------------
gap> Read(Functions);
# You read attachment file Functions
gap> Read(Test0010);
# You read attachment file StartGroupProducts
gap> iso0010;
[ (1,4,5)(2,6,3)(7,16,19)(8,17,20)(9,18,21)(10,22,13)(11,23,14)(12,24,15), (1,3)(2,5)(4,6)(7,13)(8,14)(9,15)(10,19)(11,20)(12,21)(16,22)(17,23)(18,24), 
  (1,8)(2,11)(3,14)(4,17)(5,20)(6,23)(7,9)(10,12)(13,15)(16,18)(19,21)(22,24), (1,7)(2,10)(3,13)(4,16)(5,19)(6,22)(8,9)(11,12)(14,15)(17,18)(20,21)(23,24)
    , (2,6,3)(7,8,9)(10,23,15)(11,24,13)(12,22,14)(16,17,18)(19,20,21) ] -> [ (1,5,4)(2,6,3), (1,3)(2,4)(5,6), (7,8)(9,10), (7,9)(8,10), (1,5,4)(7,10,8) ]
gap> iso0020;
[ (1,4)(2,7)(3,10)(5,8)(6,11)(9,12), (1,9)(2,11)(3,5)(4,12)(6,7)(8,10), (1,3,2)(4,5,6)(7,9,8)(10,11,12), (2,3)(5,6)(7,10)(8,11)(9,12), 
  (4,12,9)(5,10,8)(6,11,7) ] -> [ (1,9)(2,7)(3,8)(4,12)(5,10)(6,11), (1,4)(2,6)(3,5)(7,11)(8,10)(9,12), (1,4,9)(2,6,7)(3,5,8), 
  (1,9)(2,8)(3,7)(5,6)(10,11), (1,7,5)(2,8,4)(3,9,6)(10,12,11) ]
gap> groups0030;
fail
gap> groups0040;
fail
gap> groups0050; 
rec( embeddedleftgroup := Group([ (1,4,5)(2,6,3)(7,16,19)(8,17,20)(9,18,21)(10,22,13)(11,23,14)(12,24,15), (1,3)(2,5)(4,6)(7,13)(8,14)(9,15)(10,19)(11,
        20)(12,21)(16,22)(17,23)(18,24) ]), embeddedrightgroup := Group([ (1,8)(2,11)(3,14)(4,17)(5,20)(6,23)(7,9)(10,12)(13,15)(16,18)(19,21)(22,24), 
      (1,7)(2,10)(3,13)(4,16)(5,19)(6,22)(8,9)(11,12)(14,15)(17,18)(20,21)(23,24), (2,22,15)(3,10,24)(6,13,12)(7,8,9)(11,23,14)(16,17,18)(19,20,21) ]), 
  product := <permutation group with 5 generators> )

gap> NrMovedPoints(groups0050.embeddedleftgroup);
24
gap> NrMovedPoints(groups0050.embeddedrightgroup);
24
gap> IsSubgroup(groups0050.product,groups0050.embeddedrightgroup);
true
gap> lg:=groups0050.embeddedleftgroup;;
gap> rg:=groups0050.embeddedrightgroup;;
gap> cartlgrg:=List(Cartesian(lg,rg),x->x[1]*x[2]);;
gap> AsGroup(cartlgrg);;
gap> last=groups0050.product;
true
gap> rightpre:=OneSmallGroup(98);;
gap> right:=Image(IsomorphismPermGroup(rightpre));;
gap> leftpre:=OneSmallGroup(102);;                 
gap> left:=Image(IsomorphismPermGroup(leftpre));;  
gap> groupstable:=SomeZSProducts(left,right);;
Number of pairs of Homomorphisms: 3
gap> Length(groupstable);
3
gap> # There are three ZS Products returned for left and right
gap> groupstable;
[ rec( embeddedleftgroup := <permutation group with 7 generators>, embeddedrightgroup := <permutation group with 6 generators>, 
      product := <permutation group with 10 generators> ), rec( embeddedleftgroup := <permutation group with 7 generators>, 
      embeddedrightgroup := <permutation group with 6 generators>, product := <permutation group with 10 generators> ), 
  rec( embeddedleftgroup := <permutation group with 7 generators>, embeddedrightgroup := <permutation group with 6 generators>, 
      product := <permutation group with 10 generators> ) ]
gap>


More information about the Forum mailing list