(* ::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:: *)
CCF[\[ScriptCapitalE]_] := ExpandDenominator@ExpandNumerator@Together[\[ScriptCapitalE]];
CCF[\[ScriptCapitalE]_] := Factor[\[ScriptCapitalE]];
CF[\[ScriptCapitalE]_List]:=CF/@\[ScriptCapitalE];
CF[\[ScriptCapitalE]_] := Module[{vs=Cases[\[ScriptCapitalE],Subscript[(x|p|\[Pi]|g), __],\[Infinity]]\[Union]{x,p,\[Epsilon]},ps,c},
Total[CoefficientRules[Expand[\[ScriptCapitalE]], vs] /. (ps_->c_) :> CCF[c](Times@@(vs^ps))] ];


(* ::Input::Initialization:: *)
g2px[\[ScriptCapitalE]_]:=CF@Module[{\[Lambda]},Expand[\[ScriptCapitalE]/.Subscript[g, \[Nu]_,i_,j_]:>Subscript[\[Lambda], \[Nu]] Subscript[p, \[Nu],i] Subscript[x, \[Nu],j]]/.\!\(
\*SubsuperscriptBox[\(\[Lambda]\), \(_\), \(k_.\)] :> \(1/\(k!\)\)\)]


(* ::Input::Initialization:: *)
{SuperStar[p],SuperStar[x],SuperStar[\[Pi]],SuperStar[\[Xi]]}={\[Pi],\[Xi],p,x};  SuperStar[(Subscript[u_, i__])]:=Subscript[(SuperStar[u]), i];


(* ::Input::Initialization:: *)
\!\(\*SubscriptBox[\(Zip\), \({}\)]\)[\[ScriptCapitalE]_]:=\[ScriptCapitalE];
\!\(\*SubscriptBox[\(Zip\), \({\[Zeta]_, \[Zeta]s___}\)]\)[\[ScriptCapitalE]_] := (Collect[\[ScriptCapitalE]//\!\(\*SubscriptBox[\(Zip\), \({\[Zeta]s}\)]\),\[Zeta]] /. f_. \[Zeta]^d_.:>(D[f,{SuperStar[\[Zeta]],d}]))/.SuperStar[\[Zeta]]->0


(* ::Input::Initialization:: *)
px2g[\[ScriptCapitalE]_]:=CF@Module[{ps,xs,Q,\[Alpha],\[Beta]},
ps=Union[Cases[\[ScriptCapitalE],Subscript[p, __],\[Infinity]]]; xs=Union[Cases[\[ScriptCapitalE],Subscript[x, __],\[Infinity]]];
Q=Sum[SuperStar[p0] SuperStar[x0] Subscript[g, p0[[2]],x0[[2]],p0[[3]],x0[[3]]],{p0,ps},{x0,xs}];
Expand[Subscript[Zip, ps\[Union]xs][\[ScriptCapitalE] E^Q]/.Subscript[g, \[Alpha]_,\[Beta]_,i_,j_]:>If[\[Alpha]===\[Beta],Subscript[g, \[Alpha],i,j],0]]
]


(* ::Input::Initialization:: *)
Subscript[R, 1][s_,i_,j_]:=CF[
s(\!\(
\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\ 
\*SubscriptBox[\(g\), \(1, i, i\)]\ 
\*SubscriptBox[\(g\), \(2, j, i\)]\)+((-1+\!\(\*SubsuperscriptBox[\(T\), \(1\), \(s\)]\)) \!\(\*SubsuperscriptBox[\(T\), \(2\), \(2\ s\)]\) Subscript[g, 1,j,i] Subscript[g, 2,j,i])/(-1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\))-Subscript[g, 1,i,i] Subscript[g, 2,j,j]-((-1+\!\(\*SubsuperscriptBox[\(T\), \(1\), \(s\)]\)) \!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\) Subscript[g, 1,j,i] Subscript[g, 2,j,j])/(-1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\))-Subscript[g, 3,i,i]-(-1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\)) Subscript[g, 2,j,i] Subscript[g, 3,i,i]+2 Subscript[g, 2,j,j] Subscript[g, 3,i,i]+((-1+\!\(\*SubsuperscriptBox[\(T\), \(3\), \(s\)]\) ) Subscript[g, 3,j,i])/(-1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\))-(\!\(
\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\ \((\(-1\) + 
\*SubsuperscriptBox[\(T\), \(3\), \(s\)]\ )\)\ 
\*SubscriptBox[\(g\), \(1, i, i\)]\ 
\*SubscriptBox[\(g\), \(3, j, i\)]\))/(-1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\))-((-1+\!\(\*SubsuperscriptBox[\(T\), \(1\), \(s\)]\)) (1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\)) (-1+\!\(\*SubsuperscriptBox[\(T\), \(3\), \(s\)]\) ) Subscript[g, 1,j,i] Subscript[g, 3,j,i])/(-1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\))+((-1+\!\(\*SubsuperscriptBox[\(T\), \(3\), \(s\)]\) ) Subscript[g, 2,i,j] Subscript[g, 3,j,i])/(-1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\))-(1-\!\(\*SubsuperscriptBox[\(T\), \(3\), \(s\)]\) ) Subscript[g, 2,j,i] Subscript[g, 3,j,i]+((-2+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\)) (-1+\!\(\*SubsuperscriptBox[\(T\), \(3\), \(s\)]\) ) Subscript[g, 2,j,j] Subscript[g, 3,j,i])/(-1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\))+Subscript[g, 1,i,i] Subscript[g, 3,j,j]+((-1+\!\(\*SubsuperscriptBox[\(T\), \(1\), \(s\)]\)) \!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\) Subscript[g, 1,j,i] Subscript[g, 3,j,j])/(-1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\))-Subscript[g, 2,i,i] Subscript[g, 3,j,j]-\!\(
\*SubsuperscriptBox[\(T\), \(2\), \(s\)]\ 
\*SubscriptBox[\(g\), \(2, j, i\)]\ 
\*SubscriptBox[\(g\), \(3, j, j\)]\)+1/2)];
Subscript[\[CapitalGamma], 1][\[CurlyPhi]_,k_]:=CF[-(\[CurlyPhi]/2)+\[CurlyPhi] Subscript[g, 3,k,k]];
\[Theta][{s0_,i0_,j0_},{s1_,i1_,j1_}]:=CF[
1/(-1+\!\(\*SubsuperscriptBox[\(T\), \(2\), \(s1\)]\)) s1 (-1+(Subscript[T, 1] Subscript[T, 2])^s1) ((-1+\!\(\*SubsuperscriptBox[\(T\), \(1\), \(s0\)]\)) Subscript[g, 1,j1,i0] (\!\(
\*SubsuperscriptBox[\(T\), \(2\), \(s0\)]\ 
\*SubscriptBox[\(g\), \(2, i1, i0\)]\)-Subscript[g, 2,i1,j0]) Subscript[g, 3,j0,i1]-(-1+\!\(\*SubsuperscriptBox[\(T\), \(1\), \(s0\)]\)) Subscript[g, 1,j1,i0] (\!\(
\*SubsuperscriptBox[\(T\), \(2\), \(s0\)]\ 
\*SubscriptBox[\(g\), \(2, j1, i0\)]\)-Subscript[g, 2,j1,j0]) Subscript[g, 3,j0,i1])]



