# David Stanovsky 2013-14 # david.stanovsky@gmail.com # for the purposes of the paper "Distributive and anti-distributive Medelsohn triple systems" LoadPackage("loops"); isnuclear:=function(g,f) local b,x; b:=true; for x in [1..Size(g)] do if not (g.(x))*(g.(x^f)) in Nuc(g) then b:=false; break; fi; od; return b; end; # g group or loop # returns all Mendelsohn automorphisms of g (i.e., nuclear and satisfying f^2-f+1=0) up to conjugacy mendelsohn_aut:=function(g) local autg,answer,conj,b,f,x; autg:=AutomorphismGroup(g); #Print("group: ",g,"\n"); conj:=List(ConjugacyClasses(autg),x->Representative(x)); #Print("Aut(G)/conj: ",Size(conj),"\n"); answer:=[]; for f in conj do b:=true; if IsLoop(g) then if isnuclear(g,f) then for x in [1..Size(g)] do if not (g.((x^f)^f))^-1 * (g.(x^f)) = g.(x) then b:=false; break; fi; od; else b:=false; fi; else for x in g do if not Image(f,Image(f,x))*Image(f,x^-1)*x = () then b:=false; break; fi; od; fi; if b then Add(answer,f); fi; od; return [g,Size(answer),answer]; end; # n number # returns the number and the list all affine Mendelsohn quasigroups on n elements up to isomorphism aff_mendelsohn:=function(n) local answer,count,g,gg,l; answer:=[]; count:=0; for g in AllGroups(Size,n,IsAbelian, true) do gg:=Image(IsomorphismPermGroup(g),g); Add(answer,mendelsohn_aut(gg)); count:=count+answer[Size(answer)][2]; od; return [count,answer]; end; # k number # returns non-affine distributive Mendelsohn quasigroups on 3^k elements up to isomorphism dist_mendelsohn:=function(k) local answer,count,g,max,i; if k<4 then return []; fi; if k>5 then return fail; fi; if k=4 then max:=5; fi; if k=5 then max:=72; fi; answer:=[]; count:=0; for i in [1..max] do g:=MoufangLoop( 3^k, i ); if not IsCommutative(g) then break; fi; Add(answer,mendelsohn_aut(g)); count:=count+answer[Size(answer)][2]; od; return [count,answer]; end;