Victor,

It is quite likely true that the functionality which you are using
from PARI/gp is usable from Sage without you needing to do the
interface yourself.

For example:

sage: E = EllipticCurve([0,0,-1,1,0])
sage: an = E.anlist(1000)
sage: q = CC(2*pi*I*(0.1+0.2*I)).exp()   // randomly chosen point in
upper half-plane!
sage: sum([an[n]*q^n for n in range(1,1000)])
0.175210435119826 + 0.0210885398756192*I

Note also
sage: phi = E.modular_parametrization()
sage: phi(0.1+0.2*I)
(13.1933643695215 - 15.0369223250467*I : -25.6051807665959 +
85.5625648931529*I : 1.00000000000000)


John Cremona

On Dec 11, 10:06 pm, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote:
> On 2010-12-11 20:24, victor wrote:
>
> > I work with 'Sage Version 4.6, Release Date: 2010-10-30' on a Mac OS X
> > 10.6.5.
>
> > I have some problems interfacing with Pari, probably due to my
> > inexperience. Could you please tell me why do I get the errors below?
>
> The problem with what you are doing is that Sage variables and PARI
> variables are completely distinct.  In fact, it is probably best to
> avoid PARI variables as much as possible and use only Sage variables.
>
> > sage: E = pari('ellinit([0,0,1,-1,0])')
>
> Here, E is a Sage variable.
>
> > sage: pari('a=ellan(E,1000)')
>
> You are trying to use a Sage variable in PARI, which doesn't work
>
> > I know I can instead do the following, which works:
> > sage: a=pari(E.ellan(1000))
>
> This works indeed.  Note that you don't need the pari() here, because
> E.ellan() already returns an object of type "gen" (which is the type for
> PARI objects).
>
> > But then the line below produces again a similar error:
>
> > sage: pari('sum(n=1,5,a[n]*q^n)')
>
> If you want to do this, you could do
> sage: pari('a=%s; sum(n=1,5,a[n]*q^n)'%a)
>
> Here, "%s" is replaced by the string representation of a.  Note that
> this is not very efficient because strings are used, it is also error-prone.
>
> Jeroen.

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

Reply via email to