Interdisciplinary Information Sciences, Vol. 9, No. 1, pp. 89–94 (2003)

An Introduction of Knotscape

Yoshiyuki NAKAGAWA

Faculty of Economics, Ryukoku University E-mail: [email protected]

Received July 1, 2002; final version accepted January 31, 2003

Knotscape is a useful Linux software for supporting the study of theory. However, not a few knot theorists give up to use Knotscape, because they do not use Linux. By preparing some files, it is certified that Knotscape can run not only on Linux but also on other operating systems. In this paper, we introduce the installation of Knotscape on other operation system and some additional help information.

KEYWORDS: Knotscape, install, FreeBSD, Microsoft Windows

1. What is Knotscape?

This paper has two purposes: to introduce the installation of Knotscape and to introduce some additional information of its manual. Knotscape [1] is a Linux freeware programmed by Jim Hoste and Morwen Thistlethwaite for supporting the study of . You can see its sample screenshot at http://dowker.math.utk.edu/png/screenshot.png. Hoste and Thistlethwaite says about Knotscape in the README file [2] of Knotscape as follows: The original purpose of Knotscape is to provide convenient access to tables of knots. Its purpose has expanded somewhat, particularly with the inclusion of the hyperbolic invariants. The binaries which calculate hyperbolic invariants are compiled against SnapPea 2.0; we are very grateful to Jeff Weeks, the author of SnapPea, for making this possible. We’d like to emphasize that we take full responsibility for any bugs that there might be in the hyperbolic part of Knotscape. At present, Knotscape will deal with knots up to 49 crossings. A database containing all prime knots of up to 16 crossings is included. Dictionaries are included in the doc directory for converting between classical numbering of knots [3] and Dowker–Thistlethwaite numbering. The doc directory also has a subdirectory, called ‘‘symmetric knots’’, containing all highly symmetric knots up to 16 crossings. These can be loaded into Knotscape and investigated. The program requires Tcl 7.4, 7.5, 7.6 or 8.0/Tk 4.0, 4.1, 4.2 or 8.0. Binaries of the executables are provided for the following two platforms: . i386 linux . sunos We can execute Knotscape not only on i386 Linux and SunOS but also on other operating systems. By changing the source a little and by installing some necessary freewares, it is certified that Knotscape can run on the following operating systems: . FreeBSD 2.2.8, 3.0, 3.4, 4.0, 4.3, 4.5 with Linux libraries . Microsoft Windows 98 Second Edition, Me, 2000, XP And also, it is known that Knotscape runs on MacOS. However, the author does not report on Knotscape on MacOS in detail, since the author has no available Macintosh. Acknowledgement We are indebted to Morwen Thistlethwaite for his permission to quote excerpts from Knotsacpe files in this report. We thank to Osamu Monta for giving me a good advice about the installation Knotscape in Microsoft Windows.

2. How to Install

2.1 Machine environment For executing Knotscape, the required specifications of the computer is in the following table: The notations in the table are as follows: Specs means the specifications; CPU means the central processing unit; MHz means mega heltzes, i.e. 106 heltzes; RAM means the random access memory; MB means mega bytes, i.e. 220 bytes; HDD means the hard disk drive; GB means giga bytes, i.e. 230 bytes. The certified specifications is not enough to execute the latest i386 Linux with X Window System. Its certified operating system is only FreeBSD 2.2.8. 90 NAKAGAWA

Table 1. Required specifcations of the computer

Certified Specs Recommend Specs Clock numbers of CPU 75 MHz 700 MHz over Size of RAM 8 MB 256 MB over Size of HDD 340 MB 2.5 GB over Size of Monitor 640 480 pixels 1024 786 pixels over Buttons of mouse 2 3, or 2 and wheel button

If you use either i386 Linux or FreeBSD, install X Window System. If the size of Monitor is less than 1024 786 pixels, you should make the window manager support at least 2 2 screens. If the mouse has only 2 buttons, emulate 3 button mouse by X server or edit the Tcl/Tk script, called linksmith procs.tcl, a little. 2.2 How to install You can download the ‘‘tarball’’ of Knotscape (5 MB over) from Thistlethwaite’s webpage: http:// dowker.math.utk.edu/knotscape.html. The ‘‘tarball’’ is one of the compressed file. The installation of Knotscape in Linux and in SunOS is written in its README file [2] as follows: Installation 1. Download the file knotscape-1.0..tar.gz, where is appropriate for your computer, and copy to the directory where you wish Knotscape to be installed. 2. Untar by typing ‘‘tar zxvf knotscape-1.0..tar.gz’’. On some systems the file has to be decompressed with gunzip before untarring with ‘‘tar xvf ...’’ A new directory ‘‘knotscape’’ will appear. 3. Change directory to the new directory ‘‘knotscape’’. 4. If necessary edit the shell script, also called ‘‘knotscape’’, to suit your system. The environment variable KSHOME should be set to the present directory. You may want to choose a different temporary directory from $KSHOME/tmp. This temporary directory is a scratch directory containing all the input and output files generated by the executables. It also contains any PostScript files generated by Knotscape. On some systems the command ‘‘wish’’ needs to be made more specific, as several different versions of Tk might be installed. Knotscape will not run on any version of Tk prior to 4.0. Finally, ensure that all files have the correct permissions. 5. Run Knotscape by typing ‘‘./knotscape’’, or simply ‘‘knotscape’’ if the current working directory is in your PATH variable The following notes are some additional information. The name of the tarball of Knotscape has been altered knotscape-1.01 .tar.bz2. Hence, if you fail to uncompress, try to untar by typing tar --bzip2 -xvf knotscape-1.01 .tar.bz2. If you use FreeBSD, do the following procedures in addition. 1. Before installing Knotscape in FreeBSD, install Linux libraries. The easiest way is to use the sysinstall command. 2. Before executing Knotscape, edit the last line of the shell script knotscape by altering ‘‘wish’’ into ‘‘wish’’. If you do not know the version number of wish, you should type wish. Then, you can see the version number, e.g. wish8.0, with a warning. Furthermore, if the version of FreeBSD is 2.2.8, do the following procedures before executing Knotscape. 1. Remove all binaries in the directory $KSHOME/bin. 2. Edit a source, called knotfind.c, in the directory $KSHOME/src for recompiling. Alter ‘‘heapsort’’ in the line 190 and 307 into ‘‘Heapsort’’. 3. Change directory to $KSHOME and recompile all sources by typing make. If you use Microsoft Windows, do the following procedures. 1. Before installing Knotscape in Microsoft Windows, install cygwin. cygwin is a UNIX environment, developed by RedHat, for Microsoft Windows since Windows 95, with the exception of Windows CE. (a) Jump to http://www.cygwin.com/. (b) Download an installer file http://www.cygwin.com/setup.exe. (c) Install all files by executing the installer. 2. When you download the tarball of Knotscape, should be selected linuxglibc. And save it at the root directory of the drive, e.g. c:\, that cygwin is installed.

This report was one of the best way, when the author introduced Knotscape at Nara Women’s University on November in 2001. Of course, you can execute Knotscape on Microsoft Windows by doing the procedures. However, the author is recommending another way to use KNOPPIX [5] nowadays. An Introduction of Knotscape 91

3. If you do not have any application for Microsoft Windows which can uncompress bzip2 file, execute cygwin for untarring the tarball as follows: (a) Change directory to root by typing cd c:. (b) Untar by typing tar --bzip2 -xvf knotscape 1.01 linuxglibc.tar.bz2. 4. After untarring the tarball, edit the shell script knotscape by using a text editor, e.g. notepad.exe. The environment variable KSHOME should be set by rewriting KSHOME=c:/knotscape 1.01. 5. Before executing Knotscape, execute cygwin and recompile all sources as follows: (a) Delete all binaries in the directory c:/knotscape 1.01/bin. (b) Change directory to c:/knotscape 1.01. (c) Recompile all sources by typing make. 6. If the mouse has only 2 buttons and no wheel, edit the Tcl/Tk script, called linksmith procs.tcl, in the directory c:\knotscape 1.01\tcl as follows: (a) Alter in the line 247 into (b) Alter in the line 248 into . By this edition, you can alter the crossing of diagram in LinkSmith by clicking the left button with pushing the Alt (or Grph) key instead of by clicking the center button (or the wheel button).

3. A Guide of Knotscape

You can see the user-friendly manual and tutorial from the Help menu of Knotscape. We extract some essential points of the Help menu and scribe some additional information in this section. 3.1 Coding for knots The contents of this subsection are based on ‘‘Notation for Knots’’ and ‘‘Entering a Knot in the Input Window’’ in the Help menu. In Knotscape, the coding of knots uses the Dowker–Thistlethwaite code. This is an enhanced version of the known notation, called the Gauss notation. The idea is to ‘‘walk round’’ the knot curve and to record crossover data on the way. 1. Let D be an n-crossing diagram D of an oriented knot K in S3. 2. Choose a starting point on K and walk round the knot curve by depending on the orientation of K. 3. Label the crossing points of D in order from 1 to 2n, whenever you pass crossing points. Then, each crossing point of K is labeled by two numbers. Each label consists of an odd number and an even number. 4. Sort the labels of crossing points in ascending order of the odd numbers. 5. Take the sequence Á of the even numbers of the sorted labels. If K is an alternative knot, this Á is known as the Dowker code. 6. If a point of K labelled by an even number is an overcrossing point, prefix a minus sign to the even number. This expansion is given by Thistlethwaite.

Fig. 1. Illustration of Dowker–Thistlethwaite code

The code depends in general on the choice of starting point and direction. However, we can see that this coding is the standard one of the diagram by taking the lexicographically least of Ás. Similarly the standard code for a knot type is the lexicographically smallest code, taken over all possible diagrams representing the knot type. 92 NAKAGAWA

The format for entering knots in Knotscape is as the following format: <#crossings>

‘‘#crossings’’ means the number of crossings of the diagram. ‘‘knot ID’’ is an arbitrary positive integer, used to label the knot K.‘‘DT code’’ means the Dowker–Thistlethwaite code of K. We call this format as the ‘‘Knotscape format’’ of K. Example: 3 1 462 4 13 4 -6 8 -2 10 121 8 1012 14 16 18 202 4 6 3.2 Useful tools of Knotscape We introduce some useful tools of Knotscape for supporting to study knots. 3.2.1 Tools for entering a knot diagram Knotscape supports three input methods for entering a knot diagram as follows: 1. Typing a Knotscape format of K manually. 2. Generating the Dowker–Thistlethwaite code of K visually by using Linksmith. 3. Typing a braid word of K manually. If you type a Knotscape format of D manually, type it in the input window directly. LinkSmith is a visual editor of links. The operation manual is written in the Help menu, ‘‘Making a Knot with LinkSmith’’. Since its operation is similar of drawing softwares, you will handle it soon.

Fig. 2. An appearance of LinkSmith

If you type a braid word of K manually, an input pannel is opened by choosing ‘‘Braid input’’ from the File menu of Knotscape. You can type the braid word as a sequence of alphabetic characters in the pannel. The braid generators 1, 1 1 1 1 2, 3, 4, ...are denoted by a, b, c, d, ..., respectively. And their inverses 1 , 2 , 3 , 4 , ...are denoted by A, B, 1 1 C, D, ..., respectively. For example, aBaB denotes the 3-braid whose closure is the figure-eight knot 12 22 . 3.2.2 A tool for drawing a smooth diagram For drawing a smooth diagram of K, you select the Knotscape format of K and choose ‘‘Draw knot’’ in the Action menu. If you use Microsoft Windows, select the Knotscape format from the first character to the last character. If you select all of the line, i.e. from the left end to the right end of the input window, you will fail in drawing. Since, in Microsoft Windows, the end of each line includes not only the line feed code but also the carrige return code, the An Introduction of Knotscape 93

Fig. 3. The 3-braid whose closure is the figure-eight knot

Fig. 4. A drawing sample of the left-handed trefoil

Knotscape format is not interpreted by Knotscape correctly. ‘‘Generating a Picture of a Knot’’ in Help menu says that the drawing engine was contributed by Ken Stephenson, and is based on W.Thurston’s algorithm for generating a circle packing from a triangulation of the unit disk. 3.2.3 Tools for the classification of knot types Knotscape supports to compute the several topological invariants of a knot. For computing them, first, you select the Knotscape format of K. Knotscape can compute the Alexander, the Jones, the HOMFLY and the Kauffman polynomial of K. For computing them, choose ‘‘Compute Polynomials’’ in the Action menu and open a ‘‘polynomials’’ pannel and check the radio button of ‘‘Alexander polynomial’’, ‘‘’’, ‘‘Homfly polynomial’’ and ‘‘Kauffman polynomial’’, respectively. Then Knotscape shows the computed polynomials by the following formats: . Alexander polynomial: <#crossings> . Jones polynomial: <#crossings> . HOMFLY polynomial: <#crossings> 2 . . . . For example, 2 6 11-1 2411 means ðv2 þ v4 v6Þz0 þðv2 þ v4Þz2. . Kauffman polynomial: <#crossings> 1 . . . . For example, 94 NAKAGAWA

-6 -2 1 1 -1 -7 -5 -2 -2 -6 -2 -2 -1 1 -7 -3 2 2 1 -6 -4 1 1 means ða6 þ a4 a2Þz0 þð2a7 2a5Þz1 þð2a6 a4 þ a2Þz2 þð2a7 þ 2a5 þ a3Þz3 þða6 þ a4Þz4. ‘‘Polynomials’’ in Help menu says that the routines for computing polynomials were written by Bruce Ewing and Kenneth Millett and that for a precise definition of the Kauffman polynomial, see Kauffman’s original paper [4]. Knotscape can find homomorphisms of the knot into the symmetric group of degree 5 by sending meridians to permutations of chosen cycle type. For finding them, choose ‘‘Find Homomorphisms’’ in the Action menu and check the radio button of the cycle type to which the meridians are sent. If you mark the ‘‘Homology’’ check button, Knotscape will also compute the first homology group of the associated branched covering space. Knotscape can compute the volume, the symmetry group, the maximal cusp neighborhood, the canonical cell decomposition of knots. For computing them, you should choose ‘‘Volume’’, ‘‘Symmetry group’’, ‘‘Maximal Cusp Neighborhood’’ and ‘‘Canonical Cell Decomposition’’ in the ‘‘Hyperbolic Invariants’’ submenu in the Action menu, respectively. And Knotscape can draw the holoball diagrams by cutting off several diameters. For drawing them, you should choose the diameter for cutting off the holoballs in the ‘‘Holoball diagrams’’ subsubmenu in the ‘‘Hyperbolic Invariants’’ submenu. However, since the computing kernel of these hyperbolic invariants is based on the kernel of SnapPea 2.0, you should use the latest version of SnapPea (3.0 for Linux [8], 2.6 for MacOS [9] and 2.6 for Microsoft Windows [6]) for computing them. ‘‘Hyperbolic Invariants’’ in the Help menu says a caveat as follows: A caveat: very occasionally, for knots of more than 16 crossings, it can happen that the computation of the canonical decomposition is adversely affected by round-off error. In such cases (which are rare), the cell decomposition produced by SnapPea has the correct underlying manifold, but isn’t canonical. For general information on the canonical decomposition, see the excellent documentation in the source code of SnapPea, which may be downloaded from http://thames.northnet.org/weeks/. In this caveat, the URL (uniform resource locator) of SnapPea is altered into http://humber.northnet.org/ weeks/index/SnapPea.html, nowadays. 3.3 How to print out the Help menu You can open and print out the Help files of Knotscape by a text editor, if necessary. All of them are put in the directory knotscape 1.01/help. They are written by plain text with a little markup symbols which show link buttons. The relation between the file names and the contents of the Help menu are as the follings: . help.draw: ‘‘Generating a Picture of a Knot’’. . help.editing: ‘‘Editing in Text Windows’’. . help.enter: ‘‘Entering a Knot in the Input Window’’ . help.homomorphisms: ‘‘Homomorphisms’’. . help.hyperbolic: ‘‘Hyperbolic Invariants’’. . help.limits: ‘‘Operational Limits’’. . help.linksmith: ‘‘Making a Knot with LinkSmith’’ . help.locate: ‘‘Locating a Knot in the Table’’. . help.notation: ‘‘Notation for Knots’’ . help.polynomials: ‘‘Polynomials’’ . help.shortcuts: ‘‘Keyboard Shortcuts’’. . help.toc: ‘‘Table of Contents’’. . help.tutorial: ‘‘Tutorial’’

REFERENCES [1] Hoste, J., and Thistlethwaite, M., ‘‘Knotscape 1.01,’’ http://dowker.math.utk.edu/knotscape.html [2] Hoste, J., and Thistlethwaite, M., ‘‘README,’’ http://dowker.math.utk.edu/download/README [3] The list of this numbering appears in the appendix of ‘‘Knots and Links’’ [7]. [4] Kauffman, L. H., ‘‘An invariant of regular isotopy,’’ Trans. Am. Math. Soc., 318: 417–471 (1990). [5] K. Knopper, ‘‘KNOPPIX 3.1,’’ http://www.knopper.net/knoppix/ [6] Manoharan, A. C., ‘‘SnapPea 2.6 for Linux,’’ http://home.att.net/%7EManoharan/SnapPea/snappea.html [7] Rolfsen, D., Knots and Links, Publish or Perish (1976). [8] Weeks, J., ‘‘SnapPea 3.0for Linux ,’’ http://humber.northnet.org/weeks/index/SnapPea3Doc/SnapPea3.html [9] Weeks, J., ‘‘SnapPea 2.6 for MacOS,’’ http://humber.northnet.org/weeks/index/SnapPea.html