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

Remove duplicated functions from genus two hyperelliptic curves #37604

Merged
Merged
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
118 changes: 4 additions & 114 deletions src/sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
return df % 2 == 1
elif df < 6:
return False
else:
a0 = f.leading_coefficient()
c0 = h.leading_coefficient()
return (c0**2 + 4*a0) == 0

a0 = f.leading_coefficient()
c0 = h.leading_coefficient()
return (c0**2 + 4*a0) == 0

Check warning on line 36 in src/sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py

View check run for this annotation

Codecov / codecov/patch

src/sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py#L34-L36

Added lines #L34 - L36 were not covered by tests

def jacobian(self):
"""
Expand Down Expand Up @@ -180,113 +180,3 @@
"""
f, h = self.hyperelliptic_polynomials()
return invariants.absolute_igusa_invariants_kohel(4*f + h**2)

def clebsch_invariants(self):
r"""
Return the Clebsch invariants `(A, B, C, D)` of Mestre, p 317, [Mes1991]_.

.. SEEALSO::

:meth:`sage.schemes.hyperelliptic_curves.invariants`

EXAMPLES::

sage: R.<x> = QQ[]
sage: f = x^5 - x^4 + 3
sage: HyperellipticCurve(f).clebsch_invariants()
(0, -2048/375, -4096/25, -4881645568/84375)
sage: HyperellipticCurve(f(2*x)).clebsch_invariants()
(0, -8388608/375, -1073741824/25, -5241627016305836032/84375)

sage: HyperellipticCurve(f, x).clebsch_invariants()
(-8/15, 17504/5625, -23162896/140625, -420832861216768/7119140625)
sage: HyperellipticCurve(f(2*x), 2*x).clebsch_invariants()
(-512/15, 71696384/5625, -6072014209024/140625, -451865844002031331704832/7119140625)

TESTS::

sage: # optional - magma
sage: magma(HyperellipticCurve(f)).ClebschInvariants()
[ 0, -2048/375, -4096/25, -4881645568/84375 ]
sage: magma(HyperellipticCurve(f(2*x))).ClebschInvariants()
[ 0, -8388608/375, -1073741824/25, -5241627016305836032/84375 ]
sage: magma(HyperellipticCurve(f, x)).ClebschInvariants()
[ -8/15, 17504/5625, -23162896/140625, -420832861216768/7119140625 ]
sage: magma(HyperellipticCurve(f(2*x), 2*x)).ClebschInvariants()
[ -512/15, 71696384/5625, -6072014209024/140625, -451865844002031331704832/7119140625 ]
"""
f, h = self.hyperelliptic_polynomials()
return invariants.clebsch_invariants(4*f + h**2)

def igusa_clebsch_invariants(self):
r"""
Return the Igusa-Clebsch invariants `I_2, I_4, I_6, I_{10}` of Igusa and Clebsch [IJ1960]_.

.. SEEALSO::

:meth:`sage.schemes.hyperelliptic_curves.invariants`

EXAMPLES::

sage: R.<x> = QQ[]
sage: f = x^5 - x + 2
sage: HyperellipticCurve(f).igusa_clebsch_invariants()
(-640, -20480, 1310720, 52160364544)
sage: HyperellipticCurve(f(2*x)).igusa_clebsch_invariants()
(-40960, -83886080, 343597383680, 56006764965979488256)

sage: HyperellipticCurve(f, x).igusa_clebsch_invariants()
(-640, 17920, -1966656, 52409511936)
sage: HyperellipticCurve(f(2*x), 2*x).igusa_clebsch_invariants()
(-40960, 73400320, -515547070464, 56274284941110411264)

TESTS::

sage: magma(HyperellipticCurve(f)).IgusaClebschInvariants() # optional - magma
[ -640, -20480, 1310720, 52160364544 ]
sage: magma(HyperellipticCurve(f(2*x))).IgusaClebschInvariants() # optional - magma
[ -40960, -83886080, 343597383680, 56006764965979488256 ]

sage: magma(HyperellipticCurve(f, x)).IgusaClebschInvariants() # optional - magma
[ -640, 17920, -1966656, 52409511936 ]
sage: magma(HyperellipticCurve(f(2*x), 2*x)).IgusaClebschInvariants() # optional - magma
[ -40960, 73400320, -515547070464, 56274284941110411264 ]
"""
f, h = self.hyperelliptic_polynomials()
return invariants.igusa_clebsch_invariants(4*f + h**2)

def absolute_igusa_invariants_wamelen(self):
r"""
Return the three absolute Igusa invariants used by van Wamelen [Wam1999]_.

EXAMPLES::

sage: R.<x> = QQ[]
sage: HyperellipticCurve(x^5 - 1).absolute_igusa_invariants_wamelen()
(0, 0, 0)
sage: HyperellipticCurve((x^5 - 1)(x - 2), (x^2)(x - 2)).absolute_igusa_invariants_wamelen()
(0, 0, 0)
"""
f, h = self.hyperelliptic_polynomials()
return invariants.absolute_igusa_invariants_wamelen(4*f + h**2)

def absolute_igusa_invariants_kohel(self):
r"""
Return the three absolute Igusa invariants used by Kohel [KohECHIDNA]_.

.. SEEALSO::

:meth:`sage.schemes.hyperelliptic_curves.invariants`

EXAMPLES::

sage: R.<x> = QQ[]
sage: HyperellipticCurve(x^5 - 1).absolute_igusa_invariants_kohel()
(0, 0, 0)
sage: HyperellipticCurve(x^5 - x + 1, x^2).absolute_igusa_invariants_kohel()
(-1030567/178769, 259686400/178769, 20806400/178769)
sage: HyperellipticCurve((x^5 - x + 1)(3*x + 1), (x^2)(3*x + 1)).absolute_igusa_invariants_kohel()
(-1030567/178769, 259686400/178769, 20806400/178769)
"""
f, h = self.hyperelliptic_polynomials()
return invariants.absolute_igusa_invariants_kohel(4*f + h**2)
Loading