Pensieve header: Read the Snappy data in DTs.txt and in Vols.txt and turn it into Vols.m

Startup

SetDirectory["C:\\drorbn\\AcademicPensieve\\Projects\\Theta\\Vols"];
<< KnotTheory`

Rot[pd_PD]:=Module[{n,xs,x,rots,Xp,Xm,front={1},k},
n=Length@pd;rots=Table[0,{2n+1}];
xs=Cases[pd,x_X:>(Piecewise[{{Xp[x[[4]],x[[1]]], PositiveQ@x}, {Xm[x[[2]],x[[1]]], True}}])];
For[k=1,k<=2n,++k,
If[FreeQ[front,-k],
front=Flatten@Replace[front,k->(xs/.{
Xp[k,l_]|Xm[l_,k]:>{l+1,k+1,-l},
Xp[l_,k]|Xm[k,l_]:>(++rots[[l]];{-l,k+1,l+1}),
_Xp|_Xm:>{}
}), {1}],
Cases[front,k|-k]/.{k,-k}:>--rots[[k]];
]
];
{xs/.{Xp[i_,j_]:>{+1,i,j}, Xm[i_,j_]:>{-1,i,j}},rots} ];
Rot[K_]:=Rot[PD[K]];

CF[ℰ_] := Expand@Collect[ℰ,(Subscript[g, __]),F]/.F->Factor;

(Subscript[T, 3])=(Subscript[T, 1])(Subscript[T, 2]);

(Subscript[F, 1])[{s_,i_,j_}]:=CF[
s(1/2-(Subscript[g, 3,i,i])+(Subscript[T, 2]^s)(Subscript[g, 1,i,i])(Subscript[g, 2,j,i])-(Subscript[g, 1,i,i])(Subscript[g, 2,j,j])-((Subscript[T, 2]^s)-1)(Subscript[g, 2,j,i])(Subscript[g, 3,i,i])+2(Subscript[g, 2,j,j])(Subscript[g, 3,i,i])-(1-(Subscript[T, 3]^s))(Subscript[g, 2,j,i])(Subscript[g, 3,j,i])-(Subscript[g, 2,i,i])(Subscript[g, 3,j,j])-(Subscript[T, 2]^s)(Subscript[g, 2,j,i])(Subscript[g, 3,j,j])+(Subscript[g, 1,i,i])(Subscript[g, 3,j,j])+(((Subscript[T, 1]^s)-1)(Subscript[g, 1,j,i])((Subscript[T, 2]^(2s))(Subscript[g, 2,j,i])-(Subscript[T, 2]^s)(Subscript[g, 2,j,j])+(Subscript[T, 2]^s)(Subscript[g, 3,j,j]))+((Subscript[T, 3]^s)-1)(Subscript[g, 3,j,i])(1-(Subscript[T, 2]^s)(Subscript[g, 1,i,i])+(Subscript[g, 2,i,j])+((Subscript[T, 2]^s)-2)(Subscript[g, 2,j,j])-((Subscript[T, 1]^s)-1)((Subscript[T, 2]^s)+1) (Subscript[g, 1,j,i])))/((Subscript[T, 2]^s)-1))]

(Subscript[F, 2])[{s0_,i0_,j0_},{s1_,i1_,j1_}]:=CF[s1((Subscript[T, 1]^s0)-1)((((Subscript[T, 2]^s1)-1))^(-1))((Subscript[T, 3]^s1)-1)(Subscript[g, 1,j1,i0])(Subscript[g, 3,j0,i1])( ((Subscript[T, 2]^s0)(Subscript[g, 2,i1,i0])-(Subscript[g, 2,i1,j0]))- ((Subscript[T, 2]^s0)(Subscript[g, 2,j1,i0])-(Subscript[g, 2,j1,j0])))]

(Subscript[F, 3])[φ_,k_]=φ (Subscript[g, 3,k,k])-φ/2;

Θ[K_]:=Θ[K]=Module[{X,φ,n,A,Δ,G,ev,θ},
(* 01 *) {X,φ}=Rot[K]; n=Length[X];
(* 02 *) A=IdentityMatrix[2n+1];
(* 03 *) Cases[X,{s_,i_,j_}:>(A[[{i,j},{i+1,j+1}]]+=(({{-(T^s), (T^s)-1}, {0, -1}})))];
(* 04 *) Δ=(T^((-Total[φ]-Total[X[[All,1]]])/2))Det[A];
(* 05 *) G=Inverse[A];
(* 06 *) ev[ℰ_]:=Factor[ℰ/.(Subscript[g, ν_,α_,β_]):>(G[[α,β]]/.T->(Subscript[T, ν]))];
(* 07 *) θ=ev[(∑_(k=1)^n)(Subscript[F, 1])[X[[k]]]];
(* 08 *) θ+=ev[(∑_(k1=1)^n)(∑_(k2=1)^n)(Subscript[F, 2])[X[[k1]],X[[k2]]]];
(* 09 *) θ+=ev[(∑_(k=1)^(2n))(Subscript[F, 3])[φ[[k]],k]];
(* 10 *) Factor@{Δ,(Δ/.T->(Subscript[T, 1]))(Δ/.T->(Subscript[T, 2]))(Δ/.T->(Subscript[T, 3]))θ}
];

{Θ[DTCode[4,6,2]], Θ[Knot[3,1]]}

Reading and Confirming the SnapPy DTs

f=OpenRead["C:\\drorbn\\AcademicPensieve\\Projects\\Theta\\Vols\\DTs.txt"];
DTs=Table[{Read[f, Word], Read[f, String]},313230]/.{K_String,dt_String}:>(Knot[K]->ToExpression@StringReplace[dt,{"[("->"DTCode[",")]"->"]"}]);
Close[f]; DTs

Total[Drop[DTs,249] /. {(K_->dt_):>(DTCode[K]==dt)}]

Short@Thread[DTCode/@AllKnots[{3,10}]==Take[DTs,249][[All,2]]]

FindInRolfsen[K_]:=Select[AllKnots[{3,10}], (Θ[K][[1]]==Θ[#][[1]]∧(Θ[K][[2]]==Θ[#][[2]]∨Θ[K][[2]]==-Θ[#][[2]]))&]

FindInRolfsen[DTCode[4,6,2]]

Table[1,249]==Length/@(FindInRolfsen/@Take[DTs,249][[All,2]])

Take[DTs,249]/.(K_->dt_):>(K=First@FindInRolfsen[dt])

f=OpenRead["C:\\drorbn\\AcademicPensieve\\Projects\\Theta\\Vols\\Vols.txt"];
Vols=Table[{Read[f, Word], Read[f, String]},313230]/.{K_String,v_String}:>(Knot[K]->ToExpression[StringReplace[v, " E"->"*^"]]);
Close[f]; Vols

Sort[Vols]>>"Vols.m"