class GT1:
def __init__(self, G, verbose= False, very_verbose= False):
self.G= G
self.verbose= verbose or very_verbose
self.very_verbose= very_verbose
def compute_cover_group(self):
if self.verbose:
print "*** computing cover"
GG= self.G.DirectProduct(self.G)
i1= GG.Embedding(1)
i2= GG.Embedding(2)
p1= GG.Projection(1)
p2= GG.Projection(2)
autG= self.G.AutomorphismGroup()
gensautG= autG.GeneratorsOfGroup()
gensGG= GG.GeneratorsOfGroup()
imgs= []
for phi in gensautG:
phi_on_gens= [ (p1*phi*i1).Image(gh) * (p2*phi*i2).Image(gh) for gh in gensGG ]
phiGG= GG.GroupHomomorphismByImages(GG, gensGG, phi_on_gens)
imgs.append(phiGG)
diagautG= libgap.Group(imgs)
classes= diagautG.OrbitsDomain(GG)
if self.very_verbose:
print len(classes), "classes of pairs"
def is_generating_pair(C):
pair= C[0]
x= p1.Image(pair)
y= p2.Image(pair)
return self.G.Subgroup([x, y]) == self.G
gens_classes= [ C for C in classes if is_generating_pair(C) ]
r= len(gens_classes)
if self.very_verbose:
print r,"of them generate G"
Gr= libgap.DirectProduct([ self.G for i in range(r) ])
inj= [ Gr.Embedding(i) for i in [1..r] ]
self.x= prod([ (p1*inj[i]).Image(gens_classes[i][0]) for i in range(r) ])
self.y= prod([ (p2*inj[i]).Image(gens_classes[i][0]) for i in range(r) ])
self.GB= Gr.Subgroup([self.x, self.y])
def compute_automorphisms(self):
if self.verbose:
print "*** computing representatives for GT1"
GB= self.GB
x= self.x
y= self.y
one= GB.Identity()
Cx= GB.Centralizer(x)
Cy= GB.Centralizer(y)
doubles= GB.DoubleCosets(Cx, Cy)
if self.very_verbose:
print "found", len(doubles), "double cosets"
wait= len(doubles)
theta= GB.GroupHomomorphismByImages(GB, [x, y], [y, x])
delta= GB.GroupHomomorphismByImages(GB, [x, y], [y^(-1)*x^(-1), y])
self.auts= []
for i, C in enumerate(doubles):
if self.very_verbose:
print "coset", i+1, "out of", wait
c= C.Representative()
xp= x^c
GBp= GB.Subgroup([xp, y])
if GBp != GB:
continue
ct= c^theta
if not IsContained(one, Cx.DoubleCoset(c*ct, Cy^ct)):
continue
phi= GB.GroupHomomorphismByImages(GB, [x, y], [xp, y])
if phi == libgap.eval("fail"):
continue
if not libgap.IsInnerAutomorphism( phi*delta*phi^(-1)*delta^(-1)):
continue
if self.very_verbose:
print "found an element in GT1(G) !"
self.auts.append(phi)