to_dt_notation#
- to_dt_notation(k)#
Serialize a knot/link diagram to DT notation.
For knots, returns a single tuple of signed odd labels. For links, returns a tuple of tuples (one per component), following the usual conventions: - Label even indices along the traversal at each crossing on the incoming over endpoint. - The sign of the paired odd label is positive/negative based on the local crossing orientation.
- Parameters:
k – Planar or oriented diagram.
- Returns:
tuple – For a knot,
(l1, l2, ..., l_{2n})
. For a link,((...), (...), ...)
.- Raises:
ValueError – If the diagram is not a knot/link in a way compatible with DT.
- Return type:
Tuple[Tuple[int, …], …] | Tuple[int, …]