Carl, regarding the parenthetical remark of your first reply, are you
saying the coercion error for plain old monomials below is supposed to
happen?

If so, then what's the simplest way to take an element f of a
polynomial ring R over a number field F and compute its embedded image
in RR= R.change_ring(QQbar), supposing you have an embedding phi: F --
> QQbar?  Grab the coefficients of f, compute their images under phi,
grab the monomials of f, redefine (not coerce) them in RR, and
reassemble the pieces in RR?

Alex

----------------------------------------------------------------------
| Sage Version 3.3, Release Date: 2009-02-21                         |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: var('t')
t
sage: F = NumberField(t^4+1, 'a')
sage: R.<x,y> = F[]
sage: f= x*y + x^2
sage: RR= R.change_ring(QQbar)
sage: print [RR(m) for m in f.monomials()]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/Users/arai021/<ipython console> in <module>()

/Applications/sage-3.3/local/lib/python2.5/site-packages/sage/rings/
polynomial/multi_polynomial_ring.pyc in __call__(self, x, check)

/Applications/sage-3.3/local/lib/python2.5/site-packages/sage/rings/
qqbar.pyc in __call__(self, x)

/Applications/sage-3.3/local/lib/python2.5/site-packages/sage/rings/
qqbar.pyc in __init__(self, x)

/Applications/sage-3.3/local/lib/python2.5/site-packages/sage/rings/
qqbar.pyc in __init__(self, parent, x)

TypeError: Illegal initializer for algebraic number


On Feb 21, 11:05 am, Alex Raichev <[email protected]> wrote:
> Sweet!  Thanks, Carl.
>
> Alex
>
> On Feb 20, 8:08 pm, Carl Witty <[email protected]> wrote:
>
> > On Feb 19, 10:16 pm, Carl Witty <[email protected]> wrote:
>
> > > There's a bug.  And, now that you've pointed out the bug, I figured
> > > out how to crash Sage with a segmentation fault; so it's a serious
> > > bug.  Thanks for reporting it!  This bug is now being tracked at
> > >http://trac.sagemath.org/sage_trac/ticket/5316
>
> > OK, I've posted a patch for the bug at that URL, and (assuming it gets
> > positively reviewed) the fix will be in Sage 3.3.
>
> > Carl
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to