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.Tue, 20 Dec 2016 11:00:31 +0100Grobner bases using sagehttps://ask.sagemath.org/question/36054/grobner-bases-using-sage/ Dear group members,
Suppose I am working with an ideal in polynomial ring with n variables w.r.t. some ordering say degrevlex. If I compute groebner basis of that ideal, then is there any tool via which one can compute total degree of each of the polynomial in Groebner basis using sage?Tue, 20 Dec 2016 09:49:00 +0100https://ask.sagemath.org/question/36054/grobner-bases-using-sage/Answer by tmonteil for <p>Dear group members,
Suppose I am working with an ideal in polynomial ring with n variables w.r.t. some ordering say degrevlex. If I compute groebner basis of that ideal, then is there any tool via which one can compute total degree of each of the polynomial in Groebner basis using sage?</p>
https://ask.sagemath.org/question/36054/grobner-bases-using-sage/?answer=36056#post-id-36056You can simply use list comprehension:
Setting example:
sage: R = PolynomialRing(QQ,3,'x',order='degrevlex') ; R
Multivariate Polynomial Ring in x0, x1, x2 over Rational Field
sage: R.inject_variables()
Defining x0, x1, x2
sage: I = R.ideal([x0*x1-x2^2,x1*x2]) ; I
Ideal (x0*x1 - x2^2, x1*x2) of Multivariate Polynomial Ring in x0, x1, x2 over Rational Field
sage: G = I.groebner_basis() ; G
[x2^3, x0*x1 - x2^2, x1*x2]
Then:
sage: [P.total_degree() for P in G]
[3, 2, 2]Tue, 20 Dec 2016 11:00:31 +0100https://ask.sagemath.org/question/36054/grobner-bases-using-sage/?answer=36056#post-id-36056