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 [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
URL: http://www.sagemath.org

Reply via email to