diff --git a/lib/autsr.gi b/lib/autsr.gi index 29f1181e83..de67d2d35c 100644 --- a/lib/autsr.gi +++ b/lib/autsr.gi @@ -620,8 +620,7 @@ local ff,r,d,ser,u,v,i,j,k,p,bd,e,gens,lhom,M,N,hom,Q,Mim,q,ocr,split,MPcgs, # do we use induced radical automorphisms to help next step? if Size(KernelOfMultiplicativeGeneralMapping(hom))>1 and - Size(A)>10^8 and (IsAbelian(r) or - Length(AbelianInvariants(r))<10) + Size(A)>10^8 and (IsAbelian(r) or AbelianRank(r)<10) #( ## potentially large GL #Size(GL(Length(MPcgs),RelativeOrders(MPcgs)[1]))>10^10 and diff --git a/lib/grp.gd b/lib/grp.gd index 26269be9c1..264d4e866d 100644 --- a/lib/grp.gd +++ b/lib/grp.gd @@ -861,6 +861,10 @@ InstallTrueMethod( IsPolycyclicGroup, ## DeclareAttribute( "AbelianInvariants", IsGroup ); +# minimal number of generators for abelianization. Used internally to check +# whether it is worth to attempt to reduce generator number +DeclareAttribute( "AbelianRank", IsGroup ); + ############################################################################# ## #A IsInfiniteAbelianizationGroup( ) diff --git a/lib/grp.gi b/lib/grp.gi index d4aa4ae6ce..6b2ca3bae8 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -701,6 +701,18 @@ InstallMethod( AbelianInvariants, return inv; end ); +InstallMethod( AbelianRank ,"generic method for groups", [ IsGroup ],0, +function(G) +local a,r; + a:=AbelianInvariants(G); + r:=Number(a,IsZero); + a:=Filtered(a,x->not IsZero(x)); + if Length(a)=0 then return r; fi; + a:=List(Set(a,SmallestRootInt),p->Number(a,x->x mod p=0)); + return r+Maximum(a); +end); + + ############################################################################# ## #M IsInfiniteAbelianizationGroup( ) diff --git a/lib/grppclat.gi b/lib/grppclat.gi index 159a362714..5b9380e46a 100644 --- a/lib/grppclat.gi +++ b/lib/grppclat.gi @@ -1201,7 +1201,7 @@ InstallMethod(CharacteristicSubgroups,"solvable, automorphisms",true, [IsGroup and IsSolvableGroup],0, function(G) local A,s; - if Length(AbelianInvariants(G))<5 then + if AbelianRank(G)<5 then TryNextMethod(); fi; A:=AutomorphismGroup(G); diff --git a/lib/morpheus.gi b/lib/morpheus.gi index 8c53229076..da48a8dad7 100644 --- a/lib/morpheus.gi +++ b/lib/morpheus.gi @@ -1267,8 +1267,7 @@ local G,cl,lcl,len,comb,combc,com,a,cnt,s,alltwo; #create just a list of ordinary classes. lcl:=List(cl,i->Concatenation(List(i,j->j.classes))); len:=1; - len:=Maximum(1,Length(MinimalGeneratingSet( - Image(IsomorphismPcGroup((G/DerivedSubgroup(G))))))-1); + len:=Maximum(1,AbelianRank(G)-1); while true do len:=len+1; Info(InfoMorph,2,"Trying length ",len); @@ -2188,8 +2187,8 @@ local m; return fail; fi; - if (Length(AbelianInvariants(G))>2 or Length(SmallGeneratingSet(G))>2) and Size(RadicalGroup(G))>1 then - # In place until a proper implementation of Cannon/Holt automorphism is + if (AbelianRank(G)>2 or Length(SmallGeneratingSet(G))>2) and Size(RadicalGroup(G))>1 then + # In place until a proper implementation of Cannon/Holt isomorphism is # made available. return PatheticIsomorphism(G,H); fi;