9.4 Quotient rings of polynomials

How do you construct a quotient ring in Sage?

We create the quotient ring $ GF(97)[x]/(x^3+7)$ , and demonstrate many basic functions with it.

sage: R = PolynomialRing(GF(97),'x')
sage: x = R.gen()
sage: S = R.quotient(x^3 + 7, 'a')
sage: a = S.gen()
sage: S
Univariate Quotient Polynomial Ring in a over Finite Field of size 97 with 
modulus x^3 + 7
sage: S.is_field()
True
sage: a in S
True
sage: x in S
True
sage: S.polynomial_ring()
Univariate Polynomial Ring in x over Finite Field of size 97
sage: S.modulus()
x^3 + 7
sage: S.degree()
3

In Sage, in means that there is a ``canonical coercion'' into the ring. So the integer $ x$ and $ a$ are both in $ S$ , although $ x$ really needs to be coerced.

You can also compute in quotient rings without actually computing then using the command quo_rem as follows.

sage: R = PolynomialRing(GF(97),'x')
sage: x = R.gen()
sage: f = x^7+1
sage: (f^3).quo_rem(x^7-1)
(x^14 + 4*x^7 + 7, 8)

See About this document... for information on suggesting changes.