# The degree of a poynomial in a quotient ring

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hello,

I am defining a ring, R, two polynomials, p1 and p2, an ideal, I=<p1>, the quotient ring S=R/I, and then I compute p2 in the new ring:

sage: R.<x,y>=QQ[]

sage: p1=x-y

sage:p2=x^2+y^2

sage: I=ideal(p1)

sage: S=R.quotient_ring(I)

sage: q=p2.change_ring(S)

sage: q

2*ybar^2

When I compute the degree of q I get:

sage: d=q.degree()

sage: d

0

and I want to get d=2. Can anybody tell me how can I obtain d=2?

edit retag close merge delete

Sort by » oldest newest most voted

If you want to compute the projection of p2 in S, you should write:

sage: q = S(p2)
sage: q
2*ybar^2
sage: q
2*ybar^2
sage: q.parent()
Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x - y)
sage: S
Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x - y)


In a general quotient ring, the degree is not well defined, but you can get the minimal degree of a representative of q in R by lifting q:

sage: q.lift().degree()
2

more