Using the LinKnot package: Difference between revisions

From Knot Atlas
Jump to navigationJump to search
No edit summary
No edit summary
 
(31 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Manual TOC Sidebar}}
{{Manual TOC Sidebar}}


The Mathematica package LinKnot is a combination of two packages. The first, "Knot2000" was written by M.Ochiai and N.Imafuji. This was extended to the package "LinKnot" by S. Jablan and R. Sazdanovic. This package provides many useful things KnotTheory can't do natively; for example, it can interpret Conway notations, and, at least on Windows machines, provides nice graphics for knots, and a graphical interface for drawing knots by hand.
The Mathematica package [https://www.mi.sanu.ac.rs/vismath/linknot/ ''LinKnot''] is a combination of two packages. The first, "Knot2000" was written by M. Ochiai and N. Imafuji. This was extended to the package ''LinKnot'' by S. Jablan and R. Sazdanovic. This package provides many useful things KnotTheory can't do natively; for example, it can interpret Conway notation, and, at least on Windows machines, provides nice graphics for knots, and a graphical interface for drawing knots by hand.


(''LinKnot'' also has a [http://math.ict.edu.yu/ webMathematica interface]!)
To use LinKnot with KnotTheory, you should download LinKnot.zip from [http://katlas.math.toronto.edu/svn/LinKnot/tags/stable/] (a full LinKnot manual page is in the zip file, in the mathematica notebook <tt>K2KL.nb</tt>). Install this wherever you like, and in your Mathematica session issue a command like

There are two ways ''LinKnot'' can be used along with <tt>KnotTheory`</tt>:
* As a "subcontractor": ''LinKnot'' is mostly hidden and wrapper functions are provided to access some of its functionality from within <tt>KnotTheory`</tt>.
* In parallel: everything from both packages is visible.

The advantage for the first approach is that the interface to ''LinKnot'' is then consistent with the conventions used by <tt>KnotTheory`</tt> and the Mathematica name space remains less cluttered. The advantage of the second approach is obvious - with it, all the functionality of ''LinKnot'' is available, and not just the parts for which wrapper functions are provided within <tt>KnotTheory`</tt>.


====Using ''LinKnot'' as a "subcontractor"====
To use ''LinKnot'' from within ''KnotTheory'', download the file <tt>LinKnot.zip</tt> from the [https://www.mi.sanu.ac.rs/vismath/linknot/ LinKnot site] or from [http://katlas.math.toronto.edu/svn/LinKnot/tags/stable/ our mirror]. Unzip and install the content of <tt>LinKnot.zip</tt> wherever you like, and within Mathematica issue a command like


{{Startup Note}}
{{Startup Note}}
Line 14: Line 24:
<!--END-->
<!--END-->


After you've done this, everything should just work. (LinKnots` will only be loaded when necessary, and there might be a short delay when this happens.) If everything doesn't just work, please complain to [[User:Scott|Scott]].
After you've done this, everything should just work. (''LinKnot'' will only be loaded when necessary, and there might be a short delay when this happens.) If everything doesn't just work, please complain to [[User:Scott|Scott]].


You may find it helpful to explicitly set the path in which you've installed LinKnot (although KnotTheory tries to do this itself). Simply set LinKnotDirectory[].
In case of problems, you may find it helpful to explicitly set the path in which you've installed ''LinKnot'' (although ''KnotTheory'' tries to do this itself). Simply set <tt>LinKnotDirectory[]</tt>.


<!--$$?LinKnotDirectory$$-->
<!--$$?LinKnotDirectory$$-->
Line 23: Line 33:
n = 3 |
n = 3 |
in = <nowiki>LinKnotDirectory</nowiki> |
in = <nowiki>LinKnotDirectory</nowiki> |
out= <nowiki>LinKnotDirectory[] contains the path to the LinKnot package. It must be set correctly in order for all the (Windows only) MathLink components of LinKnot to be usable. It can be overriden by the user.</nowiki>}}
out= <nowiki>LinKnotDirectory[] contains the path to the ''LinKnot'' package. It must be set correctly in order for all the (Windows only) MathLink components of ''LinKnot'' to be usable. It can be overriden by the user.</nowiki>}}
<!--END-->
<!--END-->

====Using ''LinKnot'' in parallel with <tt>KnotTheory`</tt>====
To use ''LinKnot'' in parallel with <tt>KnotTheory`</tt>, you should [https://www.mi.sanu.ac.rs/vismath/linknot/LinKnot.zip download LinKnot.zip] from the [https://www.mi.sanu.ac.rs/vismath/linknot/ LinKnot site] (a full ''LinKnot'' manual page ManualK2KC.nb is in the zip file, and the main file is the mathematica notebook <tt>K2KL.nb</tt>). After downloading the file LinKnot.zip:

# Extract LinKnot.zip anywhere (e.g., to the local disc "C:\"). It will automatically create a new folder <tt>LinKnot</tt>.
# Set the directory to <tt>LinKnot</tt>, add the path to <tt>KnotTheory`</tt> to the Mathematica <code>$Path</code>, and run:

<pre>
SetDirectory["/path/to/LinKnot/"];
<< LinKnots`
AppendTo[$Path, "Path to KnotTheory"];
<< KnotTheory`
</pre>

For example, if ''LinKnot'' is installed in "C:\LinKnot" and <tt>KnotTheory`</tt> is installed at "C:\KnotTheory", run:

<pre>
SetDirectory["C:\\LinKnot"];
<< LinKnots`
AppendTo[$Path, "C:\\"];
<< KnotTheory`
</pre>

Then you can work with the both programs <tt>KnotTheory`</tt> and ''LinKnot''.

If you need to have the complete program ''LinKnot'' visible (with the usage, description of all ''LinKnot'' functions, ''etc''.) and run together <tt>KnotTheory`</tt> and ''LinKnot'', you can open the file <tt>K2KL.nb</tt> from the directory <tt>LinKnot</tt> and run the same command as before.

After you've done this, everything should just work. If everything doesn't just work, please complain to S. Jablan (jablans@yahoo.com).


====Further usage notes by [[User:Jablans|Jablans]]====

If you have any problem with running ''LinKnot'' (as a separate program) please do the following:

# in your ''Mathematica'' directory (e.g., C:\Program Files\Wolfram Research\Mathematica\5.0) make a new folder named LinKnot;
# extract the contents of the file LinKnot.zip into the directory LinKnot;
# open the "Mathematica" notebook K2KL.nb that you will find in the directory LinKnot;
# run the first line:

<pre>
SetDirectory["LinKnot"]
<< LinKnots.m
</pre>

Then you can fix the appropriate path and work with ''KnotTheory'' and ''LinKnot'' as well.

====See also====

See also [[Extending/Modifying KnotTheory`#Lessons learnt from integrating LinKnot`]] for technical details on how LinKnot` and KnotTheory` were integrated.

Latest revision as of 06:39, 27 May 2023


The Mathematica package LinKnot is a combination of two packages. The first, "Knot2000" was written by M. Ochiai and N. Imafuji. This was extended to the package LinKnot by S. Jablan and R. Sazdanovic. This package provides many useful things KnotTheory can't do natively; for example, it can interpret Conway notation, and, at least on Windows machines, provides nice graphics for knots, and a graphical interface for drawing knots by hand.

(LinKnot also has a webMathematica interface!)

There are two ways LinKnot can be used along with KnotTheory`:

  • As a "subcontractor": LinKnot is mostly hidden and wrapper functions are provided to access some of its functionality from within KnotTheory`.
  • In parallel: everything from both packages is visible.

The advantage for the first approach is that the interface to LinKnot is then consistent with the conventions used by KnotTheory` and the Mathematica name space remains less cluttered. The advantage of the second approach is obvious - with it, all the functionality of LinKnot is available, and not just the parts for which wrapper functions are provided within KnotTheory`.


Using LinKnot as a "subcontractor"

To use LinKnot from within KnotTheory, download the file LinKnot.zip from the LinKnot site or from our mirror. Unzip and install the content of LinKnot.zip wherever you like, and within Mathematica issue a command like

(For In[1] see Setup)

In[2]:= AppendTo[$Path, "/path/to/LinKnots.m"];

After you've done this, everything should just work. (LinKnot will only be loaded when necessary, and there might be a short delay when this happens.) If everything doesn't just work, please complain to Scott.

In case of problems, you may find it helpful to explicitly set the path in which you've installed LinKnot (although KnotTheory tries to do this itself). Simply set LinKnotDirectory[].

In[3]:= ?LinKnotDirectory
LinKnotDirectory[] contains the path to the ''LinKnot'' package. It must be set correctly in order for all the (Windows only) MathLink components of ''LinKnot'' to be usable. It can be overriden by the user.

Using LinKnot in parallel with KnotTheory`

To use LinKnot in parallel with KnotTheory`, you should download LinKnot.zip from the LinKnot site (a full LinKnot manual page ManualK2KC.nb is in the zip file, and the main file is the mathematica notebook K2KL.nb). After downloading the file LinKnot.zip:

  1. Extract LinKnot.zip anywhere (e.g., to the local disc "C:\"). It will automatically create a new folder LinKnot.
  2. Set the directory to LinKnot, add the path to KnotTheory` to the Mathematica $Path, and run:
SetDirectory["/path/to/LinKnot/"];
<< LinKnots`
AppendTo[$Path, "Path to KnotTheory"];
<< KnotTheory`

For example, if LinKnot is installed in "C:\LinKnot" and KnotTheory` is installed at "C:\KnotTheory", run:

SetDirectory["C:\\LinKnot"];
<< LinKnots`
AppendTo[$Path, "C:\\"];
<< KnotTheory`

Then you can work with the both programs KnotTheory` and LinKnot.

If you need to have the complete program LinKnot visible (with the usage, description of all LinKnot functions, etc.) and run together KnotTheory` and LinKnot, you can open the file K2KL.nb from the directory LinKnot and run the same command as before.

After you've done this, everything should just work. If everything doesn't just work, please complain to S. Jablan (jablans@yahoo.com).


Further usage notes by Jablans

If you have any problem with running LinKnot (as a separate program) please do the following:

  1. in your Mathematica directory (e.g., C:\Program Files\Wolfram Research\Mathematica\5.0) make a new folder named LinKnot;
  2. extract the contents of the file LinKnot.zip into the directory LinKnot;
  3. open the "Mathematica" notebook K2KL.nb that you will find in the directory LinKnot;
  4. run the first line:
SetDirectory["LinKnot"]
<< LinKnots.m

Then you can fix the appropriate path and work with KnotTheory and LinKnot as well.

See also

See also Extending/Modifying KnotTheory`#Lessons learnt from integrating LinKnot` for technical details on how LinKnot` and KnotTheory` were integrated.