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


(* ::Input::Initialization:: *)
Once[<<KnotTheory`; <<RVK.m];


(* ::Input::Initialization:: *)
\[Rho][K_]:=\[Rho][K]=Module[{Cs,r,n,B,A,c,s,i,j,\[CapitalDelta],G,g,\[Rho]1},
{Cs,r}=List@@RVK[K]; n=Length[Cs]; B=Table[0,2n,2n+1];
Do[{s,i,j}=c;B[[{i,j},{i,j,i+1,j+1}]]=({
 {1, 0, -1, 0},
 {0, 1, T^s-1, -T^s}
}),{c,Cs}];
A=B[[All,2;;]];
\[CapitalDelta]=T^((Total[r]-Total[First/@Cs])/2) Det[A];
G=Prepend[Table[0,2n]][Inverse[A]]; Subscript[g, \[Alpha]_,\[Beta]_]:=G[[\[Alpha],\[Beta]]];
\[Rho]1=\[CapitalDelta]^2 Sum[{s,i,j}=c;s((1-T^s)Subscript[g, i\[InvisibleComma]j](Subscript[g, i\[InvisibleComma]j]-Subscript[g, j\[InvisibleComma]j])+2Subscript[g, i\[InvisibleComma]i] Subscript[g, i\[InvisibleComma]j]-Subscript[g, i\[InvisibleComma]j] Subscript[g, j\[InvisibleComma]i]-Subscript[g, i\[InvisibleComma]i] Subscript[g, j\[InvisibleComma]j]-Subscript[g, i\[InvisibleComma]j]+Subscript[g, j\[InvisibleComma]j]-1/2),{c,Cs}];
\[Rho]1+=\[CapitalDelta]^2 Sum[r[[k]](Subscript[g, k\[InvisibleComma]k]-1/2),{k,2n}] ;
Factor@{\[CapitalDelta],\[Rho]1}];



