Skip to content

Repository files navigation

README for Khoca, a knot homology calculator

The same text as in this README file is available (with illustrations) at http://lewark.de/lukas/khoca.html

Khoca is computer program to calculate sl(N)-homology of knots. The program has been written for joint projects with Andrew Lobb such as [3, 4]. The paper [3] also contains a description of the algorithm used by khoca. The main innovation is to use Krasner's calculation of the sl(N)-homology of the basic two-crossing tangle [2] for calculations of the homology of bipartite knots.

Khoca calculates the following:

  • Khovanov sl(2)-homology of arbitrary links, given as a braid or in PD code.
  • Khovanov-Rozansky sl(N)-homology with N > 2 of bipartite knots, given by a certain encoding of a matched diagram of the knot (see [3] and section "Encoding of matched diagrams" below).
  • Homology over the integers, the rationals or a prime field.
  • Either equivariant homology, or homology with an arbitrary fixed potential.
  • All pages of the spectral sequence of filtered homology over a field.
  • Reduced and unreduced homology.
  • Homology of sums and mirror images of knots.

You are encouraged to contact me with any kind of questions or comments regarding khoca. If you are using khoca for a project or publication, please cite this web page, or the paper [3].

1. Installation

1.1 Download of binaries

Binaries for Linux are available for download from http://lewark.de/lukas/khoca.html They should run on any Linux installation that has python3.6. Binaries for Windows or Mac are not available at the moment.

1.2 Run in a Docker container

To run Khoca in Docker type:

docker run -it soehms/khoca:latest

Its download size is 162 MB and it will need 516 MB of disk space on your device. To create a new (resp. locally own) Docker image cd to the khoca directory type

docker build -f Dockerfile --tag khoca:<your_tag>.

If your machine has an older CPU it can happen that you get Illegal Instruction errors. In that case you better should use the image soehms/khoca:old_cpu.

1.3 Installation from PyPI via pip

This installation method provides an interactive access to Khoca inside a Python session or program.

pip install khoca

or for a specific version (1.4 in the example):

pip install khoca==1.4

This also works with SageMath:

sage -pip install khoca

1.4 Source code

The source code, including instructions on how to compile it, is available at the GitHub repository khoca: https://github.com/LLewark/khoca

2. Usage

2.1 Usage at the bash prompt

To use the program, run khoca.py (a python3 script) from the command line. khoca.py takes three arguments:

  1. The coefficient ring; 0 for integers, 1 for rationals, a prime p for the corresponding finite field.

  2. A sequence of N integers a_0, ..., a_{N-1} separated by a non-digit character, defining the Frobenius algebra F[X]/(X^N + a_{N-1}X^{N-1} + ... + a_0). Alternatively, e followed by a number N for equivariant computation over sl(N). For example, -1.0.0 gives the Frobenius algebra F[X]/(X3 - 1).

  3. A root of the polynomial given in 2. for the calculation of reduced homology (for the dependence of reduced homology on a root, see [3]). For example, to get the standard graded reduced homology, use 0 as root. If you are not interested in reduced homology, it does not matter what root you chose (and khoca does not check that the number is actually a root).

The option -p will show progress bars, -v will give more verbose non-mathematical information, and -h will print a short help text. Each argument after the first three arguments, can be one of the following.

  1. BraidX calculates homology of a link given as closure of the braid X, formatted as in knotscape (a = first Artin generator, A = its inverse, b = second Artin generator, etc.). This works only for sl(2) homology, otherwise output is nonsensical.

  2. PdX calculates homology of a link given in PD notation (as e.g. given on KnotInfo). Again, this works only for sl(2) homology, otherwise output is nonsensical.

  3. GaussX calculates homology of a bipartite knot given as a matched diagram, following the convention explained in the section below. This works for sl(N) homology for all N.

  4. MirrorX takes the dual of the result at spot X.

  5. SumXY computes the homology of the connected sum of the results saved at spots X and Y (numbers separated by a non-digit character).

  6. CalcX outputs the result saved at spot X. If you forget this command, the program will have no output.

The program keeps a stack of computed homologies, enumerated 0,1,2... . Each of the commands 1 - 5 puts a new homology on that stack, whereas the command 6. prints the homology at a certain spot. This is mainly useful to compute homology of sums of knots.

Here are some examples:

./khoca.py 0 0.0 0 braidaBaB calc0

calculates the classical sl(2) Khovanov homology (both reduced and unreduced) of the closure of the braid aBaB (knotscape notation), i.e. the figure-eight knot.

./khoca.py 0 e2 0 pd[[4,2,5,1],[8,6,1,5],[6,3,7,4],[2,7,3,8]] calc0

calculates integral equivariant sl(2) homology of the figure-eight knot.

./khoca.py 7 0.-1 0 braidabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef
calc0 -p

calculates Khovanov homology of the (7,8)-torus knot over F7 with perturbed potential, displaying progress bars. This calculation takes roughly two minutes, and shows that the spectral sequence does not collapse on the second page, refuting the knight-move conjecture over finite fields (cf. [1]).

./converters/montesinos.py [1/5,1/3,-1/2]

outputs [12,4,16,10,15,9,14,13], the code for a matched diagram of the (5,3,-2)-pretzel knot, aka the (3,5)-torus knot, aka 10_{124}. So

./khoca.py 1 1.0.0.0.0 0 gauss[12,4,16,10,15,9,14,13] calc0 calculates

rational sl(5) homology and the corresponding Rasmussen invariant of the (3,5) torus knot.

./khoca.py 1 1.0 0 braidaaa dual0 sum0+1 braidaBaB sum2+3 calc4

calculates sl(2) homology of the sum of the trefoil, its mirror image and a figure-8-knot.

2.2 Usage inside a Python session or program

To use Khoca inside a Python session, function or method of a Python class you need to install it via pip (see install hint 1.3 above). In Python you can import an interactive Khoca calculator.

It's output consists of two lists of quadruples the first for reduced and the second for unreduced homology. In such a quadruple the first item stands for the t-degree, the second for the q-degree, the third for the torsion and the last item stands for the coefficient of the corresponding summand of the homology.

If the option print_messages is given, than the output contains a second result which is a list of all print messages of the command-line version.

Examples:

>>>fromkhocaimportInteractiveCalculator>>>KH=InteractiveCalculator()
>>>KHKhovanovhomologycalculatorforFrobeniusalgebra: Z[X] / (1*X^2).
>>>KH('braidaBaB')
[[[-2, 4, 0, 1], [-1, 2, 0, 1], [0, 0, 0, 1], [1, -2, 0, 1], [2, -4, 0, 1],
[-2, 4, 0, 0], [-1, 4, 0, 0], [-1, 2, 0, 0], [0, 2, 0, 0], [0, 0, 0, 0],
[1, 0, 0, 0], [1, -2, 0, 0], [2, -2, 0, 0]], [[-2, 3, 0, 1], [-2, 5, 0, 1],
[-1, 1, 0, 1], [-1, 3, 0, 1], [0, -1, 0, 1], [0, 1, 0, 1], [1, -3, 0, 1],
[1, -1, 0, 1], [2, -5, 0, 1], [2, -3, 0, 1], [-1, 3, 2, 1], [-2, 3, 0, -1],
[-1, 3, 0, -1], [-2, 5, 0, 0], [-1, 5, 0, 0], [-1, 1, 0, 0], [0, 1, 0, 0],
[-1, 3, 0, 0], [0, 3, 0, 0], [0, -1, 0, 0], [1, -1, 0, 0], [0, 1, 0, 0],
[1, 1, 0, 0], [2, -3, 2, 1], [1, -3, 0, -1], [2, -3, 0, -1], [1, -1, 0, 0],
[2, -1, 0, 0]]]
>>>res, mess=KH('braidaaa', print_messages=True); mess# doctest: +NORMALIZE_WHITESPACE
['Result:', 'Reduced Homology:', 'Non-equivariant homology:',
't^-3q^8 + t^-2q^6 + t^0q^2', 'Unreduced Homology:',
'Non-equivariant homology:', 't^-3q^9 + t^-2q^5 + t^0q^1 + t^0q^3 + t^-2q^7[2]']
>>>KH((1, 1, 1)) ==KH('braidaaa')
True>>>KH([[4,2,5,1],[8,6,1,5],[6,3,7,4],[2,7,3,8]]) ==KH('braidaBaB')
True>>>KH((1, -2, 1, -2)) ==KH('braidaBaB')
True>>>

In these examples default values for the base ring, the frobenius algebra, the root and equivariance are used. For special values of these properties you need to define specific instances of the interactive calculator. In an IPython session you may obtain more information by online-help using ?:

In [1]: fromkhocaimportInteractiveCalculatorIn [2]: InteractiveCalculator?
Initsignature:
InteractiveCalculator(
coefficient_ring=0,
frobenius_algebra=(0, 0),
root=0,
equivariant=None,
)
Docstring: Classtoallowtheusageof`Khoca`interactivelyinaPythonsession.
EXAMPLES::
>>>fromkhocaimportInteractiveCalculator
... (asabove)
>>>KH((1, -2, 1, -2)) ==KH('braidaBaB')
True>>>Initdocstring:
Constructor.
INPUT:
-``coefficient_ring``--coefficientring``F``ofthehomology. Itcanbegivenbyaninteger (orstringconvertibletoaninteger):
-``0`` (default) theringofintegers-``1``therationalfield-aprimeforthecorrespondingfinitefield-``frobenius_algebra``--theFrobeniusalgebra``F[x]/p``givenbythecoefficientsofthenormedpolynomial``p`` (defaultis``p=X^2``) asatupleoflength``deg(p)``wheretheconstanttermisthefirstentry.
-``root``--arootofthepolynomial``p`` (defaultiszero).
-``equivariant``optionalinteger``n>1``givingthedegreeof``sl(n)``forequivarianthomology. Ifthisisgiventhentheinputtothekeywordarguments``frobenius_algebra``and``root``willbeignored. Ifitisnotgiventhennonequivarianthomologywillbecalculated.
EXAMPLES::
>>>fromkhocaimportInteractiveCalculator>>>InteractiveCalculator(1, (0, 1), 0)
KhovanovhomologycalculatorforFrobeniusalgebra: Q[X] / (1*X^2+1*X).
>>>fromkhocaimportInteractiveCalculator>>>KH=InteractiveCalculator(equivariant=3); KHKhovanovhomologycalculatorforFrobeniusalgebra: Z[a, b, c][X] / (1*X^3+c*X^2+b*X+a).

To obtain the documentation of the instance-call apply ? to an instance of the calculator:

In [3]: KH=InteractiveCalculator()
In [4]: KH?
Signature: KH(link, command=None, print_messages=False, verbose=False, progress=False)
Type: InteractiveCalculator
... (asabove)
KhovanovhomologycalculatorforFrobeniusalgebra: Z[a, b, c][X] / (1*X^3+c*X^2+b*X+a).
Calldocstring:
Instancecalltoapplythecalculatortoalinkwithrespecttoacertaincommand.
INPUT:
-``link``--thelinktowhichthecalculationshouldbedone.
ItcanbegivenasaTuplewhichwillbeinterpretedasabraidinTietzeformwhichclosureisthelinkinquestion. Furtheralistoflistsisacceptedwhichwillbeinterpretedasalistofcrossingsinpd-notation. Alternativelyyoucandeclarethelinkbyastring. Thefollowingformatsareaccepted:
-``BraidX``forabraidformattedasinknotscape (``a``=firstArtingenerator, ``A``=itsinverse, ``b``=secondArtingenerator, etc.). Thisworksonlyfor``sl(2)``homology,
otherwiseoutputisnonsensical-``PdX``forinputinPDnotation (ase.g. givenon !KnotInfo).
Again, thisworksonlyfor``sl(2)``homology, otherwiseoutputisnonsensical-``GaussX``forbipartiteknotgivenasamatcheddiagram,
followingtheconventionexplainedinthesectionbelow. Thisworksfor``sl(N)``homologyforall``N``-``command``--acommandgivenasstringasexplainedinthecommandlineversionofthefunctionality. Thiscanbe:
-``MirrorX``takesthedualoftheresultatspot``X``-``SumXY``computesthehomologyoftheconnectedsumoftheresultssavedatspots``X``and``Y`` (numbersseparatedbyanon-digitcharacter)
-``CalcX` outputstheresultsavedatspotX. Ifyouforgetthiscommand, theprogramwillhavenooutputIfthiskeywordargumentisnotgivenitwillbeinterpretedas``Calc0``bydefault.
-``print_messages``boolean (defaultis``False``). Ifsetto``True``theprintoutputofthecommandlineversionisreturnedasalistonthesecondoutputposition. Bydefaultallprintmessagesto``stdout``ofthecommandlineversionaresuppressed-``verbose``boolean (defaultis``False``). Ifitissetto``True``allprintmessagesto``stdout``togetherwithspecialverbosemessagesofthecommandlineversionareprinted-``progress``boolean (defaultis``False``). Ifitissetto``True``progressbarswillbeprintedOUTPUT:
Twolistsofquadruplesthefirstforreducedandthesecondforunreducedhomology. Insuchaquadruplethefirstitemstandsfor
...
EXAMPLES::
>>>fromkhocaimportInteractiveCalculator>>>KH=InteractiveCalculator(1, (1, 0), 0); KHKhovanovhomologycalculatorforFrobeniusalgebra: Q[X] / (1*X^2+1).
>>>KH('braidaaa', 'dual0 sum0+1 braidaBaB sum2+3 calc4', print_messages=True)
([[[-5, 10, 0, 1], [-4, 8, 0, 1], [-4, 8, 0, 1], [-3, 6, 0, 1],
[-3, 6, 0, 1], [-3, 6, 0, 1], [-2, 4, 0, 1], [-2, 4, 0, 1],
[-2, 4, 0, 1], [-2, 4, 0, 1], [-2, 4, 0, 1], [-2, 4, 0, 1],
[-1, 2, 0, 1], [-1, 2, 0, 1], [-1, 2, 0, 1], [-1, 2, 0, 1],
[-1, 2, 0, 1], [-1, 2, 0, 1], [-1, 2, 0, 1], [0, 0, 0, 1],
[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1],
[0, 0, 0, 1], [0, 0, 0, 1], [1, -2, 0, 1], [1, -2, 0, 1],
[1, -2, 0, 1], [1, -2, 0, 1], [1, -2, 0, 1], [1, -2, 0, 1],
[1, -2, 0, 1], [2, -4, 0, 1], [2, -4, 0, 1], [2, -4, 0, 1],
[2, -4, 0, 1], [2, -4, 0, 1], [2, -4, 0, 1], [3, -6, 0, 1],
[3, -6, 0, 1], [3, -6, 0, 1], [4, -8, 0, 1], [4, -8, 0, 1],
[5, -10, 0, 1]], [[0, -1, 0, 1], [0, 1, 0, 1]]],
['Result:', 'Reduced Homology:', 'Non-equivariant homology:',
'Page 1:', 't^-5q^10+2t^-4q^8+3t^-3q^6+6t^-2q^4+7t^-1q^2+7t^0q^0+7t^1q^-2+6t^2q^-4+3t^3q^-6+2t^4q^-8+t^5q^-10',
'The spectral sequence collapses on the first page.\n',
'Unreduced Homology:', 'Non-equivariant homology:',
'Page 1:', 't^-5q^11+t^-4q^7+t^-4q^9+t^-3q^5+2t^-3q^7+2t^-2q^3+4t^-2q^5+4t^-1q^1+3t^-1q^3+4t^0q^-1+4t^0q^1+3t^1q^-3+4t^1q^-1+4t^2q^-5+2t^2q^-3+2t^3q^-7+t^3q^-5+t^4q^-9+t^4q^-7+t^5q^-11',
'Page 3 = infinity:', 't^0q^-1 + t^0q^1'])

3. Encoding of matched diagrams

This section describes how to encode a matched knot diagram, i.e. a diagram that consists of n copies of the basic 2-crossing tangle. Resolving each basic tangle into two intervals and a chord results in a single circle with n non-intersecting (red) chords, which may be on either side of the circle. Enumerate the 2n chord endpoints by walking around the circle. If a chord connects the points i and j, let f(i) = j. Write down the list f(1), f(2), ..., f(2n) omitting f(i) if f(i) < i. Moreover, make the list entries signed, and let the sign reflect the sign of the two crossings of the corresponding 2-crossing tangle. This list of n non-zero integers uniquely determines the matched diagram. As an example, the standard diagram of 6_1 is matched and encoded as [-4,6,5].

"Half" of Montesinos knots are bipartite [3]. You may use the python3 script ./converters/montesinos.py to obtain the encoding of a matched diagram of Montesinos knots.

4. References

[1] Bar-Natan: Fast Khovanov Homology Computations, Journal of Knot Theory and its Ramifications 16 (2007), no.3, pp. 243-255, arXiv:math/0606318, MR2320156.

[2] Daniel Krasner: A computation in Khovanov-Rozansky Homology, Fundamenta Mathematicae 203 (2009), pp. 75-95, arXiv:0801.4018, MR2491784.

[3] Lukas Lewark and Andrew Lobb: New Quantum Obstructions to Sliceness, Proceedings of the London Mathematical Society 112 (2016), no. 1, pp. 81-114, arXiv:1501.07138, MR3458146.

[4] Lukas Lewark and Andrew Lobb: Upsilon-like concordance invariants from sl(n) knot cohomology, arXiv:1707.00891.

Lukas Lewark, 2018

About

Khoca is a C++/python program for research in knot theory, a branch of pure mathematics. It computes certain Khovanov-Rozansky homologies of knots.

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages