You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sagemathgh-39161: Add hyperelliptic curves using the smooth model
## Overview
This PR includes a whole new module into schemes which implements
hyperelliptic curves over the smooth model, and focuses on implementing
decent arithmetic for Jac(H) for all reasonable cases, something which
is not done properly in the current implementation due to limitations of
the curve model used.
The idea is that `hyperelliptic_curves_sm` will be available with the
old model for some time, until someone decides we should depreciate the
old model in favour of this new implementation.
## Motivation
The current implementation of hyperelliptic curves in SageMath uses the
projective plane model. Although this works nicely enough for imaginary
curves with only one point at infinity, it is not descriptive enough for
the real models. My gut feeling is the projective plane model was used
as in early Sage days this was easier to do and allowed hyperelliptic
curves to be supported at all. Mathematically, I believe it makes much
more sense to use a weighted projective model to have this new
description but it requires more tools which we only have thanks to the
work of others in sage since it was released.
This PR is a total rewrite of the hyperelliptic curve classes to instead
use the smooth model for hyperelliptic curves which facilitates
implementing arithmetic of Jacobians of hyperelliptic curves for
(almost) all cases. In particular, now if one tries to perform
arithmetic on Jac(C) one either gets the correct value or a well-handled
error instead of just returning something which is wrong.
The hope is that with this new model for the curves, more recent
research in the area of hyperelliptic curves and their jacobians can be
more easily integrated. As a personal example, being able to compute
arithmetic in Jac(H) for the real model unconditionally would help with
the implementation of genus two isogenies which are "in vogue" right now
in the cryptography world.
### Content of PR
This PR looks WAY bigger than it is, as it duplicates ALL code from
`hyperelliptic_curves` and then has modifications to allow this to work
in the new curve model. I believe the best thing to do in the long run
is to depreciate the old hyperelliptic curve impl and have this replace
it, but this will take years(?) so I think we'll just have to have both
side by side for a while.
This PR still needs a lot of work including:
- more tests
- better comments and docstrings
- potentially refactoring of which files belong where
but the code has sat at this stage for a long time without much more
progress from the three of us, so I think the best thing to do is open
up the PR and try and get some extra attention on getting this code
ready to be included.
One benefit is that all this code is "new" in that it should not
conflict with anyone else's work, so we can get this code into a good
position and keep adding to it with more interesting maths once the base
layer is in place
### Example of better arithmetic
For example, this code fixed the following issue:
sagemath#32024
```py
sage: R.<x> = QQ[]
sage: f = 144*x^6 - 240*x^5 + 148*x^4 + 16*x^3 - 16*x^2 - 4*x + 1
sage: H = HyperellipticCurveSmoothModel(f)
sage: J = Jacobian(H)
sage: P = J(H(0,1))-J(H(0,-1))
sage: (5*P).is_zero()
False
sage:
sage: H = HyperellipticCurve(f)
sage: J = Jacobian(H)
sage: P = J(H(0,1))-J(H(0,-1))
sage: (5*P).is_zero()
True
```
and is also related to the issues
sagemath#37109sagemath#37093sagemath#37101sagemath#37626
### Help!
This code needs more work, and lots of time spent on the review which I
don't think is a reasonable thing to do for one person. So if this area
interests you any help would be appreciated (either in the review of
some of the code or some extra commits which tidy up aspects)
URL: sagemath#39161
Reported by: Giacomo Pope
Reviewer(s): Frédéric Chapoton, Giacomo Pope, grhkm21, sabrinakunzweiler, Vincent Macri
0 commit comments