<< KnotTheory`

wAlex[gc_GC] := {
Aij[Ar[ti_,hi_,si_], Ar[tj_,hj_,sj_]] := If[
ti<hj<hi || hi<hj<ti,
(X^(si)-1)*Sign[hi-ti],
0
];
MatrixForm[A=Outer[Aij,List@@gc, List@@gc]],
Tr[Inverse[
IdentityMatrix[Length[A]] - A
]]-Length[A] //Together // ExpandNumerator,
Det[
IdentityMatrix[Length[A]] - A
] //Together // ExpandNumerator
};
wAlex[K_] := Join[{
pd=PD[K],
gc=GC @@ pd /. X[i_,j_,k_,l_] :> If[PositiveQ[X[i,j,k,l]],
Ar[l,i,+1], Ar[j,i,-1]
]
},
wAlex[gc]
]

wAlex[BR[2,{1,1,1}]]

wAlex[BR[3,{1,2,1,2}]]

wAlex[BR[3,{1,2,1,1,-1,2}]]

wAlex[BR[3,{1,2,1,2,-2,2}]]

wAlex[Knot[4,1]]

Simplify[((-1+2 X)/(X^2))+(((-1+2 X)/(X^2))/. X-> 1/X)]

wAlex[Mirror[Knot[4,1]]]

Simplify[((-2+6 X-4 (X^2)+(X^3))/X)+(((-2+6 X-4 (X^2)+(X^3))/X)/. X-> 1/X)]

wAlex[Knot[5,1]]

wAlex[Knot[10,132]]

wAlex[GC[Ar[1,3,+1],Ar[4,2,+1]]]