Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
8a97e77
start work on porting to sage
GiacomoPope Dec 2, 2024
93019cf
fix import lines
GiacomoPope Dec 4, 2024
50154ed
fix function imports
GiacomoPope Dec 4, 2024
7044145
fix a bunch of old import statements
GiacomoPope Dec 4, 2024
1f2e5ff
fix some monsky_washnitzer imports
grhkm21 Dec 4, 2024
c5e077b
fix all doctest errors
grhkm21 Dec 4, 2024
e16e9f5
add long time warning to doctest
GiacomoPope Dec 5, 2024
79e3692
run linting checks
GiacomoPope Dec 5, 2024
54619c4
remove is_HyperellipticCurveSmoothModel as it's not really a modern s…
GiacomoPope Dec 5, 2024
5a8daf4
start porting code ready to be integrated into sagemath
GiacomoPope Dec 2, 2024
7383da5
some proof reading
GiacomoPope Dec 5, 2024
55bdd3a
fix stupid bug
GiacomoPope Dec 5, 2024
0d9b77d
Merge commit '5a8daf4e29c0124bcfc4cd0758de4a81f47b1fc6' into hyperell…
grhkm21 Dec 16, 2024
eec1543
Merge remote-tracking branch 'refs/remotes/jack/hyperelliptic_curve_s…
grhkm21 Dec 16, 2024
f41710c
Merge remote-tracking branch 'origin/develop' into hyperelliptic_curv…
grhkm21 Dec 16, 2024
910cf7f
Merge branch 'develop' into hyperelliptic_curve_sm
GiacomoPope Dec 18, 2024
a1a44c3
pycodestyle fix
GiacomoPope Dec 18, 2024
9a0c4d7
fix some rst issues, some remain...
GiacomoPope Dec 18, 2024
e83a326
try and fix more RST issues
GiacomoPope Dec 18, 2024
86bd99c
Merge remote-tracking branch 'refs/remotes/jack/hyperelliptic_curve_s…
grhkm21 Dec 18, 2024
b56a767
Moved weighted files and changed imports
grhkm21 Dec 18, 2024
6c78345
remove random file...
grhkm21 Dec 18, 2024
c6e9f14
remove more debugs...
grhkm21 Dec 18, 2024
4bc05aa
more RST
GiacomoPope Dec 18, 2024
6c7c436
fix failing doctests
GiacomoPope Dec 18, 2024
ab94c8f
fix typing error
GiacomoPope Dec 18, 2024
dddb0ee
implement comparison between weighted projective points
grhkm21 Dec 19, 2024
228be07
implement zero divisor check for constructor of points in weighted pr…
grhkm21 Dec 19, 2024
1392729
reimplement check more directly
grhkm21 Dec 19, 2024
afd568a
remove extra import
grhkm21 Dec 19, 2024
0418f7c
move weighted_projective_curve to schemes/curves
grhkm21 Dec 19, 2024
2467ced
update meson.build
grhkm21 Dec 19, 2024
fe6cdf4
sort imports and remove extra export
grhkm21 Dec 19, 2024
456c0c6
add back missing import for WeightedProjectiveSpace
grhkm21 Dec 19, 2024
490f774
run tools/update_meson.py (also done in #39159)
grhkm21 Dec 19, 2024
6c00438
fix doctest errors 2
grhkm21 Dec 19, 2024
d478cb7
(TODO?) fix normalisation of points in weighted projective space
grhkm21 Dec 19, 2024
4f41fd6
Merge branch 'develop' into hyperelliptic_curve_sm
GiacomoPope Jan 6, 2025
34dd9ac
fix and add some docstrings
sabrinakunzweiler Jan 9, 2025
6064885
include our files in the documentation and fix some docstrings
sabrinakunzweiler Feb 20, 2025
17f6f80
fix docstrings again
sabrinakunzweiler Feb 20, 2025
fe03817
Update src/sage/schemes/hyperelliptic_curves_smooth_model/jacobian_ho…
sabrinakunzweiler Feb 20, 2025
ab08002
Update src/sage/schemes/hyperelliptic_curves_smooth_model/hyperellipt…
sabrinakunzweiler Feb 21, 2025
009a98e
Update src/sage/schemes/hyperelliptic_curves_smooth_model/hyperellipt…
sabrinakunzweiler Feb 21, 2025
4ae3357
delete whitespace
sabrinakunzweiler Feb 22, 2025
0fb70af
add more docstrings
sabrinakunzweiler May 6, 2025
679b2e4
minor
sabrinakunzweiler May 7, 2025
bb4b129
add basic weighted projective space functionality
grhkm21 May 8, 2025
8aae3d4
remove finished TODO
grhkm21 May 8, 2025
ebe3a94
clean up implementation of weighted (plane) curves and other docs
grhkm21 May 8, 2025
5418f19
Merge branch 'weighted-projective' into hyperelliptic_curve_sm
grhkm21 May 15, 2025
56a65d4
Merge remote-tracking branch 'refs/remotes/jack/hyperelliptic_curve_s…
grhkm21 May 15, 2025
54fb0b5
add additional tests for points_at_infinity
grhkm21 May 15, 2025
8b83992
fix doctest errors
grhkm21 May 15, 2025
00dce0a
remove useless .curve method
grhkm21 May 16, 2025
6330043
implement converting wp curve to proj curve
grhkm21 May 16, 2025
1767db8
Merge branch 'weighted-projective' into hyperelliptic_curve_sm
grhkm21 May 16, 2025
608233a
implement discriminant formula for hyperelliptic curves
grhkm21 May 16, 2025
ba8448b
J.order only works over finite fields
grhkm21 Aug 28, 2025
ef00a85
fix issues with coerce_map_from not firing for polynomial rings
grhkm21 Aug 28, 2025
8820851
add `distinguished_point` to hyperelliptic curve constructor
grhkm21 Aug 28, 2025
7c7138a
Merge remote-tracking branch 'sagemath/develop' into hyperelliptic_cu…
grhkm21 Sep 2, 2025
af95248
Merge branch 'develop' into hyperelliptic_curve_sm
GiacomoPope Nov 21, 2025
40c71ec
Update weighted_projective_space.py
fchapoton Nov 24, 2025
cd1d85f
fix RST lint issue
GiacomoPope Nov 25, 2025
8398ccf
fix whitespace linter issue
GiacomoPope Nov 25, 2025
ea1fbe2
fix doctests
GiacomoPope Nov 25, 2025
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
39 changes: 38 additions & 1 deletion src/doc/en/reference/arithmetic_curves/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,41 @@ Hyperelliptic curves

sage/interfaces/genus2reduction

.. include:: ../footer.txt
Hyperelliptic curves (smooth model)
===================================

.. toctree::
:maxdepth: 1

sage/schemes/hyperelliptic_curves_smooth_model/hyperelliptic_constructor
sage/schemes/hyperelliptic_curves_smooth_model/hyperelliptic_generic
sage/schemes/hyperelliptic_curves_smooth_model/hyperelliptic_finite_field
sage/schemes/hyperelliptic_curves_smooth_model/hyperelliptic_padic_field
sage/schemes/hyperelliptic_curves_smooth_model/hyperelliptic_rational_field
sage/schemes/hyperelliptic_curves_smooth_model/hyperelliptic_g2

sage/schemes/hyperelliptic_curves_smooth_model/invariants
sage/schemes/hyperelliptic_curves_smooth_model/mestre
sage/schemes/hyperelliptic_curves_smooth_model/monsky_washnitzer

Jacobians of hyperelliptic curves (smooth model)
------------------------------------------------

.. toctree::
:maxdepth: 1

sage/schemes/hyperelliptic_curves_smooth_model/jacobian_generic
sage/schemes/hyperelliptic_curves_smooth_model/jacobian_homset_generic
sage/schemes/hyperelliptic_curves_smooth_model/jacobian_homset_ramified
sage/schemes/hyperelliptic_curves_smooth_model/jacobian_homset_split
sage/schemes/hyperelliptic_curves_smooth_model/jacobian_homset_inert

sage/schemes/hyperelliptic_curves_smooth_model/jacobian_g2_generic
sage/schemes/hyperelliptic_curves_smooth_model/jacobian_g2_homset_ramified
sage/schemes/hyperelliptic_curves_smooth_model/jacobian_g2_homset_split
sage/schemes/hyperelliptic_curves_smooth_model/jacobian_g2_homset_inert

sage/schemes/hyperelliptic_curves_smooth_model/jacobian_morphism


.. include:: ../footer.txt
4 changes: 4 additions & 0 deletions src/doc/en/reference/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2980,6 +2980,10 @@ REFERENCES:
.. [GHJV1994] \E. Gamma, R. Helm, R. Johnson, J. Vlissides, *Design
Patterns: Elements of Reusable Object-Oriented
Software*. Addison-Wesley (1994). ISBN 0-201-63361-2.

.. [GHM2008] \S. Galbraith, M. Harrison, D. Mireles Morales,
*Efficient hyperelliptic arithmetic using balanced representation for divisors*,
Algorithmic Number Theory: 8th International Symposium, ANTS-VIII Banff, Canada, May 17-22, 2008 Proceedings 8.

.. [Gil1959] Edgar Nelson Gilbert. *Random Graphs*, Annals of Mathematical
Statistics. 30 (4): 1141-1144, 1959.
Expand Down
6 changes: 6 additions & 0 deletions src/sage/schemes/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@

from sage.schemes.product_projective.all import *

from sage.schemes.weighted_projective.all import *

from sage.schemes.cyclic_covers.all import *

from sage.schemes.berkovich.all import *

from sage.schemes.hyperelliptic_curves_smooth_model.all import *

from sage.schemes.weighted_projective.all import *
16 changes: 16 additions & 0 deletions src/sage/schemes/curves/constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
Projective Plane Curve over Finite Field of size 5
defined by -x^9 + y^2*z^7 - x*z^8

Here, we construct a hyperelliptic curve manually::

sage: WP.<x,y,z> = WeightedProjectiveSpace([1, 3, 1], GF(103))
sage: Curve(y^2 - (x^5*z + 17*x^2*z^4 + 92*z^6), WP)
Weighted Projective Curve over Finite Field of size 103 defined by y^2 - x^5*z - 17*x^2*z^4 + 11*z^6

AUTHORS:

- William Stein (2005-11-13)
Expand Down Expand Up @@ -49,6 +55,7 @@
from sage.schemes.generic.algebraic_scheme import AlgebraicScheme
from sage.schemes.affine.affine_space import AffineSpace, AffineSpace_generic
from sage.schemes.projective.projective_space import ProjectiveSpace, ProjectiveSpace_ring
from sage.schemes.weighted_projective.weighted_projective_space import WeightedProjectiveSpace_ring
from sage.schemes.plane_conics.constructor import Conic

from .projective_curve import (ProjectiveCurve,
Expand All @@ -71,6 +78,8 @@
IntegralAffinePlaneCurve,
IntegralAffinePlaneCurve_finite_field)

from .weighted_projective_curve import WeightedProjectiveCurve


def _is_irreducible_and_reduced(F) -> bool:
"""
Expand Down Expand Up @@ -376,5 +385,12 @@ def Curve(F, A=None):
return ProjectivePlaneCurve_field(A, F)
return ProjectivePlaneCurve(A, F)

elif isinstance(A, WeightedProjectiveSpace_ring):
# currently, we only support curves in a weighted projective plane
if n != 2:
raise NotImplementedError("ambient space has to be a weighted projective plane")
# currently, we do not perform checks on weighted projective curves
return WeightedProjectiveCurve(A, F)

else:
raise TypeError('ambient space neither affine nor projective')
91 changes: 91 additions & 0 deletions src/sage/schemes/curves/weighted_projective_curve.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# sage.doctest: needs sage.libs.singular
r"""
Weighted projective curves

Weighted projective curves in Sage are curves in a weighted projective space or
a weighted projective plane.

EXAMPLES:

For now, only curves in weighted projective plane is supported::

sage: WP.<x, y, z> = WeightedProjectiveSpace([1, 3, 1], QQ)
sage: C1 = WP.curve(y^2 - x^5 * z - 3 * x^2 * z^4 - 2 * z^6); C1
Weighted Projective Curve over Rational Field defined by y^2 - x^5*z - 3*x^2*z^4 - 2*z^6
sage: C2 = Curve(y^2 - x^5 * z - 3 * x^2 * z^4 - 2 * z^6, WP); C2
Weighted Projective Curve over Rational Field defined by y^2 - x^5*z - 3*x^2*z^4 - 2*z^6
sage: C1 == C2
True
"""

from sage.schemes.curves.curve import Curve_generic
from sage.schemes.weighted_projective.weighted_projective_space import WeightedProjectiveSpace_ring


class WeightedProjectiveCurve(Curve_generic):
"""
Curves in weighted projective spaces.

EXAMPLES:

We construct a hyperelliptic curve manually::

sage: WP.<x, y, z> = WeightedProjectiveSpace([1, 3, 1], QQ)
sage: C = Curve(y^2 - x^5 * z - 3 * x^2 * z^4 - 2 * z^6, WP); C
Weighted Projective Curve over Rational Field defined by y^2 - x^5*z - 3*x^2*z^4 - 2*z^6
"""
def __init__(self, A, X, *kwargs):
if not isinstance(A, WeightedProjectiveSpace_ring):
raise TypeError(f"A(={A}) is not a weighted projective space")
self._weights = A._weights
super().__init__(A, X, *kwargs)

def _repr_type(self):
r"""
Return a string representation of the type of this curve.

EXAMPLES::

sage: WP.<x,y,z> = WeightedProjectiveSpace([1, 3, 1], QQ)
sage: C = Curve(y^2 - x^5 * z - 3 * x^2 * z^4 - 2 * z^6, WP); C
Weighted Projective Curve over Rational Field defined by y^2 - x^5*z - 3*x^2*z^4 - 2*z^6
sage: C._repr_type()
'Weighted Projective'
"""
return "Weighted Projective"

def projective_curve(self):
r"""
Return this weighted projective curve as a projective curve.

A weighted homogeneous polynomial `f(x_1, \ldots, x_n)`, where `x_i` has
weight `w_i`, can be viewed as an unweighted homogeneous polynomial
`f(y_1^{w_1}, \ldots, y_n^{w_n})`. This correspondence extends to
varieties.

.. TODO:

Implement homsets for weighted projective spaces and implement this
as a ``projective_embedding`` method instead.

EXAMPLES::

sage: WP = WeightedProjectiveSpace([1, 3, 1], QQ, "x, y, z")
sage: x, y, z = WP.gens()
sage: C = WP.curve(y^2 - (x^5*z + 3*x^2*z^4 - 2*x*z^5 + 4*z^6)); C
Weighted Projective Curve over Rational Field defined by y^2 - x^5*z - 3*x^2*z^4 + 2*x*z^5 - 4*z^6
sage: C.projective_curve()
Projective Plane Curve over Rational Field defined by y^6 - x^5*z - 3*x^2*z^4 + 2*x*z^5 - 4*z^6
"""
from sage.schemes.projective.projective_space import ProjectiveSpace

WP = self.ambient_space()
PP = ProjectiveSpace(WP.dimension_relative(), WP.base_ring(), WP.variable_names())
PP_ring = PP.coordinate_ring()
subs_dict = {name: var**weight for (name, var), weight in
zip(WP.gens_dict().items(), WP.weights())}

wp_polys = self.defining_polynomials()
pp_polys = [PP_ring(poly.subs(**subs_dict)) for poly in wp_polys]

return PP.curve(pp_polys)
3 changes: 3 additions & 0 deletions src/sage/schemes/hyperelliptic_curves_smooth_model/all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from sage.schemes.hyperelliptic_curves_smooth_model.hyperelliptic_constructor import (
HyperellipticCurveSmoothModel,
)
Loading
Loading