affine_index#
Affine index polynomial for knotoids.
Functions
Compute the affine index polynomial of a knotoid. |
- affine_index_polynomial(k)#
Compute the affine index polynomial of a knotoid.
The algorithm follows the standard labeling along the open arc starting from the outgoing terminal. Crossings receive weights that depend on the traversal label and crossing sign; the polynomial is then \(\sum_{c \in \text{crossings}} \operatorname{sign}(c) (t^{w(c)} - 1)\).
- Parameters:
k (PlanarDiagram | OrientedPlanarDiagram) – A planar diagram of a knotoid. If not oriented, it will be oriented internally.
- Returns:
A SymPy expression in the symbol
t
representing the affine index polynomial.- Raises:
ValueError – If a valid outgoing terminal endpoint of degree 1 cannot be found.
- Return type:
Expr
Examples
>>> from knotpy.io import read_pd # example-only; adjust to your API #TODO: !!! >>> K = read_pd("knotoid_example") >>> affine_index_polynomial(K) t**2 - 2*t + 1