Database module

pyknotid looks up knot information via a prebuilt sqlite database, accessed using the peewee ORM. Other ORMs are not currently supported.

The model class is pyknotid.catalogue.database.Knot, documented below. For generic documentation about using the database, see Knot catalogue.

pyknotid also includes functions for creating a database from scratch (using knot information from the Knot Atlas), and improving an existing database by calculating new invariants or pulling information from other sources such as the KnotInfo database. These functions can be found in pyknotid.catalogue.build and pyknotid.catalogue.improve, which are not included in the indexed documentation here.

API documentation

class pyknotid.catalogue.database.Knot(*args, **kwargs)[source]

Bases: pyknotid.catalogue.database.BaseModel

Peewee model for storing a knot in a database.

alexander = <peewee.TextField object>

Alexander polynomial, stored as a json list of coefficients from lowest to highest index, including zeros if there are any jumps in index.

alexander_imag_3 = <peewee.IntegerField object>

The absolute value of the Alexander polynomial at exp(2 pi I / 3). This will always be an integer.

alexander_imag_4 = <peewee.IntegerField object>

The absolute value of the Alexander polynomial at exp(2 pi I / 4) == I. This will always be an integer.

components

A list tuples (identifier, index), where the knot with the given identifier occurs index times.

composite = <peewee.BooleanField object>

Whether the knot is composite or not.

conway_notation = <peewee.CharField object>

Conway notation, as a string.

determinant = <peewee.IntegerField object>

The knot determinant (Alexander polynomial at -1)

dt_code = <peewee.CharField object>

Dowker-Thistlethwaite code, as a string.

fibered = <peewee.BooleanField object>

Whether the knot is fibered or not.

gauss_code = <peewee.CharField object>

Gauss code, as a string.

homfly = <peewee.TextField object>

HOMFLY-PT polynomial, stored as a json list.

hyperbolic_volume = <peewee.CharField object>

Hyperbolic volume, stored as a string to avoid precision problems.

identifier = <peewee.CharField object>

The standard knot notation, e.g. 3_1 for trefoil

jones = <peewee.TextField object>

Jones polynomial, stored as a json list of coefficients and indices for each monomial.

min_crossings = <peewee.IntegerField object>

Minimal crossing number for the knot, e.g. 3 for trefoil

name = <peewee.CharField object>

The actual name (if any), e.g. trefoil

planar_diagram = <peewee.CharField object>

Planar diagram representation, as a string.

planar_writhe = <peewee.IntegerField object>

The writhe of the minimal diagram described by the DT_code. This is not necessarily unique (see Perko pair, I think?).

pretty_print()[source]

Pretty print all information contained about self.

signature = <peewee.IntegerField object>

The knot signature

space_curve(verbose=True, **kwargs)[source]

Returns a Knot object representing this knot.

symmetry = <peewee.CharField object>

The symmetry type of the knot; reversible, positive amphichiral, negative amphichiral fully amphichiral or chiral.

two_bridge = <peewee.CharField object>

Two-bridge notation, as a string.

unknotting_number = <peewee.IntegerField object>

Unknotting number, stored as an integer.

url()[source]

The guessed url of this knot in the Knot Atlas. This page may not actually exist or be populated.

vassiliev_2 = <peewee.IntegerField object>

The Vassiliev invariant of order 2.

vassiliev_3 = <peewee.IntegerField object>

The Vassiliev invariant of order 3.