(* ::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\\LearningSeminarOnCategorification-2006"];
<< "Engine-Speedy.m";
<< "Objects.m";
$k=0; \[HBar]=1;


(* ::Input::Initialization:: *)
s;h;t;\[CapitalGamma];dL;V;Xp;Xm
Once[Begin["MetaCalculi`"]; << "../../Projects/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:: *)
Subscript[cR, i_,j_]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] {i, j}\)]\)[Subscript[a, j] Subscript[b, i],(1-Subscript[B, i])/Subscript[b, i] Subscript[x, j] Subscript[y, i],1]


(* ::Input::Initialization:: *)
Subscript[\!\(\*OverscriptBox[\(cR\), \(_\)]\), i_,j_]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] {i, j}\)]\)[-Subscript[a, j] Subscript[b, i],(Subscript[B, i]-1)/(Subscript[b, i] Subscript[B, i]) Subscript[x, j] Subscript[y, i],1]


(* ::Input::Initialization:: *)
Subscript[\[DoubleStruckCapitalG], sp1_][\[Omega]_,L_,Q_]//\[DoubleStruckCapitalE]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] sp1\)]\)[L,Q,\[Omega]+O[\[Epsilon]]];
Subscript[\[DoubleStruckCapitalG], sp1_][\[Omega]_,L_,Q_] // Subscript[\[DoubleStruckCapitalE], sp2_][L2_,Q2_,P2_] := Subscript[\[DoubleStruckCapitalG], sp1][\[Omega],L,Q]//\[DoubleStruckCapitalE]//Subscript[\[DoubleStruckCapitalE], sp2][L2,Q2,P2]


(* ::Input::Initialization:: *)
\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] r_\)]\)[L_,Q_,P_]//\[DoubleStruckCapitalG]:=Subscript[\[DoubleStruckCapitalG], r][Normal@P,L,Q]


(* ::Input::Initialization:: *)
Subscript[\[DoubleStruckCapitalG], S_][\[Omega]_,L_,Q_]//\[DoubleStruckCapitalG]Form := Module[{M,i,j},
M = Table[Simplify[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(x\), \(i\)], 
\*SubscriptBox[\(y\), \(j\)]\)]Q\)],{i,S},{j,S}];
PrependTo[M, Subscript[y, #]&/@S];
M = Join[
{Prepend[Subscript[x, #]&/@S, \[Omega]]},
Transpose[M],
{Prepend[Table[\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(a\), \(i\)]]L\),{i,S}], "\[DoubleStruckCapitalG]"]}
];
MatrixForm[M]
];


(* ::Input::Initialization:: *)
Subscript[\[DoubleStruckCapitalG], S1_][\[Omega]1_,L1_,Q1_]\[Congruent]Subscript[\[DoubleStruckCapitalG], S2_][\[Omega]2_,L2_,Q2_]:=(Sort[S1]===Sort[S2])\[And]Simplify[\[Omega]1==\[Omega]2]\[And]Simplify[L1==L2]\[And]Simplify[Q1==Q2]


(* ::Input::Initialization:: *)
\[Gamma]1=Expand/@\!\(\*SubscriptBox[\(\[CapitalGamma]1\), \({1, 2, 3}\)]\)[\[Omega],{Subscript[b, 1],Subscript[b, 2],Subscript[b, 3]}.({
 {Subscript[l, 11], Subscript[l, 12], Subscript[l, 13]},
 {Subscript[l, 21], Subscript[l, 22], Subscript[l, 23]},
 {Subscript[l, 31], Subscript[l, 32], Subscript[l, 33]}
}).{Subscript[a, 1],Subscript[a, 2],Subscript[a, 3]},{Subscript[y, 1],Subscript[y, 2],Subscript[y, 3]}.({
 {\[Alpha], \[Beta], \[Theta]},
 {\[Gamma], \[Delta], \[Epsilon]},
 {\[Phi], \[Psi], \[CapitalXi]}
}).{Subscript[x, 1],Subscript[x, 2],Subscript[x, 3]}]


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]1, sp1_][\[Omega]_,L_,Q_]//\[DoubleStruckCapitalE]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] sp1\)]\)[L,Q,\[Omega]+O[\[Epsilon]]];
Subscript[\[CapitalGamma]1, sp1_][\[Omega]_,L_,Q_] // Subscript[\[DoubleStruckCapitalE], sp2_][L2_,Q2_,P2_] := Subscript[\[CapitalGamma]1, sp1][\[Omega],L,Q]//\[DoubleStruckCapitalE]//Subscript[\[DoubleStruckCapitalE], sp2][L2,Q2,P2]


(* ::Input::Initialization:: *)
\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] r_\)]\)[L_,Q_,P_]//\[CapitalGamma]1:=Subscript[\[CapitalGamma]1, r][Normal@P,L,Q]


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]1, S_][\[Omega]_,L_,Q_]//\[CapitalGamma]1Form := Module[{M,i,j},
M = Table[Simplify[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(x\), \(i\)], 
\*SubscriptBox[\(y\), \(j\)]\)]Q\)],{i,S},{j,S}];
PrependTo[M, Subscript[y, #]&/@S];
M = Join[
{Prepend[Subscript[x, #]&/@S, \[Omega]]},
Transpose[M],
{Prepend[Table[\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(a\), \(i\)]]L\),{i,S}], "\[CapitalGamma]1"]}
];
MatrixForm[M]
];


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]1, S1_][\[Omega]1_,L1_,Q1_]\[Congruent]Subscript[\[CapitalGamma]1, S2_][\[Omega]2_,L2_,Q2_]:=(Sort[S1]===Sort[S2])\[And]Simplify[\[Omega]1==\[Omega]2]\[And]Simplify[L1==L2]\[And]Simplify[Q1==Q2]


(* ::Input::Initialization:: *)
\[Gamma]2=Expand/@\!\(\*SubscriptBox[\(\[CapitalGamma]2\), \({1, 2, 3}\)]\)[\[Omega],{Subscript[b, 1],Subscript[b, 2],Subscript[b, 3]}.({
 {Subscript[l, 11], Subscript[l, 12], Subscript[l, 13]},
 {Subscript[l, 21], Subscript[l, 22], Subscript[l, 23]},
 {Subscript[l, 31], Subscript[l, 32], Subscript[l, 33]}
}).{Subscript[a, 1],Subscript[a, 2],Subscript[a, 3]},{Subscript[y, 1],Subscript[y, 2],Subscript[y, 3]}.({
 {\[Alpha], \[Beta], \[Theta]},
 {\[Gamma], \[Delta], \[Epsilon]},
 {\[Phi], \[Psi], \[CapitalXi]}
}).{Subscript[x, 1],Subscript[x, 2],Subscript[x, 3]}]


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]2, sp1_][\[Omega]_,L_,Q_]//\[DoubleStruckCapitalE]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] sp1\)]\)[L,Q/.Subscript[y, i_]:>Subscript[y, i]/Subscript[b, i],\[Omega]+O[\[Epsilon]]];


(* ::Input::Initialization:: *)
\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] r_\)]\)[L_,Q_,P_]//\[CapitalGamma]2:=Subscript[\[CapitalGamma]2, r][Normal@P,L,Q/.Subscript[y, i_]:>Subscript[y, i] Subscript[b, i]]


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]2, S1_][\[Omega]1_,L1_,Q1_]\[Congruent]Subscript[\[CapitalGamma]2, S2_][\[Omega]2_,L2_,Q2_]:=(Sort[S1]===Sort[S2])\[And]Simplify[\[Omega]1==\[Omega]2]\[And]Simplify[L1==L2]\[And]Simplify[Q1==Q2]


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]2, S_][\[Omega]_,L_,Q_]//\[CapitalGamma]2Form := Module[{M,i,j},
M = Table[Simplify[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(x\), \(i\)], 
\*SubscriptBox[\(y\), \(j\)]\)]Q\)],{i,S},{j,S}];
PrependTo[M, Subscript[y, #]&/@S];
M = Join[
{Prepend[Subscript[x, #]&/@S, \[Omega]]},
Transpose[M],
{Prepend[Table[\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(a\), \(i\)]]L\),{i,S}], "\[CapitalGamma]2"]}
];
MatrixForm[M]
];


(* ::Input::Initialization:: *)
\[Gamma]3=Expand/@\!\(\*SubscriptBox[\(\[CapitalGamma]3\), \({1, 2, 3}\)]\)[\[Omega],{Subscript[b, 1],Subscript[b, 2],Subscript[b, 3]}.({
 {Subscript[l, 11], Subscript[l, 12], Subscript[l, 13]},
 {Subscript[l, 21], Subscript[l, 22], Subscript[l, 23]},
 {Subscript[l, 31], Subscript[l, 32], Subscript[l, 33]}
}).{Subscript[a, 1],Subscript[a, 2],Subscript[a, 3]},{Subscript[y, 1],Subscript[y, 2],Subscript[y, 3]}.({
 {\[Alpha], \[Beta], \[Theta]},
 {\[Gamma], \[Delta], \[Epsilon]},
 {\[Phi], \[Psi], \[CapitalXi]}
}).{Subscript[x, 1],Subscript[x, 2],Subscript[x, 3]}]


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]3, sp_][\[Omega]_,L_,Q_]//\[DoubleStruckCapitalE]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] sp\)]\)[L,(Q/.Subscript[y, i_]:>Subscript[y, i]/Subscript[b, i])-Sum[(E^-\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(a\), \(i\)]]L\)//.l2U)Subscript[y, i]Subscript[x, i]/Subscript[b, i],{i,sp}],\[Omega]+O[\[Epsilon]]];


(* ::Input::Initialization:: *)
\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] r_\)]\)[L_,Q_,P_]//\[CapitalGamma]3:=Subscript[\[CapitalGamma]3, r][Normal@P,L,(Q/.Subscript[y, i_]:>Subscript[y, i] Subscript[b, i])+Sum[(E^-\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(a\), \(i\)]]L\)//.l2U)Subscript[y, i] Subscript[x, i],{i,r}]]


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]3, S_][\[Omega]_,L_,Q_]//\[CapitalGamma]3Form := Module[{M,i,j},
M = Table[Simplify[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(x\), \(i\)], 
\*SubscriptBox[\(y\), \(j\)]\)]Q\)],{i,S},{j,S}];
PrependTo[M, Subscript[y, #]&/@S];
M = Join[
{Prepend[Subscript[x, #]&/@S, \[Omega]]},
Transpose[M],
{Prepend[Table[\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(a\), \(i\)]]L\),{i,S}], "\[CapitalGamma]3"]}
];
MatrixForm[M]
];


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]3, S1_][\[Omega]1_,L1_,Q1_]\[Congruent]Subscript[\[CapitalGamma]3, S2_][\[Omega]2_,L2_,Q2_]:=(Sort[S1]===Sort[S2])\[And]Simplify[\[Omega]1==\[Omega]2]\[And]Simplify[L1==L2]\[And]Simplify[Q1==Q2]


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]4, S_][\[Omega]_,L_,Q_]//\[CapitalGamma]4Form := Module[{M,i,j,SS=Sort[S]},
M = Table[Simplify[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(y\), \(i\)], 
\*SubscriptBox[\(x\), \(j\)]\)]Q\)],{i,SS},{j,SS}];
PrependTo[M, Subscript[x, #]&/@SS];
M = Join[
{Prepend[Subscript[y, #]&/@SS, \[Omega]]},
Transpose[M],
{Prepend[Table[\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(a\), \(i\)]]L\),{i,SS}], "\[CapitalGamma]4"]}
];
MatrixForm[M]
];


(* ::Input::Initialization:: *)
\[Gamma]4=Expand/@\!\(\*SubscriptBox[\(\[CapitalGamma]4\), \({1, 2, 3}\)]\)[\[Omega],{Subscript[b, 1],Subscript[b, 2],Subscript[b, 3]}.({
 {Subscript[l, 11], Subscript[l, 12], Subscript[l, 13]},
 {Subscript[l, 21], Subscript[l, 22], Subscript[l, 23]},
 {Subscript[l, 31], Subscript[l, 32], Subscript[l, 33]}
}).{Subscript[a, 1],Subscript[a, 2],Subscript[a, 3]},{Subscript[x, 1],Subscript[x, 2],Subscript[x, 3]}.({
 {\[Alpha], \[Beta], \[Theta]},
 {\[Gamma], \[Delta], \[CurlyEpsilon]},
 {\[Phi], \[Psi], \[CapitalXi]}
}).{Subscript[y, 1],Subscript[y, 2],Subscript[y, 3]}]


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]4, sp_][\[Omega]_,L_,Q_]//\[DoubleStruckCapitalE]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] sp\)]\)[L,(Q/.Subscript[y, i_]:>Subscript[y, i]/Subscript[b, i])-Sum[(E^-\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(a\), \(i\)]]L\)//.l2U)Subscript[y, i]Subscript[x, i]/Subscript[b, i],{i,sp}],\[Omega]^-1+O[\[Epsilon]]];


(* ::Input::Initialization:: *)
\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] r_\)]\)[L_,Q_,P_]//\[CapitalGamma]4:=Subscript[\[CapitalGamma]4, r][(Normal@P)^-1,L,(Q/.Subscript[y, i_]:>Subscript[y, i] Subscript[b, i])+Sum[(E^-\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(a\), \(i\)]]L\)//.l2U)Subscript[y, i] Subscript[x, i],{i,r}]]


(* ::Input::Initialization:: *)
Subscript[\[CapitalGamma]4, S1_][\[Omega]1_,L1_,Q1_]\[Congruent]Subscript[\[CapitalGamma]4, S2_][\[Omega]2_,L2_,Q2_]:=(Sort[S1]===Sort[S2])\[And]Simplify[\[Omega]1==\[Omega]2]\[And]Simplify[L1==L2]\[And]Simplify[Q1==Q2]


(* ::Input::Initialization:: *)
Scatter[Subscript[v_, i_],\[ScriptCapitalE]_]:=Module[{z},(\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] {z}\)]\)[0,0,Subscript[v, z]]\[ScriptCapitalE]//Subscript[cm, z,i->i])[[3]]//Normal]


(* ::Input::Initialization:: *)
(\[Gamma]4p=Expand/@\!\(\*SubscriptBox[\(\[CapitalGamma]4\), \({1, 2, 3}\)]\)[1,{Subscript[b, 1],Subscript[b, 2],Subscript[b, 3]}.({
 {Subscript[l, 11], Subscript[l, 12], Subscript[l, 13]},
 {Subscript[l, 21], Subscript[l, 22], Subscript[l, 23]},
 {Subscript[l, 31], Subscript[l, 32], Subscript[l, 33]}
}).{Subscript[a, 1],Subscript[a, 2],Subscript[a, 3]},{Subscript[x, 1],Subscript[x, 2],Subscript[x, 3]}.({
 {\[Alpha], \[Beta], \[Theta]},
 {\[Gamma], \[Delta], \[CurlyEpsilon]},
 {\[Phi], \[Psi], \[CapitalXi]}
}).{Subscript[y, 1],Subscript[y, 2],Subscript[y, 3]}])//\[CapitalGamma]4Form


(* ::Input::Initialization:: *)
(\[Gamma]4pp=Expand/@\!\(\*SubscriptBox[\(\[CapitalGamma]4\), \({1, 2, 3}\)]\)[\[Omega]^-1,{Subscript[b, 1],Subscript[b, 2],Subscript[b, 3]}.({
 {Subscript[l, 11], Subscript[l, 12], Subscript[l, 13]},
 {Subscript[l, 21], Subscript[l, 22], Subscript[l, 23]},
 {Subscript[l, 31], Subscript[l, 32], Subscript[l, 33]}
}).{Subscript[a, 1],Subscript[a, 2],Subscript[a, 3]},{Subscript[x, 1],Subscript[x, 2],Subscript[x, 3]}.({
 {\[Alpha], \[Beta], \[Theta]},
 {\[Gamma], \[Delta], \[CurlyEpsilon]},
 {\[Phi], \[Psi], \[CapitalXi]}
}).{Subscript[y, 1],Subscript[y, 2],Subscript[y, 3]}])//\[CapitalGamma]4Form



