(* ::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"]


(* ::Input::Initialization:: *)
CF=ExpandNumerator@*ExpandDenominator@*PowerExpand@*Factor;


(* ::Input::Initialization:: *)
Subscript[\[DoubleStruckCapitalE], s1_][\[Omega]Q1__]\[Congruent]Subscript[\[DoubleStruckCapitalE], s2_][\[Omega]Q2__]:=s1===s2\[And]Simplify[{\[Omega]Q1}=={\[Omega]Q2}]


(* ::Input::Initialization:: *)
Subscript[\[DoubleStruckCapitalE], A1_->B1_][\[Omega]1_,Q1_]Subscript[\[DoubleStruckCapitalE], A2_->B2_][\[Omega]2_,Q2_]^:=Subscript[\[DoubleStruckCapitalE], A1\[Union]A2->B1\[Union]B2][\[Omega]1 \[Omega]2,Q1+Q2]


(* ::Input::Initialization:: *)
(Subscript[\[DoubleStruckCapitalE], A1_->B1_][\[Omega]1_,Q1_]//Subscript[\[DoubleStruckCapitalE], A2_->B2_][\[Omega]2_,Q2_])/; (SuperStar[B1]===A2):=Module[{i,j,E1,F1,G1,E2,F2,G2,I,M=Table},
I=IdentityMatrix@Length@B1;
E1=M[\!\(
\*SubscriptBox[\(\[PartialD]\), \(i, j\)]Q1\),{i,A1},{j,B1}]; E2=M[\!\(
\*SubscriptBox[\(\[PartialD]\), \(i, j\)]Q2\),{i,A2},{j,B2}];
F1=M[\!\(
\*SubscriptBox[\(\[PartialD]\), \(i, j\)]Q1\),{i,A1},{j,A1}]; F2=M[\!\(
\*SubscriptBox[\(\[PartialD]\), \(i, j\)]Q2\),{i,A2},{j,A2}];
G1=M[\!\(
\*SubscriptBox[\(\[PartialD]\), \(i, j\)]Q1\),{i,B1},{j,B1}]; G2=M[\!\(
\*SubscriptBox[\(\[PartialD]\), \(i, j\)]Q2\),{i,B2},{j,B2}];
Subscript[\[DoubleStruckCapitalE], A1->B2][CF[\[Omega]1 \[Omega]2 Det[I-F2.G1]^(1/2)],CF@Plus[
If[A1==={}\[Or]B2==={},0,A1.E1.Inverse[I-F2.G1].E2.B2],
If[A1==={},0,1/2 A1.(F1+E1.F2.Inverse[I-G1.F2].Transpose[E1]).A1],
If[B2==={},0,1/2 B2.(G2+Transpose[E2].G1.Inverse[I-F2.G1].E2).B2]]]]


(* ::Input::Initialization:: *)
A_\[Backslash]B_:=Complement[A,B];
(Subscript[\[DoubleStruckCapitalE], A1_->B1_][\[Omega]1_,Q1_]//Subscript[\[DoubleStruckCapitalE], A2_->B2_][\[Omega]2_,Q2_])/; (SuperStar[B1]=!=A2):=Subscript[\[DoubleStruckCapitalE], A1\[Union](A2\[Backslash]SuperStar[B1])->B1\[Union]SuperStar[A2]][\[Omega]1,Q1+Sum[SuperStar[\[Zeta]] \[Zeta],{\[Zeta],A2\[Backslash]SuperStar[B1]}]]//Subscript[\[DoubleStruckCapitalE], SuperStar[B1]\[Union]A2->B2\[Union](B1\[Backslash]SuperStar[A2])][\[Omega]2,Q2+Sum[SuperStar[z] z,{z,B1\[Backslash]SuperStar[A2]}]]


(* ::Input::Initialization:: *)
{SuperStar[p],SuperStar[x],SuperStar[\[Pi]],SuperStar[\[Xi]]}={\[Pi],\[Xi],p,x}; SuperStar[(Subscript[u_, i_])]:=Subscript[(SuperStar[u]), i]; SuperStar[l_List]:=SuperStar[#]& /@ l;


(* ::Input::Initialization:: *)
Subscript[R, i_,j_]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] {
\*SubscriptBox[\(p\), \(i\)], 
\*SubscriptBox[\(x\), \(i\)], 
\*SubscriptBox[\(p\), \(j\)], 
\*SubscriptBox[\(x\), \(j\)]}\)]\)[T^(-1/2),(1-T)Subscript[p, j] Subscript[x, j]+(T-1)Subscript[p, i] Subscript[x, j]];
Subscript[\!\(\*OverscriptBox[\(R\), \(_\)]\), i_,j_]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] {
\*SubscriptBox[\(p\), \(i\)], 
\*SubscriptBox[\(x\), \(i\)], 
\*SubscriptBox[\(p\), \(j\)], 
\*SubscriptBox[\(x\), \(j\)]}\)]\)[T^(1/2),(1-T^-1)Subscript[p, j] Subscript[x, j]+(T^-1-1)Subscript[p, i] Subscript[x, j]];
Subscript[C, i_]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] {
\*SubscriptBox[\(p\), \(i\)], 
\*SubscriptBox[\(x\), \(i\)]}\)]\)[T^(-1/2),0]; Subscript[\!\(\*OverscriptBox[\(C\), \(_\)]\), i_]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] {
\*SubscriptBox[\(p\), \(i\)], 
\*SubscriptBox[\(x\), \(i\)]}\)]\)[T^(1/2),0]; 


(* ::Input::Initialization:: *)
Subscript[hm, i_,j_->k_]:=\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({
\*SubscriptBox[\(\[Pi]\), \(i\)], 
\*SubscriptBox[\(\[Xi]\), \(i\)], 
\*SubscriptBox[\(\[Pi]\), \(j\)], 
\*SubscriptBox[\(\[Xi]\), \(j\)]} \[Rule] {
\*SubscriptBox[\(p\), \(k\)], 
\*SubscriptBox[\(x\), \(k\)]}\)]\)[1,-Subscript[\[Xi], i] Subscript[\[Pi], j]+(Subscript[\[Pi], i]+Subscript[\[Pi], j])Subscript[p, k]+(Subscript[\[Xi], i]+Subscript[\[Xi], j])Subscript[x, k]]


(* ::Input::Initialization:: *)
Subscript[\!\(\*SubscriptBox[\(\[DoubleStruckCapitalE]\), \({} \[Rule] vs_\)]\)[\[Omega]i_,Q_], \[GothicH]]:=Module[{ps,xs,M},
ps=Cases[vs,Subscript[p, _]]; xs=Cases[vs,Subscript[x, _]];
M=Table[\[Omega]i,1+Length@ps,1+Length@xs];
M[[2;;,2;;]]=Table[CF[\!\(
\*SubscriptBox[\(\[PartialD]\), \(i, j\)]Q\)],{i,ps},{j,xs}];
M[[2;;,1]]=ps; M[[1,2;;]]=xs;
Subscript[MatrixForm[M], \[GothicH]]]



