Multiplication table of a group

NOTE: Please refresh the page if latex code is not converted to text
Usually in softwares that generate multiplication table for groups, the states are represented as numbers or alphabets which requires running to legend again and again.
This piece of code in Mathematica will store the elements in terms of their own identity. No indexing will be used.

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]]]]]
    {AppendTo[newlist, inlist], inlist = List[]}];
  TableForm[newlist, TableHeadings -> {ele, ele}]}]
  OUTPUT
The topmost row and left most column represents the elements of group and rest of the entries are the corresponding entries based on permutation between cycles. $\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}\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}\left[\left( \begin{array}{cc} 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{cc} 2 & 3 \\ \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}{cc} 1 & 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}{cc} 1 & 2 \\ \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}[\{\}] & \text{Cycles}\left[\left( \begin{array}{cc} 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{cc} 1 & 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 & 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}{cc} 1 & 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}{cc} 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}{cc} 1 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{cc} 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}{cc} 1 & 2 \\ \end{array} \right)\right] \\ \text{Cycles}\left[\left( \begin{array}{cc} 1 & 3 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{cc} 1 & 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}{cc} 1 & 2 \\ \end{array} \right)\right] & \text{Cycles}\left[\left( \begin{array}{cc} 2 & 3 \\ \end{array} \right)\right] & \text{Cycles}[\{\}] \\ \end{array} \right) $

No comments:

Post a Comment

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