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.Fri, 21 Apr 2017 15:01:22 +0200Ideals and commutative ringshttps://ask.sagemath.org/question/37359/ideals-and-commutative-rings/ I consider a matrix $M$ which I transform into a system of equations similar as this (but with a different $M$)
sage: M=matrix(3,3,[1,2,3,4,5,6,7,8,9])
sage: P=PolynomialRing(GF(p),M.nrows(),names="x")
sage: (vector(P.gen(i) for i in range(3))*M).list()
[x0 + 4*x1 + 7*x2, 2*x0 + 5*x1 + 8*x2, 3*x0 + 6*x1 + 9*x2]
(Example taken from another equation where $p$ is a prime).
When I try to create the ideal generated by this system, I get the following error : TypeError: R must be a commutative ring. Any idea how I can fix this?
Fri, 21 Apr 2017 14:18:51 +0200https://ask.sagemath.org/question/37359/ideals-and-commutative-rings/Answer by B r u n o for <p>I consider a matrix $M$ which I transform into a system of equations similar as this (but with a different $M$)</p>
<p>sage: M=matrix(3,3,[1,2,3,4,5,6,7,8,9])</p>
<p>sage: P=PolynomialRing(GF(p),M.nrows(),names="x")</p>
<p>sage: (vector(P.gen(i) for i in range(3))*M).list()</p>
<p>[x0 + 4<em>x1 + 7</em>x2, 2<em>x0 + 5</em>x1 + 8<em>x2, 3</em>x0 + 6<em>x1 + 9</em>x2]</p>
<p>(Example taken from another equation where $p$ is a prime).</p>
<p>When I try to create the ideal generated by this system, I get the following error : TypeError: R must be a commutative ring. Any idea how I can fix this?</p>
https://ask.sagemath.org/question/37359/ideals-and-commutative-rings/?answer=37360#post-id-37360I do not understand what your problem is. The computation you want to perform works as far as I can tell:
sage: p = 65539
sage: M = matrix(3,3,[1,2,3,4,5,6,7,8,9])
sage: P = PolynomialRing(GF(p),M.nrows(),names="x")
sage: L =(vector(P.gen(i) for i in range(3))*M).list()
sage: P.ideal(L)
Ideal (x0 + 4*x1 + 7*x2, 2*x0 + 5*x1 + 8*x2, 3*x0 + 6*x1 + 9*x2) of Multivariate Polynomial Ring in x0, x1, x2 over Finite Field of size 65539
Fri, 21 Apr 2017 14:48:34 +0200https://ask.sagemath.org/question/37359/ideals-and-commutative-rings/?answer=37360#post-id-37360Comment by Sasha-dpt for <p>I do not understand what your problem is. The computation you want to perform works as far as I can tell:</p>
<pre><code>sage: p = 65539
sage: M = matrix(3,3,[1,2,3,4,5,6,7,8,9])
sage: P = PolynomialRing(GF(p),M.nrows(),names="x")
sage: L =(vector(P.gen(i) for i in range(3))*M).list()
sage: P.ideal(L)
Ideal (x0 + 4*x1 + 7*x2, 2*x0 + 5*x1 + 8*x2, 3*x0 + 6*x1 + 9*x2) of Multivariate Polynomial Ring in x0, x1, x2 over Finite Field of size 65539
</code></pre>
https://ask.sagemath.org/question/37359/ideals-and-commutative-rings/?comment=37361#post-id-37361My matrix is slightly different and has many zeros. Maybe this causes the ring R to be non-commutative. I will have a look. Thanks for your answer!Fri, 21 Apr 2017 15:01:22 +0200https://ask.sagemath.org/question/37359/ideals-and-commutative-rings/?comment=37361#post-id-37361