ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 13 Mar 2017 05:19:06 -0500The computation of Groebner basis not correct?http://ask.sagemath.org/question/36922/the-computation-of-groebner-basis-not-correct/I was trying to compute a Groebner basis for the ideal `I=<xz-y, y^2+z,x+1/2yz>`, using lex order.
I used the following code:
P.<x,y,z>=PolynomialRing(QQ,'lex')
I=ideal(x*z-y,y^2+z,x+(1/2)*y*z)
G=I.groebner_basis();G
The result is
[z^3 + 2*z, x^2 - 1/2*z, x*y - 1/2*z^2, y^2 + z, x*z - y, y*z + 2*x]
Since the computation is easy, I checked by hands but got different result. So I checked by Singular and got the same result as mine, which is
> groebner(I);
_[1]=z3+2z
_[2]=yz2+2y
_[3]=y2+z
_[4]=2x+yz
So the result from Sage is wrong, since `yz^2+2y` is in the ideal `I`, but is not in the Groebner basis from the first computation using `I.groebner_basis()`. Did I miss something in my command? Or is there a bug that needs to be fixed?Sun, 12 Mar 2017 14:59:54 -0500http://ask.sagemath.org/question/36922/the-computation-of-groebner-basis-not-correct/Answer by tmonteil for <p>I was trying to compute a Groebner basis for the ideal <code>I=<xz-y, y^2+z,x+1/2yz></code>, using lex order. </p>
<p>I used the following code:</p>
<pre><code>P.<x,y,z>=PolynomialRing(QQ,'lex')
I=ideal(x*z-y,y^2+z,x+(1/2)*y*z)
G=I.groebner_basis();G
</code></pre>
<p>The result is</p>
<pre><code>[z^3 + 2*z, x^2 - 1/2*z, x*y - 1/2*z^2, y^2 + z, x*z - y, y*z + 2*x]
</code></pre>
<p>Since the computation is easy, I checked by hands but got different result. So I checked by Singular and got the same result as mine, which is </p>
<pre><code>> groebner(I);
_[1]=z3+2z
_[2]=yz2+2y
_[3]=y2+z
_[4]=2x+yz
</code></pre>
<p>So the result from Sage is wrong, since <code>yz^2+2y</code> is in the ideal <code>I</code>, but is not in the Groebner basis from the first computation using <code>I.groebner_basis()</code>. Did I miss something in my command? Or is there a bug that needs to be fixed?</p>
http://ask.sagemath.org/question/36922/the-computation-of-groebner-basis-not-correct/?answer=36924#post-id-36924I tried with various engines (you can set the `algoritmh` parameter, see `I.groebner_basis?`), including singular itself, giac, naive implementation and they all agree. Are you sure about the meaning of `lex` order in Sage ?
Sun, 12 Mar 2017 16:31:23 -0500http://ask.sagemath.org/question/36922/the-computation-of-groebner-basis-not-correct/?answer=36924#post-id-36924Comment by KittyL for <p>I tried with various engines (you can set the <code>algoritmh</code> parameter, see <code>I.groebner_basis?</code>), including singular itself, giac, naive implementation and they all agree. Are you sure about the meaning of <code>lex</code> order in Sage ?</p>
http://ask.sagemath.org/question/36922/the-computation-of-groebner-basis-not-correct/?comment=36929#post-id-36929I realized I forgot to put `order='lex'`. Sage must have identified the '`lex`' as a variable. Thanks.Mon, 13 Mar 2017 05:19:06 -0500http://ask.sagemath.org/question/36922/the-computation-of-groebner-basis-not-correct/?comment=36929#post-id-36929Comment by KittyL for <p>I tried with various engines (you can set the <code>algoritmh</code> parameter, see <code>I.groebner_basis?</code>), including singular itself, giac, naive implementation and they all agree. Are you sure about the meaning of <code>lex</code> order in Sage ?</p>
http://ask.sagemath.org/question/36922/the-computation-of-groebner-basis-not-correct/?comment=36925#post-id-36925Thanks for your answer! I never set parameters. So what is the default? I thought 'lex' means lexicographical order, with whichever order placed in the '< >'. I will check the instructions.Sun, 12 Mar 2017 16:44:16 -0500http://ask.sagemath.org/question/36922/the-computation-of-groebner-basis-not-correct/?comment=36925#post-id-36925