Skip to content

Commit

Permalink
Trac #27522: implement Conway polynomial
Browse files Browse the repository at this point in the history
as deduced from Alexander polynomial

URL: https://trac.sagemath.org/27522
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Sebastian Oehms, Travis Scrimshaw
  • Loading branch information
Release Manager committed May 22, 2022
2 parents 98e21b8 + bd2b791 commit f5c86b9
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion src/sage/knots/link.py
Expand Up @@ -37,7 +37,7 @@
- Miguel Angel Marco Buzunariz
- Amit Jamadagni
- Sebastian Oehms (October 2020, add :meth:`get_knotinfo` and meth:`is_isotopic`)
- Sebastian Oehms (October 2020, add :meth:`get_knotinfo` and :meth:`is_isotopic`)
"""

# ****************************************************************************
Expand Down Expand Up @@ -1895,6 +1895,8 @@ def alexander_polynomial(self, var='t'):
sage: L = Link(B([-2, 4, 1, 6, 1, 4]))
sage: L.alexander_polynomial()
0
.. SEEALSO:: :meth:`conway_polynomial`
"""
R = LaurentPolynomialRing(ZZ, var)
# The Alexander polynomial of disjoint links are defined to be 0
Expand All @@ -1909,6 +1911,53 @@ def alexander_polynomial(self, var='t'):
return t ** ((-max(exp) - min(exp)) // 2) * f
return f

def conway_polynomial(self):
"""
Return the Conway polynomial of ``self``.
This is closely related to the Alexander polynomial.
See :wikipedia:`Alexander_polynomial` for the definition.
EXAMPLES::
sage: B = BraidGroup(3)
sage: L = Link(B([1, -2, 1, -2]))
sage: L.conway_polynomial()
-t^2 + 1
sage: Link([[1, 5, 2, 4], [3, 9, 4, 8], [5, 1, 6, 10],
....: [7, 3, 8, 2], [9, 7, 10, 6]])
Link with 1 component represented by 5 crossings
sage: _.conway_polynomial()
2*t^2 + 1
sage: B = BraidGroup(4)
sage: L = Link(B([1,3]))
sage: L.conway_polynomial()
0
.. SEEALSO:: :meth:`alexander_polynomial`
"""
alex = self.alexander_polynomial()
L = alex.parent()
R = L.polynomial_ring()
if alex == 0:
return R.zero()

t = L.gen()
alex = alex(t**2)
exp = alex.exponents()
alex = t**((-max(exp) - min(exp)) // 2) * alex

conway = R.zero()
t_poly = R.gen()
binom = t - ~t
while alex:
M = max(alex.exponents())
coeff = alex[M]
alex -= coeff * binom**M
conway += coeff * t_poly**M
return conway

def determinant(self):
r"""
Return the determinant of ``self``.
Expand Down

0 comments on commit f5c86b9

Please sign in to comment.