Skip to content

Make Jacobian morphisms hashable #40534

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
11 changes: 7 additions & 4 deletions src/sage/schemes/hyperelliptic_curves/jacobian_morphism.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def __init__(self, parent, polys, check=True):
genus = C.genus()
if a.degree() > genus:
polys = cantor_reduction(a, b, f, h, genus)
self.__polys = polys
self.__polys = tuple(polys)

def _printing_polys(self):
r"""
Expand Down Expand Up @@ -633,7 +633,7 @@ def __tuple__(self):
sage: tuple(P) # indirect doctest # needs sage.rings.number_field
(x - 1, -a)
"""
return tuple(self.__polys)
return self.__polys

def __getitem__(self, n):
r"""
Expand Down Expand Up @@ -662,9 +662,9 @@ def __getitem__(self, n):
sage: P[-1] # indirect doctest
-a
sage: P[:1] # indirect doctest
[x - 1]
(x - 1,)
"""
return list(self.__polys)[n]
return self.__polys[n]

def _richcmp_(self, other, op):
r"""
Expand Down Expand Up @@ -724,6 +724,9 @@ def _richcmp_(self, other, op):
# comparing polynomials is well-defined
return richcmp(self.__polys, other.__polys, op)

def __hash__(self):
return hash(self.__polys)

def __bool__(self):
r"""
Return ``True`` if this divisor is not the additive identity element.
Expand Down
Loading