Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade database_knotinfo to version 2024.10.1 #38822

Merged
merged 6 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/sage/databases/knotinfo_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ def _test_database(self, **options):
'fibered': ['Fibered', KnotInfoColumnTypes.OnlyKnots],
'unoriented': ['Unoriented', KnotInfoColumnTypes.OnlyLinks],
'symmetry_type': ['Symmetry Type', KnotInfoColumnTypes.OnlyKnots],
'geometric_type': ['Geometric Type', KnotInfoColumnTypes.OnlyKnots],
'cosmetic_crossing': ['Cosmetic Crossing', KnotInfoColumnTypes.OnlyKnots],
'width': ['Width', KnotInfoColumnTypes.OnlyKnots],
'arc_notation': ['Arc Notation', KnotInfoColumnTypes.OnlyLinks],
'dt_code': ['DT code', KnotInfoColumnTypes.OnlyLinks]
Expand Down Expand Up @@ -1019,6 +1021,18 @@ def _test_database(self, **options):
'reversible',
'reversible'
],
dc.geometric_type: [
'',
'torus knot T(2,3)',
'hyperbolic',
'torus knot T(2,5)',
'hyperbolic',
'hyperbolic',
'hyperbolic',
'hyperbolic',
'torus knot T(2,7)',
'hyperbolic'],
dc.cosmetic_crossing: ['', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N'],
dc.homfly_polynomial: [
'',
'(2*v^2-v^4)+v^2*z^2',
Expand Down
51 changes: 50 additions & 1 deletion src/sage/knots/knotinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@
return (1, )

braid_notation = eval_knotinfo(braid_notation)
if type(braid_notation) is list:
if type(braid_notation) in (list, tuple):
# in some cases there are a pair of braid representations
# in the database. If this is the case we select the
# corresponding to the braid index.
Expand Down Expand Up @@ -1183,6 +1183,23 @@

return None

@cached_method
def is_hyperbolic(self):
r"""
Return whether ``self`` is hyperbolic.

EXAMPLES::

sage: KnotInfo.K3_1.is_hyperbolic()
False
sage: KnotInfo.K5_2.is_hyperbolic()
True
"""
geometric_type = self[self.items.geometric_type]
if geometric_type == 'hyperbolic':
return True
return False

@cached_method
def is_alternating(self):
r"""
Expand Down Expand Up @@ -1309,6 +1326,38 @@
"""
return not knotinfo_bool(self[self.items.unoriented])

@cached_method
def cosmetic_crossing_conjecture_verified(self):
r"""
Return whether the Cosmetic Crossing Conjecture has been verified
for ``self``.

From the KnotInfo `description page <https://knotinfo.math.indiana.edu/descriptions/cosmetic_crossing.html>`__:

A crossing change in a diagram of a knot ``K`` is called cosmetic if
the resulting diagram also represents ``K``. The cosmetic crossing
conjecture posits that for any knot ``K``, the only cosmetic crossing
changes are nugatory, i.e. there exists an embedded 2-sphere in
``S3`` which intersects K only at the two points of the relevant
crossing. Conversely, it is not hard to see that any nugatory
crossing change is cosmetic.

EXAMPLES::

sage: knots = [K for K in KnotInfo if K.is_knot() and K.crossing_number() < 10]
sage: all(K.cosmetic_crossing_conjecture_verified() for K in knots)
True
"""
cosmetic_crossing = self[self.items.cosmetic_crossing]
if self.crossing_number() == 0:
return True
if not cosmetic_crossing or cosmetic_crossing == 'Unknown':
return False

Check warning on line 1355 in src/sage/knots/knotinfo.py

View check run for this annotation

Codecov / codecov/patch

src/sage/knots/knotinfo.py#L1355

Added line #L1355 was not covered by tests
verified = not knotinfo_bool(cosmetic_crossing)
if not knotinfo_bool(cosmetic_crossing):
return True
raise AssertionError(f'{self} is a counterexample to the cosmetic crossing conjecture')

Check warning on line 1359 in src/sage/knots/knotinfo.py

View check run for this annotation

Codecov / codecov/patch

src/sage/knots/knotinfo.py#L1359

Added line #L1359 was not covered by tests

@cached_method
def homfly_polynomial(self, var1='v', var2='z', original=False):
r"""
Expand Down
Loading