Click here for downloading the source file.
Click here for VIRTUAL VERSION , that is, for algorithms allowing virtual crossings, and some information about invariants of virtual knots/links.
Click here for SINGULAR VERSION.
A biquandle is a function r:X\times X\to X\times X satisfying certain properties, is given as list of permutations. If r(x,y)=(sigma_x(y),\tau_y(x)), then {sigma_x: x in X} is a list of permutations, called lperms, and similarly rperms for tau.
If r(x,y)=(y,x) then rperm_x=lperm_x=id for all x. Then the data of this solution, for X={1,2,3} is encoded by
flip:=rec(lperms=[[1,2,3],[1,2,3],[1,2,3]],rperms=[[1,2,3],[1,2,3],[1,2,3]])
biq.g contains a list of biquandles of order 3 and 4, and some of order 5, taken from http://www.layer8.co.uk/maths/biquandles/index.htm, but with suitable GAP sintaxis.
They are called listquandles3, listquandles4, listbiquandles3, listbiquandles4, listbiquandles5. For instance, the second member of the listbiquandles3 is
gap> listbiquandles3[2];
rec( rperms := [ [ 1, 2, 3 ], [ 1, 3, 2 ], [ 1, 3, 2 ] ],
lperms := [ [ 1, 2, 3 ], [ 1, 3, 2 ], [ 1, 3, 2 ] ] )
For the pourpose of future use, it was convenient to have the function s, the size, and labels of a biquandle. If lperms and rpemrs is given, the function oficialbiquandle provides the rest. For example
gap> oficialbiquandle(listabiquandles3[2]);
rec( lperms := [ [ 1, 2, 3 ], [ 1, 3, 2 ], [ 1, 3, 2 ] ],
rperms := [ [ 1, 2, 3 ], [ 1, 3, 2 ], [ 1, 3, 2 ] ], size := 3,
labels := [ 1, 2, 3 ], s := [ 1, 3, 2 ] )
Given a group G, then r(x,y)=(xy^{-1}x^{-1},xy^2) is a biquandle solution, due to Wada. The function wada computes this biquandle. For example
gap> wada(CyclicGroup(3));
rec( lperms := [ [ 1, 3, 2 ], [ 1, 3, 2 ], [ 1, 3, 2 ] ],
rperms := [ [ 1, 2, 3 ], [ 3, 1, 2 ], [ 2, 3, 1 ] ], size := 3,
labels := [ < identity > of ..., f1, f1^2 ], s := [ 1, 3, 2 ] )
If R is a ring, s,t two commuting units, and M is an R-module then M is a biquandle via r(x,y)=(sy,tx+(1-st)y), it is called the Alexander biquandle. Function bialexander computes this biquandle for M=R=Z/mZ. The usage is bialexander(m,s,t). For example:
gap> bialexander(4,-1,1);
rec( lperms := [ [ 1, 4, 3, 2 ], [ 1, 4, 3, 2 ], [ 1, 4, 3, 2 ], [ 1, 4, 3, 2 ] ] ,
rperms := [ [ 1, 2, 3, 4 ], [ 3, 4, 1, 2 ], [ 1, 2, 3, 4 ], [ 3, 4, 1, 2 ] ] ,
size := 4, labels := < enumerator of (Integers mod 4) >, s := [ 1, 4, 3, 2 ] )
If C is a subset of a group G, stable under conjugation, then r(x,y)=(y,y^-1xy) is a (quandle) solution, we called conj. As an example:
gap> conj(ConjugacyClass(AlternatingGroup(4),(1,2,3)));
rec( lperms := [ [ 1, 2, 3, 4 ], [ 1, 2, 3, 4 ], [ 1, 2, 3, 4 ], [ 1, 2, 3, 4 ] ] ,
rperms := [ [ 1, 4, 2, 3 ], [ 3, 2, 4, 1 ], [ 4, 1, 3, 2 ], [ 2, 3, 1, 4 ] ] ,
size := 4, labels := [ (2,4,3), (1,2,3), (1,3,4), (1,4,2) ], s := [ 1, 2, 3, 4 ] )
If (X,r) is a biquandle, then the inverse function r^-1 is also a biquandle. The function inversebiquandle computes r^-1 as biquandle:
gap> inversebiquandle(oficialbiquandle(listabiquandles5[47]));
rec( lperms := [ [ 1, 2, 4, 3, 5 ], [ 1, 2, 4, 3, 5 ], [ 1, 5, 3, 4, 2 ],
[ 1, 5, 3, 4, 2 ], [ 1, 2, 4, 3, 5 ] ],
rperms := [ [ 1, 5, 3, 4, 2 ], [ 5, 2, 3, 4, 1 ], [ 1, 5, 3, 4, 2 ],
[ 1, 5, 3, 4, 2 ], [ 2, 1, 3, 4, 5 ] ],
size := 5,
labels := [ 1, 2, 3, 4, 5 ], s := [ 1, 2, 3, 4, 5 ] )
Function colorings consider all posible colorings of the semiarcs of a link/knot over a given biquandle and eliminates the noncompatible ones.
Function colormejor does the same thing but coloring one crossing at a time and adding one by one the rest of crossings, elimnating the non compatibles ones on the way. Gives the same answer but much faster. In both cases, the knot/link must be given as a planar diagram with sign.
Example:
gap> trefoil:=[[-1,[1,4,2,5]],[-1,[3,6,4,1]],[-1,[5,2,6,3]]];
[ [ -1, [ 1, 4, 2, 5 ] ], [ -1, [ 3, 6, 4, 1 ] ], [ -1, [ 5, 2, 6, 3 ] ] ]
gap> colormejor(trefoil,bialexander(3,1,-1));
[ [ 1, 1, 1, 1, 1, 1 ], [ 3, 1, 1, 2, 2, 3 ], [ 2, 1, 1, 3, 3, 2 ], [ 3, 2, 2, 1, 1, 3 ], [ 2, 2, 2, 2, 2, 2 ], [ 1, 2, 2, 3, 3, 1 ], [ 2, 3, 3, 1, 1, 2 ],
[ 1, 3, 3, 2, 2, 1 ], [ 3, 3, 3, 3, 3, 3 ] ]
If your knot/link is given as a usual planar diagram (i.e. without sign), see function sign below.
The function componentesconexas give the number of connected component of a link up to 4 connected components.
Function n1 gives the first semiarc of the 2nd connected component, and function ns gives the pair [first semiarc of the second component, first semiarc of the third component]. The entry is always a planar diagram with sign.
Given a list of sets, it returns the relation generated (as a partition) on the union of these sets. As example:
gap> relationgenerated([[1],[2],[3,4],[5,6],[6,2],[7,1,4]]);
[ [ 1, 3, 4, 7 ], [ 2, 5, 6 ] ]
Function unc computes generators and relations of a given biquandle, together with a prescribed set of trivial elements in X\times X. Example:
gap> unc(bialexander(3,1,-1),[]);
rec( S := [ [ ], [ 1, 1 ], [ 2, 2 ], [ 3, 3 ] ], clases := [ [ [ 1, 2 ] ], [ [ 1, 3 ] ], [ [ 2, 1 ] ], [ [ 2, 3 ] ], [ [ 3, 1 ] ], [ [ 3, 2 ] ] ],
equations := [ [ [ ], [ 1, 3 ], [ 1, 2 ], [ 3, 1 ] ], [ [ ], [ 2, 3 ], [ 2, 1 ], [ 3, 2 ] ], [ [ ], [ 3, 2 ], [ 3, 1 ], [ 2, 3 ] ],
[ [ 1, 3 ], [ 2, 1 ], [ ], [ 1, 2 ] ], [ [ 2, 3 ], [ 1, 2 ], [ ], [ 2, 1 ] ], [ [ 3, 2 ], [ 1, 3 ], [ ], [ 3, 1 ] ] ],
cocycle := [ [ 1, [ 1, 2 ], 3 ], [ 1, [ 1, 3 ], 2 ], [ 2, [ 2, 1 ], 3 ], [ 2, [ 2, 3 ], 1 ], [ 3, [ 3, 1 ], 2 ], [ 3, [ 3, 2 ], 1 ] ] )
The equations should be read in the following way: every element [a,b,c,d] means ab=cd, and [ ]=1, so for example [ [ ], [ 1, 3 ], [ 1, 2 ], [ 3, 1 ] ] means [1,3]=[1,2][3,1].
The cocycle part gives a list of possible elements to consider cohomologicaly trivial. The notation is, given \gamma:X\to G, the values of a given 2-cocycle changes under gamma via
f_\gamma=\gamma(1) f(1,2)\gamma(3) ^{-1}, etc. So in the above example (Dihedral quandle) one can see that it is possible to trivialize [ 1, 2 ] and [ 1, 3 ] simultaneously. If we do so, we get
gap> unc(bialexander(3,1,-1),[[1,2],[1,3]]);
rec( S := [ [ ], [ 1, 1 ], [ 1, 2 ], [ 1, 3 ], [ 2, 1 ], [ 2, 2 ], [ 2, 3 ], [ 3, 1 ], [ 3, 2 ], [ 3, 3 ] ], clases := [ ], equations := [ ],
cocycle := [ ] )
that is, no generators at all, the group is trivial, so every 2-cocycle is a coboundary.
The function print_equations is similar to unc but human friendly, in the above examples:
gap> print_equations(bialexander(3,1,-1),[]);
Unc have 6 generators:
f_{1}=(1,2), f_{2}=(1,3), f_{3}=(2,1), f_{4}=(2,3), f_{5}=(3,1), f_{6}=(3,2),
trivial elements:
=[ ]=[ 1, 1 ]=[ 2, 2 ]=[ 3, 3 ]
equations:
f_{2}=f_{1}f_{5}, f_{4}=f_{3}f_{6}, f_{6}=f_{5}f_{4}, f_{2}f_{3}=f_{1}, f_{4}f_{1}=f_{3}, f_{6}f_{2}=f_{5},
coboundary conditions to be consider to eventually add elements to S:
\gamma_1[ 1, 2 ]\gamma_3^{-1}, \gamma_1[ 1, 3 ]\gamma_2^{-1}, \gamma_2[ 2, 1 ]\gamma_3^{-1}, \gamma_2[ 2, 3 ]\gamma_1^{-1}, \gamma_3[ 3, 1 ]\gamma_
2^{-1}, \gamma_3[ 3, 2 ]\gamma_1^{-1},
gap> print_equations(bialexander(3,1,-1),[[1,2],[1,3]]);
Unc ={1}
trivial elements:
=[ ]=[ 1, 1 ]=[ 1, 2 ]=[ 1, 3 ]=[ 2, 1 ]=[ 2, 2 ]=[ 2, 3 ]=[ 3, 1 ]=[ 3, 2 ]=[ 3, 3 ]
equations:
coboundary conditions to be consider to eventually add elements to S:
This is a program computing the universal nc-invariant for each coloring of a given biquandle, together with a subset S\subset X\times that we declare that our cocycle is trivial. The sintaxis is
gap> invariantgen(trefoil,bialexander(3,1,-1),[]);
[ [ [ 1, 1, 1, 1, 1, 1 ],
Notice that the answer is given in the FREE group on same number of generators as unc, but no relations are included. So one has to look at unc(biquandle,[S]) in order to see if these invariants are trivial or not. For instance, they are all trivial in this case. But with the biquandle conj(ConjugacyClass(SymmetricGroup(4),(1,2,3,4))) we get nontrivial invariant.
Given a usual planar diagram, it return the same planar diagram but with signs included. It works only for knots. For example, for the trefoil:
gap> spd([[1,4,2,5],[3,6,4,1],[5,2,6,3]]);
[ [ -1, [ 1, 4, 2, 5 ] ], [ -1, [ 3, 6, 4, 1 ] ], [ -1, [ 5, 2, 6, 3 ] ] ]