bug in coercion and cyclotomic fields
This should work automagically:
----------------------------------------------------------------------
| Sage Version 4.2.1, Release Date: 2009-11-14 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: a = CyclotomicField(3).random_element()
sage: b = CyclotomicField(4).random_element()
sage: a + b
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/ghitza/.sage/temp/artin/9098/_home_ghitza__sage_init_sage_0.py in <module>()
/home/ghitza/sage-devel/local/lib/python2.6/site-packages/sage/structure/element.so in sage.structure.element.ModuleElement.__add__ (sage/structure/element.c:6989)()
/home/ghitza/sage-devel/local/lib/python2.6/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7021)()
TypeError: unsupported operand parent(s) for '+': 'Cyclotomic Field of order 3 and degree 2' and 'Cyclotomic Field of order 4 and degree 2'
sage: a * b
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/ghitza/.sage/temp/artin/9098/_home_ghitza__sage_init_sage_0.py in <module>()
/home/ghitza/sage-devel/local/lib/python2.6/site-packages/sage/structure/element.so in sage.structure.element.RingElement.__mul__ (sage/structure/element.c:10248)()
/home/ghitza/sage-devel/local/lib/python2.6/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7021)()
TypeError: unsupported operand parent(s) for '*': 'Cyclotomic Field of order 3 and degree 2' and 'Cyclotomic Field of order 4 and degree 2'
I think it's a coercion problem. If someone knows better, please change the trac component accordingly.
Change History (13)
Milestone: |
sage-5.11 →
sage-5.12
|
Milestone: |
sage-6.1 →
sage-6.2
|
Keywords: |
coercion cyclotomic added
|
Milestone: |
sage-6.2 →
sage-6.3
|
Milestone: |
sage-6.3 →
sage-6.4
|
Milestone: |
sage-6.4 →
sage-7.4
|
Authors: |
→ Frédéric Chapoton
|
Branch: |
→ u/chapoton/7589
|
Cc: |
stumpc5 added
|
Commit: |
→ 0a00b44d43002eaf650a418b516a838cb32f334f
|
Keywords: |
coxeter added
|
Milestone: |
sage-7.4 →
sage-8.3
|
Status: |
new →
needs_review
|
Reviewers: |
→ Travis Scrimshaw
|
Status: |
needs_review →
positive_review
|
Branch: |
u/chapoton/7589 →
0a00b44d43002eaf650a418b516a838cb32f334f
|
Resolution: |
→ fixed
|
Status: |
positive_review →
closed
|
Has anyone looked at this ticket? I ran into this today and discover that the issue has been reported 4 years ago... This bug is particularly confusing for the user, especially when you read the doc that says "Due to their default embedding into CC, cyclotomic number fields are all compatible", and goes on to show the following example:
It turns out Sage is able to compute that only because the first field contains the next two! Note the following test: