On Sep 10, 2009, at 5:24 AM, J. Cooley wrote:

> Hi
>
> I'm trying to write some code involving isogenies that will work over
> different types of fields (at least rational and finite and hopefully
> number fields too.)

Cool.

> Part of the code includes the line:
>
> fp.numerator()-j*fp.denominator() where fp is a polynomial in t over
> Qt = FractionField(PolynomialRing(QQ,'t')

What is j?

>
> for the elliptic curve
> E = EllipticCurve([1,0,1,4, -6]); E
>
> we have
> sage: E.j_invariant()
> 9938375/21952
> sage: type(E.j_invariant())
> <type 'sage.rings.rational.Rational'>
>  and this works fine
>
> but for
> sage: E = EllipticCurve(GF(13^4, 'a'),[2,8])
> sage: E.j_invariant()
> 4
> sage: type(E.j_invariant())
> <type 'sage.rings.finite_field_givaro.FiniteField_givaroElement'>
>
> and so I get the error
> TypeError: unsupported operand parent(s) for '-': 'Univariate
> Polynomial Ring in t over Rational Field' and 'Univariate Polynomial
> Ring in t over Finite Field in a of size 13^4'
>
> I have tried replacing j with QQ(j), but I got the error
> TypeError: Unable to coerce 4 (<type
> 'sage.rings.finite_field_givaro.FiniteField_givaroElement'>) to
> Rational
>
> Not quite sure how to proceed!

It looks like you're trying to mix rational numbers and elements of GF 
(13^4), which shouldn't work, but it's unclear from the above  
examples where the mixing is occurring. Could you give the code that  
leads up to the error?

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an 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