pyarcknot


Namepyarcknot JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/inigorrix/pyarcknot
SummaryA package for studying the arc diagrams of mathematical knots
upload_time2024-01-17 16:48:25
maintainer
docs_urlNone
authorinigorrix
requires_python
licenseMIT
keywords knot knot diagram arc diagram jones polynomial turaev surface
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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](https://oa.upm.es/77063/).


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](https://github.com/inigorrix/pyarcknot_demo/blob/main/pyarcknot_demo.ipynb).

The package requires [NumPy](https://numpy.org/), [Matplotlib](https://matplotlib.org/), [Sympy](https://www.sympy.org/) and [Numba](https://numba.pydata.org/). They can be installed by running:

```bash
pip install numpy matplotlib sympy numba
```

To install the PyArcKnot package run:

```bash
pip install pyarcknot
```

The package consists of 4 modules:

```python
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](https://numpy.org/) arrays in order to be able to work with them

```python
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](https://matplotlib.org/) to display diagrams of the knot.

```python
kd.draw_arc(k8_21_xco)
```

![arc_diagram](https://github.com/inigorrix/pyarcknot/blob/main/docs/arc_diagram.png?raw=true)


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

```python
kd.draw_diagrams(k8_21_xco)
```

Number of crossings = 8

![arc_diagram](https://github.com/inigorrix/pyarcknot/blob/main/docs/smooth_a.png?raw=true)

|s_A D| = 5 

![arc_diagram](https://github.com/inigorrix/pyarcknot/blob/main/docs/arc_diagram.png?raw=true)

![arc_diagram](https://github.com/inigorrix/pyarcknot/blob/main/docs/smooth_b.png?raw=true)

|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](https://www.sympy.org/) was used to work with polynomials and [Numba](https://numba.pydata.org/) to increase the performance and reduce the calculation time.

```python
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}}$

```python
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](https://matplotlib.org/) to render a 3D surface obtained from the diagram of the knot.

```python
ts.turaev_surf(k8_21_xco)
```

![arc_diagram](https://github.com/inigorrix/pyarcknot/blob/main/docs/turaev_surface.png?raw=true)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/inigorrix/pyarcknot",
    "name": "pyarcknot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "knot,knot diagram,arc diagram,jones polynomial,turaev surface",
    "author": "inigorrix",
    "author_email": "inigorrix@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1f/2d/c36810b1507e3a2b0f7ffec5cfc89b16de69370ce1acb331158d90452fa5/pyarcknot-0.0.2.tar.gz",
    "platform": null,
    "description": "PyArcKnot\n===\n\nPyArcKnot is a package for studying the arc diagrams of mathematical knots.\n\nIt was developed as part of my Final Project for my Industrial Design Engineering Degree, with the help and support of Pedro Gonz\u00e1lez Manch\u00f3n.\nThe Final Project paper (in Spanish) can be found [here](https://oa.upm.es/77063/).\n\n\nThe following is just a showcase of some of the most important functions.\nFor a more in-depth demonstration of the possibilities available, check out the [Jupyter Notebook demo](https://github.com/inigorrix/pyarcknot_demo/blob/main/pyarcknot_demo.ipynb).\n\nThe package requires [NumPy](https://numpy.org/), [Matplotlib](https://matplotlib.org/), [Sympy](https://www.sympy.org/) and [Numba](https://numba.pydata.org/). They can be installed by running:\n\n```bash\npip install numpy matplotlib sympy numba\n```\n\nTo install the PyArcKnot package run:\n\n```bash\npip install pyarcknot\n```\n\nThe package consists of 4 modules:\n\n```python\nimport pyarcknot.knot_matrix as km\nimport pyarcknot.knot_diagram as kd\nimport pyarcknot.knot_calculate as kc\nimport pyarcknot.turaev_surface as ts\n```\n\n### Knot Matrix\n\nKnot Matrix is used to define the knot diagrams as [NumPy](https://numpy.org/) arrays in order to be able to work with them\n\n```python\nk8_21_arc = km.clean_k_arc('2 7 1 4 3 5 4 8 2 6 1 5 3 7 6 8')\nk8_21_xco = km.xco_arc(k8_21_arc)\nprint(k8_21_xco)\n```\n\t[[0 0 0 0 0 1 0 2]\n\t [0 0 1 0 0 3 2 0]\n\t [1 0 3 0 2 0 0 0]\n\t [0 1 3 0 3 2 0 0]\n\t [0 0 0 2 3 0 3 1]\n\t [0 0 2 3 1 0 0 0]\n\t [2 3 0 1 0 0 0 0]\n\t [0 2 0 0 0 0 1 0]]\n\n\n### Knot Diagram\n\nKnot Diagram uses [Matplotlib](https://matplotlib.org/) to display diagrams of the knot.\n\n```python\nkd.draw_arc(k8_21_xco)\n```\n\n![arc_diagram](https://github.com/inigorrix/pyarcknot/blob/main/docs/arc_diagram.png?raw=true)\n\n\nIt can also return the number of loops in a smoothed diagram\n\n```python\nkd.draw_diagrams(k8_21_xco)\n```\n\nNumber of crossings = 8\n\n![arc_diagram](https://github.com/inigorrix/pyarcknot/blob/main/docs/smooth_a.png?raw=true)\n\n|s_A D| = 5 \n\n![arc_diagram](https://github.com/inigorrix/pyarcknot/blob/main/docs/arc_diagram.png?raw=true)\n\n![arc_diagram](https://github.com/inigorrix/pyarcknot/blob/main/docs/smooth_b.png?raw=true)\n\n|s_B D| = 1 \n\n\n### Knot Calculate\n\nKnot Calculate is used to calculate properties of the diagram such as the Kauffman Bracket Polynomial or the Jones Polynomial.\nFor this, [Sympy](https://www.sympy.org/) was used to work with polynomials and [Numba](https://numba.pydata.org/) to increase the performance and reduce the calculation time.\n\n```python\nkc.kauffman_bracket(k8_21_xco)\n```\n\n$\\displaystyle A^{16} - 2 A^{12} + 2 A^{8} - 3 A^{4} + 3 - \\frac{2}{A^{4}} + \\frac{2}{A^{8}}$\n\n```python\nkc.jones_polynomial(k8_21_xco)\n```\n\n$\\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}}$\n\n\n### Turaev Surface\n\nTuraev Surface uses [Matplotlib](https://matplotlib.org/) to render a 3D surface obtained from the diagram of the knot.\n\n```python\nts.turaev_surf(k8_21_xco)\n```\n\n![arc_diagram](https://github.com/inigorrix/pyarcknot/blob/main/docs/turaev_surface.png?raw=true)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A package for studying the arc diagrams of mathematical knots",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/inigorrix/pyarcknot"
    },
    "split_keywords": [
        "knot",
        "knot diagram",
        "arc diagram",
        "jones polynomial",
        "turaev surface"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4591bad1f8e03edbd95a5e50c8e95ddcd32cf698dd961a6cda4ac19d8d8f233d",
                "md5": "bd0e08cf5aa9d9fbb4b722642fc8649d",
                "sha256": "6758eadcf34acad7aac3473875f38c2a844a9f10ea767cc02889ed4c6d9be3bb"
            },
            "downloads": -1,
            "filename": "pyarcknot-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bd0e08cf5aa9d9fbb4b722642fc8649d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10717,
            "upload_time": "2024-01-17T16:48:23",
            "upload_time_iso_8601": "2024-01-17T16:48:23.378479Z",
            "url": "https://files.pythonhosted.org/packages/45/91/bad1f8e03edbd95a5e50c8e95ddcd32cf698dd961a6cda4ac19d8d8f233d/pyarcknot-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f2dc36810b1507e3a2b0f7ffec5cfc89b16de69370ce1acb331158d90452fa5",
                "md5": "cc93e06afec0a52449dd96665cfb2f9b",
                "sha256": "2b265a02183365cc6ad5407d0e925f24c8c87a6a8685072b37fadafc3d4e6b96"
            },
            "downloads": -1,
            "filename": "pyarcknot-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "cc93e06afec0a52449dd96665cfb2f9b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10524,
            "upload_time": "2024-01-17T16:48:25",
            "upload_time_iso_8601": "2024-01-17T16:48:25.921400Z",
            "url": "https://files.pythonhosted.org/packages/1f/2d/c36810b1507e3a2b0f7ffec5cfc89b16de69370ce1acb331158d90452fa5/pyarcknot-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-17 16:48:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "inigorrix",
    "github_project": "pyarcknot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyarcknot"
}
        
Elapsed time: 0.17324s