-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
Elliptic curves should be unique parent structures #11474
Comments
comment:1
My approach is: A) Let B) The C) By One detail to consider: Sometimes an elliptic curve is taken from the Cremona database (see But the classcall method could very well assign those additional attributes to an elliptic curve found in the cache before returning it. So, it should still work. |
comment:2
Or should perhaps |
This comment has been minimized.
This comment has been minimized.
Make elliptic curves unique parents -- doesn't work yet |
Attachment: trac11474_unique_elliptic_curves.patch.gz doctest log |
Author: Simon King |
comment:4
Attachment: test11474.log The discussion on sage-nt shows that it is even not clear whether we want elliptic curves to be unique parents (yet). Anyway, I posted a preliminary patch. There are some doctest failures -- a test log is attached as well. Some of the errors are easy to understand: Previously, one had a "Generic morphism", but with unique parents one has a "Generic endomorphism". Others seem more tricky. For example one gets
Hence, first there is a (warning or error?) message " On the bright side, one has the following. Elliptic curves are unique, even when they are created in different ways:
If an elliptic curve is provided with some custom attribute and the "same" curve is found in the database with different attributes, then one has no uniqueness of parents; this is in order to prevent the database from overriding stuff that the user has computed:
However, if the custom attribute is removed, then the data from the database are used to provide a value for that attribute:
|
comment:7
I think this would still be good to fix. The consensus seems to be that an However, in the Intuitively, I would say they should be identical; the fact that there is no canonical basis for the MW group does not justify breaking the unique parents convention (equality of parents, as determined by some defining data, implies identity). On the question of whether the generators from the database should override the ones computed by the user, I think the answer is no. The database provides a convenient way to avoid a possibly long computation, but the basis returned by it has no mathematical property that makes it preferred over any other one. Compare to |
comment:8
There is also the related question on whether an elliptic curve E itself or the Abelian group of rational points of E should be regarded as the parent of the rational points of E. Same question for the (co)domain of isogenies; see #12880. |
comment:10
Replying to @pjbruin:
What happened to the idea of having the MW group as an object different from the elliptic curve? Possibly attaching different representations of it to the same curve? The sage-nt discussion mentions it, but I don't see any trace of it in the patch. I really like the idea, as I like the general idea of having the Abelian group of (rational?) points as a separate object. Sébastien (cc-ed) is working on this (and the related questions with isogenies) for its masters' thesis. If there is a consensus on having a separate object for the Abelian group, I think he will be happy (or at least his advisor will :) to do it and finalize this ticket. |
comment:11
I also like the idea of having a separate object for the group of points. Then for an elliptic curve E defined over K one could have different point groups for E(K) and for E(L) for extensions L of K. Magma did that a few years ago and it was very convenient. I have not thought at all about how to implement it though. About isogeny (c)domains it is not so clear to me. An isogeny is both a map from one curve to another (preserving the base point), and also a group homomorphism. If we are going to separate out the curve E from its group(s) E(K), E(L), then should we not keep these separate for isogenies too? |
comment:12
Replying to @JohnCremona:
There is already a very basic class in
We could create a subclass of (In the above example it looks as if
Yes, I think we should. To rephrase your point, an isogeny is a map f: E -> E' between elliptic curves over a field K (preserving 0), and induces group homomorphisms f(L): E(L) -> E'(L) for every extension L/K. (In categorical language, E determines a functor from K-algebras to Abelian groups, and f determines a morphism [natural transformation] between two such functors.) Of course, as a Sage user you should still be able to construct a point P from its coordinates (u, v) by typing |
comment:13
So, if I make it short:
Am I right? May I begin to refactoring the code in this way? I've disscussed today with Luca today and he thinks that would be good to create a new category "AbelianVarieties" which require to implement this "abelian_group" method. What do you think about that ? |
comment:14
Replying to @sagetrac-sbesnier:
I think this sounds like a good plan. It does have a certain the risk of becoming a big project, so be careful to split it into well-defined steps and to proceed one step at a time. Just some thoughts about the first of your two points for now. Before doing any coding, I would say it is essential to have a clear picture of both the mathematical objects and the Sage (or Python) objects representing them, and of the relations between them. Currently, given an elliptic curve E over a field K, there are at least three kinds of objects to consider:
In general it is important to find out what functionality is already available, and how much of it you can use. (Remember that a guiding principle of Sage is "building the car, not reinventing the wheel". This originally refers to the fact that Sage builds on many other pieces of software, but it is also a good general slogan.)
It would indeed be nice to have a category of Abelian varieties, but this is probably largely independent of the rest of what you want to do. The current implementation of |
comment:15
I haven't dug enough into the way Sage represents groups, but do these two objects need to be different ? If groups in Sage need to have explicitly set generators, then obviously yes: we don't want to compute generators unless the user asks us to. But if a group can be represented abstractly (by its elements and an algorithm for the group operation), then it seems to me that these two should be the same, with the generators computed lazily when the user asks for them. |
comment:16
Replying to @defeo:
But don't you then run into the same difficulty with unique representation that we now have for elliptic curves, namely caching non-canonical data inside a canonical object? If you keep the two objects (i.e. the abstract group vs. the generators) separate, then it is clear that the way for the user to remember a choice of generators is to store the result of Also, I would say it is conceptually better to keep them separate, since the |
comment:17
I agree with Peter here (we have been discussing these issues in our common room in Warwick). I particularly want to emphasize that what you have in mind is quite a large project, which needs to be done step by step, with plenty of input from other experienced Sage users who will be greatly affected by such changes (e.g. me!). Also, be careful that the improved design will not be accompanied by a decrease in efficiency. Some of what is being proposed here would have been done a lot earlier, but Sage's support for f.g. abelian groups was not good enough in the early days. As soon as it became good enough it was applied to the simplest of these cases, namely the group of points of an e.c. over a finite field. We want to keep separate the abstract abelian group from the concrete realization of it as a set of points, so that we can use generaic abelian group functionality to (for example) compute kernels. And as well as the easy map from the abstract group to the concrete point set (using known generators) we must also provide the harder map in the reverse direction, which is a form of elliptic logarithm. This is actually easier in the number field case since we can use canonical heights to express a point as a linear combination of the generators. |
comment:18
Considering the EC part, we already have almost what we want isn't it? Let
John wrote:
I'm not sure to see the point. You would like to have the map |
comment:19
Replying to @sagetrac-sbesnier:
Don't use the patch as it is: for a start Sage no longer uses patches but git branches, and also as the patch is 3 years old it certainly will not apply cleanly. What will be needed is a new git branch based on the current development branch (also known as version 6.2.beta8) onto which the same changes as made by the patch are applied. You can try to use Sage's methods for converting patches to git branches, but it would be a miracle if that worked on a 3-year-old patch! If you are nervous, someone else might do this step for you. Then after committing Simon's changes in the new branch you can add your changes, make a new commit, and everyone will be able to try it out.
My point is that somewhere there has to be code which, given a point and known generators, expresses that point as a Z-linear combination of the generators. Assuming that E.abelian_group was an abstract abelian group, this code would be used in mapping from E(K) to it. |
comment:20
One remark about the approach to follow to make elliptic curves satisfy unique representation: it turns out that there is an important problem with using |
comment:33
Thanks. We need to reach a conclusion while there are other "needs review" tickets claiming to depend on this. I used to know what that meant, but now... it may or may not mean that the branches asking for review include the unreviewed commits here. For example #12880. |
comment:34
Replying to @JohnCremona:
I think the other tickets depend on this one in the sense that they need elliptic curves to be unique parents, not in the sense that they already include commits that belong to this ticket. In my opinion we should definitely make elliptic curves unique parents. The question is whether we should use The idea is that the
Of course, whoever implements this in the end has to make the choice how to do it. Unfortunately I am currently a bit too busy with some research things and don't have a lot of time for it at the moment. |
comment:35
Replying to @pjbruin:
... except for the fact that
This I consider a valid argument for using a factory. But a tad more needs to be done. |
comment:36
Replying to @simon-king-jena:
Something that I think you recently clarified to me elsewhere, and which might be worth emphasising here too, is that "unique parents" really refers to two conditions:
|
comment:37
Replying to @pjbruin:
Yes. |
comment:38
Sounds like quite a big job, needing people who know enough about elliptic curves and also enough about UniqueFactories. Perhaps we can recruit Nils Bruin to help? |
comment:39
I have been working on a branch that makes elliptic curves unique using My approach removes the need for a separate "database curve" attached to an elliptic curve over Q. With my branch, an elliptic curve constructed from the database is identical to the same curve constructed using Weierstrass coefficients. Moreover, the curves returned by I have to add some documentation and will upload my branch soon. There are unfortunately two remaining doctest failures, which are manifestations of #10665 and #16317. |
Changed author from Simon King to Peter Bruin |
Changed branch from u/defeo/ticket/11474 to u/pbruin/11474-elliptic_curves_unique |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Reviewer: Volker Braun |
Changed branch from u/pbruin/11474-elliptic_curves_unique to |
comment:44
Follow-up: #17415. |
Changed commit from |
While elliptic curves are derived from
sage.structure.parent.Parent
, they violate the "unique parent" condition:Some people on sage-nt originally agreed that it is a bug. Other people think it isn't...
Depends on #10665
Depends on #16317
CC: @JohnCremona @defeo @sagetrac-sbesnier @jpflori
Component: elliptic curves
Keywords: unique parent
Author: Peter Bruin
Branch:
f7f3755
Reviewer: Volker Braun
Issue created by migration from https://trac.sagemath.org/ticket/11474
The text was updated successfully, but these errors were encountered: