yamada_polynomial#
- yamada_polynomial(k: PlanarDiagram, normalize=True)#
Computes the Yamada polynomial of a given planar diagram using the skein relation and the contraction-deletion operation as defined in [Yamada, S. (1989). An invariant of spatial graphs. Journal of Graph Theory, 13(5), 537-551].
- Args:
k (PlanarDiagram): The input planar diagram representation normalize (bool, optional): Indicates whether to normalize the computed polynomial
by shifting the lowest degree term to ensure consistent representation. Defaults to True.
- Returns:
sympy.Expr: The expanded polynomial expression representing the Yamada polynomial of the input diagram.
- Raises:
- ValueError: If the deletion-contraction process results in mismatched loop
and arc counts, which violates the consistency of the diagram’s graphical properties.