skein#
Implementations of Skein operations. The “A”-type smoothing is also referred to as “L_0” smoothing and the “B”-type smoothing is also referred to as “L_infinity” smoothing, see [L.H. Kauffman, “State models and the Jones polynomial” Topology , 26 (1987) pp. 395–407]
Functions
|
Converts a crossing in a planar diagram to a vertex, by projecting it to a vertex. |
|
Smoothens a specified crossing in a planar diagram using type "A", "B", or oriented ("O") smoothing, depending on the method specified. |
- smoothen_crossing(k, crossing_for_smoothing, method, inplace=False, **attr)#
Smoothens a specified crossing in a planar diagram using type “A”, “B”, or oriented (“O”) smoothing, depending on the method specified. The function modifies the connectivity of the crossing to achieve the smoothing and returns a new planar diagram with one less crossing. For example, for the crossing [1,3,4,6] and type “A” smoothing, we join the positions (0,1) and (2,3). The function will return a knot/link, where we join nodes 1 & 3 and 4 & 6. For type “B”, we join positions (1, 2) and (3, 0).
- Parameters:
k (PlanarDiagram) – The planar diagram representing the knot or link.
crossing_for_smoothing (int) – The index or identifier of the crossing in the diagram to smoothen.
method (str) – Specifies the type of smoothing to perform. Can be: - “A”: Type-A smoothing. - “B”: Type-B smoothing. - “O”: Oriented smoothing (applies “B” or “A” based on the diagram’s orientation).
inplace (bool, optional) – Indicates whether the operation is performed in-place on the input diagram. Defaults to False.
- Returns:
PlanarDiagram – A modified planar diagram with one less crossing after smoothing the specified crossing.
- Raises:
ValueError – If attempting to perform “A” or “B” smoothing on an oriented diagram, or if an invalid smoothing type is specified for non-oriented diagrams.
TypeError – If the specified crossing is not of the expected type (Crossing).
- Return type:
- crossing_to_vertex(k, crossing, inplace=False)#
Converts a crossing in a planar diagram to a vertex, by projecting it to a vertex.
- Parameters:
k (PlanarDiagram) – The planar diagram containing the crossing to be transformed.
crossing – The crossing that will be converted into a vertex.
inplace (bool, optional) – If True, modifies the PlanarDiagram in place; otherwise, creates and returns a copy with the transformation applied.
- Returns:
PlanarDiagram – The modified PlanarDiagram with the specified crossing converted into a vertex.