sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen() sage: S = R.quotient(x**3-3*x+1, 'alpha') sage: S.gen()**2 in S True sage: x in S True sage: S.gen() in R False sage: 1 in S True
The module rings.polynomial_quotient_ring defines the following methods:
ring, polynomial, [name=None]) |
Create a quotient of a polynomial ring.
INPUT: ring -- a univariate polynomial ring in one variable. polynomial -- element name -- (optional) name for the variable OUTPUT: Creates the quotient ring R/I, where R is the ring and I is the principal ideal generated by the polynomial.
We create the quotient ring
, and demonstrate many
basic functions with it:
sage: Z = IntegerRing() sage: R = PolynomialRing(Z,'x'); x = R.gen() sage: S = R.quotient(x**3 + 7, 'a'); a = S.gen() sage: S Univariate Quotient Polynomial Ring in a over Integer Ring with modulus x^3 + 7 sage: a**3 -7 sage: S.is_field() False sage: a in S True sage: x in S True sage: a in R False sage: S.polynomial_ring() Univariate Polynomial Ring in x over Integer Ring sage: S.modulus() x^3 + 7 sage: S.degree() 3
We create the ``iterated'' polynomial ring quotient
sage: A = PolynomialRing(GF(2),'y'); y=A.gen(); print A Univariate Polynomial Ring in y over Finite field of size 2 sage: B = A.quotient(y**2 + y + 1, 'y2'); print B Univariate Quotient Polynomial Ring in y2 over Finite field of size 2 with modulus y^2 + y + 1 sage: C = PolynomialRing(B, 'x'); x=C.gen(); print C Univariate Polynomial Ring in x over Univariate Quotient Polynomial Ring in y2 over Finite field of size 2 with modulus y^2 + y + 1 sage: R = C.quotient(x**3 - 5); print R Univariate Quotient Polynomial Ring in x over Univariate Quotient Polynomial Ring in y2 over Finite field of size 2 with modulus y^2 + y + 1 with modulus x^3 + 1
Next we create a number field, but viewed as a quotient of a
polynomial ring over
:
sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen() sage: S = R.quotient(x**3 + 2*x - 5, 'a') sage: S Univariate Quotient Polynomial Ring in a over Rational Field with modulus x^3 + 2*x - 5 sage: S.is_field() True sage: S.degree() 3
There are conversion functions for easily going back and forth
between quotients of polynomial rings over
and number
fields:
sage: K = S.number_field(); K Number Field in a with defining polynomial x^3 + 2*x - 5 sage: K.polynomial_quotient_ring() Univariate Quotient Polynomial Ring in a over Rational Field with modulus x^3 + 2*x - 5
The leading coefficient must be a unit (but need not be 1).
sage: R = PolynomialRing(Integers(9), 'x'); x = R.gen() sage: S = R.quotient(2*x**4 + 2*x**3 + x + 2, 'a') sage: S = R.quotient(3*x**4 + 2*x**3 + x + 2, 'a') Traceback (most recent call last): ... TypeError: polynomial (=3*x^4 + 2*x^3 + x + 2) must have unit leading coefficient
Another example:
sage: R = PolynomialRing(IntegerRing()) sage: x = R.gen() sage: f = x**2 + 1 sage: R.quotient(f) Univariate Quotient Polynomial Ring in x over Integer Ring with modulus x^2 + 1
The module rings.polynomial_quotient_ring defines the following classes: