Commutator operation on groups


Referring to this GroupWiki information on Commutator group, the following piece of Mathematica code will achieve the same. For theoretical detail please avail the link.

The row element is $"g"$ and column element is $"h"$ and cells have $"ghg^{-1}h^{-1}"$.


CODE:

Module[{newlist = List[], 
  inlist = List[]}, {list = ele = GroupElements[SymmetricGroup[3]],
  For[i = 1, i <= Length[list], i++,
   For[k = 1, k <= Length[list], k++, 
     AppendTo[inlist, 
      PermutationProduct[list[[k]], list[[i]], 
       InversePermutation[list[[k]]], 
       InversePermutation[list[[i]]]]]]
    {AppendTo[newlist, inlist], inlist = List[]}];
  TableForm[newlist, TableHeadings -> {ele, ele}]
  }]

OUTPUT: 
The left most column and top most row are group elements and rest is the interaction between them.

$\left( \begin{array}{ccccccc} & \text{Cycles}[\{\}] & \text{Cycles}\left[\left( \begin{array}{cc} 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{cc} 1 & 2 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{cc} 1 & 3 \\ \end{array} \right)\right] \\ \text{Cycles}[\{\}] & \text{Cycles}[\{\}] & \text{Cycles}[\{\}] & \text{Cycles}[\{\}] & \text{Cycles}[\{\}] & \text{Cycles}[\{\}] & \text{Cycles}[\{\}] \\ \text{Cycles}\left[\left( \begin{array}{cc} 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}[\{\}] & \text{Cycles}[\{\}] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] \\ \text{Cycles}\left[\left( \begin{array}{cc} 1 & 2 \\ \end{array} \right)\right] & \text{Cycles}[\{\}] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] & \text{Cycles}[\{\}] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] \\ \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}[\{\}] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}[\{\}] & \text{Cycles}[\{\}] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] \\ \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] & \text{Cycles}[\{\}] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] & \text{Cycles}[\{\}] & \text{Cycles}[\{\}] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] \\ \text{Cycles}\left[\left( \begin{array}{cc} 1 & 3 \\ \end{array} \right)\right] & \text{Cycles}[\{\}] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 3 & 2 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{ccc} 1 & 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}[\{\}] \\ \end{array} \right)$

No comments:

Post a Comment

Disqus for http://programathing.blogspot.in/