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

Bug in elliptic curve Galois Representation #19229

Closed
JohnCremona opened this issue Sep 17, 2015 · 49 comments
Closed

Bug in elliptic curve Galois Representation #19229

JohnCremona opened this issue Sep 17, 2015 · 49 comments

Comments

@JohnCremona
Copy link
Member

sage: K.<a> = NumberField(x^2-x+1)
sage: E = EllipticCurve([a+1,1,1,0,0])
sage: C = E.isogeny_class()
...
ValueError: 0 is not prime.

is caused by

sage: from sage.schemes.elliptic_curves.isogeny_class import possible_isogeny_degrees
sage: possible_isogeny_degrees(E)                                                                      
[0]

and in turn by

sage: EG = E.galois_representation()
sage: EG.reducible_primes()
[0]

According to the documentation for the last function it should return [0] if and only if E has CM, which is does not:

sage: E.has_cm()
False
sage: E.j_invariant().is_integral()
False

(CM curves certainly have integral j-invariant, so you don't need to trust the is_cm() method to believe that!)

Component: elliptic curves

Keywords: Galois representations

Author: John Cremona

Branch/Commit: 8680baa

Reviewer: Frédéric Chapoton

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

@JohnCremona
Copy link
Member Author

comment:1

Tracked down to {{{_semistable_reducible_primes()}} in line 801:

F = NumberField(y**2 - a, 'a')

where a is an integer, but then the code base-changes the base field to this field Q(sqrt(a)), and there is a problem since 'a' is the name of K's generator. This causes a ValueError which is caught in the wrong place in lines 292-4:

        try:
            bad_primes = _semistable_reducible_primes(E)
        except ValueError:
            return [0]

I will fix this by putting in a test for CM much earlier (which did not exist when this code was written). Also when constructing F we can make sure that the name of iots generator is not the same as that of K.

@JohnCremona
Copy link
Member Author

Author: John Cremona

@JohnCremona

This comment has been minimized.

@JohnCremona
Copy link
Member Author

Commit: df3d3f7

@JohnCremona
Copy link
Member Author

New commits:

df3d3f719229: e.c. gal.reps. bug fix

@JohnCremona
Copy link
Member Author

Branch: u/cremona/19229

@JohnCremona
Copy link
Member Author

comment:4

Fixed as follows: on construction of the GaloisRepresentation object the CM status of the elliptic curve is assessed and cached. This enables some cleaning of the code later where we never have to rely on the raising of exceptions to catch situations which only happen in the CM case. This does not in itself fix the bug, we just get a different error, so the second fix is to make the variable name of a number field constructed on one function not clash.

Appropriate doctests added here and in the docstring for E.isogeny_class().

@JohnCremona

This comment has been minimized.

@JohnCremona
Copy link
Member Author

comment:6

Anyone out there?

@jdemeyer
Copy link

jdemeyer commented Dec 8, 2015

comment:7

What's the point of this "poor man's caching", why not use cached_method?

+        self._has_cm = E.has_cm()
+        self._has_rational_cm = E.has_rational_cm()

There seems to be an indentation problem with

+ # ramified primes

Funny spacing:

+ if E .has_bad_reduction(P):

@JohnCremona
Copy link
Member Author

comment:8

Replying to @jdemeyer:

What's the point of this "poor man's caching", why not use cached_method?

+        self._has_cm = E.has_cm()
+        self._has_rational_cm = E.has_rational_cm()

No reason, but that is how it was, and this is a bug fix.

There seems to be an indentation problem with

+ # ramified primes

Funny spacing:

+ if E .has_bad_reduction(P):

I will look at those.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 9, 2015

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

83f8108Merge branch 'u/cremona/19229' of trac.sagemath.org:sage into 19229
cbd7a97#19229: fixes after review

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 9, 2015

Changed commit from df3d3f7 to cbd7a97

@JohnCremona
Copy link
Member Author

comment:10

I merged with current beta, fixed the two spacing issues, made 3 methods into cached_methods as suggested. I also tidied up imports in ell_number_field.

Please re-review!

@jdemeyer
Copy link

jdemeyer commented Dec 9, 2015

comment:11

Did you do something while committing? I see you added files src/sage/schemes/hyperelliptic_curves/hypellfrob.cpp and src/sage/schemes/toric/divisor_class.c

I recommend to fix this using --amend to make sure these added files don't appear in the git history at all.

@JohnCremona
Copy link
Member Author

comment:12

That was a mistake. git is showing up hundreds of .c, .cpp, .h files which makes "git status" hard to read and I added some files by mistake but then thought that I had removed them again. What a pain. I'll fix it.

@jdemeyer
Copy link

jdemeyer commented Dec 9, 2015

comment:13

Replying to @JohnCremona:

git is showing up hundreds of .c, .cpp, .h files which makes "git status" hard to read

This isn't supposed to be like that. Do yourself a favour and remove those files.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 9, 2015

Changed commit from cbd7a97 to 62accc0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 9, 2015

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

62accc019229: fixes after review

@JohnCremona
Copy link
Member Author

comment:15

Replying to @jdemeyer:

Replying to @JohnCremona:

git is showing up hundreds of .c, .cpp, .h files which makes "git status" hard to read

This isn't supposed to be like that. Do yourself a favour and remove those files.

Any idea how they got there? None have anything to do with anything I have done. I presume a simple rm (not git) will suffice?

I fixed the commit...

@fchapoton
Copy link
Contributor

comment:25

does no longer apply.

@JohnCremona
Copy link
Member Author

comment:26

Dammit, I thought this was merged ages ago. So I'll fix it -- I am using it every day!

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 4, 2016

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

3ce177aMerge branch 'develop' into 19229
de3fdf1minor changes to imports in one file

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 4, 2016

Changed commit from e640e42 to de3fdf1

@JohnCremona
Copy link
Member Author

comment:28

OK, I merged into 7.0.beta1 and make some import adjustments so it now works.


New commits:

3ce177aMerge branch 'develop' into 19229
de3fdf1minor changes to imports in one file

@fchapoton
Copy link
Contributor

comment:29

two failing doctests !

@JohnCremona
Copy link
Member Author

comment:30

I can guess which ones wince I noticed that there are two which sometoimes do work and sometimes do not. Since you do not tell me, I guess that these are the 2 6x6 matrices for the CM isogeny class example with class number 6.

In my defence, I can assure you that on my machine the tests did pass before I uploaded the branch....

@fchapoton
Copy link
Contributor

comment:31

To know the failing doctest, you have to click on the patchbot icon (currently yellow with a question mark) at the top right of this page.

Then click on the "shortlog" link of the next-to-last report by "poseidon" patchbot.

This is indeed a 66 matrix of numbers and a 66 matrix of lists.

@JohnCremona
Copy link
Member Author

comment:32

Yes that is the thing I was expecting. Note that there is another bot on which the test passes. It's something nondeterministic in how I sort the curves in an isogeny class.

@JohnCremona
Copy link
Member Author

comment:33

By the, this (sometimes) failing doctest has nothing whatsoever to do with the changes on this ticket, but there is some randomness creeping into the sorting of curves.

@fchapoton
Copy link
Contributor

comment:34

I have found a typo (several times):

infintely many primes

Otherwise looks good to me (but I am no expert)

@fchapoton fchapoton modified the milestones: sage-6.10, sage-7.1 Feb 4, 2016
@JohnCremona
Copy link
Member Author

comment:36

Would people be bothered if I marked the two strange doctests as "random" for the time being? Otherwise this sorting issue is delaying the merging of a genuine bug-fix. I have a strong personal incentive to get the sorting issue dealt with, but that should not be on this ticket anyway.

I plan to update the branch accordingly.

@jdemeyer
Copy link

jdemeyer commented Feb 9, 2016

comment:37

Replying to @JohnCremona:

Would people be bothered if I marked the two strange doctests as "random" for the time being?

With proper documentation and a reference to the discussion, no problem.

@JohnCremona
Copy link
Member Author

comment:38

Replying to @jdemeyer:

Replying to @JohnCremona:

Would people be bothered if I marked the two strange doctests as "random" for the time being?

With proper documentation and a reference to the discussion, no problem.

OK, I'll see if I can meet your high standards or "proper"!

I corrected all occurrences of "infintely" also (2 here, but a few a other places).

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 9, 2016

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

226821fcorrected typo infinite(ly) in a few places
8680baamade two doctests random pending #20028

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 9, 2016

Changed commit from de3fdf1 to 8680baa

@JohnCremona
Copy link
Member Author

comment:40

I opened a new ticket #20028 for the issue of sorting number field elements. Th ebranch now marks thoe tests as #random and refers to the discussion on this ticket.


New commits:

226821fcorrected typo infinite(ly) in a few places
8680baamade two doctests random pending #20028

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:41

ok, good enough for me

@vbraun
Copy link
Member

vbraun commented Feb 10, 2016

Changed branch from u/cremona/19229 to 8680baa

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

4 participants