Opened 10 years ago
Closed 10 years ago
#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: | Merged in: | sage-5.1.beta5 | |
Authors: | R. Andrew Ohana | Reviewers: | William Stein |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
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 (1)
Change History (10)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
- Keywords sd40.5 added
- Status changed from new to needs_review
comment:3 follow-up: ↓ 4 Changed 10 years ago by
- 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 10 years ago by
- 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 10 years ago by
Can you mention the ticket number as :trac:`#13005`
in the documentation?
comment:6 in reply to: ↑ 5 Changed 10 years ago by
comment:7 Changed 10 years ago by
Never ever do this:
raise TypeError("cannot convert %s to real number"%(self))
Changed 10 years ago by
comment:8 Changed 10 years ago by
- Reviewers set to William Stein
- Status changed from needs_review to positive_review
LGTM
comment:9 Changed 10 years ago by
- Merged in set to sage-5.1.beta5
- Resolution set to fixed
- Status changed from positive_review to closed
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.