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

eclib interface uses bad default value for elliptic curve modular symbols #31317

Closed
JohnCremona opened this issue Feb 1, 2021 · 14 comments
Closed

Comments

@JohnCremona
Copy link
Member

This was reported to me by Chris Wuthrich in December 2019, and by Barry Mazur and Karl Rubin a few days ago. I originally thought that there was a bug in eclib, but it turns out that the only bug is that the default value of certain parameters is too small for the cases they were interested in. I will post a 2-line patch to increase this. It has to be a 2-line patch, not 1, since the current eclib interfae does not expose the relevant parameter to Sage at all currently.

Here are two example. Wuthrich's (takes a little while as the conductor is 87416):

sage: E = EllipticCurve([49,-49])
sage: me = E.modular_symbol(implementation="eclib")
sage: me(1/8)
10/17
sage: mn = E.modular_symbol(implementation="num")
sage: mn(1/8)
1/2

and Mazur's:

sage: E = EllipticCurve('1590g1')                                                                                                                     
sage: ms = E.modular_symbol()                                                                                                                         
sage: [ms(a/5) for a in [1..4]]                                                                                                                       
[1001/153, -1001/153, -1001/153, 1001/153]
sage: ms = E.modular_symbol(implementation='num')                                                                                                     
sage: [ms(a/5) for a in [1..4]]                                                                                                                       
[13/2, -13/2, -13/2, 13/2]

In both cases, after my patch the 'eclib' values agree with the numerical values.

CC: @categorie

Component: elliptic curves

Keywords: elliptic curve modular symbol

Author: John Cremona

Branch/Commit: 2ab86ef

Reviewer: Chris Wuthrich

Issue created by migration from https://trac.sagemath.org/ticket/31317

@JohnCremona
Copy link
Member Author

Branch: u/cremona/31317

@JohnCremona
Copy link
Member Author

Commit: da09de4

@JohnCremona
Copy link
Member Author

comment:1

As well as adding the nap option to te interface itself I passed this up the chain so that users can see it too, with doctests. While there I tidied up the documentation a bit too.


New commits:

da09de4#31317 eclib elliptic curve modular symbols

@chriswuthrich
Copy link
Contributor

comment:2

Is there evidence that 1000 is the right bound for all curves? All for which it makes sense to use eclib. Maybe it should increase with the conductor. Probably 100*sqrt(N) or so is saver.

(sorry not to reply in full, busy with marking new semester etc)

@JohnCremona
Copy link
Member Author

comment:3

Replying to @categorie:

Is there evidence that 1000 is the right bound for all curves? All for which it makes sense to use eclib. Maybe it should increase with the conductor. Probably 100*sqrt(N) or so is safer.

Good point -- though at the top level E.modular_symbol() used default nap=400 in this patch. As you know, for large conductor it will take a long time to make this construction, so I rather doubt it will be used much for N>10000 (say), so a default which works on this range seemed reasonable. On the other hand, compared with the time it takes to construct the modular symbol space, the time to compute more ap from the curve is negligible, suggesting that having a higher default is better.

I will be changing eclib's own default (which is 300 ap) anyway, probably to 1000, and the way the code works is that it sets a minimum value of nap (currently 300) so that whatever value the user gives is increased to this if less. (i.e., there is in effect the line nap=max(300,nap) in eclib's relevant function.)

I would be so much happier if it were possible to get this normalising factor another way than by taking rations of periods. It is only needed at all so that we get the right answers for non-optima curves -- when you give it an optimal curve it goes to all this trouble to compute the ratio as 1 (or in the example before the fix it computed it as 73/68 or something), but I know of no way to do that. It would be possible to change eclib so that it assumes that the curve is optimal by default, only computing the normalisation factors if the users specifically asks. Then on the Sage side we could decide to use the default if the curve's label ends in '1', or if the isogeny class consists of only one curve.

The current fix is designed to be easily implemented as it requires no change to eclib -- which had no bugs in this regard, except possible the too low default value of 300.

But I will take your suggestion on board with a new patch, and while waiting for the review I'll test it as many curves as I can -- the test being that 'eclib' and 'num' give the same answer for all small rationals.

(sorry not to reply in full, busy with marking new semester etc)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 2, 2021

Changed commit from da09de4 to 2ab86ef

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 2, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

2ab86ef#31317: more intelligent default for nap

@JohnCremona
Copy link
Member Author

comment:5

I switched the default at at the top level to max(100*N.isqrt(),10000). I have started a test for all conductors up to (however far I get, but maybe) 10000. By comparison, even for conductors up to 500000 I was only computing 6000 ap when finding the curves, which requires far greater precision.

@JohnCremona
Copy link
Member Author

comment:6

For all curves of conductor up to 1000, with the new code, the 'eclib' and 'num' results agree (at all rationals with numerator and denominator bounded by 5). I'll continue to test more, but no-one need be in any doubt that this should be merged.

@chriswuthrich
Copy link
Contributor

Reviewer: Chris Wuthrich

@chriswuthrich
Copy link
Contributor

Author: John Cremona

@chriswuthrich
Copy link
Contributor

comment:7

I agree with all that is said here and I checked the code and all tests pass etc.

@JohnCremona
Copy link
Member Author

comment:8

Replying to @categorie:

I agree with all that is said here and I checked the code and all tests pass etc.

Thanks. Although some patchbots are reporting test failures these have nothing to do with this patch, so are less than helpful. Perhaps patchbots should first run all tests without applying the patch, and only if those pass would they apply the patch and retest. That would take twice as long but would avoid spurious failures like this which probably have the effect that the release manager assumes something is actually wrong and the bug-fix never gets merged.

@vbraun
Copy link
Member

vbraun commented Mar 9, 2021

Changed branch from u/cremona/31317 to 2ab86ef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants