GithubHelp home page GithubHelp logo

igorrivin / pyknotid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spocknots/pyknotid

0.0 0.0 0.0 2.01 MB

A Python package for analysing knots and links, in space-curves or from standard topological notations

License: MIT License

Python 96.27% Cython 3.73%

pyknotid's Introduction

Pyknotid

image

Python (and optional Cython) modules for detecting and measuring knotting and linking. pyknotid can analyse space-curves, i.e. sets of points in three-dimensions, or can parse standard topological representations of knot diagrams.

pyknotid is released under the MIT license.

A graphical interface to some of these tools is available online at Knot ID.

pyknotid was originally developed as part of the Leverhulme Trust Research Programme Grant RP2013-K-009: Scientific Properties of Complex Knots (SPOCK), a collaboration between the University of Bristol and Durham University in the UK. For more information, see the SPOCK homepage.

If you use pyknotid in your research, please cite us.

Questions or comments are welcome, please email [email protected].

The knot 10_92, visualised by pyknotid.

Documentation

pyknotid is documented online at readthedocs.

Installation

pyknotid supports both Python 2.7 and Python 3.5+, you can install it with:

$ pip install pyknotid

To try the latest development version, clone this repository and run:

$ python setup.py install

Requirements

If installing pyknotid without pip, the following dependencies are required:

  • cython (not essential, but strongly recommended)
  • numpy
  • sympy
  • peewee
  • networkx
  • planarity

Most of these are not hard requirements, but some functionality will not be available if they are not present.

Example usage

In [1]: import pyknotid.spacecurves as sp

In [2]: import pyknotid.make as mk

In [3]: k = sp.Knot(mk.three_twist(num_points=100))

In [4]: k.plot()

In [5]: k.alexander_polynomial(-1)
Finding crossings
i = 0 / 97
7 crossings found

Simplifying: initially 14 crossings
-> 10 crossings after 2 runs
Out[5]: 6.9999999999999991

In [6]: import sympy as sym

In [7]: t = sym.var('t')

In [8]: k.alexander_polynomial(t)
Simplifying: initially 10 crossings
-> 10 crossings after 1 runs
Out[8]: 2/t - 3/t**2 + 2/t**3

In [9]: k.octree_simplify(5)
Run 0 of 5, 100 points remain
Run 1 of 5, 98 points remain
Run 2 of 5, 104 points remain
Run 3 of 5, 92 points remain
Run 4 of 5, 77 points remain

Reduced to 77 points

In [10]: k.plot()

pyknotid's People

Contributors

inclement avatar kalexander92 avatar dotmet avatar xcapaldi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.