Center of a Group



To get the basic idea behind center of a group please refer to wikipedia. In this post, one can find a small piece of code in Mathematica that finds all the centralizers of any group.

CODE: (Click link for github access)

 GroupCenter[ele_List] :=
      Module[ {newlist = List[], inlist = List[],i,k,s,list=List[],columns=List[]},
     {     
         list = ele;
      
         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 -> {list,list}],
            Table[AppendTo[columns,newlist[[All,i]]],{i,1,Length[newlist]}];
        
             For[s=1,s<=Length[columns],s++,
                {
                      If[MemberQ[newlist,columns[[s]],2],Print["Subgroup=",columns[[s,1]]],Continue]
                 }
      ]   
     }   ]

OUTPUT:
1. Dihedral Group of order 6
   Center: Cycles[{}],Cycles[{{1,4},{2,5},{3,6}}].

2. Dihedral Group of order 4
   Center: Cycles[{}],Cycles[{{1,3},{2,4}}]

3. Symmetric Group of order 2
   Center: Cycles[{}],Cycles[{1,2}] 

4. Symmetric Group of order 3
   Center: Cycles[{}]

5. Cyclic Group of any order has all the group elements as center  
   of group.


The idea behind center of a group(G) is that subgroup that commutes with every element of G. If one holds a multiplication table of groups in front of one self, the way to find center is to find those rows that are present as columns too. 
Though the logic of loops should have been calculating it as per definition but this code finds for those rows that are present as columns too and finding those subgroups that generate them.

No comments:

Post a Comment

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