-
-
Notifications
You must be signed in to change notification settings - Fork 419
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_exponential broken for curves over number fields #8820
Comments
comment:1
Actually, this makes sense because I'm not giving Pari the embedding to use. |
comment:2
Rats, I thought I had implemented this properly. The elliptic log does have examples over number fields with complex embeddings! This should be a lot easier... The period lattice has an embedding into CC (or RR) stored with it. That should be used to create a pari elliptic curve defined over RR or CC, there the pari function would work. I would much prefer to have our own Weierstrass functions implemented, but that's the situation right now. Note that this will involve some of the same code as #8815. |
comment:3
I am working on this right now. |
applies to 4.5.3.alpha2 |
comment:4
Attachment: trac_8820-elliptic-exp.patch.gz The patch implements this. I left the old code (using ellztopoint) for curves over QQ though the new code (using ellwp) works fine too, since the the output of many doctests would have changed (in insignificant bits), especially in heegner.py. I also documented a couple of functions in period_lattice.py which were not, so that file now has 100% coverage. |
Author: John Cremona |
comment:5
I get doctest failures, like the typical case below. It should be considered numerical noise, but somehow it is not a very good example then. I think a point (1,1) would give a more convincing example.
The lines that fail are 1424, 1426, 1428, 1440, 1450, 1452. |
comment:6
Replying to @categorie:
Which version is that? The patch says 4.5! |
comment:7
Replying to @JohnCremona:
Sorry, I meant "path". |
comment:8
It is 4.5.3 on my office computer. Not that I believe that it matters. It is just numerical noise. Both results are correct with an error 2.e-16. My question is whether we should change it to 2.2.... e-16, while we could take as an example a point (1,1) where 1.000000... would be a better illustration of the computations. Am I too picky ? Chris. |
comment:9
Replying to @categorie:
No, not at all -- using points which do not have 0 as a coordinate is a good idea! But I was confused since the test which fails does not appear to exist on my 4.6.alpha1.
|
comment:10
Replying to @JohnCremona:
Sorry, I am being completely stupid -- of course the failing test is in the patch and I was looking at unpatched files! But now I find that the patch does not apply to 4.6.alpha1 so I will have to rebase it. When I do that I will try to use better examples.
|
comment:11
Please try the rebased patch. I changes the point (0,0) to (-1,-1) in the bad example, but that was enough since the approximate imaginary parts were not exactly 0 -- which I got around by taking real parts where necessary. A little crude, but it avoids the fuzz. |
comment:12
John: I suppose you mean rebased to 4.6.alpha1 unless you have some super-secret pre-release version of sage-4.6.alpha2 :-) Also: you should use "PARI" instead of "Pari". |
comment:13
Replying to @jdemeyer:
yes, alpha1 |
comment:14
Replying to @JohnCremona:
I have now fixed all the offending "Pari" and "pari" in the patch, and all the files in elliptic_curves! |
applies to 4.6.alpha1 |
comment:15
Attachment: trac_8820-elliptic-exp-rebase.patch.gz John, I have rebased your patch such that it can be applied after the positively-reviewed #9931 (there were several conflicts). I also made some very small changes to the docstring of the |
Changed reviewer from Jeroen Demeyer to Chris Wuthrich, Jeroen Demeyer |
comment:21
Replying to @jdemeyer:
No problem -- I misunderstood, and also forgot that the original doctest failures were not from you but from Chris Wuthrich. Of course I would not positively review my own work! I have now added Chris to the list of reviewers, and hope that he'll be able to take another look at it. Needs review! |
comment:22
A few comments:
seems to refer to old code.
|
comment:24
Also, there is trouble with points which are very close to the point af infinity:
|
comment:25
Thanks for the comments, I will revise the patch accordingly. The very last point (evaluation when z is very small but not zero) will not be easy though. I think that I left in the special code for QQ since it was faster, but I may be mixing this up with the (harder!) elliptic logarithm. |
comment:26
Replying to @JohnCremona:
You could use |
comment:27
It's ok, I have fixed it and the only reason I have not yet upadted the patch is that I am getting lots of failures in heegner.py -- not for the first time. Several of the doctests there are not very well designed, so I may complain to Robert Bradshaw if I cannot fix them all! |
comment:28
8820_rebase_after_9931-new.patch adresses the doctest failures in heegner.py. I did this quite carefully (even refining a little the code which does the modular parametrization). I took account where sensible of Chris's remark that it is better in approximate doctests not to have numbers which are approximately zero; but when the output is an approximate integral Heegner point one cannot easily change the point. I hope reviewer(s) do not object to the various ways I found around this -- with very little use of ... and none (I think) of #random. Note that these Heegner examples are often going to be problematical since in many cases the point computed is approximately (0:1:0), i.e. the z in CC is approximately a period. In such examples it might be better just to output E.period_lattice().coordinates(z) rather than E.elliptic_exponential(z). However, I have adjusted the test for being integral (i.e. for z to b in the period lattice) in a way that I hope is a reasonable compromise: namely that the coordinates w.r.t. the lattice basis should be approximately integral in the sense that their fractional part is at most |
comment:29
Replying to @JohnCremona:
I like this solution. The One small suggestion: the doctest for |
comment:30
Replying to @JohnCremona:
Well, my personal opinion on this differs a bit. I think we should remember that doctests not only serve as tests, but also as documentation. I think it is always a difficult excercise to balance these two. For me personally, the balance always goes in favour of documentation. When needed, one can still add true tests in a |
comment:31
Replying to @jdemeyer:
Fair enough. In the heegner file, which I did not write any of, I did not want to re-think documentation/tests from scratch, although that might be a good idea; I just wanted to get things to work! (And I would not have had to do anything, I think, if I had not followed the suggestion to eliminate the specific QQ code from elliptic_exponential.) |
comment:32
I give all the changes to heegner.py in the patch "8820_rebase_after_9931-new.patch" a positive review. |
comment:33
You beat me to it :). Looks fine by me too. |
comment:34
There is a doctest failure on a 32-bit machine:
When this is fixed (just write -1.261...), this ticket can finally gets its positive_review. |
replaces previous |
comment:35
Attachment: 8820_rebase_after_9931-new.patch.gz Thanks to all, and apologies for missing that one. I have changed the patch as suggested and just tested it on a 32-bit machine as well as a 64-bit. That failing test is exactly the kind of thing it would be nice to avoid altogether in doctests, since the "true" value of the x-coordinate is 0, so all nonzero digits, and the sign, are completely spurious. Jeroen, if you are happy with this now could you mark it as "positive review"? Thanks. Release manager: only the last patch is to be applied. |
Merged: sage-4.6.alpha3 |
Perhaps Pari doesn't support curve not over Q?
CC: @jdemeyer @robertwb
Component: elliptic curves
Author: John Cremona
Reviewer: Chris Wuthrich, Jeroen Demeyer
Merged: sage-4.6.alpha3
Issue created by migration from https://trac.sagemath.org/ticket/8820
The text was updated successfully, but these errors were encountered: