Implementation of Permutations in Mathematica. 
Computation of the Group Table of (Subscript[S, 3]).

B. Schnizer

schnizer@itp.tu-graz.ac.at

2008-11-10

$Version

Needs["DiscreteMath`Combinatorica`"]

np  =  3;  unit  =   Table[k, {k, np}]

l0  =  MinimumChangePermutations[Table[n, {n, np}]]

lc  =  Table[ToCycles[l0[[j]]], {j, Length[l0]}]

cred  =   { {{x_, y_, z_}}  ->   {x, y, 
            z},    {{x_, y_}, {z_}}  ->  {x, 
            y},   {{z_}, {x_, y_}}  ->  {x, 
            y}, 
{{x_}, {y_}, {z_}}   ->  {1} }

lc   =  Map[Reverse, lc  //. cred]

c1  =  Cases[lc,  {x_}]

\(p1\  = \ 

      Table[Position[lc, c1[\([k]\)]], {k, Length[c1]}] // Flatten\)

c2  =  Cases[lc,  {x_, y_, z_}]

\(p2\  = \ 

      Table[Position[lc, c2[\([k]\)]], {k, Length[c2]}] // Flatten\)

c3  =  Cases[lc,  {x_, y_}]

\(p3\  = \ 

      Table[Position[lc, c3[\([k]\)]], {k, Length[c3]}] // Flatten\)

p3  =  {2, 6, 4}

lg  =  
      Table[l0[[Join[p1, p2, p3][[k]]]], {k, 
          Length[l0]}]

Table[ToCycles[lg[[j]]], {j, Length[lg]}] //. cred

lh  =  {lg[[1]], lg[[3]], lg[[2]], lg[[4]], 
        lg[[5]], lg[[6]]}

\(\(\(\(\(ppr[li_, lk_]\  := \ \ lk\  /. \ 
        Thread[\ unit\  -> \ li]\)\(
\)\( (*\ 
      computes\ product\ of\ two\ permutations\ *) \)\(
\)
    \)

    \(\(ppi[li_]\  := \ unit\  /. \ Thread[\ li\ \  -> \ unit\ ]\)\(
\)
    \)\)\( (*\ computes\ permutation\ inverse\ to\ li\ *) \)\)\)

\(\(\(
\)\(grt\  = \ 
      Table[Table[ppr[lg[\([k]\)], lh[\([j]\)]], {j, Length[lg]}], {k, 
          Length[lg]}]\)\)\)

grtc  =  Map[ToCycles, grt, {2}] //. cred; 
    MatrixForm[grtc]

grtd  =  Map[RotateRight, grtc, {2}]; MatrixForm[grtd]

ld  =  
        Table[Table[ 
            If[ lg[[1, 
                    i]]  ==  
         lg[[n, k]],  1, 0], {i, np}, {k, np}], {n, Length[l0]}];

Table[MatrixForm[ld[[k]]], {k, Length[ld]}]