You can use dictionaries, like this:
sage: R.<x,y> = PolynomialRing(GF(2),2,'xy')
sage: coeffs = {(1, 0): 1, (1, 1): 1}
sage: R(coeffs)
x*y + x
On Thu, Feb 5, 2009 at 12:31 PM, Christophe Oosterlynck
<[email protected]> wrote:
>
> Hi,
>
> is there a way to construct a polynomial using a coefficient vector?
> If I construct a polynomial ring ( R = BooleanPolynomialRing(5,'x') ),
> I want to be able to construct, for example, a polynomial "x0 +x0*x1"
> by using the coefficients vector [0,1,0,0,0,0,1,0,0,0,0 ... ]
>
> thanks
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---