Pensieve header: Programming the Kauffman bracket in the conventions of http://www.math.toronto.edu/~drorbn/papers/Categorification/QRG.pdf.

<<KnotTheory`

SetAttributes[p, Orderless]

q[1,2]===q[2,1]

p[1,2]===p[2,1]

pd=PD[Knot[8,17]]

t1=pd /. X[i_,j_,k_,l_] :> p[i,j]p[k,l]-q p[i,l]p[j,k]

t2=Expand[t1 /. PD -> Times]

t3 = t2 //. p[i_,j_]p[j_,k_] :> p[i,k]

t4 = Expand[t3 /. {p[i_,i_]->(q+1/q), p[i_,j_]^2 -> (q+1/q)}]