(* ::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\\Projects\\HigherRank"];
Once[<<KnotTheory`; <<Rot.m];
<< FormalGaussianIntegration.m;


(* ::Input::Initialization:: *)
q[s_,i_,j_]:=Subscript[x, i]((1-T^s)Subscript[p, i+1]+(T^s-1)Subscript[p, j+1]);
Subscript[r, 1][s_,i_,j_]:=s (-1+2Subscript[p, i] Subscript[x, i]-2Subscript[p, j] Subscript[x, i]+(T^s-1)Subscript[p, i] Subscript[p, j] \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)+(1-T^s)\!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) \!\(\*SubsuperscriptBox[\(x\), \(i\), \(2\)]\)-2Subscript[p, i] Subscript[p, j] Subscript[x, i] Subscript[x, j]+2\!\(\*SubsuperscriptBox[\(p\), \(j\), \(2\)]\) Subscript[x, i] Subscript[x, j])/2;
Subscript[\[Gamma], 1][\[CurlyPhi]_,k_]:=\[Epsilon] \[CurlyPhi](1/2-Subscript[x, k] Subscript[p, k]);
\[Rho]1i[s_,i_,j_]:=T^(s/2) \[DoubleStruckCapitalE][-q[s,i,j]+\[Epsilon] Subscript[r, 1][s,i,j]+O[\[Epsilon]]^2];
\[Rho]1i[\[CurlyPhi]_,k_]:=T^(\[CurlyPhi]/2) \[DoubleStruckCapitalE][-Subscript[x, k] (Subscript[p, k]-Subscript[p, k+1])+Subscript[\[Gamma], 1][\[CurlyPhi],k]+O[\[Epsilon]]^2];
\[Rho]1i[End,k_]:=\[DoubleStruckCapitalE][-Subscript[x, k] Subscript[p, k]+O[\[Epsilon]]^2];
\[Rho]1i[K_]:=Module[{Cs,\[CurlyPhi],n,c,k,\[ScriptCapitalE]},
{Cs,\[CurlyPhi]}=Rot[K]; n=Length[Cs];
\[ScriptCapitalE]=\[Rho]1i[End,2n+1];
Do[\[ScriptCapitalE]*=\[Rho]1i@@c,{c,Cs}];
Do[\[ScriptCapitalE]*=\[Rho]1i[\[CurlyPhi][[k]],k],{k,2n}];
CF@\[ScriptCapitalE]
];
\[Rho]1vs[K_] := Union@@Table[{Subscript[x, i],Subscript[p, i]},{i,2Crossings[K]+1}]



