(* ::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:: *)
SetDirectory["C:\\drorbn\\AcademicPensieve\\Talks\\Oaxaca-2210"];


(* ::Input::Initialization:: *)
Once[<<KnotTheory`; <<Rot.m];


(* ::Input::Initialization:: *)
Subscript[R, 1][s_,i_,j_]:=s(Subscript[g, j\[InvisibleComma]i](Subscript[g, SuperPlus[j],j]+Subscript[g, j,SuperPlus[j]]-Subscript[g, i\[InvisibleComma]j])-Subscript[g, i\[InvisibleComma]i](Subscript[g, j,SuperPlus[j]]-1)-1/2);
Z[K_]:=Module[{Cs,\[CurlyPhi],n,A,s,i,j,k,\[CapitalDelta],G,\[Rho]1},
{Cs,\[CurlyPhi]}=Rot[K]; n=Length[Cs];
A=IdentityMatrix[2n+1];
Cases[Cs,{s_,i_,j_}:>(A[[{i,j},{i+1,j+1}]]+=({
 {-T^s, T^s-1},
 {0, -1}
}))];
\[CapitalDelta]=T^((-Total[\[CurlyPhi]]-Total[Cs[[All,1]]])/2) Det[A];
G=Inverse[A];
\[Rho]1=\!\(
\*SubsuperscriptBox[\(\[Sum]\), \(k = 1\), \(n\)]\(
\*SubscriptBox[\(R\), \(1\)] @@ Cs[[k]]\)\) - \!\(
\*SubsuperscriptBox[\(\[Sum]\), \(k = 1\), \(2  n\)]\(\[CurlyPhi][[k]] \((
\*SubscriptBox[\(g\), \(k\[InvisibleComma]k\)] - 1/2)\)\)\);
Factor@{\[CapitalDelta],\[CapitalDelta]^2 \[Rho]1/.SuperPlus[\[Alpha]_]:>\[Alpha]+1/.Subscript[g, \[Alpha]_,\[Beta]_]:>G[[\[Alpha],\[Beta]]]}];


(* ::Input::Initialization:: *)
V@Subscript[\[Gamma], 1,\[CurlyPhi]_][k_]=\[CurlyPhi] (1/2-Subscript[\!\(\*OverscriptBox[\(p\), \(_\)]\), k] Subscript[\!\(\*OverscriptBox[\(x\), \(_\)]\), k]); V@Subscript[\[Gamma], 2,\[CurlyPhi]_][k_]=-\[CurlyPhi]^2 Subscript[\!\(\*OverscriptBox[\(p\), \(_\)]\), k] Subscript[\!\(\*OverscriptBox[\(x\), \(_\)]\), k]/2; V@Subscript[\[Gamma], 3,\[CurlyPhi]_][k_]:=-\[CurlyPhi]^3 Subscript[\!\(\*OverscriptBox[\(p\), \(_\)]\), k] Subscript[\!\(\*OverscriptBox[\(x\), \(_\)]\), k]/6


(* ::Input::Initialization:: *)
V@Subscript[r, 1,s_][i_,j_]:=s (-1+2 Subscript[p, i] Subscript[x, i]-2 Subscript[p, j] Subscript[x, i]+(-1+T^s) Subscript[p, i] Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)+(1-T^s) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)-2 Subscript[p, i] Subscript[p, j] Subscript[x, i] Subscript[x, j]+2 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) Subscript[x, i] Subscript[x, j])/2


(* ::Input::Initialization:: *)
V@Subscript[r, 2,1][i_,j_]:=(-6 Subscript[p, i] Subscript[x, i]+6 Subscript[p, j] Subscript[x, i]-3 (-1+3 T) Subscript[p, i] Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)+3 (-1+3 T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)+4 (-1+T) \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)-2 (-1+T) (5+T) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)+2 (-1+T) (3+T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)+18 Subscript[p, i] Subscript[p, j] Subscript[x, i] Subscript[x, j]-18 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) Subscript[x, i] Subscript[x, j]-6 \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]+6 (2+T) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]-6 (1+T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]-6 Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)+6 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\))/12


(* ::Input::Initialization:: *)
V@Subscript[r, 2,-1][i_,j_]:=(-6 T^2 Subscript[p, i] Subscript[x, i]+6 T^2 Subscript[p, j] Subscript[x, i]+3 (-3+T) T Subscript[p, i] Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)-3 (-3+T) T \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)-4 (-1+T) T \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)+2 (-1+T) (1+5 T) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)-2 (-1+T) (1+3 T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)+18 T^2 Subscript[p, i] Subscript[p, j] Subscript[x, i] Subscript[x, j]-18 T^2 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) Subscript[x, i] Subscript[x, j]-6 T^2 \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]+6 T (1+2 T) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]-6 T (1+T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]-6 T^2 Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)+6 T^2 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\))/(12T^2)


(* ::Input::Initialization:: *)
V@Subscript[r, 3,1][i_,j_]:=(4 Subscript[p, i] Subscript[x, i]-4 Subscript[p, j] Subscript[x, i]+2 (5+7 T) Subscript[p, i] Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)-2 (5+7 T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)-4 (-5+6 T) \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)+4 (-16+17 T+2 T^2) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)-4 (-11+11 T+2 T^2) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)+3 (-1+T) \!\(\*SubsuperscriptBox[\(p\), \(i\), \(3\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(4\)]\)-3 (-1+T) (4+3 T) \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(4\)]\)+(-1+T) (13+22 T+T^2) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(4\)]\)-(-1+T) (4+13 T+T^2) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(4\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(4\)]\)-28 Subscript[p, i] Subscript[p, j] Subscript[x, i] Subscript[x, j]+28 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) Subscript[x, i] Subscript[x, j]+36 \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]-12 (9+2 T) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]+24 (3+T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]-4 \!\(\*SubsuperscriptBox[\(p\), \(i\), \(3\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\) Subscript[x, j]+28 T \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\) Subscript[x, j]-4 (-6+17 T+T^2) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\) Subscript[x, j]+4 (-5+10 T+T^2) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(4\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\) Subscript[x, j]+24 Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)-24 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)-24 \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)+6 (10+T) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)-6 (6+T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(4\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)-4 Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(3\)]\)+4 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(4\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(3\)]\))/24


(* ::Input::Initialization:: *)
V@Subscript[r, 3,-1][i_,j_]:=(-4 T^3 Subscript[p, i] Subscript[x, i]+4 T^3 Subscript[p, j] Subscript[x, i]-2 T^2 (7+5 T) Subscript[p, i] Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)+2 T^2 (7+5 T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)-4 T^2 (-6+5 T) \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)+4 T (-2-17 T+16 T^2) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)-4 T (-2-11 T+11 T^2) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\)+3 (-1+T) T^2 \!\(\*SubsuperscriptBox[\(p\), \(i\), \(3\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(4\)]\)-3 (-1+T) T (3+4 T) \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(4\)]\)+(-1+T) (1+22 T+13 T^2) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(4\)]\)-(-1+T) (1+13 T+4 T^2) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(4\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(4\)]\)+28 T^3 Subscript[p, i] Subscript[p, j] Subscript[x, i] Subscript[x, j]-28 T^3 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) Subscript[x, i] Subscript[x, j]-36 T^3 \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]+12 T^2 (2+9 T) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]-24 T^2 (1+3 T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) Subscript[x, j]+4 T^3 \!\(\*SubsuperscriptBox[\(p\), \(i\), \(3\)]\) Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\) Subscript[x, j]-28 T^2 \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\) Subscript[x, j]-4 T (-1-17 T+6 T^2) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\) Subscript[x, j]+4 T (-1-10 T+5 T^2) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(4\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(3\)]\) Subscript[x, j]-24 T^3 Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)+24 T^3 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)+24 T^3 \!\(\*SubsuperscriptBox[\(p\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)-6 T^2 (1+10 T) Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)+6 T^2 (1+6 T) \!\(\*SubsuperscriptBox[\(p\), \(j\), \(4\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(j\), \(2\)]\)+4 T^3 Subscript[p, i] \!\(\*SubsuperscriptBox[\(p\), \(j\), \(3\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(3\)]\)-4 T^3 \!\(\*SubsuperscriptBox[\(p\), \(j\), \(4\)]\) Subscript[x, i] \!\(\*SubsuperscriptBox[\(x\), \(j\), \(3\)]\))/(24T^3)


(* ::Input::Initialization:: *)
{SuperStar[p],SuperStar[x],SuperStar[\!\(\*OverscriptBox[\(p\), \(_\)]\)],SuperStar[\!\(\*OverscriptBox[\(x\), \(_\)]\)]}={\[Pi],\[Xi],\!\(\*OverscriptBox[\(\[Pi]\), \(_\)]\),\!\(\*OverscriptBox[\(\[Xi]\), \(_\)]\)};  SuperStar[(Subscript[z_, i__])]:=Subscript[(SuperStar[z]), i];
\!\(\*SubscriptBox[\(Zip\), \({}\)]\)[\[ScriptCapitalE]_]:=\[ScriptCapitalE];
\!\(\*SubscriptBox[\(Zip\), \({z_, zs___}\)]\)[\[ScriptCapitalE]_] := (Collect[\[ScriptCapitalE]//\!\(\*SubscriptBox[\(Zip\), \({zs}\)]\),z] /. f_. z^d_.:>(D[f,{SuperStar[z],d}]))/.SuperStar[z]->0


(* ::Input::Initialization:: *)
gPair[fs_,w_]:=gPair[fs,w]=Collect[Subscript[Zip, Join@@Table[{Subscript[p, \[Alpha]],Subscript[\!\(\*OverscriptBox[\(p\), \(_\)]\), \[Alpha]],Subscript[x, \[Alpha]],Subscript[\!\(\*OverscriptBox[\(x\), \(_\)]\), \[Alpha]]},{\[Alpha],w}]][(Times@@(V/@fs))Exp[Sum[Subscript[g, \[Alpha],\[Beta]](Subscript[\[Pi], \[Alpha]]+Subscript[\!\(\*OverscriptBox[\(\[Pi]\), \(_\)]\), \[Alpha]])(Subscript[\[Xi], \[Beta]]+Subscript[\!\(\*OverscriptBox[\(\[Xi]\), \(_\)]\), \[Beta]]),{\[Alpha],w},{\[Beta],w}]-Sum[Subscript[\!\(\*OverscriptBox[\(\[Xi]\), \(_\)]\), \[Alpha]] Subscript[\[Pi], \[Alpha]],{\[Alpha],w}]]],Subscript[g, __],Factor]


(* ::Input::Initialization:: *)
T2z[p_]:=Module[{q=Expand[p],n,c},
If[q===0,0,c=Coefficient[q,T,n=Exponent[q,T]];c z^(2n)+T2z[q-c (T^(1/2)-T^(-1/2))^(2n)]]];


(* ::Input::Initialization:: *)
Subscript[Z, d_][K_]:=Module[{Cs,\[CurlyPhi],n,A,s,i,j,k,\[CapitalDelta],G,d1,Z1,Z2,Z3},
{Cs,\[CurlyPhi]}=Rot[K]; n=Length[Cs];A=IdentityMatrix[2n+1];
Cases[Cs,{s_,i_,j_}:>(A[[{i,j},{i+1,j+1}]]+=({
 {-T^s, T^s-1},
 {0, -1}
}))];
{\[CapitalDelta],G}=Factor@{T^((-Total[\[CurlyPhi]]-Total[Cs[[All,1]]])/2) Det@A,Inverse@A};
Z1=Exp[Total[Cases[Cs,{s_,i_,j_}:>Sum[\[Epsilon]^d1 Subscript[r, d1,s][i,j],{d1,d}]]]+ Sum[\[Epsilon]^d1 Subscript[\[Gamma], d1,\[CurlyPhi][[k]]][k], {k,2n},{d1,d}]/.Subscript[\[Gamma], _,0][_]->0];
Z2=Expand[F[{},{}]*Normal@Series[Z1,{\[Epsilon],0,d}]]//.F[fs_,{es___}]*(f:Subscript[(r|\[Gamma]), ps__][is__])^p_.:>F[Join[fs,Table[f,p]],DeleteDuplicates@{es,is}];
Z3=Expand[Z2/.F[fs_,es_]:>Expand[gPair[
Replace[fs,Thread[es->Range@Length@es],{2}],Length@es
]/.Subscript[g, \[Alpha]_,\[Beta]_]:>G[[es[[\[Alpha]]],es[[\[Beta]]]]]] ];
Collect[{\[CapitalDelta],Z3/.\[Epsilon]^p_.->p! \[CapitalDelta]^(2p) \[Epsilon]^p},\[Epsilon],T2z] ];



