I guess this is a bug but you for now you can just coerce into k first,
right?

On Thu, May 21, 2009 at 12:13 PM, Jerome Lefebvre
<jerome.p.lefeb...@gmail.com> wrote:
>
> Hello,
> I've been trying to convert gap complex number to Sage complex
> numbers, and not doing well.
> More precisely, given a gap object, x, that represents some number and
> given a field,k, (coming from Sage), I'd like to find y\in k that
> equivalent to x. While the math is obviously field specific, the code
> seems to be so as well.
> For example;
> sage: x = gap('E(3) + E(10)')
> sage: x
> -E(15)^2+E(15)^4-E(15)^8-E(15)^11
> sage: k = CyclotomicField(x.CONDUCTOR())
> sage: k(x)
> -zeta15^7 + zeta15^6 + zeta15^5 + zeta15^3 - zeta15^2 + 1
> sage: CC(x)
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call
> last)
> [....]
> sage: y = k(x)
> sage: CC(y)
> 0.309016994374948 + 1.45381065607691*I
>
> Does anybody know of the way this should be done?
>
> I guess this is related to this bug ;
> http://trac.sagemath.org/sage_trac/ticket/5618
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to