Skip to content

Commit 240e7ce

Browse files
committed
40081: add doctest and fixup
1 parent 27e0eee commit 240e7ce

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/sage/interfaces/khoca.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,23 @@ def khoca_interface(ring, **kwds):
9191
Return an instance of ``InteractiveCalculator` of the ``Khoca``.
9292
This is a calculator for Khovanov homology written by Lukas
9393
Lewark. For more information see :class:`~sage.features.khoca.Khoca`.
94+
95+
EXAMPLES::
96+
97+
sage: # optional khoca
98+
sage: from sage.interfaces.khoca import khoca_interface
99+
sage: khoca_interface(ZZ)
100+
Khovanov homology calculator for Frobenius algebra: Z[X] / (1*X^2).
101+
sage: khoca_interface(QQ)
102+
Khovanov homology calculator for Frobenius algebra: Q[X] / (1*X^2).
103+
sage: khoca_interface(GF(3))
104+
Khovanov homology calculator for Frobenius algebra: F_3[X] / (1*X^2).
105+
sage: khoca_interface(ZZ, frobenius_algebra=(1,-2), root=1)
106+
Khovanov homology calculator for Frobenius algebra: Z[X] / (1*X^2 + -2*X + 1).
107+
sage: khoca_interface(QQ, equivariant=3)
108+
Traceback (most recent call last):
109+
...
110+
NotImplementedError: keyword equivariant is not implemented yet
94111
"""
95112
from sage.features.khoca import Khoca
96113
Khoca().require()

src/sage/knots/link.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ def khovanov_homology(self, ring=ZZ, height=None, degree=None, implementation='n
12591259
* ``'Khoca'`` -- uses the implementation of the optional package
12601260
``khoca``
12611261
1262-
- ``kwds`` -- dictionary of options to be passes to ``Khoca``
1262+
- ``kwds`` -- dictionary of options to be passed to ``Khoca``
12631263
12641264
* ``reduced`` -- boolean (default ``False``); if
12651265
``True``, then returns the reduced homology
@@ -1275,6 +1275,7 @@ def khovanov_homology(self, ring=ZZ, height=None, degree=None, implementation='n
12751275
* ``root`` -- integer specifying a root of the modulus of the
12761276
Frobenius algeba
12771277
1278+
12781279
OUTPUT:
12791280
12801281
The Khovanov homology of the Link. It is given as a dictionary
@@ -1315,7 +1316,7 @@ def khovanov_homology(self, ring=ZZ, height=None, degree=None, implementation='n
13151316
sage: K.khovanov_homology(base_ring=QQ)
13161317
Traceback (most recent call last):
13171318
...
1318-
ValueError: 'base_ring' is not a valid KnownKeywords
1319+
ValueError: invalid keyword(s): ['base_ring']
13191320
13201321
TESTS:
13211322
@@ -1348,6 +1349,8 @@ def khovanov_homology(self, ring=ZZ, height=None, degree=None, implementation='n
13481349
check_kwds(**kwds)
13491350
elif implementation != 'native':
13501351
raise ValueError('%s is not a recognized implementation')
1352+
elif kwds:
1353+
raise ValueError(f"invalid keyword(s): {list(kwds)}")
13511354

13521355
if not self.pd_code(): # special case for the unknot with no crossings
13531356
from sage.homology.homology_group import HomologyGroup

0 commit comments

Comments
 (0)