# In booleanpolynomialring how we can find coefficient?

Let x1 ,x2,x3, v1,v2,v3 be the variable in a booleanpolynomialring. Let F = 1+ x1v1v2 + x2v1v2 + x1v3+ x2x3+ v1

Now what is the coefficient of v1v2? In this case it will be x1+x2. How can I find this using sagemath. I try to use F.coefficient(v1v2). But it not work. Plese help.

edit retag close merge delete

Sort by ยป oldest newest most voted

Homework ?

Just a hint, for now: if I understand you correctly, you're trying to use v1, v2, v3 as the indeterminates of a (boolean) polynomial whose coefficients are themselves boolean polynomials. Try to implement that...

more

i write this code: from sage.crypto.boolean_function import BooleanFunction
B.<x1,x2,x3,v1,v2,v3> = BooleanPolynomialRing()
x = B.gens()
F = 1+ x1v1v2 + x2v1v2 + x1v3+ x2x3 + v1
F.coefficient(v1*v2)

but it shows :

Traceback (click to the left of this block for traceback)
...
AttributeError: 'sage.rings.polynomial.pbori.BooleanPolynomial' object
has no attribute 'coefficient'

( 2019-10-30 12:47:49 +0200 )edit