(* ::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\\SL2Portfolio2"];
<< KnotTheory`;
<<"../Profile/Profile.m";
<<"Engine-Speedy.m";
<<"Objects.m";
<<"KT.m";
BeginProfile[];
PopupWindow[Button["Show Profile Monitor"],Dynamic[PrintProfile[], UpdateInterval->3, TrackedSymbols->{}]]


(* ::Input::Initialization:: *)
$k=0; \[HBar]=\[Gamma]=1;


(* ::Input::Initialization:: *)
s;h;t;\[CapitalGamma];dL;V;
Once[Begin["MetaCalculi`"]; << "../MetaCalculi/MetaCalculi.m";End[];]
\[CapitalGamma]Simp=MetaCalculi`\[CapitalGamma]Simp;
\[CapitalGamma]R[i_,j_] := \[CapitalGamma][Xp[i,j]]; \!\(\*OverscriptBox[\(\[CapitalGamma]R\), \(_\)]\)[i_,j_] := \[CapitalGamma][Xm[i,j]];


(* ::Input::Initialization:: *)
HL[\[ScriptCapitalE]_] := Style[\[ScriptCapitalE], Background -> Green];


(* ::Input::Initialization:: *)
\[CapitalGamma][\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] ss_\)]\)[LL_,QQ_,PP_]] := Module[{L,Q,P,\[Sigma],i,j},
{L,Q,P}=List@@(\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] ss\)]\)[LL,QQ,PP]//Composition@@(Subscript[dS, #]&/@ss));
\[CapitalGamma]Simp[\[CapitalGamma][
(Normal[P]/.\[Epsilon]->0)^-1,
\[Sigma]=Sum[Subscript[h, i]Product[\!\(
\*SubsuperscriptBox[\(T\), \(j\), \(Coefficient[L, \[HBar]\ 
\*SubscriptBox[\(a\), \(i\)] 
\*SubscriptBox[\(b\), \(j\)]]\)], \({j, ss}\)\)],{i,ss}],
(\[Sigma]/.Subscript[h, i_]:>Subscript[t, i] Subscript[h, i])+Sum[Subscript[h, i] Subscript[t, j](1-Subscript[T, j])Coefficient[Q,\[HBar] Subscript[x, i] Subscript[y, j]],{i,ss},{j,ss}]
]/.B->T]
]


(* ::Input::Initialization:: *)
\[DoubleStruckCapitalE][\[CapitalGamma][\[Omega]_,\[Sigma]_,\[Lambda]_]] := Module[{ss,L,Q,P,i,j},
ss=dL@\[CapitalGamma][\[Omega],\[Sigma],\[Lambda]];
P=\[Omega]^-1+O[\[Epsilon]];
L=Sum[\[HBar] Subscript[a, i] Subscript[b, j]Exponent[Coefficient[\[Sigma],Subscript[h, i]],Subscript[T, j]],{i,ss},{j,ss}];
Q=(\[Lambda]-(\[Sigma]/.Subscript[h, i_]:>Subscript[t, i] Subscript[h, i]))/.{Subscript[h, i_]:>Subscript[x, i], Subscript[t, j_]:>\[HBar]/(1-Subscript[T, j]) Subscript[y, j]};
(\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] ss\)]\)[L,Q,P]/.T->B)//Composition@@(Subscript[dS, #]&/@ss)
]



