Usage » Input

There are three ways to tell kht++ which tangle you would like to compute the invariants for:

Interactive tangle definition

Run the program without any argument:


This will start a dialogue in which you can specify the name of your tangle as well as a location for where the input and output data should be stored. The location should be in the same path as the directory from which you run the program. The program will then ask for the number of tangle ends at the top as well as for their orientation. The number of tangle ends should be positive. Knots and links are regarded as 1-1-tangles.

For example, the dialogue might look like this:

Please specify a path for this project: 
(default 'examples/tests') 
Please specify a name for this project: 
(default 'test'; only use alphanumeric characters, '-', and '_')
Specify the number of tangle ends at the top:
Specify the orientation of each strand at the top: (1=↑,0=)
0: 0
1: 1

Next, you will be asked to specify a Morse presentation for your tangle. By this we mean a decomposition into tangle slices, i.e. elementary top-bottom-tangles with a single crossing, a single cap, or a single cup. Each slice is specified by a word of the form <c><i> where

  • the slice type <c> is one of the following letters: x, y, l, r, and u. These letters are translated into elementary tangles as follows:
    • x : ⤬ (crossing with over-strand starting at top left corner)
    • y : ⤫ (crossing with over-strand starting at top right corner)
    • l : ↶ (cap, oriented to the left)
    • r : ↷ (cap, oriented to the right)
    • u : ∪ (cup)
  • The slice index <i> is the index of the left strand in a crossing/cap/cup, counted from the left, starting at 0.

Specify a word and press Enter. Then continue with the remaining tangle slices in the same way. The tangle slices that you enter will be shown in the terminal and build up your tangle step-by-step. If you find a mistake, you can delete the previous slice by typing k. If you want to start from scratch, you can quit the program by typing q. Once you have entered the whole tangle, you type . (full stop).

For example, the following code specifies the rational tangle of slope 2:

===tangle slices===
1 l2    ↓ ↑  ↶ 
| x1    ↓  ⤬  ↑ 
| y0     ⤫  ↑ ↑ 
4 u1    ↓   ͝  /

The program will then compute the tangle invariants. See Output for how to interpret the output.

Tangle definition via a .kht-file

The interactive method of defining a tangle produces a number of files in the path previously specified. In the running example above, the folder examples/tests now contains

  • the file my-test-1.kht: This is a text file containing the input tangle data; more on this below.
  • the file my-test-1.html: It contains a summary of the input and the invariants; see Output on how to interpret the latter.
  • the folder my-test-1; it contains several .svg-drawings of your tangle and various text files that contain the computed invariants.

Let us have a closer look at the .kht-file. It should look something like this:

% my-test-1

The character % in the first line signifies that this is a comment (like e.g. in $\text{\LaTeX}$ ) and will be ignored by the program. You might want to add more comments to help you remember later, why you were interested in this tangle. More generally, anything between the first occurence of the character % and the end of the line will be ignored.

The second line consists of a .-separated list of words that specify the slices of your tangle, ordered from top to bottom when read from left to right. This list can be split over multiple lines. The last slice should be followed by a comma (,) and a ,-separated list of zeros (0) and ones (1). Each of these represent the orientation of a top tangle end, ordered from left to right, using the following convention:

  • 1 means that the tangle end points upwards (↑);
  • 0 means that it points downwards (↓).

Given such a .kht-file, we can run the computation as follows:

./kht++ examples/tests/my-test-1.kht

The suffix .kht may be omitted. You can also run computations for multiple .kht-files in one go:

./kht++ <path-to-file-1> ... <path-to-file-N>

When you do this, note that any Options that you specify will apply to all computations.

Strongly invertible knots

There is a special input format for strongly invertible knots. These are knots with a certain symmetry, see for instance [9] for details. The trefoil knot admits a unique strong inversion, which is realized by the following diagram:


This diagram shows the symmetry axis as a vertical dotted line and one half of the diagram; the other half is obtained by rotation about the vertical axis by 180 degrees. The .kht-file for this strongly invertible knot looks as follows:

%  strong inversion on 3_1

The prefix s. signifies that the data should be interpreted as a strongly invertible knot. Only one orientation should be specified (as in the third line above), and it may be 0 or 1. There should be the same number of caps as there are cups. Moreover, the symmetrized diagram should have a single component only (so we get a knot, as opposed to a link with more than one component). Finally, neither caps nor cups may have slice index 0, otherwise they would intersect the axis; in particular, neither the top cap nor the bottommost cup should be specified.

For 2-bridge knots, one can use the parameter -r to generate all strong inversions, see here for details.

New from old

There are several ways to compute the invariants of new tangles from existing .kht-files by passing some optional parameters to kht++: