In[]:=
ClearAll[a1,a2,a3,b1,b2,b3,c1,c2,c3,d1,d2,d3];​​​​​​v1={a1,a2};​​v2={b1,b2};​​v3={c1,c2};​​v4={d1,d2};​​​​M={{0,1},{-1,0}}​​MatrixForm[M]​​​​n=5;​​​​(*​​"Trefoil Knot"​​e3=v1+(v1.M.v2)v2;​​e1=v2+(v2.M.v3)v3;​​e2=v3+(v3.M.v1)v1;​​soln=Solve[{v1e1,v2e2,v3e3},Modulusn];​​Length[soln];​​soln={{a1,a2},{b1,b2},{c1,c2}}/.soln;​​​​"Coloring Polynomial Treefoil"​​gPol=0;​​For[i=1,i≤Length[soln],​​gPol=gPol+q^(CountDistinct[soln[[i]]]);​​i=i+1]​​gPol​​*)​​​​"Connected sum of Hopy links"​​e2=v3+(v3.M.v1)v1;​​e3=v2+(v2.M.v4)v4;​​e1=v1+(v1.M.v3)v3;​​e4=v4+(v4.M.v3)v3;​​soln=Solve[{v1e1,v2e2,v3e3,v4e4},Modulusn];​​Length[soln]​​soln={{a1,a2},{b1,b2},{c1,c2},{d1,d2}}/.soln;​​"Note that v2 = v3 in all solutions"​​​​"Coloring Polynomial Hopf"​​gPol=0;​​For[i=1,i≤Length[soln],​​gPol=gPol+q^(CountDistinct[soln[[i]]]);​​i=i+1]​​gPol​​​​"Color configurations Hopf"​​s1=Map[PositionIndex,soln];​​s1=Map[Values,s1];​​s1=DeleteDuplicates[s1]​​​​
Out[]=
{{0,1},{-1,0}}
Out[]//MatrixForm=

0
1
-1
0

Out[]=
Connected sum of Hopy links
Out[]=
1225
Out[]=
Note that v2 = v3 in all solutions
Out[]=
Coloring Polynomial Hopf
Out[]=
25q+360
2
q
+840
3
q
Out[]=
Color configurations Hopf
Out[]=
{{{1,2,3,4}},{{1,2,3},{4}},{{1,4},{2,3}},{{1},{2,3,4}},{{1},{2,3},{4}}}