(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(* ::Input::Initialization:: *)
DeclareGroup[Subscript[S, k_]]:=Module[{\[Alpha],\[Beta],e,\[Gamma]s},
Clear[G,n,g,\[Iota],m,inv];
G=PermutationCycles/@(Permutations@Range@k);
n=Length[G];
Do[g[\[Alpha]]=e=G[[\[Alpha]]]; \[Iota][e]=\[Alpha],{\[Alpha],n} ];
m[]=\[Iota][Cycles[{}]];
Do[m[\[Alpha],\[Beta]]=\[Iota][g[\[Alpha]]~PermutationProduct~g[\[Beta]]],{\[Alpha],n},{\[Beta],n} ];
m[\[Alpha]_]:=\[Alpha]; m[\[Alpha]_,\[Beta]_,\[Gamma]s__]:=m[m[\[Alpha],\[Beta]],\[Gamma]s];
Do[inv[\[Alpha]]=\[Iota][InversePermutation[g[\[Alpha]]]],{\[Alpha],n}]
]


(* ::Input::Initialization:: *)
DeclareGroup[Subscript[S, 3]];
Table[m[i,j],{i,n},{j,n}]//MatrixForm


(* ::Input::Initialization:: *)
Basis[]={1};
Basis[i_,is___]:=Flatten@Table[Subscript[W, i][\[Alpha],\[Beta]]Basis[is],{\[Alpha],n},{\[Beta],n}]


(* ::Input::Initialization:: *)
Subscript[m, i_,j_->k_][\[ScriptCapitalE]_]:=Expand[\[ScriptCapitalE]]/.Subscript[W, i][\[Alpha]_,\[Beta]_]Subscript[W, j][\[Gamma]_,\[Delta]_]:>If[m[\[Alpha],\[Beta]]==m[\[Beta],\[Gamma]],Subscript[W, k][\[Alpha],m[\[Beta],\[Delta]]],0];
Subscript[\[Eta], i_][\[ScriptCapitalE]_]:=Expand[\[ScriptCapitalE] Sum[Subscript[W, i][\[Alpha],m[]], {\[Alpha],n}]];


(* ::Input::Initialization:: *)
Subscript[\[CapitalDelta], i_->j_,k_][\[ScriptCapitalE]_]:=Expand[\[ScriptCapitalE]/.Subscript[W, i][\[Alpha]_,\[Beta]_]:>Sum[Subscript[W, j][\[Gamma],\[Beta]]Subscript[W, k][m[\[Alpha],inv[\[Gamma]]],\[Beta]],{\[Gamma],n}]];
Subscript[\[CurlyEpsilon], i_][\[ScriptCapitalE]_]:=Expand[\[ScriptCapitalE]/.Subscript[W, i][\[Alpha]_,\[Beta]_]:>If[\[Alpha]==m[],1,0]];


(* ::Input::Initialization:: *)
Subscript[S, i_][\[ScriptCapitalE]_]:=Expand[\[ScriptCapitalE]/.Subscript[W, i][\[Alpha]_,\[Beta]_]:>Subscript[W, i][m[inv[\[Beta]],inv[\[Alpha]],\[Beta]], inv[\[Beta]]]];


(* ::Input::Initialization:: *)
Subscript[R, i_,j_]:=Sum[Subscript[W, i][\[Alpha],m[]]Subscript[W, j][\[Beta],\[Alpha]], {\[Alpha],n}, {\[Beta],n}];
Subscript[\!\(\*OverscriptBox[\(R\), \(_\)]\), i_,j_]:=Sum[Subscript[W, i][\[Alpha],m[]]Subscript[W, j][\[Beta],inv@\[Alpha]], {\[Alpha],n}, {\[Beta],n}];



