Ticket #13005 (closed defect: fixed)
"maximum recursion depth exceeded" when doing change_ring(RR) on an elliptic curve
| Reported by: | was | Owned by: | cremona |
|---|---|---|---|
| Priority: | major | Milestone: | sage-5.1 |
| Component: | elliptic curves | Keywords: | sd40.5 |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | William Stein |
| Authors: | R. Andrew Ohana | Merged in: | sage-5.1.beta5 |
| Dependencies: | Stopgaps: |
Description
Behold this bug:
K.<a> = NumberField(x^2-5) EllipticCurve(K,[1..5]).change_ring(RR)
BOOM!
...
File "coerce_maps.pyx", line 82, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3345)
File "coerce_maps.pyx", line 77, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3248)
File "/Users/wstein/sage/build/sage-5.0/local/lib/python2.7/site-packages/sage/rings/complex_field.py", line 286, in _element_constructor_
if not isinstance(x, (real_mpfr.RealNumber, tuple)):
RuntimeError: maximum recursion depth exceeded while calling a Python object
Attachments
Change History
comment:2 Changed 12 months ago by rohana
- Keywords sd40.5 added
- Status changed from new to needs_review
- Authors set to R. Andrew Ohana
comment:3 follow-up: ↓ 4 Changed 12 months ago by roed
- Status changed from needs_review to needs_work
Can you add doctests for number fields that already embeds into a real field (possibly of precision different from that of R)?
comment:4 in reply to: ↑ 3 Changed 12 months ago by rohana
- Status changed from needs_work to needs_review
Replying to roed:
Can you add doctests for number fields that already embeds into a real field (possibly of precision different from that of R)?
Ok, done
comment:5 follow-up: ↓ 6 Changed 12 months ago by ppurka
Can you mention the ticket number as :trac:`#13005` in the documentation?
comment:7 Changed 12 months ago by was
Never ever do this:
raise TypeError("cannot convert %s to real number"%(self))
Note: See
TracTickets for help on using
tickets.


It's nothing to do with elliptic curves. Try
So the expected "natural" coercion from elements of K to elements of RR is blowing up, instead of using the default embedding.