Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Apparently, you want to treat the x as coefficients and the v as indeterminates. One way do do this is to create a ring of polynomials in x1, x2, x3overGF(2) :

sage: R1.<x1, x2, x3>=GF(2)[]
sage: R1
Multivariate Polynomial Ring in x1,

then a ring of polynomials in v1, v2, v3over the latter :

sage: R.<v1, v2, v3>=R1[]
sage: R
Multivariate Polynomial Ring in v1, v2, v3 over Multivariate Polynomial Ring in x1, x2, x3 over Finite Field of size 2

Define f pver this one: sage: f = 1+x1x2v1v2 + x3v1v2 + v1v3 +x1x2v3

and, lo !, it works as you intended:

sage: f.coefficient(v1*v2)
x1*x2 + x3

There are probably other ways to do this.

HTH,