Identify module

Functions for identifying knots based on their name or invariants.

API documentation

pyknotid.catalogue.identify.first_from_invariants(*args, **kwargs)[source]

Returns the first Knot by crossing number (and arbitrary ordering within that) with the given invariant conditions.

Parameters:**kwargs – Any set of invariant conditions. The accepted arguments are the same as for from_invariants().
pyknotid.catalogue.identify.from_invariants(*args, **kwargs)[source]

Takes invariants as kwargs, and does the appropriate conversion to return a list of database objects matching all the given criteria.

Note

This only searches within the indexed database available. Some invariant options return only results where the invariant both matches and is known, others return those that match or are not known. Check the source if depending on accurate results.

Does not support all available invariants. Currently, searching is supported by:

Parameters:
  • or name or id (identifier) – The name of the knot following knot atlas conventions, e.g. ‘3_1’
  • min_crossings (int) – The minimal crossing number of the knot.
  • max_crossings (int) – The maximal known crossing number of the knot. This may be higher than its actual crossing number, it serves only to prune the results list.
  • signature (int) – The signature invariant.
  • unknotting_number (int) – The unknotting number of the knot.
  • or alex (alexander) – The Alexander polynomial, provided as a sympy expression in a single variable (ideally ‘t’).
  • or alexander_imag_2 (determinant) – The Alexander polynomial at -1 (== exp(Pi I))
  • alexander_imag_3 (int) – The abs of the Alexander polynomial at exp(2 Pi I / 3)
  • alexander_imag_4 (int) – The abs of the Alexander polynomial at exp(Pi I / 2)
  • roots (iterable) – The abs of the Alexander polnomial at the given roots, assumed to start at 2, e.g. passing (3, 2, 1) is the same as identifying at determinant=3, alexander_imag_3=2, alexander_imag_4=1. An entry of None means the value is ignored in the lookup.
  • jones (sympy) – The Jones polynomial, provided as a sympy expression in a single variable (ideally ‘q’).
  • homfly (sympy) – The HOMFLY-PT polynomial, provided as a sympy expression in two variables.
  • or hyp_vol or hypvol (hyperbolic_volume) – The hyperbolic volume of the knot complement. The lookup is a string comparison based on the given number of significant digits.
  • or vassiliev_2 or v_2 or v2 (vassiliev_order_2) – The Vassiliev invariant of order 2. This will not prune knots where this invariant is not known (specifically, those with 12 or more crossings).
  • or vassiliev_3 or v_3 or v3 (vassiliev_order_3) – The Vassiliev invariant of order 3. This will not prune knots where this invariant is not known (specifically, those with 12 or more crossings).
  • symmetry (string) – The symmetry of the knot, one of ‘reversible’, ‘positive amphicheiral’, ‘negative amphicheiral’, ‘chiral’.
  • or planar_writhe (writhe) – The writhe of the knot’s minimal diagram as recorded by its dt code. This is not necessarily unique, only the value of the dt code stored is given.
  • composite (bool) – If True, will return only composite knots. If False, will return only prime knots. Defaults to None, meaning it will return any knot type.
  • prime (bool) – If True, will return only prime knots. If False, will return only composite knots. Defaults to None, meaning it will return any knot type.
  • other (iterable) – A list of other peewee terms that can be chained in where() calls, e.g. database.Knot.min_crossings < 5. This provides more flexibility than the other options.
  • return_query (bool) – If True, returns the database iterator for the objects, otherwise returns a list. Defaults to False (i.e. the list). This will be much slower if the list is very large, but is convenient for most searches.
pyknotid.catalogue.identify.get_knot(*args, **kwargs)[source]

Returns from the database the Knot with the given identifier.

For instance, trefoil = get_knot('3_1').