(* ::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.                                                         *)
(************************************************************************)



SetDirectory["C:\\drorbn\\AcademicPensieve\\2014-11"];
Get["../Projects/WKO4/FreeLie.m"];
Get["../Projects/WKO4/AwCalculus.m"];
$SeriesShowDegree=2;


Subscript[Z, t:(l|s)][K1_**K2_] := Subscript[Z, t][K1]**Subscript[Z, t][K2];
Subscript[Z, t:(l|s)][K1_ K2_] := Subscript[Z, t][K1]Subscript[Z, t][K2];


Subscript[\:0416Z, t:(l|s)][K1_**K2_] := Subscript[\:0416Z, t][K1]**Subscript[\:0416Z, t][K2];
Subscript[\:0416Z, t:(l|s)][K1_ K2_] := Subscript[\:0416Z, t][K1]Subscript[\:0416Z, t][K2];


SuperPlus[R][a_,b_] // Subscript[Z, t:(l|s)] := Subscript[E, t][\[LeftAngleBracket]a->LS[0], b->LS[LW@a]\[RightAngleBracket], CWS[0]];
SuperMinus[R][a_,b_] // Subscript[Z, t:(l|s)] := Subscript[E, t][\[LeftAngleBracket]a->LS[0], b->-LS[LW@a]\[RightAngleBracket], CWS[0]]


Zw[Tangle[skel_, diag_]] := Module[{res,c,k},
res=Subscript[Z, s][diag /. {SuperPlus[X]->SuperPlus[R], SuperMinus[X]->SuperMinus[R]}];
For[c=1, c<=Length[skel], ++c,
For[k=2, k<=Length[skel[[c]]], ++k,
res = res // dm[skel[[c,1]], skel[[c,k]], skel[[c,1]]]
]];
res
]


SuperPlus[R][a_,b_] // Subscript[\:0416Z, s] := (SuperPlus[R][q,b]**SuperPlus[R][a,b]**SuperMinus[R][q,a]) // Subscript[Z, s] // h\[Eta][q];
SuperMinus[R][a_,b_] // Subscript[\:0416Z, s] := (SuperPlus[R][q,a]**SuperMinus[R][a,b]**SuperMinus[R][q,b]) // Subscript[Z, s] // h\[Eta][q];


SuperPlus[R][1,2] // Subscript[\:0416Z, s]


\:0416Zw[Tangle[skel_, diag_]] := Module[{res,c,k},
res=Subscript[\:0416Z, s][diag /. {SuperPlus[X]->SuperPlus[R], SuperMinus[X]->SuperMinus[R]}];
For[c=1, c<=Length[skel], ++c,
For[k=2, k<=Length[skel[[c]]], ++k,
res = res // dm[skel[[c,1]], skel[[c,k]], skel[[c,1]]]
]];
res
]



