# Revision history [back]

### Solve for coeffcients of polynomials

I want to solve for the coefficients $\alpha(n,m,)$ an equation that looks like this:

$$0=(1+x+y+z)\sum_{n,m,l\in0,1,\dots,N} \alpha(n,m,l)x^ny^mz^k$$ Where $\alpha(n,m,)\in{0,1}$ and $x^ny^mz^k$ are polynomials over $\mathbb{F}_2$ that satisfy $x^L=y^L=z^L=1$ for some integer $L$.
Is there a way to do this in sage?

 2 None slelievre 15399 ●18 ●144 ●304 http://carva.org/samue...

### Solve for coeffcients of polynomials

I want to solve for the coefficients $\alpha(n,m,)$ $\alpha(n, m, k)$ an equation that looks like this:

$$0=(1+x+y+z)\sum_{n,m,l\in0,1,\dots,N} \alpha(n,m,l)x^ny^mz^k$$ Where $\alpha(n,m,)\in{0,1}$ this: $$0 = (1 + x + y + z) \sum_{n, m, k \in \{0, 1, \dots, N\}} \alpha(n, m, k) x^n y^m z^k$$ where $\alpha(n, m, k) \in \{0, 1\}$ and $x^ny^mz^k$ $x^n y^m z^k$ are polynomials over $\mathbb{F}_2$ that satisfy $x^L=y^L=z^L=1$ satisfy $x^L = y^L = z^L = 1$ for some integer $L$.
$L$.

Is there a way to do this in sage?Sage?

 3 None slelievre 15399 ●18 ●144 ●304 http://carva.org/samue...

### Solve for coeffcients of polynomials

I want to solve for the coefficients $\alpha(n, m, k)$ an equation that looks like this: $$0 = (1 + x + y + z) \sum_{n, m, k \in \{0, 1, \dots, N\}} \alpha(n, m, k) x^n y^m z^k$$ where $\alpha(n, m, k) \in \{0, 1\}$ and $x^n y^m z^k$ are polynomials over $\mathbb{F}_2$ that satisfy $x^L = y^L = z^L = 1$ for some integer $L$.

Is there a way to do this in Sage?

### Solve for coeffcients coefficients of polynomials

I want to solve for the coefficients $\alpha(n, m, k)$ an equation that looks like this: $$0 = (1 + x + y + z) \sum_{n, m, k \in \{0, 1, \dots, N\}} \alpha(n, m, k) x^n y^m z^k$$ where $\alpha(n, m, k) \in \{0, 1\}$ and $x^n y^m z^k$ are polynomials over $\mathbb{F}_2$ that satisfy $x^L = y^L = z^L = 1$ for some integer $L$.

Is there a way to do this in Sage?

I tried to follow this answer and wrote this code that failed-

R = PolynomialRing(GF(2),3,"xyz")
x,y,z = R.gens()
S.<a,b,c> = R.quotient((x^2 + 1,y^2+1,z^2+1))
K = PolynomialRing(GF(2),2,'a') # Coefficients
a= K.gens()

Pol = (a[1]*a+a[0])*(a*b)-5*b*a # Equation to solve

K.ideal(Pol.coefficients())
I = K.ideal(Pol.coefficients())
I.variety()


And I get the following error:

TypeError                              Traceback (most recent call last) <ipython-input-183-38877ec0fab3> in <module>
2 a= K.gens()
3
----> 4 Pol = (a[Integer(1)]*a+a[Integer(0)])*(a*b)-Integer(5)*b*a # Equation to solve
5
6 K.ideal(Pol.coefficients())

TypeError: can't multiply sequence by non-int of type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'


### Solve for coefficients of polynomials

I want to solve for the coefficients $\alpha(n, m, k)$ an equation that looks like this: $$0 = (1 + x + y + z) \sum_{n, m, k \in \{0, 1, \dots, N\}} \alpha(n, m, k) x^n y^m z^k$$ where $\alpha(n, m, k) \in \{0, 1\}$ and $x^n y^m z^k$ are polynomials over $\mathbb{F}_2$ that satisfy $x^L = y^L = z^L = 1$ for some integer $L$.

Is there a way to do this in Sage?

I tried to follow this answer and wrote this code that failed-

R = PolynomialRing(GF(2),3,"xyz")
x,y,z = R.gens()
S.<a,b,c> = R.quotient((x^2 + 1,y^2+1,z^2+1))
K = PolynomialRing(GF(2),2,'a') PolynomialRing(GF(2),2,'q') # Coefficients
a= q = K.gens()

Pol = (a[1]*a+a[0])*(a*b)-5*b*a (q[1]*a+q[0])*(a*b)-5*b*a # Equation to solve

K.ideal(Pol.coefficients())
I = K.ideal(Pol.coefficients())
I.variety()


And I get the following error:

TypeError                               Traceback (most recent call last) <ipython-input-183-38877ec0fab3> last)
<ipython-input-90-e45cccb450b5> in <module>
2 a= 5 q = K.gens()
3 6
----> 4 7 Pol = (a[Integer(1)]*a+a[Integer(0)])*(a*b)-Integer(5)*b*a (q[Integer(1)]*a+q[Integer(0)])*(a*b)-Integer(5)*b*a # Equation to solve
5
6 8
9 K.ideal(Pol.coefficients())

/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/structure/element.pyx in sage.structure.element.Element.__mul__ (build/cythonized/sage/structure/element.c:12199)()
1513             return (<Element>left)._mul_(right)
1514         if BOTH_ARE_ELEMENT(cl):
-> 1515             return coercion_model.bin_op(left, right, mul)
1516
1517         cdef long value

/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/structure/coerce.pyx in sage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:11304)()
1246         # We should really include the underlying error.
1247         # This causes so much headache.
-> 1248         raise bin_op_exception(op, x, y)
1249
1250     cpdef canonical_coercion(self, x, y):

TypeError: can't multiply sequence unsupported operand parent(s) for *: 'Multivariate Polynomial Ring in q0, q1 over Finite Field of size 2' and 'Quotient of Multivariate Polynomial Ring in x, y, z over Finite Field of size 2 by non-int of type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'
the ideal (x^2 + 1, y^2 + 1, z^2 + 1)'


### Solve for coefficients of polynomials

I want to solve for the coefficients $\alpha(n, m, k)$ an equation that looks like this: $$0 = (1 + x + y + z) \sum_{n, m, k \in \{0, 1, \dots, N\}} \alpha(n, m, k) x^n y^m z^k$$ where $\alpha(n, m, k) \in \{0, 1\}$ and $x^n y^m z^k$ are polynomials over $\mathbb{F}_2$ that satisfy $x^L = y^L = z^L = 1$ for some integer $L$.

Is there a way to do this in Sage?Sage? Notice there are three generators $x,y,$ but the number of coefficents $alpha$ is $2^{3L}$.

I tried to follow this answer and wrote this code that failed-

R = PolynomialRing(GF(2),3,"xyz")
x,y,z = R.gens()
S.<a,b,c> = R.quotient((x^2 + 1,y^2+1,z^2+1))
K = PolynomialRing(GF(2),2,'q') # Coefficients
q = K.gens()

Pol = (q[1]*a+q[0])*(a*b)-5*b*a # Equation to solve

I = K.ideal(Pol.coefficients())
I.variety()


And I get the following error:

TypeError                                 Traceback (most recent call last)
<ipython-input-90-e45cccb450b5> in <module>
5 q = K.gens()
6
----> 7 Pol = (q[Integer(1)]*a+q[Integer(0)])*(a*b)-Integer(5)*b*a # Equation to solve
8
9 K.ideal(Pol.coefficients())

/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/structure/element.pyx in sage.structure.element.Element.__mul__ (build/cythonized/sage/structure/element.c:12199)()
1513             return (<Element>left)._mul_(right)
1514         if BOTH_ARE_ELEMENT(cl):
-> 1515             return coercion_model.bin_op(left, right, mul)
1516
1517         cdef long value

/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/structure/coerce.pyx in sage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:11304)()
1246         # We should really include the underlying error.
1247         # This causes so much headache.
-> 1248         raise bin_op_exception(op, x, y)
1249
1250     cpdef canonical_coercion(self, x, y):

TypeError: unsupported operand parent(s) for *: 'Multivariate Polynomial Ring in q0, q1 over Finite Field of size 2' and 'Quotient of Multivariate Polynomial Ring in x, y, z over Finite Field of size 2 by the ideal (x^2 + 1, y^2 + 1, z^2 + 1)'


### Solve for coefficients of polynomials

I want to solve for the coefficients $\alpha(n, m, k)$ an equation that looks like this: $$0 = (1 + x + y + z) \sum_{n, m, k \in \{0, 1, \dots, N\}} \alpha(n, m, k) x^n y^m z^k$$ where $\alpha(n, m, k) \in \{0, 1\}$ and $x^n y^m z^k$ are polynomials over $\mathbb{F}_2$ that satisfy $x^L = y^L = z^L = 1$ for some integer $L$.

Is there a way to do this in Sage? Notice there are three generators $x,y,$ but the number of coefficents $alpha$ $\alpha$ is $2^{3L}$.

I tried to follow this answer and wrote this code that failed-

R = PolynomialRing(GF(2),3,"xyz")
x,y,z = R.gens()
S.<a,b,c> = R.quotient((x^2 + 1,y^2+1,z^2+1))
K = PolynomialRing(GF(2),2,'q') # Coefficients
q = K.gens()

Pol = (q[1]*a+q[0])*(a*b)-5*b*a # Equation to solve

I = K.ideal(Pol.coefficients())
I.variety()


And I get the following error:

TypeError                                 Traceback (most recent call last)
<ipython-input-90-e45cccb450b5> in <module>
5 q = K.gens()
6
----> 7 Pol = (q[Integer(1)]*a+q[Integer(0)])*(a*b)-Integer(5)*b*a # Equation to solve
8
9 K.ideal(Pol.coefficients())

/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/structure/element.pyx in sage.structure.element.Element.__mul__ (build/cythonized/sage/structure/element.c:12199)()
1513             return (<Element>left)._mul_(right)
1514         if BOTH_ARE_ELEMENT(cl):
-> 1515             return coercion_model.bin_op(left, right, mul)
1516
1517         cdef long value

/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/structure/coerce.pyx in sage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:11304)()
1246         # We should really include the underlying error.
1247         # This causes so much headache.
-> 1248         raise bin_op_exception(op, x, y)
1249
1250     cpdef canonical_coercion(self, x, y):

TypeError: unsupported operand parent(s) for *: 'Multivariate Polynomial Ring in q0, q1 over Finite Field of size 2' and 'Quotient of Multivariate Polynomial Ring in x, y, z over Finite Field of size 2 by the ideal (x^2 + 1, y^2 + 1, z^2 + 1)'