alexander#

Alexander polynomials (one-variable and multivariable).

alexander(k, symmetric=False)#

Compute the one-variable Alexander polynomial via HOMFLY-PT specialization.

Parameters:
  • k (PlanarDiagram | OrientedPlanarDiagram) – Planar diagram of a knot or link. If not oriented, it will be oriented internally.

  • symmetric (bool) – If True, normalize to a symmetric (palindromic) representative.

Returns:

A SymPy expression in t representing the Alexander polynomial.

Return type:

Expr

Notes

Uses the substitution x=1, y=-1, z=-(t**1/2) + (t**(-1/2)) on HOMFLY-PT.

Examples

>>> # K is a diagram of the trefoil (example; adjust to your construction)
>>> # alexander(K)
t**2 - t + 1
multivariable_alexander(k)#

Alias for alexander_multivariable().

Parameters:

k (PlanarDiagram | OrientedPlanarDiagram)

Return type:

Expr

alexander_multivariable(k)#

Compute the multivariable Alexander polynomial from the abelianized Alexander matrix.

This returns the gcd (up to units) of all (n-1)×(n-1) minors of the Alexander–Fox matrix after collapsing generators to one variable per link component.

Parameters:

k (PlanarDiagram | OrientedPlanarDiagram) – Planar diagram (knot or link). If not oriented, it will be oriented internally.

Returns:

A SymPy expression in variables t1, t2, ... (one per component).

Raises:

ValueError – If minors cannot be computed due to matrix shape.

Return type:

Expr