Skip to main content
Ctrl+K
KnotPy  documentation - Home KnotPy  documentation - Home
  • Install
  • Tutorial
  • Reference
  • Examples
  • GitHub
  • Install
  • Tutorial
  • Reference
  • Examples
  • GitHub

Section Navigation

  • Basic
    • Knot example
    • Drawing example
  • Notation
    • Parsing knots
  • Examples
  • Basic
  • Knot example

Note

Go to the end to download the full example code.

Knot example#

Compute the Jones polynomial of the trefoil knot.

import knotpy as kp

k = kp.PlanarDiagram("3_1")
print("Jones polynomial:", kp.jones_polynomial(k))

Download Jupyter notebook: example.ipynb

Download Python source code: example.py

Download zipped: example.zip

Gallery generated by Sphinx-Gallery

© Copyright 2025, Boštjan Gabrovšek.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.1.