Skip to main content

A package for studying the arc diagrams of mathematical knots

Project description

PyArcKnot

PyArcKnot is a package for studying the arc diagrams of mathematical knots.

It was developed as part of my Final Project for my Industrial Design Engineering Degree, with the help and support of Pedro González Manchón. The Final Project paper (in Spanish) can be found here.

The following is just a showcase of some of the most important functions. For a more in-depth demonstration of the possibilities available, check out the Jupyter Notebook demo.

The package requires NumPy, Matplotlib, Sympy and Numba. They can be installed by running:

pip install numpy matplotlib sympy numba

To install the PyArcKnot package run:

pip install pyarcknot

The package consists of 4 modules:

import pyarcknot.knot_matrix as km
import pyarcknot.knot_diagram as kd
import pyarcknot.knot_calculate as kc
import pyarcknot.turaev_surface as ts

Knot Matrix

Knot Matrix is used to define the knot diagrams as NumPy arrays in order to be able to work with them

k8_21_arc = km.clean_k_arc('2 7 1 4 3 5 4 8 2 6 1 5 3 7 6 8')
k8_21_xco = km.xco_arc(k8_21_arc)
print(k8_21_xco)
[[0 0 0 0 0 1 0 2]
 [0 0 1 0 0 3 2 0]
 [1 0 3 0 2 0 0 0]
 [0 1 3 0 3 2 0 0]
 [0 0 0 2 3 0 3 1]
 [0 0 2 3 1 0 0 0]
 [2 3 0 1 0 0 0 0]
 [0 2 0 0 0 0 1 0]]

Knot Diagram

Knot Diagram uses Matplotlib to display diagrams of the knot.

kd.draw_arc(k8_21_xco)

arc_diagram

It can also return the number of loops in a smoothed diagram

kd.draw_diagrams(k8_21_xco)

Number of crossings = 8

arc_diagram

|s_A D| = 5

arc_diagram

arc_diagram

|s_B D| = 1

Knot Calculate

Knot Calculate is used to calculate properties of the diagram such as the Kauffman Bracket Polynomial or the Jones Polynomial. For this, Sympy was used to work with polynomials and Numba to increase the performance and reduce the calculation time.

kc.kauffman_bracket(k8_21_xco)

$\displaystyle A^{16} - 2 A^{12} + 2 A^{8} - 3 A^{4} + 3 - \frac{2}{A^{4}} + \frac{2}{A^{8}}$

kc.jones_polynomial(k8_21_xco)

$\displaystyle \frac{2}{t} - \frac{2}{t^{2}} + \frac{3}{t^{3}} - \frac{3}{t^{4}} + \frac{2}{t^{5}} - \frac{2}{t^{6}} + \frac{1}{t^{7}}$

Turaev Surface

Turaev Surface uses Matplotlib to render a 3D surface obtained from the diagram of the knot.

ts.turaev_surf(k8_21_xco)

arc_diagram

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyarcknot-0.0.2.tar.gz (10.5 kB view hashes)

Uploaded Source

Built Distribution

pyarcknot-0.0.2-py3-none-any.whl (10.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page