(* ::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:: *)
DP[P_, x_->Subscript[D, \[Alpha]_],y_->Subscript[D, \[Beta]_]][f_] := Total[CoefficientRules[P, {x,y}] /. ({m_,n_}->c_) :> c D[f,{\[Alpha],m},{\[Beta],n}]]


(* ::Input::Initialization:: *)
\[DoubleStruckCapitalE] /: Simplify[\[DoubleStruckCapitalE][\[Omega]_,L_,Q_,P_]] := \[DoubleStruckCapitalE][Expand@Together[\[Omega]/.Subscript[b, l_]:>Log[Subscript[t, l]]],Expand[L], Expand@Together[Q/.Subscript[b, l_]:>Log[Subscript[t, l]]], Expand@Together[P/.Subscript[b, l_]:>Log[Subscript[t, l]]]];
\[DoubleStruckCapitalE] /: \[DoubleStruckCapitalE][\[Omega]1_,L1_,Q1_,P1_]\[Congruent]\[DoubleStruckCapitalE][\[Omega]2_,L2_,Q2_,P2_] := (\[Omega]1==\[Omega]2\[And]L1==L2\[And]Q1==Q2\[And]P1==P2);


(* ::Input::Initialization:: *)
\[DoubleStruckCapitalE] /: \[DoubleStruckCapitalE][\[Omega]1_,L1_,Q1_,P1_]\[DoubleStruckCapitalE][\[Omega]2_,L2_,Q2_,P2_] := Simplify@\[DoubleStruckCapitalE][\[Omega]1 \[Omega]2, L1+L2,\[Omega]2 Q1+\[Omega]1 Q2,\[Omega]2^4 P1+\[Omega]1^4 P2];


(* ::Input::Initialization:: *)
NO[Subscript[u, i_],Subscript[c, j_],k_][\[DoubleStruckCapitalE][\[Omega]_,L_,Q_,P_]] := With[{q=E^-\[Gamma] \[Beta] Subscript[u, k]+\[Gamma] Subscript[c, k]}, Simplify[
\[DoubleStruckCapitalE][\[Omega], \[Gamma] Subscript[c, k]+(L/.Subscript[c, j]->0), \[Omega] E^-\[Gamma] \[Beta] Subscript[u, k]+(Q/.Subscript[u, i]->0), E^-q DP[P,Subscript[c, j]->Subscript[D, \[Gamma]],Subscript[u, i]->Subscript[D, \[Beta]]][E^q]]/. {\[Gamma]->\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(c\), \(j\)]]L\),\[Beta]->\[Omega]^-1 \!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(u\), \(i\)]]Q\)}]]


(* ::Input::Initialization:: *)
NO[Subscript[w, i_],Subscript[c, j_],k_][\[DoubleStruckCapitalE][\[Omega]_,L_,Q_,P_]] := With[{q=E^\[Gamma] \[Beta] Subscript[w, k]+\[Gamma] Subscript[c, k]}, Simplify[
\[DoubleStruckCapitalE][\[Omega], \[Gamma] Subscript[c, k]+(L/.Subscript[c, j]->0), \[Omega] E^\[Gamma] \[Beta] Subscript[w, k]+(Q/.Subscript[w, i]->0), E^-q DP[P,Subscript[c, j]->Subscript[D, \[Gamma]],Subscript[w, i]->Subscript[D, \[Beta]]][E^q]]/. {\[Gamma]->\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(c\), \(j\)]]L\),\[Beta]->\[Omega]^-1 \!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(w\), \(i\)]]Q\)}]]


(* ::Input::Initialization:: *)
 NO[Subscript[w, i_],Subscript[u, j_],k_][\[DoubleStruckCapitalE][\[Omega]_,L_,Q_,P_]] :=With[{q=(1-Subscript[t, k])\[Nu] \[Alpha] \[Beta]+\[Nu] \[Beta] Subscript[u, k]+\[Nu] \[Delta] Subscript[u, k] Subscript[w, k]+\[Nu] \[Alpha] Subscript[w, k]}, Simplify[
\[DoubleStruckCapitalE][\[Nu]^-1 \[Omega], L, \[Nu]^-1 \[Omega] q+\[Nu]^-1 (Q/.Subscript[w, i]|Subscript[u, j]->0), \[Nu]^-4 E^-q DP[P,Subscript[w, i]->Subscript[D, \[Alpha]],Subscript[u, j]->Subscript[D, \[Beta]]][E^q]+\[Omega]^4 \[CapitalLambda]] /. {
\[Nu]->(1+(Subscript[t, k]-1) \[Delta])^-1,
 \[CapitalLambda]->-(1/2) (-1+Subscript[t, k]) (\[Alpha]^2 \[Beta]^2+4 \[Alpha] \[Beta] \[Delta] (1+(-1+Subscript[t, k]) \[Delta])+2 \[Delta]^2 (1+(-1+Subscript[t, k]) \[Delta])^2)+2 (1+(-1+Subscript[t, k]) \[Delta])^2 (\[Alpha] \[Beta]+\[Delta]+(-1+Subscript[t, k]) \[Delta]^2) Subscript[c, k]-\[Beta] (1+2 (-1+Subscript[t, k]) \[Delta]) (\[Alpha] \[Beta]+2 \[Delta] (1+(-1+Subscript[t, k]) \[Delta])) Subscript[u, k]+2 \[Beta] \[Delta] (1+(-1+Subscript[t, k]) \[Delta])^2 Subscript[c, k] Subscript[u, k]-1/2 \[Beta]^2 \[Delta] (2+3 (-1+Subscript[t, k]) \[Delta]) 
\!\(\*SubsuperscriptBox[\(u\), \(k\), \(2\)]\)+\[Alpha] (\[Alpha] \[Beta]+2 \[Delta] (1+(-1+Subscript[t, k]) \[Delta])) Subscript[w, k]+2 \[Alpha] \[Delta] (1+(-1+Subscript[t, k]) \[Delta])^2 Subscript[c, k] Subscript[w, k]-2 (-1+Subscript[t, k]) \[Delta]^2 (\[Alpha] \[Beta]+\[Delta] (1+(-1+Subscript[t, k]) \[Delta])) Subscript[u, k] Subscript[w, k]+2 \[Delta]^2 (1+(-1+Subscript[t, k]) \[Delta])^2 Subscript[c, k] Subscript[u, k] Subscript[w, k]-\[Beta] \[Delta]^2 (1+2 (-1+Subscript[t, k]) \[Delta]) 
\!\(\*SubsuperscriptBox[\(u\), \(k\), \(2\)]\) Subscript[w, k]+1/2 \[Alpha]^2 \[Delta] (2+(-1+Subscript[t, k]) \[Delta]) 
\!\(\*SubsuperscriptBox[\(w\), \(k\), \(2\)]\)+\[Alpha] \[Delta]^2 Subscript[u, k] 
\!\(\*SubsuperscriptBox[\(w\), \(k\), \(2\)]\)-1/2 (-1+Subscript[t, k]) \[Delta]^4 
\!\(\*SubsuperscriptBox[\(u\), \(k\), \(2\)]\) 
\!\(\*SubsuperscriptBox[\(w\), \(k\), \(2\)]\)
} /. {\[Alpha]->\[Omega]^-1 (\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(w\), \(i\)]]Q\)/.Subscript[u, j]->0), \[Beta]->\[Omega]^-1 (\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(u\), \(j\)]]Q\)/.Subscript[w, i]->0), \[Delta]->\[Omega]^-1 \!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(w\), \(i\)], 
\*SubscriptBox[\(u\), \(j\)]\)]Q\)}]];


(* ::Input::Initialization:: *)
m[i_,j_,kk_][Z_] :=Module[{x,y},
Z // ReplaceAll[{Subscript[b, i|j]->Subscript[b, kk],Subscript[t, i|j]->Subscript[t, kk]}]// NO[Subscript[w, i],Subscript[c, j],x] // NO[Subscript[w, x],Subscript[u, j],y] // ReplaceAll[{Subscript[c, x|y]->Subscript[c, x],Subscript[w, j]->Subscript[w, y]}] // NO[Subscript[u, i],Subscript[c, x],x] // ReplaceAll[{Subscript[c, i|x]->Subscript[c, kk],Subscript[u, x|y]->Subscript[u, kk],Subscript[w, y]->Subscript[w, kk],Subscript[b, x|y]->Subscript[b, kk],Subscript[t, x|y]->Subscript[t, kk]}] // Simplify]



