ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 30 Oct 2019 12:47:49 +0100In booleanpolynomialring how we can find coefficient?https://ask.sagemath.org/question/48531/in-booleanpolynomialring-how-we-can-find-coefficient/ Let x1 ,x2,x3, v1,v2,v3 be the variable in a booleanpolynomialring. Let
F = 1+ x1*v1*v2 + x2*v1*v2 + x1*v3+ x2*x3+ v1
Now what is the coefficient of v1*v2?
In this case it will be x1+x2.
How can I find this using sagemath.
I try to use F.coefficient(v1*v2). But it not work.
Plese help. Mon, 28 Oct 2019 05:48:35 +0100https://ask.sagemath.org/question/48531/in-booleanpolynomialring-how-we-can-find-coefficient/Answer by Emmanuel Charpentier for <p>Let x1 ,x2,x3, v1,v2,v3 be the variable in a booleanpolynomialring. Let
F = 1+ x1<em>v1</em>v2 + x2<em>v1</em>v2 + x1<em>v3+ x2</em>x3+ v1</p>
<p>Now what is the coefficient of v1<em>v2?
In this case it will be x1+x2.
How can I find this using sagemath.
I try to use F.coefficient(v1</em>v2). But it not work.
Plese help. </p>
https://ask.sagemath.org/question/48531/in-booleanpolynomialring-how-we-can-find-coefficient/?answer=48538#post-id-48538Homework ?
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...Tue, 29 Oct 2019 07:47:48 +0100https://ask.sagemath.org/question/48531/in-booleanpolynomialring-how-we-can-find-coefficient/?answer=48538#post-id-48538Comment by Rahul for <p>Homework ?</p>
<p>Just a hint, for now: if I understand you correctly, you're trying to use <code>v1, v2, v3</code> as the <em>indeterminates</em> of a (boolean) polynomial whose <em>coefficients</em> are themselves boolean polynomials. Try to implement that...</p>
https://ask.sagemath.org/question/48531/in-booleanpolynomialring-how-we-can-find-coefficient/?comment=48552#post-id-48552i write this code:
from sage.crypto.boolean_function import BooleanFunction
B.<x1,x2,x3,v1,v2,v3> = BooleanPolynomialRing()
x = B.gens()
F = 1+ x1*v1*v2 + x2*v1*v2 + x1*v3+ x2*x3 + 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'Wed, 30 Oct 2019 12:47:49 +0100https://ask.sagemath.org/question/48531/in-booleanpolynomialring-how-we-can-find-coefficient/?comment=48552#post-id-48552