Hi Ahmad,

Unfortunately I know nothing about multivariate polynomials in sage,  
but in case you didn't already know, there is an easy way to find out  
what methods an object supports. For example I did this:

sage: k = GF(7)
sage: R = MPolynomialRing(k,2,x)
sage: x = R.gens()
sage: g = x[0]^3 + 2*x[1] + 5

Since g.list() doesn't work, I type "g." and then press Tab. I get a  
long list of methods attached to g. Then I see for example that I can  
do:

sage: g.dict()
{(0, 0): 5, (0, 1): 2, (3, 0): 1}

This is a dictionary representation of the coefficients of g, and  
there are probably other representations available too.

If I type:

sage: g.dict?

I get some documentation on what g.dict() does.

david

On Dec 1, 2007, at 10:37 AM, Ahmad wrote:

>
> Hi David,
>
> I think "list" function is enough for me if I extend the ring in two
> steps: first with free variables and then I extend it algebraically.
> Your solution is working for me in this way:
>
> sage: k = GF(2);
> sage: WRBasePolyRing = MPolynomialRing(k, 8, x); x =
> WRBasePolyRing.gens()
> sage: S = WRBasePolyRing['w']; w = S.gen()
> sage: WRPolyRing = S.quotient(w^4 + w^3 + w^2 + w + 1, 't'); t =
> WRPolyRing.gen()
> sage: X = x[0]*t + x[1]*t^2 + x[2]*t^4 + x[3]* t^8;
> sage: Y = x[4]*t + x[5]*t^2 + x[6]*t^4 + x[7]* t^8;
> sage: MyCurve = Y^2+X*Y+X^3+1
> sage: print MyCurve.list()
>
> [x0^2*x1 + x0*x1^2 + x0*x2^2 + x1*x2^2 + x0^2*x3 + x2*x3^2 + x3^3 +
> x2*x4 + x3*x4 + x1*x5 + x3*x5 + x5^2 + x0*x6 + x0*x7 + x1*x7 + 1,
> x0^2*x1 + x1^3 + x0^2*x2 + x0*x2^2 + x2^2*x3 + x3^3 + x3*x4 + x1*x5 +
> x2*x5 + x5^2 + x1*x6 + x0*x7 + x3*x7 + x7^2, x0^2*x1 + x0*x2^2 + x2^3
> + x1^2*x3 + x0*x3^2 + x3^3 + x0*x4 + x3*x4 + x4^2 + x1*x5 + x5^2 +
> x3*x6 + x0*x7 + x2*x7, x0^3 + x0^2*x1 + x1^2*x2 + x0*x2^2 + x1*x3^2 +
> x3^3 + x1*x4 + x3*x4 + x0*x5 + x1*x5 + x5^2 + x2*x6 + x6^2 + x0*x7]
>
> And after that as you mentioned, I can multiply the list by the basis
> change matrix.
>
> Thank you again (More question is on the way ... :">)
>
> Bests,
> Ahmad


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to