3.組成列

組成列の計算については,http://ehito.hatenablog.com/entry/2019/02/13/200937 で述べましたが,mnsg に積閉の必要条件などを加え,やや速くなっています.cs の引数は nGG の出力,出力は先述の通りです.

mul(A,B):=map(lambda([s],A[s]),B)$
inv(A):=map(second,sort(map("[",A,sort(A)),lambda([s,t],s[1]<t[1])))$
isG(GG):=is(setify(apply('append,makelist(makelist(mul(i,j),i,GG),j,GG)))=setify(GG))$
CC(GG):=block([g,C:[],G:setify(GG),H],
unless G={} do (g:listify(G)[1],
H:setify(map(lambda([s],mul(s,mul(g,inv(s)))),GG)),
G:setdifference(G,H),push(H,C)),map(listify,C))$
mnsg(GG):=block([S:0,lenGG:length(GG)],
C0:sort(CC(GG)),C01:C0[1],
PS:map(lambda([s],apply('append,listify(s))),listify(powerset(setify(rest(C0))))),
PS:map(lambda([s],append(C0[1],s)),PS), printn(length(PS)),
for d in rest(reverse(listify(divisors(lenGG)))) while S=0 do (
PS:sublist(PS,lambda([s],length(s)<=d and member(lst2:mul(lst:last(s),lst),s) and member(mul(lst2,lst),s))), printn(length(PS)),
for g in PS unless length(S:g)=d and isG(g) do S:0),S)$
cs(GG):=block([S:[GG],m:GG],unless length(m)=1 do push(m:mnsg(m),S),
csGG:[S:reverse(S),S:map(length,S),makelist(S[i-1]/S[i],i,2,length(S))])$

実行例.

(%i7) cs(nGG(mp(x^12-3)));
Evaluation took 3.5550 seconds (3.5900 elapsed) using 679.381 MB.
(%o7) [[[[1,2,3,4,5,6,7,8,9,10,11,12],[12,9,8,7,5,6,4,3,2,11,10,1],
          [10,9,7,8,3,4,6,5,11,2,12,1],[11,2,4,3,8,7,6,5,10,9,1,12],
          [7,5,11,10,12,2,9,1,8,3,4,6],[4,5,10,11,1,9,2,12,3,8,7,6],
          [3,8,9,1,11,10,2,12,4,5,6,7],[8,3,2,12,10,11,9,1,7,5,6,4],
          [3,6,11,10,9,1,12,2,4,7,8,5],[8,6,10,11,2,12,1,9,7,4,3,5],
          [7,4,12,2,11,10,1,9,8,6,5,3],[4,7,1,9,10,11,12,2,3,6,5,8],
          [2,1,7,8,6,5,3,4,12,10,11,9],[9,12,4,3,6,5,8,7,1,11,10,2],
          [10,12,3,4,7,8,5,6,11,1,9,2],[11,1,8,7,4,3,5,6,10,12,2,9],
          [6,3,12,2,1,9,11,10,5,7,8,4],[6,8,1,9,12,2,10,11,5,4,3,7],
          [1,11,5,6,3,4,8,7,9,12,2,10],[12,10,5,6,8,7,3,4,2,1,9,11],
          [2,11,6,5,7,8,4,3,12,9,1,10],[9,10,6,5,4,3,7,8,1,2,12,11],
          [5,7,9,1,2,12,11,10,6,3,4,8],[5,4,2,12,9,1,10,11,6,8,7,3]],
         [[1,2,3,4,5,6,7,8,9,10,11,12],[1,11,5,6,3,4,8,7,9,12,2,10],
          [2,1,7,8,6,5,3,4,12,10,11,9],[9,10,6,5,4,3,7,8,1,2,12,11],
          [10,12,3,4,7,8,5,6,11,1,9,2],[11,2,4,3,8,7,6,5,10,9,1,12],
          [12,9,8,7,5,6,4,3,2,11,10,1],[2,11,6,5,7,8,4,3,12,9,1,10],
          [11,1,8,7,4,3,5,6,10,12,2,9],[9,12,4,3,6,5,8,7,1,11,10,2],
          [10,9,7,8,3,4,6,5,11,2,12,1],[12,10,5,6,8,7,3,4,2,1,9,11]],
         [[1,2,3,4,5,6,7,8,9,10,11,12],[1,11,5,6,3,4,8,7,9,12,2,10],
          [2,1,7,8,6,5,3,4,12,10,11,9],[11,2,4,3,8,7,6,5,10,9,1,12],
          [2,11,6,5,7,8,4,3,12,9,1,10],[11,1,8,7,4,3,5,6,10,12,2,9]],
         [[1,2,3,4,5,6,7,8,9,10,11,12],[2,11,6,5,7,8,4,3,12,9,1,10],
          [11,1,8,7,4,3,5,6,10,12,2,9]],[[1,2,3,4,5,6,7,8,9,10,11,12]]],
        [24,12,6,3,1],[2,2,2,3]]