On Mon, May 27, 2013 at 9:00 PM, Santanu Sarkar
<sarkar.santanu....@gmail.com> wrote:
> Dear all,
>   In the following code, although the
> coefficient of x0 is 1+x1*x2, it returns
> 1.
>
> from sage.crypto.boolean_function import BooleanFunction
> R.<x0,x1,x2,x3,x4,x5>=BooleanPolynomialRing(6)
>
> f=(1+x1*x2)*x0+x4*x5
> print f.monomial_coefficient(x0)
>

I'm not sure if this helps but you could try

sage: R.<x0,x1,x2,x3,x4,x5>=PolynomialRing(GF(2),6)
sage: f=(1+x1*x2)*x0+x4*x5
sage: print f.coefficient(x0)
x1*x2 + 1

or

sage: R1.<x1,x2,x3,x4,x5>=BooleanPolynomialRing(5)
sage: R2.<x0>=PolynomialRing(R1, 1, "x0")
sage: f=(1+x1*x2)*x0+x4*x5
sage: print f.monomial_coefficient(x0)
x1*x2 + 1

> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to