Pensieve header: The Alexander polynomial using bridges, tunnels, and Alexander numbering.

SetDirectory["C:\\drorbn\\AcademicPensieve\\2023-12"];
Once[
<< KnotTheory`;
<< "../Talks/Oaxaca-2210/Rot.m"
]

K1=EPD[(Subscript[X, 1,2])];
K3=EPD[(Subscript[X, 1,4]),(Subscript[X, 5,2]),(Subscript[X, 3,6])];
K8=Knot[8,17];
K10=Knot[10,165];

mat[K_,flip_]:=Module[{},
{Cs,φ}=Rot[K]/.{s_,i_,j_}/;flip:>{s,j,i};
n=Length[Cs];
bridges=tunnels={};
bn=tn=0; (* completed features *)
cfb=¬flip; (* current feautre is bridge *);
cfs=0; (* current feature start *)
ν={lν=0};
ϕ={};
Q=0;
For[k=1,k<=2n,++k,
Cs/.{
{s_,k,j_}:>(
AppendTo[ϕ,bn+1];
If[¬cfb,AppendTo[tunnels,{cfs,k}]; ++tn;cfb=True;cfs=k; Q+=(T^(lν))(T-1)(Subscript[β, bn+1])(Subscript[τ, tn])];
AppendTo[ν,lν+=s];
),
{s_,i_,k}:>(
AppendTo[ϕ,tn+1];
If[cfb,AppendTo[bridges,{cfs,k}]; ++bn;cfb=False;cfs=k; Q+=(T^(lν))(1-T)(Subscript[β, bn])(Subscript[τ, tn+1]) ];
AppendTo[ν,lν-=s];
)
};
Cs/.{
{s_,k,j_}/;k>j:>(Q+=(T^(ν[[k]]))(T-1)((T^s)-1)(Subscript[β, ϕ[[k]]])(Subscript[τ, ϕ[[j]]])),
{s_,i_,k}/;k>i:>(Q+=(T^(ν[[i]]))(T-1)((T^s)-1)(Subscript[β, ϕ[[i]]])(Subscript[τ, ϕ[[k]]]))
}
];
Factor@Table[(((∂_((Subscript[β, i]),(Subscript[τ, j])))Q)/(T-1)),{i,1,bn+If[flip,1,0]},{j,1,tn+If[flip,0,1]}]
];
mat[K_]:=mat[K,False];
mat[Flip@K_]:=mat[K,True];

K=Knot[10,165]

mat[K]//MatrixForm

mat[Flip@K]//MatrixForm

Factor[mat[K]+(mat[Flip@K]\[Transpose]/.T->(T^(-1)))]

Det[mat[K]]

Alexander[K][T]