Using the LinKnot package: Difference between revisions
No edit summary |
|||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Manual TOC Sidebar}} |
{{Manual TOC Sidebar}} |
||
The Mathematica package [ |
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]!) |
|||
There are two ways ''LinKnot'' can be used along with <tt>KnotTheory`</tt>: |
There are two ways ''LinKnot'' can be used along with <tt>KnotTheory`</tt>: |
||
Line 11: | Line 13: | ||
====Using ''LinKnot'' as a "subcontractor"==== |
====Using ''LinKnot'' as a "subcontractor"==== |
||
To use ''LinKnot'' from within ''KnotTheory'', download the file <tt>LinKnot.zip</tt> from the [ |
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 35: | Line 37: | ||
====Using ''LinKnot'' in parallel with <tt>KnotTheory`</tt>==== |
====Using ''LinKnot'' in parallel with <tt>KnotTheory`</tt>==== |
||
To use ''LinKnot'' in parallel with <tt>KnotTheory`</tt>, you should [ |
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 new folder LinKnot |
# Extract LinKnot.zip anywhere (e.g., to the local disc "C:\"). It will automatically create a new folder <tt>LinKnot</tt>. |
||
⚫ | |||
⚫ | |||
⚫ | |||
<pre> |
|||
⚫ | |||
<< LinKnots` |
<< LinKnots` |
||
AppendTo[$Path, "Path to KnotTheory"]; |
AppendTo[$Path, "Path to KnotTheory"]; |
||
<< KnotTheory` |
<< KnotTheory` |
||
</pre> |
|||
For example, if |
For example, if ''LinKnot'' is installed in "C:\LinKnot" and <tt>KnotTheory`</tt> is installed at "C:\KnotTheory", run: |
||
<pre> |
|||
SetDirectory["C:\\LinKnot"]; |
SetDirectory["C:\\LinKnot"]; |
||
<< LinKnots` |
<< LinKnots` |
||
AppendTo[$Path, "C:\\"]; |
AppendTo[$Path, "C:\\"]; |
||
<< KnotTheory` |
<< KnotTheory` |
||
</pre> |
|||
Then you can work with the both programs <tt>KnotTheory`</tt> and ''LinKnot''. |
Then you can work with the both programs <tt>KnotTheory`</tt> and ''LinKnot''. |
||
If you |
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 |
After you've done this, everything should just work. If everything doesn't just work, please complain to S. Jablan (jablans@yahoo.com). |
||
Line 70: | Line 69: | ||
If you have any problem with running ''LinKnot'' (as a separate program) please do the following: |
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; |
|||
⚫ | |||
3) open the "Mathematica" notebook K2KL.nb that you will find in the directory LinKnot; |
|||
⚫ | |||
<pre> |
|||
SetDirectory["LinKnot"] |
SetDirectory["LinKnot"] |
||
<< LinKnots.m |
<< LinKnots.m |
||
</pre> |
|||
Then you can fix the appropriate path and work with ''KnotTheory'' and ''LinKnot'' as well. |
Then you can fix the appropriate path and work with ''KnotTheory'' and ''LinKnot'' as well. |
||
====See also==== |
====See also==== |
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[].
|
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:
- Extract LinKnot.zip anywhere (e.g., to the local disc "C:\"). It will automatically create a new folder LinKnot.
- 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:
- 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:
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.