I have written the following snippet of code to compute the subgroup permutability degree of a finite group $G$.
spd := function(G)
local allsubs, subreps, count, H, K, index;
subreps := Flat(List(ConjugacyClassesSubgroups(G),Representative));
allsubs := Flat(List(ConjugacyClassesSubgroups(G),Elements));
count:=0;
for H in subreps do
index := Index(G,Normalizer(G,H));
for K in allsubs do
if ArePermutableSubgroups(H,K) then
count := count+index;
fi;
od;
od;
return Float(count/(Size(allsubs)^2));
end;
I want to ask two things: first, whether this can be slightly improved to run faster, and second, how to install this as a function in GAP so that I don't have to define it every time I run the programme.
Read("file-with-this-function")into yourgaprcfile. – Olexandr Konovalov Mar 08 '15 at 14:59subrepsandallsubs, they only create some overhead. I will try to think of more. For which groups are you calculating this, and what can you say about the performance that you observe? I think most of the time would be spent inConjugacyClassesSubgroupsand that's unavoidable. – Olexandr Konovalov Mar 08 '15 at 15:04