(* ::Package:: *)

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

(* ::Input::Initialization:: *)
SetDirectory["C:\\drorbn\\AcademicPensieve\\Talks\\Bonn-2505"];
Once[<<"IType(SimplifiedFormatting).m"];


(* ::Input::Initialization:: *)
CCF[\[ScriptCapitalE]_] := ExpandDenominator@ExpandNumerator@Together[\[ScriptCapitalE]]; 
CCF[\[ScriptCapitalE]_] := Factor[\[ScriptCapitalE]];
CF[\[ScriptCapitalE]_List]:=CF/@\[ScriptCapitalE];
CF[\[ScriptCapitalE]_\[Epsilon]Series]:=CF/@Take[\[ScriptCapitalE],$k+1];
CF[\[ScriptCapitalE]_] :=Module[{F},Expand@Collect[\[ScriptCapitalE],\[Epsilon]|Subscript[(p|x|\[Pi]|\[Xi]|g), __],F]/.F->CCF];
CF[\[ScriptCapitalE]_\[DoubleStruckCapitalE]]:=CF/@\[ScriptCapitalE]; 
CF[Subscript[\[DoubleStruckCapitalE], sp___][\[ScriptCapitalE]s___]]:=CF/@Subscript[\[DoubleStruckCapitalE], sp][\[ScriptCapitalE]s];


(* ::Input::Initialization:: *)
Subscript[\[ScriptCapitalL], i_][K_]:=CF[Subscript[\[ScriptCapitalL], i]/@Features[K][[2]]]
vs[K_]:=Join@@Table[{Subscript[p, i],Subscript[x, i]},{i,Features[K][[1]]}]


(* ::Input::Initialization:: *)
{SuperStar[p],SuperStar[x],SuperStar[\[Pi]],SuperStar[\[Xi]]}={\[Pi],\[Xi],p,x}; 
SuperStar[(vs_List)]:=(v|->SuperStar[v])/@vs;
SuperStar[(Subscript[u_, \[Nu]i__])]:=Subscript[(SuperStar[u]), \[Nu]i];


(* ::Input::Initialization:: *)
HL[\[ScriptCapitalE]_] := Style[\[ScriptCapitalE], Background -> If[TrueQ@\[ScriptCapitalE],RGBColor[Rational[1, 3], 1, Rational[1, 3]],RGBColor[1, 0.5, 0.5]]];


(* ::Input::Initialization:: *)
g2px[\[ScriptCapitalE]_]:=CF@Module[{\[Lambda]},Expand[\[ScriptCapitalE]/.{Subscript[g, i_,j_]:>\[Lambda] Subscript[p, i] Subscript[x, j]}]/.{\[Lambda]^k_.:>1/k!}]
g\[Nu]2px[\[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:: *)
\!\(\*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,ps},{x0,xs}];
Expand[Subscript[Zip, ps\[Union]xs][\[ScriptCapitalE] E^Q]]
]
px\[Nu]2g[\[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[gR, s_,i_,j_]:={
Subscript[g, j\[InvisibleComma]\[Beta]_]:>Subscript[g, SuperPlus[j]\[InvisibleComma]\[Beta]]+Subscript[\[Delta], j\[InvisibleComma]\[Beta]],Subscript[g, i\[InvisibleComma]\[Beta]_]:>T^s Subscript[g, SuperPlus[i]\[InvisibleComma]\[Beta]]+(1-T^s)Subscript[g, SuperPlus[j]\[InvisibleComma]\[Beta]]+Subscript[\[Delta], i\[InvisibleComma]\[Beta]],
Subscript[g, \[Alpha]_\[InvisibleComma]SuperPlus[i]]:>T^s Subscript[g, \[Alpha]\[InvisibleComma]i]+Subscript[\[Delta], \[Alpha]\[InvisibleComma]SuperPlus[i]],Subscript[g, \[Alpha]_\[InvisibleComma]SuperPlus[j]]:>Subscript[g, \[Alpha]\[InvisibleComma]j]+(1-T^s)Subscript[g, \[Alpha]\[InvisibleComma]i]+Subscript[\[Delta], \[Alpha]\[InvisibleComma]SuperPlus[j]],
Subscript[g, \[Nu]_\[InvisibleComma]j\[InvisibleComma]\[Beta]_]:>Subscript[g, \[Nu]\[InvisibleComma]SuperPlus[j]\[InvisibleComma]\[Beta]]+Subscript[\[Delta], j\[InvisibleComma]\[Beta]],Subscript[g, \[Nu]_\[InvisibleComma]i\[InvisibleComma]\[Beta]_]:>\!\(
\*SubsuperscriptBox[\(T\), \(\[Nu]\), \(s\)] 
\*SubscriptBox[\(g\), \(\[Nu]\[InvisibleComma]
\*SuperscriptBox[\(i\), \(+\)]\[InvisibleComma]\[Beta]\)]\)+(1-\!\(\*SubsuperscriptBox[\(T\), \(\[Nu]\), \(s\)]\))Subscript[g, \[Nu]\[InvisibleComma]SuperPlus[j]\[InvisibleComma]\[Beta]]+Subscript[\[Delta], i\[InvisibleComma]\[Beta]],
Subscript[g, \[Nu]_\[InvisibleComma]\[Alpha]_\[InvisibleComma]SuperPlus[i]]:>\!\(
\*SubsuperscriptBox[\(T\), \(\[Nu]\), \(s\)] 
\*SubscriptBox[\(g\), \(\[Nu]\[InvisibleComma]\[Alpha]\[InvisibleComma]i\)]\)+Subscript[\[Delta], \[Alpha]\[InvisibleComma]SuperPlus[i]],Subscript[g, \[Nu]_\[InvisibleComma]\[Alpha]_\[InvisibleComma]SuperPlus[j]]:>Subscript[g, \[Nu]\[InvisibleComma]\[Alpha]\[InvisibleComma]j]+(1-\!\(\*SubsuperscriptBox[\(T\), \(\[Nu]\), \(s\)]\))Subscript[g, \[Nu]\[InvisibleComma]\[Alpha]\[InvisibleComma]i]+Subscript[\[Delta], \[Alpha]\[InvisibleComma]SuperPlus[j]]
}
Subscript[gR, i_]:={Subscript[g, i,\[Beta]_]:>Subscript[g, SuperPlus[i],\[Beta]]+Subscript[\[Delta], i,\[Beta]],Subscript[g, \[Alpha]_,SuperPlus[i]]:>Subscript[g, \[Alpha],i]+Subscript[\[Delta], \[Alpha],SuperPlus[i]]}


(* ::Input::Initialization:: *)
Subscript[igR, s_,i_,j_]:={
Subscript[g, SuperPlus[j],\[Beta]_]:>Subscript[g, j,\[Beta]]-Subscript[\[Delta], j,\[Beta]], Subscript[g, SuperPlus[i],\[Beta]_]:>T^-s Subscript[g, i\[InvisibleComma]\[Beta]]-(T^-s-1)Subscript[g, SuperPlus[j]\[InvisibleComma]\[Beta]]-T^-s Subscript[\[Delta], i\[InvisibleComma]\[Beta]],
Subscript[g, \[Alpha]_,i]:>T^-s (Subscript[g, \[Alpha],SuperPlus[i]]-Subscript[\[Delta], \[Alpha],SuperPlus[i]]),Subscript[g, \[Alpha]_,j]:>Subscript[g, \[Alpha],SuperPlus[j]]-(1-T^s)Subscript[g, \[Alpha],i]-Subscript[\[Delta], \[Alpha],SuperPlus[j]],
Subscript[g, \[Nu]_,SuperPlus[j],\[Beta]_]:>Subscript[g, \[Nu],j,\[Beta]]-Subscript[\[Delta], j,\[Beta]], Subscript[g, \[Nu]_,SuperPlus[i],\[Beta]_]:>\!\(
\*SubsuperscriptBox[\(T\), \(\[Nu]\), \(-s\)] 
\*SubscriptBox[\(g\), \(\[Nu]\[InvisibleComma]i\[InvisibleComma]\[Beta]\)]\)-(\!\(
\*SubsuperscriptBox[\(T\), \(\[Nu]\), \(-s\)] - 1\))Subscript[g, \[Nu]\[InvisibleComma]SuperPlus[j]\[InvisibleComma]\[Beta]]-\!\(
\*SubsuperscriptBox[\(T\), \(\[Nu]\), \(-s\)] 
\*SubscriptBox[\(\[Delta]\), \(i\[InvisibleComma]\[Beta]\)]\),
Subscript[g, \[Nu]_,\[Alpha]_,i]:>\!\(
\*SubsuperscriptBox[\(T\), \(\[Nu]\), \(-s\)] \((
\*SubscriptBox[\(g\), \(\[Nu], \[Alpha], 
\*SuperscriptBox[\(i\), \(+\)]\)] - 
\*SubscriptBox[\(\[Delta]\), \(\[Alpha], 
\*SuperscriptBox[\(i\), \(+\)]\)])\)\),Subscript[g, \[Nu]_,\[Alpha]_,j]:>Subscript[g, \[Nu],\[Alpha],SuperPlus[j]]-(1-\!\(\*SubsuperscriptBox[\(T\), \(\[Nu]\), \(s\)]\))Subscript[g, \[Nu],\[Alpha],i]-Subscript[\[Delta], \[Alpha],SuperPlus[j]]
}


(* ::Input::Initialization:: *)
Subscript[\[ScriptCapitalL], 1][Subscript[X, i_,j_][s_]]:=T^(s/2) \[DoubleStruckCapitalE][
Subscript[x, i](Subscript[p, i+1]-Subscript[p, i])+Subscript[x, j](Subscript[p, j+1]-Subscript[p, j])+(T^s-1)Subscript[x, i](Subscript[p, i+1]-Subscript[p, j+1])+(\[Epsilon] s/2)*(Subscript[x, i](Subscript[p, i]-Subscript[p, j])((T^s-1)Subscript[x, i] Subscript[p, j]+2(1-Subscript[x, j] Subscript[p, j]))-1)]
Subscript[\[ScriptCapitalL], 1][Subscript[C, i_][\[CurlyPhi]_]]:=T^(\[CurlyPhi]/2) \[DoubleStruckCapitalE][Subscript[x, i](Subscript[p, i+1]-Subscript[p, i])+\[Epsilon] \[CurlyPhi](1/2-Subscript[x, i] Subscript[p, i])]
$\[ScriptCapitalL]=Subscript[\[ScriptCapitalL], 1];


(* ::Input::Initialization:: *)
Subscript[pPush, loc__][\[ScriptCapitalE]_]:=g2px[px2g[\[ScriptCapitalE]]/.Subscript[gR, loc]/.{Subscript[\[Delta], \[Alpha]_,\[Alpha]_]->1,Subscript[\[Delta], i,j]->0,Subscript[\[Delta], j,i]->0}/.SuperPlus[\[Alpha]_]:>\[Alpha]+1];


(* ::Input::Initialization:: *)
Subscript[\[ScriptCapitalL], pPush][Subscript[X, i_,j_][s_]]:=T^(s/2) CF@\[DoubleStruckCapitalE][Plus[
Subscript[x, i](Subscript[p, i+1]-Subscript[p, i])+Subscript[x, j](Subscript[p, j+1]-Subscript[p, j])+(T^s-1)Subscript[x, i](Subscript[p, i+1]-Subscript[p, j+1]),
Subscript[pPush, s,i,j][(\[Epsilon] s/2)*(Subscript[x, i](Subscript[p, i]-Subscript[p, j])((T^s-1)Subscript[x, i] Subscript[p, j]+2(1-Subscript[x, j] Subscript[p, j]))-1)]
]]
Subscript[\[ScriptCapitalL], pPush][Subscript[C, i_][\[CurlyPhi]_]]:=T^(\[CurlyPhi]/2) \[DoubleStruckCapitalE][Subscript[x, i](Subscript[p, i+1]-Subscript[p, i])+Subscript[pPush, i][\[Epsilon] \[CurlyPhi](1/2-Subscript[x, i] Subscript[p, i])]]
$\[ScriptCapitalL]=Subscript[\[ScriptCapitalL], pPush];



