Skip to content

Commit 2af7613

Browse files
author
Release Manager
committed
sagemathgh-38822: Upgrade database_knotinfo to version 2024.10.1 <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> The current `database_knotinfo` version 2024.10.1 is no longer compatible with Sage because the syntax for 16 knots for which two braid notations are recorded has changed (see the corresponding [Release Notes ](https://github.com/soehms/database_knotinfo/releases/tag/2024.10.1)). This is fixed by this PR. In addition, two new fields (`geometric_type` and `cosmetic_crossing`) added in this version are used to implement corresponding methods (`is_hyperbolic` and `cosmetic_crossing_conjecture_verified`) of the interface. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#38822 Reported by: Sebastian Oehms Reviewer(s): Sebastian Oehms, Travis Scrimshaw
2 parents 1b5ea27 + 70adf3a commit 2af7613

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

src/sage/databases/knotinfo_db.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,8 @@ def _test_database(self, **options):
838838
'fibered': ['Fibered', KnotInfoColumnTypes.OnlyKnots],
839839
'unoriented': ['Unoriented', KnotInfoColumnTypes.OnlyLinks],
840840
'symmetry_type': ['Symmetry Type', KnotInfoColumnTypes.OnlyKnots],
841+
'geometric_type': ['Geometric Type', KnotInfoColumnTypes.OnlyKnots],
842+
'cosmetic_crossing': ['Cosmetic Crossing', KnotInfoColumnTypes.OnlyKnots],
841843
'width': ['Width', KnotInfoColumnTypes.OnlyKnots],
842844
'arc_notation': ['Arc Notation', KnotInfoColumnTypes.OnlyLinks],
843845
'dt_code': ['DT code', KnotInfoColumnTypes.OnlyLinks]
@@ -1019,6 +1021,18 @@ def _test_database(self, **options):
10191021
'reversible',
10201022
'reversible'
10211023
],
1024+
dc.geometric_type: [
1025+
'',
1026+
'torus knot T(2,3)',
1027+
'hyperbolic',
1028+
'torus knot T(2,5)',
1029+
'hyperbolic',
1030+
'hyperbolic',
1031+
'hyperbolic',
1032+
'hyperbolic',
1033+
'torus knot T(2,7)',
1034+
'hyperbolic'],
1035+
dc.cosmetic_crossing: ['', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N'],
10221036
dc.homfly_polynomial: [
10231037
'',
10241038
'(2*v^2-v^4)+v^2*z^2',

src/sage/knots/knotinfo.py

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def braid_notation(self, original=False):
790790
return (1, )
791791

792792
braid_notation = eval_knotinfo(braid_notation)
793-
if type(braid_notation) is list:
793+
if type(braid_notation) in (list, tuple):
794794
# in some cases there are a pair of braid representations
795795
# in the database. If this is the case we select the
796796
# corresponding to the braid index.
@@ -1183,6 +1183,23 @@ def is_amphicheiral(self, positive=False):
11831183

11841184
return None
11851185

1186+
@cached_method
1187+
def is_hyperbolic(self):
1188+
r"""
1189+
Return whether ``self`` is hyperbolic.
1190+
1191+
EXAMPLES::
1192+
1193+
sage: KnotInfo.K3_1.is_hyperbolic()
1194+
False
1195+
sage: KnotInfo.K5_2.is_hyperbolic()
1196+
True
1197+
"""
1198+
geometric_type = self[self.items.geometric_type]
1199+
if geometric_type == 'hyperbolic':
1200+
return True
1201+
return False
1202+
11861203
@cached_method
11871204
def is_alternating(self):
11881205
r"""
@@ -1309,6 +1326,38 @@ def is_oriented(self):
13091326
"""
13101327
return not knotinfo_bool(self[self.items.unoriented])
13111328

1329+
@cached_method
1330+
def cosmetic_crossing_conjecture_verified(self):
1331+
r"""
1332+
Return whether the Cosmetic Crossing Conjecture has been verified
1333+
for ``self``.
1334+
1335+
From the KnotInfo `description page <https://knotinfo.math.indiana.edu/descriptions/cosmetic_crossing.html>`__:
1336+
1337+
A crossing change in a diagram of a knot ``K`` is called cosmetic if
1338+
the resulting diagram also represents ``K``. The cosmetic crossing
1339+
conjecture posits that for any knot ``K``, the only cosmetic crossing
1340+
changes are nugatory, i.e. there exists an embedded 2-sphere in
1341+
``S3`` which intersects K only at the two points of the relevant
1342+
crossing. Conversely, it is not hard to see that any nugatory
1343+
crossing change is cosmetic.
1344+
1345+
EXAMPLES::
1346+
1347+
sage: knots = [K for K in KnotInfo if K.is_knot() and K.crossing_number() < 10]
1348+
sage: all(K.cosmetic_crossing_conjecture_verified() for K in knots)
1349+
True
1350+
"""
1351+
cosmetic_crossing = self[self.items.cosmetic_crossing]
1352+
if self.crossing_number() == 0:
1353+
return True
1354+
if not cosmetic_crossing or cosmetic_crossing == 'Unknown':
1355+
return False
1356+
verified = not knotinfo_bool(cosmetic_crossing)
1357+
if not knotinfo_bool(cosmetic_crossing):
1358+
return True
1359+
raise AssertionError(f'{self} is a counterexample to the cosmetic crossing conjecture')
1360+
13121361
@cached_method
13131362
def homfly_polynomial(self, var1='v', var2='z', original=False):
13141363
r"""

0 commit comments

Comments
 (0)