<< KnotTheory`

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

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

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

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

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

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