Skip to content

Commit 160dddb

Browse files
committed
ENHANCE: Isomorphism
Ensure existing permrep is used. Avoid searching hard for 2 generators if the cost seems high.
1 parent 100af55 commit 160dddb

2 files changed

Lines changed: 26 additions & 16 deletions

File tree

lib/autsr.gi

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,7 +2225,7 @@ local
22252225
iso, # NOTE: two roles -- the isomorphism from a recursive
22262226
# call, and later a flag for whether the permutation
22272227
# representation has been built
2228-
areduce,
2228+
makenewa,
22292229
origa,
22302230
# -- loop counters --
22312231
i, # NOTE: two roles -- a loop index, and an
@@ -2329,30 +2329,34 @@ local
23292329
delaypermrep:=true );
23302330

23312331
origa:=a;
2332-
areduce:=function()
2332+
makenewa:=function(makesmall)
23332333
local map,as;
23342334
if not HasIsomorphismPermGroup(origa) then
23352335
origa!.makeaqiso();
23362336
fi;
23372337
map:=IsomorphismPermGroup(origa);
2338-
as:=SmallGeneratingSet(Image(map,a));
2339-
if Length(as)>=Length(GeneratorsOfGroup(a)) then return;fi;
2340-
as:=List(as,x->PreImagesRepresentative(map,x));
2341-
Info(InfoMorph,1,"Genreduction:",Length(GeneratorsOfGroup(a)),
2342-
"=>",Length(as));
2343-
a:=SubgroupNC(Parent(a),as);
2338+
if makesmall then
2339+
as:=SmallGeneratingSet(Image(map,a));
2340+
if Length(as)<Length(GeneratorsOfGroup(a)) then
2341+
as:=List(as,x->PreImagesRepresentative(map,x));
2342+
Info(InfoMorph,1,"Genreduction:",Length(GeneratorsOfGroup(a)),
2343+
"=>",Length(as));
2344+
a:=SubgroupNC(Parent(a),as);
2345+
fi;
2346+
fi;
23442347
SetIsGroupOfAutomorphismsFiniteGroup(a,true);
23452348
SetNiceMonomorphism(a,map);
2349+
SetIsomorphismPermGroup(a,map);
23462350
end;
23472351

23482352

23492353
for i in cG do
23502354
if not ForAll(GeneratorsOfGroup(a),x->Image(x,i)=i) then
2351-
if Length(GeneratorsOfGroup(a))>12 then areduce();fi;
2355+
makenewa(Length(GeneratorsOfGroup(a))>12);
23522356
a:=Stabilizer(a,i,AsAutomorphism);
23532357
fi;
23542358
od;
2355-
if Length(GeneratorsOfGroup(a))>12 then areduce();fi;
2359+
makenewa(Length(GeneratorsOfGroup(a))>12);
23562360

23572361
iso:=fail;
23582362

@@ -2383,7 +2387,7 @@ local
23832387
if iso<>fail then
23842388
map:=fail;
23852389
else
2386-
if Length(GeneratorsOfGroup(a))>8 then areduce();fi;
2390+
makenewa(Length(GeneratorsOfGroup(a))>8);
23872391
map:=AGBoundedOrbrep(a,u,v,AsAutomorphism,200);
23882392
fi;
23892393
if map=false then
@@ -2392,14 +2396,16 @@ local
23922396
elif map<>fail then
23932397
Info(InfoMorph,1,"Shortorb factor reduce ",map.orblen);
23942398
a:=SubgroupNC(Parent(a),map.stabgens);
2399+
makenewa(Length(GeneratorsOfGroup(a))>8);
23952400
map:=map.rep;
23962401
conj:=conj*map;
23972402
K:=Image(map,K);
23982403
a:=a^map;
23992404
else
24002405
if iso=fail then
24012406
Info(InfoMorph,1,"Shortorb failed, get delayed permrep");
2402-
areduce();
2407+
makenewa(Length(GeneratorsOfGroup(a))>8);
2408+
if not HasIsomorphismPermGroup(a) then Error("WW");fi;
24032409
iso:=IsomorphismPermGroup(a:autactbase:=aab);
24042410
api:=Image(iso,a);
24052411
fi;

lib/morpheus.gi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ end);
17541754
##
17551755
InstallGlobalFunction(Morphium,function(G,H,DoAuto)
17561756
local combi,Gr,Gcl,Ggc,Hr,Hcl,bg,bpri,x,dat,
1757-
gens,i,c,hom,elms,price,result,inns,bcl,vsu;
1757+
gens,i,c,hom,elms,price,result,inns,bcl,vsu,costlimit;
17581758

17591759
if IsSolvableGroup(G) and CanEasilyComputePcgs(G) then
17601760
gens:=MinimalGeneratingSet(G);
@@ -1766,6 +1766,8 @@ local combi,Gr,Gcl,Ggc,Hr,Hcl,bg,bpri,x,dat,
17661766

17671767
Ggc:=List(gens,i->First(Gcl,j->ForAny(j,j->ForAny(j.classes,k->i in k))));
17681768
combi:=List(Ggc,i->Concatenation(List(i,i->i.classes)));
1769+
1770+
costlimit:=ValueOption("costlimit");
17691771
price:=Product(combi,i->Sum(i,Size));
17701772
Info(InfoMorph,1,"generating system ",Sum(Flat(combi),Size),
17711773
" of price:",price,"");
@@ -1810,6 +1812,9 @@ local combi,Gr,Gcl,Ggc,Hr,Hcl,bg,bpri,x,dat,
18101812
gens:=bg;
18111813

18121814
else
1815+
if costlimit<>fail and price>costlimit*20 and Sum(Gcl,Length)>30 then
1816+
return -1;
1817+
fi;
18131818
gens:=MorFindGeneratingSystem(G,Gcl);
18141819
fi;
18151820

@@ -1931,10 +1936,9 @@ local combi,Gr,Gcl,Ggc,Hr,Hcl,bg,bpri,x,dat,
19311936
fi;
19321937
result.inner:=inns;
19331938
else
1934-
dat:=ValueOption("costlimit");
1935-
if IsInt(dat) and Product(List(combi,x->Sum(x,Size)))>dat then
1939+
if IsInt(costlimit) and Product(List(combi,x->Sum(x,Size)))>costlimit then
19361940
Info(InfoMorph,2,"Morpheus seems to be to costly: ",
1937-
Product(List(combi,x->Sum(x,Size)))," vs ",dat);
1941+
Product(List(combi,x->Sum(x,Size)))," vs ",costlimit);
19381942
return -1; # not fail, as this is valid
19391943
fi;
19401944
result:=MorClassLoop(H,combi,result,7);

0 commit comments

Comments
 (0)