Modifying Knot Pages

From Knot Atlas
Jump to navigationJump to search

Knot pages on The Knot Atlas can be modified in three ways:

  • Beginner. Only the knot page being viewed is modified, and only in certain specific places.
  • Intermediate. These are modifications that effect the way all knot pages (or sometimes just all knot pages of a given class) are displayed, but no new "per knot" data is introduced.
  • Expert. Introduces new invariants, pictures or data on all knot pages.

Beginner Mode Editing: Using Existing Hooks

On every knot page there are a number of "named editing hooks"; links bearing names such as Edit 5_1 Further Notes and Views, which contain the explicit name of the knot being studied. Clicking on a named editing hook allows you to edit (wiki-style) the section that follows it on the knot page. Just for fun, put your name in the obvious place (down at the bottom) using Edit 5_1 Further Notes and Views and see how it affects the knot page 5_1.

Intermediate Mode Editing: Modifying Templates

In MediaWiki talk, each knot page conatains just one element: a template call with many parameters (the values of the various "invariants" of that knot, including names of image files, etc.). That templates renders a knot page with the given values for its invariants. So the appearance of knot pages, including the addition/modification/removal of the named editing hooks of the beginners section, can be controlled by modifying this "master" template. At the moment there are four knot tables on the Knot Atlas, and hence four master templates. These are: Template:Rolfsen Knot Page (used, for example, in 5_1), Template:Hoste-Thistlethwaite Knot Page (used in K11n13), Template:Link Page (used in L10a9) and Template:Torus Knot Page (used in T(7,6)). Each such master template contains a link to itself somewhere near its bottom, and the result is that every knot page contains somewhere near its bottom a link to the template that renders it. Find it on 5_1!

Each master template in itself calls a number of "slave" templates which render smaller parts of knot pages. Some of these slave templates, and some subsections of the master templates, can be reached directly from the knot pages with certain "unnamed editing hooks". (Find them on 5_1). Many (hopefully all!) of the slave templates used are in the Category:Invariant Template, and often their 'discussion' page describes the parameters they use.

Warning: Some slave templates are shared between several masters. So editing Template:Khovanov Homology, for example, will change the way Khovanov Homology is displayed on several types of knot pages.

Expert Mode Editing: Splicing and Data Uploading

At the moment there are two Knot Atlas experts and they do "bulk editing" (adding invariants or pictures to all knots at the same time) in two different ways (though each is/would be happy to use the other's way when appropriate).

Dror's way: Splicing

Each knot page calls a master template, assigning value to lots of parameters, and these values are the values of the various "invariants" of that knot, including honest knot-theoretic invariants, names of image files and even a long text field that renders a simulated Mathematica session. That knot page in itself is generated using Mathematica from a (wiki-editable!) "splice base", a certain text file that contains wiki commands as well as well-marked Mathematica commands. Mathematica goes over the splice base and finds the marked commands; it executes those and replaces them with the output that they produce. This action is called "splicing" and it is very similar to the action of the Mathematica Splice command.

For example, the splice base may contain a part like

 {{Rolfsen Knot Page|
   braid_index     = <*BraidIndex[K]*>

The delimeters for marked text are <* and *>, and hence the Mathematica-marked text here is BraidIndex[K]. When splicing into the page for 5_1 Mathematica sets the value of K to be Knot[5, 1], and the package KnotTheory` knows that the braid index of 5_1 is 2, and so it replaces the string <*BraidIndex[K]*> appearing in the base with the string 2. Thus the knot page for 5_1 contains a part that looks like

 {{Rolfsen Knot Page|
   braid_index     = 2

When handled by MediaWiki this becomes a call to the master template "Rolfsen Knot Page" with value 2 for the parameter braid_index. "Rolfsen Knot Page" then puts the value 2 in the appropriate place on the page 5_1.

The Mathematica program that performs all this sorcery is a Mathematica notebook, KnotPageSpliceRobot.nb. If you've gone this far, you are an expert and you'll have no difficulty figuring out how it works by downloading it and reading the instructions within the notebook and by looking at the current splice bases Rolfsen Splice Base, Hoste-Thistlethwaite Splice Base, Link Splice Base and Torus Knot Splice Base (at the bottom of every knot page you'll find a link to its parent splice base).

When running KnotPageSpliceRobot.nb you'll need the following:

  1. Mathematica.
  2. The Mathematica Package KnotTheory`
  3. The "extra definitions" file KnotTheoryExtra.m (this will eventually be incorporated into KnotTheory`).
  4. Java (usually included with Mathematica).
  5. WikiLink.
  6. And KnotPageSpliceRobot.nb, of course.

Scott's way: Data Uploading

Much of the data in the Knot Atlas is stored in separate pages, and transcluded as needed. Here's how it works.

The page Data:7_5/Jones_Polynomial contains the wiki text

<math> q^{-2} - q^{-3} +3 q^{-4} -3 q^{-5} +3 q^{-6} -3 q^{-7} +2 q^{-8} - q^{-9} </math>

Any other page can 'transclude' this text, so that it appears inline. Thus if a page contains the text

The Jones polynomial of the knot [[7_5]] is {{Data:7_5/Jones_Polynomial}}.

it will render as

The Jones polynomial of the knot [[7_5]] is <math> q^{-2} - q^{-3} +3 q^{-4} -3 q^{-5} +3 q^{-6} -3 q^{-7} +2 q^{-8} - q^{-9} </math>.