(* ::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:: *)
Subscript[R\[DoubleStruckCapitalM], A_->B_]:=Module[{vs},
vs=Table[Subscript[\[Zeta], i],{i,A}]\[Union]Table[Subscript[z, i],{i,B}];
Subscript[\[DoubleStruckCapitalM], A->B][1,Sum[RandomInteger[{-3,3}]vi vj,{vi,vs},{vj,vs}], 0]
];
Subscript[\[DoubleStruckCapitalM], A_->B_][\[Omega]1_,Q1_,P1_]\[Congruent]Subscript[\[DoubleStruckCapitalM], A_->B_][\[Omega]2_,Q2_,P2_]:=Simplify[\[Omega]1==\[Omega]2\[And]Q1==Q2\[And]P1==P2];
Subscript[\[DoubleStruckCapitalM], A_->B_][\[Omega]1_,Q1_,P1_]//Subscript[\[DoubleStruckCapitalM], B_->C_][\[Omega]2_,Q2_,P2_]:=Module[{E1,F1,G1,E2,F2,G2,\[Zeta]A,zC,I},
E1=Table[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Zeta]\), \(i\)], 
\*SubscriptBox[\(z\), \(j\)]\)]Q1\),{i,A},{j,B}];
F1=Table[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Zeta]\), \(i\)], 
\*SubscriptBox[\(\[Zeta]\), \(j\)]\)]Q1\),{i,A},{j,A}];
G1=Table[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(z\), \(i\)], 
\*SubscriptBox[\(z\), \(j\)]\)]Q1\),{i,B},{j,B}];
E2=Table[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Zeta]\), \(i\)], 
\*SubscriptBox[\(z\), \(j\)]\)]Q2\),{i,B},{j,C}];
F2=Table[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(\[Zeta]\), \(i\)], 
\*SubscriptBox[\(\[Zeta]\), \(j\)]\)]Q2\),{i,B},{j,B}];
G2=Table[\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[\(z\), \(i\)], 
\*SubscriptBox[\(z\), \(j\)]\)]Q2\),{i,C},{j,C}];
\[Zeta]A=Table[Subscript[\[Zeta], i],{i,A}]; zC=Table[Subscript[z, i],{i,C}];
I=IdentityMatrix@Length@B;
Expand/@Subscript[\[DoubleStruckCapitalM], A->C][\[Omega]1 \[Omega]2 Det[I-F2.G1]^-1,\[Zeta]A.E1.Inverse[I-F2.G1].E2.zC+1/2 \[Zeta]A.(F1+E1.F2.Inverse[I-G1.F2].Transpose[E1]).\[Zeta]A+1/2 zC.(G2+Transpose[E2].G1.Inverse[I-F2.G1].E2).zC,0]
]



