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.

DoesNotExist

alias of KnotDoesNotExist

alexander = <TextField: Knot.alexander>

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 = <IntegerField: Knot.alexander_imag_3>

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

alexander_imag_4 = <IntegerField: Knot.alexander_imag_4>

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 = <BooleanField: Knot.composite>

Whether the knot is composite or not.

conway_notation = <CharField: Knot.conway_notation>

Conway notation, as a string.

determinant = <IntegerField: Knot.determinant>

The knot determinant (Alexander polynomial at -1)

dt_code = <CharField: Knot.dt_code>

Dowker-Thistlethwaite code, as a string.

fibered = <BooleanField: Knot.fibered>

Whether the knot is fibered or not.

gauss_code = <CharField: Knot.gauss_code>

Gauss code, as a string.

homfly = <TextField: Knot.homfly>

HOMFLY-PT polynomial, stored as a json list.

hyperbolic_volume = <CharField: Knot.hyperbolic_volume>

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

identifier = <CharField: Knot.identifier>

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

jones = <TextField: Knot.jones>

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

min_crossings = <IntegerField: Knot.min_crossings>

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

name = <CharField: Knot.name>

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

planar_diagram = <CharField: Knot.planar_diagram>

Planar diagram representation, as a string.

planar_writhe = <IntegerField: Knot.planar_writhe>

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 = <IntegerField: Knot.signature>

The knot signature

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

Returns a Knot object representing this knot.

symmetry = <CharField: Knot.symmetry>

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

two_bridge = <CharField: Knot.two_bridge>

Two-bridge notation, as a string.

unknotting_number = <IntegerField: Knot.unknotting_number>

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 = <IntegerField: Knot.vassiliev_2>

The Vassiliev invariant of order 2.

vassiliev_3 = <IntegerField: Knot.vassiliev_3>

The Vassiliev invariant of order 3.