Pensieve header: This notebook contains some testing code for the package KnotTheory`.

KnotTheory` Testing.nb

SetAttributes[Assert, HoldAll];
Assert[fact_] := Module[
{result=fact},
If[result===True,
True,
Print[
StringTake[ToString[Hold[fact]], {6,-2}],
" yields ", fact]
]
];

<< KnotTheory`

Assert[Jones[Link["L11n458"]][q] == Jones[DTCode[Link["L11n458"]]][q]]

Assert[Kh[PD[Knot[3,1]]][q,t]== (1/(q^3))+(1/q)+(1/((q^9) (t^3)))+(1/((q^5) (t^2)))]

Assert[Kh[PD[Knot[4,1]],Program->"FastKh"][q,t]==(1/q)+q+(1/((q^5) (t^2)))+(1/(q t))+q t+(q^5) (t^2)]

Assert[Last[Kh[TorusKnot[6,5], Modulus -> Null][q,t]] == (q^39) (t^12) ZMod[2,5]]

Assert[Alexander["K11a44",2][t] === {1-t+(t^2)}]

Assert[
Alexander["10_99",#][t]& /@ {1,2} === {{1-4 t+10 (t^2)-16 (t^3)+19 (t^4)-16 (t^5)+10 (t^6)-4 (t^7)+(t^8)},{1-2 t+3 (t^2)-2 (t^3)+(t^4)}}
]

Assert[
ArcPresentation["K11n11"] === ArcPresentation[{12,2},{1,10},{3,9},{5,11},{9,12},{4,8},{2,5},{11,7},{8,6},{7,4},{10,3},{6,1}]
]

Assert[
BR[ArcPresentation[
{12,2},{1,10},{3,9},{5,11},{9,12},{4,8},{2,5},{11,7},{8,6},{7,4},{10,3},{6,1}]
] === BR[4,{-1,2,3,3,-2,-1,-2,-1,2,3,3,3,2}]
]

Assert[(HFKHat[Knot[8,19]][t,m] /. m -> 1/t) == (4/(t^3))+(1/(t^2))]

Assert[(HFKHat[BR[Knot[8,19]]][t,m] /. m -> 1/t) == (4/(t^3))+(1/(t^2))]

Assert[(Plus@@ (AlternatingQ /@ AllKnots[8])) ==  3False+18 True]

Assert[AlternatingQ[Knot[0,1]] == True]

Assert[
MultivariableAlexander[Link["L7a7"]][t]== MultivariableAlexander[PD[Link["L7a7"]]][t]
]

Flip[X[i_,j_,k_,l_]] := If[l==j+1 || j-l>1, X[j,k,l,i], X[l,i,j,k]];
VassilievCube[{}, pdcomb_] := pdcomb;
VassilievCube[{i_, rest___}, pdcomb_] := VassilievCube[{rest},
Expand[pdcomb-(pdcomb /. pd_PD :> MapAt[Flip, pd, i])]
]

Assert[Equal[
Series[
VassilievCube[{1,2,5,7}, PD[#]]
/. pd_PD :> MultivariableAlexander[pd][t] /. t[i_] -> E^(h x[i]),
{h, 0,2}
]& /@AllLinks[7],
{((O[h])^3),((O[h])^3),((O[h])^3),((O[h])^3),((O[h])^3),((O[h])^3),((O[h])^3),((O[h])^3),((O[h])^3)}
]]

Assert[Equal[
Series[
VassilievCube[{1,2,5,7}, PD[Link[7, Alternating, 1]]]
/. pd_PD :> MultivariableAlexander[pd, Program -> "MVA1"][t] /. t[i_] -> E^(h x[i]),
{h, 0,2}
],
-2 x[1] h+(-2 ((x[1])^2)-x[1] x[2]) (h^2)+((O[h])^3)
]]

The Test Part - Graphics

TubePlot[TorusKnot[4,3]] // Show

Draw[ArcPresentation[Knot[9,17]]]