Using the LinKnot package: Difference between revisions
No edit summary |
No edit summary |
||
(12 intermediate revisions by 5 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]!) |
|||
⚫ | To use ''LinKnot'' with |
||
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}} |
|||
⚫ | |||
<!--$$AppendTo[$Path, "/path/to/LinKnots.m"];$$--> |
|||
⚫ | |||
<!--Robot Land, no human edits to "END"--> |
|||
{{In| |
|||
n = 2 | |
|||
in = <nowiki>AppendTo[$Path, "/path/to/LinKnots.m"];</nowiki>}} |
|||
<!--END--> |
|||
⚫ | |||
For example, if the directories KnotTheory and LinKnot are both at C: run: |
|||
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$$--> |
|||
<!--Robot Land, no human edits to "END"--> |
|||
{{HelpLine| |
|||
n = 3 | |
|||
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>}} |
|||
<!--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: |
||
⚫ | |||
⚫ | |||
<pre> |
|||
SetDirectory["/path/to/LinKnot/"]; |
|||
<< LinKnots` |
<< LinKnots` |
||
⚫ | |||
⚫ | |||
</pre> |
|||
For example, if ''LinKnot'' is installed in "C:\LinKnot" and <tt>KnotTheory`</tt> is installed at "C:\KnotTheory", run: |
|||
⚫ | |||
<pre> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
<< KnotTheory` |
<< KnotTheory` |
||
</pre> |
|||
⚫ | |||
⚫ | |||
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> |
|||
⚫ | |||
⚫ | |||
<< 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. |
See also [[Extending/Modifying KnotTheory`#Lessons learnt from integrating LinKnot`]] for technical details on how LinKnot` and KnotTheory` were integrated. |
Latest revision as of 07: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.