Thank you so much. On 18 November 2014 00:02, slelievre <[email protected]> wrote:
> Santanu wrote: > > >> R.<v1, v2, v3>=BooleanPolynomialRing(3) >> f=v1*v2+v1*v3+v1 >> print f.coefficient(v1) >> >> I am getting >> >> Traceback (click to the left of this block for traceback) >> ... >> AttributeError: 'sage.rings.polynomial.pbori.BooleanPolynomial' object >> has no attribute 'coefficient' >> >> Answer should be v2+v3+1. I do not want >> >> to use R.<v1, v2, v3>=GF(2)[] as in this >> >> ring operations are much slower than >> R.<v1, v2, v3>=BooleanPolynomialRing(3). >> >> > Here v1 divides f so you could do > > sage: sum(m/v1 for m in f.monomials()) > > Without that assumption you could do > > sage: sum(m/v1 for m in (f-f(v1=0)).monomials()) > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
