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, 23 Aug 2010 14:57:44 -0500Implementing different groebner_basis() algorithmshttp://ask.sagemath.org/question/7619/implementing-different-groebner_basis-algorithms/I'm not sure if this is the correct forum to ask this type of question, but I'll try anyway.
I am curious if there is a way to do the following in Sage. I would like a way to make a Groebner basis calculation to not worry about calculations involving polynomials of too high degree. Macaulay2's gb command has the ability to specify this with an option called HardDegreeLimit, for instance. The Sage documentation on groebner_basis seems to imply that I can use Macaulay2's gb command with this option, but I don't know how to make it work. Singular's std command also has a degBound option, but I again don't know how to use this in my Sage implementation.Mon, 23 Aug 2010 08:28:46 -0500http://ask.sagemath.org/question/7619/implementing-different-groebner_basis-algorithms/Answer by Mike Hansen for <p>I'm not sure if this is the correct forum to ask this type of question, but I'll try anyway.</p>
<p>I am curious if there is a way to do the following in Sage. I would like a way to make a Groebner basis calculation to not worry about calculations involving polynomials of too high degree. Macaulay2's gb command has the ability to specify this with an option called HardDegreeLimit, for instance. The Sage documentation on groebner_basis seems to imply that I can use Macaulay2's gb command with this option, but I don't know how to make it work. Singular's std command also has a degBound option, but I again don't know how to use this in my Sage implementation.</p>
http://ask.sagemath.org/question/7619/implementing-different-groebner_basis-algorithms/?answer=11523#post-id-11523With the current Groebner basis commands in Sage, there is not a good way to do this. None of the underlying methods like `_groebner_basis_macaulay2` support a degree limit.
As a workaround, you can do something like the following:
sage: P.<a,b,c> = PolynomialRing(QQ,3, order='lex')
sage: I = sage.rings.ideal.Katsura(P,3)
sage: I.groebner_basis() #compute the normal Groebner basis
[a - 60*c^3 + 158/7*c^2 + 8/7*c - 1, b + 30*c^3 - 79/7*c^2 + 3/7*c, c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c]
sage: singular.eval('degBound = 2;') #set the degree bound in Singular
'degBound = 2;'
sage: gb = Sequence(map(P, singular(I).std())); gb
[10*b*c - b + 12*c^2 - 4*c, 4*b^2 + 2*b*c - b, a + 2*b + 2*c - 1]
sage: singular.eval('degBound = 0;') #reset it back to 0 (unlimited)
'degBound = 0;'
I've made this ticket [#9789][1].
[1]: http://trac.sagemath.org/sage_trac/ticket/9789Mon, 23 Aug 2010 10:02:27 -0500http://ask.sagemath.org/question/7619/implementing-different-groebner_basis-algorithms/?answer=11523#post-id-11523Comment by Volker Braun for <p>With the current Groebner basis commands in Sage, there is not a good way to do this. None of the underlying methods like <code>_groebner_basis_macaulay2</code> support a degree limit.</p>
<p>As a workaround, you can do something like the following:</p>
<pre><code>sage: P.<a,b,c> = PolynomialRing(QQ,3, order='lex')
sage: I = sage.rings.ideal.Katsura(P,3)
sage: I.groebner_basis() #compute the normal Groebner basis
[a - 60*c^3 + 158/7*c^2 + 8/7*c - 1, b + 30*c^3 - 79/7*c^2 + 3/7*c, c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c]
sage: singular.eval('degBound = 2;') #set the degree bound in Singular
'degBound = 2;'
sage: gb = Sequence(map(P, singular(I).std())); gb
[10*b*c - b + 12*c^2 - 4*c, 4*b^2 + 2*b*c - b, a + 2*b + 2*c - 1]
sage: singular.eval('degBound = 0;') #reset it back to 0 (unlimited)
'degBound = 0;'
</code></pre>
<p>I've made this ticket <a href="http://trac.sagemath.org/sage_trac/ticket/9789">#9789</a>.</p>
http://ask.sagemath.org/question/7619/implementing-different-groebner_basis-algorithms/?comment=22917#post-id-22917I agree with your answer, but I think your example is misleading. The Singular manual states that "degBound should not be used for a global ordering with inhomogeneous input". I'm pretty sure that the output for a non-homogeneous ideal is potentially not the degree truncation of an actual GB.Mon, 23 Aug 2010 14:57:44 -0500http://ask.sagemath.org/question/7619/implementing-different-groebner_basis-algorithms/?comment=22917#post-id-22917