10. Rubik's Cube: 置換と巡回置換( GAP, Mathematica )

GAP のインストールは次に書いてあります。

 置換と巡回置換の理解を深めるため、GAPとMathematica の関数の対応関係を調べた。数学の記述とGAPの関数について書かれてる次が参考になった。

関連する部分をキャプチャしここに載せさせていただきます。

GAP関数とMathematicaの対応

GAP の実行結果とMathematicaの実行結果を示す。これにより巡回置換に関連する関数の対応関係が分かる。

gap> (1,2,3)^-1;
(1,3,2)
InversePermutation[Cycles[{{1,2,3}}]]
⇒ Cycles[{{1,3,2}}] 
gap> 2^(1,2,3);
3
PermutationReplace[2,Cycles[{{1,2,3}}]]
⇒ 3
gap> (1,2)*(2,3);
(1,3,2) 
PermutationProduct[Cycles[{{1,2}}], Cycles[{{2,3}}]]
⇒ Cycles[{{1,3,2}}]
gap> (1,2,3)^(1,2);
(2,1,3)      #  疑問:gap で実行すると (1,3,2) になる
# 文章を読むと。数の列 (1 2,3) と書いてある。 したがって次である。
gap> List( [1,2,3], i->i^(1,2) )    
[2,1,3] 
PermutationReplace[{1,2,3}, Cycles[{{1, 2}}]] 
⇒ {2,1,3}
gap> (1,2,3)^(1,2);
(1,3,2)    # gap の実行結果
PermutationReplace[Cycles[{{1,2,3}}], Cycles[{{1,2}}]]
⇒ Cycles[{{1,3,2}}]

(1,2,3)^(1,2);について,GAP manual:20 Permutations で調べたところ次のように書いてあった。

p1^p2 
The operator ^ evaluates to the conjugate p2-1*p1*p2 of the permutation p1 
by the permutation p2.
p1 = Cycles[{{1,2,3}}];
p2 = Cycles[{{1,2}}];
PermutationProduct[InversePermutation[p2], p1, p2]
⇒ Cycles[{{1,3,2}}]
PermutationReplace[p1, p2]
⇒ Cycles[{{1,3,2}}]

このプログラムを Pythonica を使って Mathematica notebook で実行した。Mathematica 9 の探索(10)> に載っています。

まとめ

  • GAP とMathematica(MMA) の関数の対応関係を調べた。
  •                                    GAP                  MMA
  • 置換の表現             [1,2,3]                {1,2,3}
  • 巡回置換の表現        (1,2,3)          Cycles[{{1,2,3}}]
  • 置換の演算について調べた。

Wolfram Mathematica 9 ドキュメントセンターに説明がある。

目次へ( Rubiks's Cube を Mathematica で解く )

目次へ( GAP について )