A comprehensive Julia toolkit for computational knot theory: planar diagram data structures, classical invariants, polynomial invariants, Seifert theory, Reidemeister simplification, braid word interop, and import/export helpers.
using KnotTheory
k = trefoil()
println(crossing_number(k)) # 3
println(alexander_polynomial(k)) # t^-1 - 1 + t
println(jones_polynomial(k)) # -t^-4 + t^-3 + t^-1-
Planar diagram model with oriented crossings and multi-component links.
-
Code representations: PD code, DT/Dowker code, signed Gauss code, JSON serialization.
-
Classical invariants: crossing number, writhe, linking number, signature, determinant.
-
Polynomial invariants: Alexander, Jones, Conway, and HOMFLY-PT.
-
Seifert theory: Seifert circles, Seifert matrix, braid index estimate.
-
Reidemeister simplification: R1, R2, R3 moves and combined simplifier.
-
Braid word interop: convert between planar diagrams and braid words (TANGLE compatibility).
-
Knot table: built-in catalogue with named knots up to standard tables.
-
Graph conversion: Graphs.jl integration via
to_graph. -
Polynomial helpers: Polynomials.jl conversion via
to_polynomial. -
Optional plotting: CairoMakie-based diagram rendering via package extension.
| Type | Description |
|---|---|
|
Enum for edge direction ( |
|
Single crossing with strand indices and orientation |
|
Full planar diagram with crossings and components |
|
Dowker-Thistlethwaite code representation |
|
Signed Gauss code representation |
|
Named knot wrapper (e.g. |
|
Named link wrapper for multi-component objects |
| Function | Description |
|---|---|
|
The unknot (zero crossings) |
|
Trefoil knot (3_1) |
|
Figure-eight knot (4_1) |
|
Cinquefoil knot (5_1) |
|
Return the built-in knot table |
|
Look up knot table entry by name |
| Function | Description |
|---|---|
|
Minimum crossing number |
|
Sum of crossing signs |
|
Linking number for two-component links |
|
Knot signature (from Seifert matrix) |
|
Knot determinant ( |
det(V + V^T) |
) |
| Function | Description |
|---|---|
|
Alexander polynomial via Seifert matrix |
|
Jones polynomial via skein relation |
|
Conway polynomial (substitution from Alexander) |
|
HOMFLY-PT two-variable polynomial |
| Function | Description |
|---|---|
|
Seifert circle decomposition |
|
Seifert circles with strand-to-circle mapping |
|
Seifert matrix computation |
|
Lower bound on braid index from Seifert circles |
| Function | Description |
|---|---|
|
Planar diagram code (list of crossing tuples) |
|
Dowker-Thistlethwaite code |
|
Canonical conversion to planar diagram |
|
Convert to DT code |
|
Convert DT code to planar diagram |
|
Convert to signed Gauss code |
|
Convert signed Gauss code to planar diagram |
|
Serialize knot data to JSON |
|
Deserialize knot data from JSON |
| Function | Description |
|---|---|
|
Apply all Reidemeister moves until stable |
|
Reidemeister I: remove kinks |
|
Reidemeister II: cancel opposing crossings |
|
Reidemeister III: triangle move |
| Function | Description |
|---|---|
|
Construct a knot from braid word |
|
Convert knot or planar diagram to braid word |
julia --project=. -e 'using Pkg; Pkg.instantiate()'
julia --project=. -e 'using Pkg; Pkg.test()'285 tests across 25 test sets covering all exported functions, invariant consistency, and known values from knot tables.
For external consumers (e.g. Skein.jl), the minimal surface is:
-
PlanarDiagram,Crossing,DTCode,GaussCode(core representation types) -
to_pd,to_dt,to_gauss,from_dt,from_gauss(pure conversions) -
crossing_number,writhe,seifert_circles,seifert_matrix -
alexander_polynomial,jones_polynomial,conway_polynomial,homfly_polynomial -
signature,determinant -
simplify_pd,r1_simplify,r2_simplify,r3_simplify
This package intentionally does not include persistence, indexing, or database logic.
-
docs/README.mdfor documentation drafts. -
tutorials/intro.ipynbfor a minimal notebook scaffold.
-
Adams, C.C. The Knot Book. American Mathematical Society, 2004.
-
Lickorish, W.B.R. An Introduction to Knot Theory. Springer, 1997.
-
Rolfsen, D. Knots and Links. AMS Chelsea Publishing, 1976/2003.
-
Murasugi, K. Knot Theory and Its Applications. Birkhauser, 1996.
-
Kauffman, L.H. Knots and Physics. 3rd ed., World Scientific, 2001.
-
Cromwell, P.R. Knots and Links. Cambridge University Press, 2004.
-
Fox, R.H. “Free differential calculus. I.” Annals of Mathematics 57(3), 1953, pp. 547–560.
-
Freyd, P. et al. “A new polynomial invariant of knots and links.” Bulletin of the AMS 12(2), 1985, pp. 239–246.
-
Seifert, H. “Uber das Geschlecht von Knoten.” Mathematische Annalen 110, 1935, pp. 571–592.
-
Jones, V.F.R. “A polynomial invariant for knots via von Neumann algebras.” Bulletin of the AMS 12(1), 1985, pp. 103–111.