Skip to content

Commit 26c168c

Browse files
author
Release Manager
committed
gh-40810: Implement is_hyperelliptic <!-- ^ 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 #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 #12345". --> This PR implements a method to determine if a Riemann surface is hyperelliptic. Such a method [exists in Maple](https://www.maplesoft.com /support/help/Maple/view.aspx?path=algcurves/is_hyperelliptic) and this provides an open-source alternative following the original method of Maple. It keep Sage more up to date with the tools required for Riemann surface research. ### 📝 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. - [ ] 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, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #40810 Reported by: Linden Disney-Hogg Reviewer(s): Linden Disney-Hogg, Michael Orlitzky
2 parents 85f6557 + d216c0f commit 26c168c

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

src/doc/en/reference/references/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,6 +2424,13 @@ REFERENCES:
24242424
24252425
.. [dotspec] http://www.graphviz.org/doc/info/lang.html
24262426
2427+
.. [DP2011] \B. Deconinck and M. S. Patterson, *Computing with plane algebraic
2428+
curves and Riemann surfaces: The algorithms of the Maple package
2429+
"Algcurves"*, In: A. Bobenko and C. Klein (eds) Computational
2430+
approach to Riemann surfaces. Lecture Notes in Mathematics 2013.
2431+
Springer, Berlin, Heidelberg. (2011).
2432+
:doi:`10.1007/978-3-642-17413-1_2`
2433+
24272434
.. [DPS2017] Kevin Dilks, Oliver Pechenik, and Jessica Striker,
24282435
*Resonance in orbits of plane partitions and increasing
24292436
tableaux*, JCTA 148 (2017), 244-274,

src/sage/schemes/riemann_surfaces/riemann_surface.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,6 +1908,66 @@ def cohomology_basis(self, option=1):
19081908
self._differentials = generators
19091909
return self._differentials
19101910

1911+
def is_hyperelliptic(self):
1912+
r"""
1913+
Determine whether ``self`` is a hyperelliptic curve.
1914+
1915+
Uses the subspace of quadratic differentials generated by the
1916+
holomorphic differentials on ``self`` to determine if the curve is
1917+
hyperelliptic. Elliptic curves, i.e. curves of genus 1, are considered
1918+
to be hyperelliptic.
1919+
1920+
OUTPUT:
1921+
1922+
- boolean; whether or not the curve is hyperelliptic
1923+
1924+
EXAMPLES:
1925+
1926+
We consider the three examples given in [DP2011]_::
1927+
1928+
sage: from sage.schemes.riemann_surfaces.riemann_surface import RiemannSurface
1929+
sage: R.<x,y> = QQ[]
1930+
sage: f1 = y^3 - 2*x*y + x^4
1931+
sage: S1 = RiemannSurface(f1)
1932+
sage: S1.is_hyperelliptic()
1933+
True
1934+
sage: f2 = y^3 - 2*x*y + x^5
1935+
sage: S2 = RiemannSurface(f2)
1936+
sage: S2.is_hyperelliptic()
1937+
False
1938+
sage: f3 = y^9 + 3*x^2*y^6 + 3*x^4*y^3 + x^6 + y^2
1939+
sage: S3 = RiemannSurface(f3) # long time
1940+
sage: S3.is_hyperelliptic() # long time
1941+
True
1942+
1943+
ALGORITHM:
1944+
1945+
This uses the approach of van Hoeij who implemented the same function
1946+
in ``algcurves``. This uses the theory of Noether, and is described in
1947+
[DP2011]_. It finds the rank of the subspace of quadratic differentials
1948+
generated by holomorphic differentials: if this rank is `< 2g`, then
1949+
the curve is hyperelliptic.
1950+
"""
1951+
# This uses common theory of Riemann surfaces
1952+
if self.genus <= 2:
1953+
return True
1954+
1955+
# Find the products of pairs of holomorphic differentials. We reduce
1956+
# these modulo the curve so that a linear dependence between the
1957+
# monomial coefficients becomes a linear dependence between the
1958+
# corresponding quadratic differentials
1959+
II = self._R.ideal(self.f)
1960+
diffs = self.cohomology_basis()
1961+
pairs = [II.reduce(diffs[i]*diffs[j]) for i in range(self.genus)
1962+
for j in range(i, self.genus)]
1963+
1964+
# Find the monomials present and their coefficients
1965+
mons = {mon for p in pairs for mon in p.monomials()}
1966+
CM = Matrix([[p.monomial_coefficient(mon) for p in pairs]
1967+
for mon in mons])
1968+
# test the number of linearly independent pairs
1969+
return CM.rank() <= 2*self.genus - 1
1970+
19111971
def _bounding_data(self, differentials, exact=False):
19121972
r"""
19131973
Compute the data required to bound a differential on a circle.

0 commit comments

Comments
 (0)