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



<< KnotTheory`


SetDirectory["C:/drorbn/AcademicPensieve/2015-07/"];
Get["../Projects/MetaCalculi/MetaCalculi-Program.m"]


\[CapitalOmega]a=({
 {1/(1-Subscript[T, 1]), 0},
 {1, 1/(1-Subscript[T, 2])}
}); \[CapitalOmega]b=({
 {1/(1-Subscript[T, 1]), 1},
 {0, 1/(1-Subscript[T, 2])}
});


TestUnitarity[L_,d_] := Module[{n,\[Lambda],\[Zeta],min,max},
n=Crossings[L];
\[Lambda]=Times@@PD[L] /. X[i_,j_,k_,l_] :> If[PositiveQ[X[i,j,k,l]],Xp[l,i], Xm[j,i]];
\[Zeta]=\[CapitalGamma][Drop[\[Lambda],{d}]];
{min,max}=Sort[List@@\[Lambda][[d]]];
Do[\[Zeta]=dm[min+1,i,min+1][\[Zeta]], {i,min+2,max-1}];
If[max<2n,
Do[\[Zeta]=dm[max+1,i,max+1][\[Zeta]], {i,max+2,2n}];
Do[\[Zeta]=dm[max+1,i,max+1][\[Zeta]], {i, 1, min-1}];
\[Zeta]=d\[Sigma][min+1->1, max+1->2][\[Zeta]],
(*else*) Do[\[Zeta]=dm[1,i,1][\[Zeta]], {i, 2, min-1}];
\[Zeta]=d\[Sigma][min+1->2][\[Zeta]]
];
U=Simplify[\[Zeta]@A];
Simplify[(\[CapitalOmega]a == Transpose[U /. {Subscript[T, i_]:>1/Subscript[T, i]}].\[CapitalOmega]a.U)\[Or](\[CapitalOmega]b == Transpose[U /. {Subscript[T, i_]:>1/Subscript[T, i]}].\[CapitalOmega]b.U)]
]



