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, 19 Feb 2016 22:42:11 +0100The degree of a poynomial in a quotient ringhttps://ask.sagemath.org/question/32594/the-degree-of-a-poynomial-in-a-quotient-ring/ 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:
<p>sage: R.<x,y>=QQ[]
<p>sage: p1=x-y
<p>sage:p2=x^2+y^2
<p>sage: I=ideal(p1)
<p>sage: S=R.quotient_ring(I)
<p>sage: q=p2.change_ring(S)
<p>sage: q
<p>2*ybar^2
When I compute the degree of q I get:
<p>sage: d=q.degree()
<p>sage: d
<p>0
and I want to get d=2.
Can anybody tell me how can I obtain d=2?Fri, 19 Feb 2016 10:26:04 +0100https://ask.sagemath.org/question/32594/the-degree-of-a-poynomial-in-a-quotient-ring/Answer by tmonteil for <p>Hello,</p>
<p>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:</p>
<p></p><p>sage: R.<x,y>=QQ[]
</p><p>sage: p1=x-y
</p><p>sage:p2=x^2+y^2
</p><p>sage: I=ideal(p1)
</p><p>sage: S=R.quotient_ring(I)
</p><p>sage: q=p2.change_ring(S)
</p><p>sage: q
</p><p>2*ybar^2</p>
<p>When I compute the degree of q I get:</p>
<p></p><p>sage: d=q.degree()
</p><p>sage: d
</p><p>0</p>
<p>and I want to get d=2.
Can anybody tell me how can I obtain d=2?</p>
https://ask.sagemath.org/question/32594/the-degree-of-a-poynomial-in-a-quotient-ring/?answer=32598#post-id-32598If 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
Fri, 19 Feb 2016 22:42:11 +0100https://ask.sagemath.org/question/32594/the-degree-of-a-poynomial-in-a-quotient-ring/?answer=32598#post-id-32598