(* ::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\\Projects\\BabyDoPeGDO"];
<< Engine.m


(* ::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:: *)
GenericPerturbation[d_Integer, vars_List, gc_] := Total[Map[
Subscript[gc, Sequence@@#]Times@@(vars^#)&,
Join@@(Permutations /@ IntegerPartitions[d+Length@vars,{Length@vars}])-1
]];
GenericPerturbation[{m_}, vars_List, gc_] := Prepend[0][\[Epsilon]Series@@Table[GenericPerturbation[2d+2,vars,gc],{d,m}]]


(* ::Input::Initialization:: *)
Unprotect[SeriesData];
Expand[sd_SeriesData] ^:= MapAt[Expand,sd,3];
Protect[SeriesData];


(* ::Input::Initialization:: *)
Subscript[Ev, k_]@Subscript[\[LeftBracketingBar]F_,\[DoubleStruckCapitalE][\[Omega]_,Q_,P_]\[RightBracketingBar], B_]:=Module[{\[ScriptCapitalE],d},
\[ScriptCapitalE]=\[Omega] E^(Q+Sum[P[[d+1]]\[Epsilon]^d,{d,0,Length[P]-1}]);
Expand[Total[
CoefficientRules[Normal@Series[E^(SuperStar[B] . F . SuperStar[B]/2),{\[HBar],0,k}],SuperStar[B]] /. (ps_->c_) :> c D[\[ScriptCapitalE],Sequence@@Thread[{B,ps}]]
]+O[\[HBar]]^(k+1)]
];
Subscript[Ev, k_]@Subscript[\[LeftAngleBracket]F_,\[ScriptCapitalE]_\[RightAngleBracket], B_]:= Subscript[Ev, k]@Subscript[\[LeftBracketingBar]F,\[ScriptCapitalE]\[RightBracketingBar], B]/.Alternatives@@B->0;
Subscript[Ev, k_][B_,\[LeftAngleBracket]\[ScriptCapitalF]_,\[ScriptCapitalE]_\[RightAngleBracket]]:= Subscript[Ev, k]@Subscript[\[LeftAngleBracket]Table[\!\(
\*SubscriptBox[\(\[PartialD]\), \(u, v\)]\[ScriptCapitalF]\),{u,SuperStar[B]},{v,SuperStar[B]}],\[ScriptCapitalE]\[RightAngleBracket], B];


(* ::Input::Initialization:: *)
Zip1[Subscript[\[LeftAngleBracket]F_,\[ScriptCapitalE]_\[RightAngleBracket], B_]]:=Subscript[Zip1, B][\[LeftAngleBracket]SuperStar[B] . F . SuperStar[B]/2,\[ScriptCapitalE]\[RightAngleBracket]]


(* ::Input::Initialization:: *)
Zip2[Subscript[\[LeftAngleBracket]F_,\[ScriptCapitalE]_\[RightAngleBracket], B_]]:=Subscript[Zip2, B][\[LeftAngleBracket]SuperStar[B] . F . SuperStar[B]/2,\[ScriptCapitalE]\[RightAngleBracket]]


(* ::Input::Initialization:: *)
Zip3[Subscript[\[LeftAngleBracket]F_,\[ScriptCapitalE]_\[RightAngleBracket], B_]]:=Subscript[Zip3, B][\[LeftAngleBracket]SuperStar[B] . F . SuperStar[B]/2,\[ScriptCapitalE]\[RightAngleBracket]]



