smoothen_crossing#
- smoothen_crossing(k: PlanarDiagram, crossing_for_smoothing, method: str, inplace=False)#
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).
- Args:
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).