Closed JohnCremona closed 9 years ago
Branch: u/cremona/ticket/16764
Commit: 8dff296
The changes in isogeny_class.py belong to #16743, not here, and should be ignored. I'll fix this.
Branch pushed to git repo; I updated commit sha1. New commits:
caf41e6 | #16764 revert changes to isogeny_class.py which belong in #16743 |
Replying to @JohnCremona:
The changes in isogeny_class.py belong to #16743, not here, and should be ignored. I'll fix this.
Done. This probably counts as rewriting history, too bad. #16743 will depend on this anyway.
Hello,
Lines after a .. NOTE::
should be indented by 4 spaces (not 3).
Replying to @fchapoton:
Hello,
Lines after a
.. NOTE::
should be indented by 4 spaces (not 3).
Are you sure? See http://sphinx-doc.org/markup/para.html. I was aligning the following text under the n of "note".
Oh, well. I was trusting
http://www.sagemath.org/doc/developer/coding_basics.html
but I wonder now who is right.
While you're at it, could you change the wording in the first line of the documentation of has_cm for elliptic curves over the rationals to be less ambiguous?
I've seen Complex Multiplication to mean over the base field and to mean over the algebraic closure, so "Returns True iff this elliptic curve has Complex Multiplication." is ambiguous. It could be "Returns True iff this elliptic curve has Complex Multiplication over the algebraic closure." or "Returns True iff this elliptic curve has a CM j-invariant." as in the number field case.
Replying to @mstreng:
While you're at it, could you change the wording in the first line of the documentation of has_cm for elliptic curves over the rationals to be less ambiguous?
I've seen Complex Multiplication to mean over the base field and to mean over the algebraic closure, so "Returns True iff this elliptic curve has Complex Multiplication." is ambiguous. It could be "Returns True iff this elliptic curve has Complex Multiplication over the algebraic closure." or "Returns True iff this elliptic curve has a CM j-invariant." as in the number field case.
Good point! Thanks. A suitable change for a reviewer's patch (as they used to be called)?
I will follow Marco's suggestion about the documentation for has_cm, and also add a field parameter to has_rational_cm (defaulting to the base_field) as William had suggested.
Done as above; also merged 6.3.rc1 into the branch.
Branch pushed to git repo; I updated commit sha1. New commits:
7852e0f | Merge branch 'develop' into cm |
I hope that merging in the develop branch (as at version 6.4.beta1) will make this easier to review and not harder!
Reviewer: Marco Streng
The documentation has three references to "the j
-invariant of an immaginary quadratic order",
which is either a whole Galois orbit or one specific complex number. In all those places it
should be "a j
-invariant of an imaginary quadratic order". I'm writing a reviewer patch
that corrects this.
Changed branch from u/cremona/ticket/16764 to u/mstreng/ticket/16764
Thanks, Marco. If that's the only thing you found I am delighted!
At some point a better implementation of the basic function (detecting whether an algebraic integer is a CM j-invariant) would be good, but the one there is fine for small degrees which is likely to be all that is needed most of the time.
New commits:
4aea367 | Reviewer patch for ticket 16764 with minor documentation fixes. |
Hi John. If you agree with my reviewer patch, you can set the ticket to postive_review.
New commits:
4aea367 | Reviewer patch for ticket 16764 with minor documentation fixes. |
Oops, I haven't set up my editor properly on this machine. Let me remove the tab character first...
Replying to @mstreng:
Oops, I haven't set up my editor properly on this machine. Let me remove the tab character first...
Never mind, the tab character is in some kind of xcode temp file, not in the actual source code.
All tests pass for me, the documentation builds nicely (I can see a tab character). So this all looks fine to me.
Changed reviewer from Marco Streng to Marco Streng, Chris Wuthrich
Changed branch from u/mstreng/ticket/16764 to 4aea367
What's the intention of the code
try:
D = self._CMD
if D:
return D
else:
raise ValueError("%s does not have CM"%self)
except:
pass
which is obviously equivalent to
try:
D = self._CMD
if D:
return D
except:
pass
I assume you meant something like
try:
D = self._CMD
except AttributeError:
pass
else:
if D:
return D
else:
raise ValueError("%s does not have CM"%self)
Apart from this issue, you really should never use except:
since that catches also KeyboardInterrupt
.
Replying to @jdemeyer:
Apart from this issue, you really should never use
except:
since that catches alsoKeyboardInterrupt
.
You are right. Could you reopen this ticket? This should not be merged into a stable version without fixing that code.
I will fix it in #17076.
Apologies, of course I meant to write "except AttributeError". I do know the rules.
To make absolutely sure: the field _CMD stores 0 if it has already been determined that E does not have CM, and in this case the method cm_discriminant raises an error -- not my choice but for compatibility with curves over Q. (I would have preferred to return 0 which is easy for other coed to check).
I'll be happy to review #17076 (though I seem to have forfeited my right to give any code a trustworthy review with this lapse).
Elliptic curves over the rationals have mathods
has_cm()
andcm_discriminant()
. We extend these to curves over number fields, and add a functionhas_rational_cm()
to indicate the the curve has CM which is defined over its base field (i.e. the CM discriminant is a square in that field), which is always False over QQ.Component: elliptic curves
Keywords: complex multiplication
Author: John Cremona
Branch:
4aea367
Reviewer: Marco Streng, Chris Wuthrich
Issue created by migration from https://trac.sagemath.org/ticket/16764