R, f, [variable=None]) |
Create a quotient of a polynomial ring.
INPUT: R -- polynomial ring in one variable. f -- element of R. OUTPUT: Creates the quotient ring R/(f).
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 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
base_ring,
characteristic,
degree,
discriminant,
gen,
is_field,
modulus,
name,
ngens,
number_field,
polynomial_ring,
variable
Further documentation:
) |
Return the base base ring of the polynomial ring, of which this ring is a quotient.
The base ring of
is
.
sage: R = PolynomialRing(IntegerRing(), 'z'); z = R.gen() sage: S = R.quotient(z**3 + z**2 + z + 1, 'beta') sage: S.base_ring() Integer Ring
Next we make a polynomial quotient ring over
and ask for its basering.
sage: T = PolynomialRing(S); W = T.quotient(T.gen()**99 + 99) sage: W.base_ring() Univariate Quotient Polynomial Ring in beta over Integer Ring with modulus z^3 + z^2 + z + 1
) |
Return the characteristic of this quotient ring.
This is always the same as the characteristic of the base ring.
sage: R = PolynomialRing(IntegerRing(), 'z'); z = R.gen() sage: S = R.quotient(z - 19, 'a') sage: S.characteristic() 0 sage: R = PolynomialRing(GF(9), 'x'); x = R.gen() sage: S = R.quotient(x**3 + 1) sage: S.characteristic() 3
) |
Return the degree of this quotient ring. The degree is the degree of the polynomial that we quotiented out by.
sage: R = PolynomialRing(GF(3), 'x'); x = R.gen() sage: S = R.quotient(x**2005 + 1) sage: S.degree() 2005
[v=None]) |
Return the discriminant of this ring over the base ring. This is by definition the discriminant of the polynomial that we quotiented out by.
sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen() sage: S = R.quotient(x**3 + x**2 + x + 1) sage: S.discriminant() -16 sage: S = R.quotient((x + 1) * (x + 1)) sage: S.discriminant() 0
The discriminant of the quotient polynomial ring need not equal the discriminant of the corresponding number field, since the discriminant of a number field is by definition the discriminant of the ring ring of integers of the number field:
sage: S = R.quotient(x**2 - 8) sage: S.number_field().discriminant() 8 sage: S.discriminant() 32
[n=0]) |
Return the generator of this quotient ring. This is the equivalence class of the image of the generator of the polynomial ring.
sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen() sage: S = R.quotient(x**2 - 8, 'gamma') sage: S.gen() gamma
) |
Return whether or not this quotient ring is a field.
sage: R = PolynomialRing(IntegerRing(), 'z'); z = R.gen() sage: S = R.quotient(z**2-2) sage: S.is_field() False sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen() sage: S = R.quotient(x**2 - 2) sage: S.is_field() True
) |
Return the polynomial modulus of this quotient ring.
sage: R = PolynomialRing(GF(3), 'x'); x = R.gen() sage: S = R.quotient(x**2 - 2) sage: S.modulus() x^2 + 1
) |
Return a short name useful in caching this ring. (Mainly for internal use.)
sage: R = PolynomialRing(GF(3), 'x'); x = R.gen() sage: S = R.quotient(x**2 - 2) sage: S.name() 'polyquox^2+1'
) |
Return the number of generators of this quotient ring over the base ring. This function always returns 1.
sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen() sage: S = PolynomialRing(R, 'y'); y=S.gen() sage: T = S.quotient(y + x, 'z') sage: T Univariate Quotient Polynomial Ring in z over Univariate Polynomial Ring in x over Rational Field with modulus y + x sage: T.ngens() 1
) |
Return the number field isomorphic to this quotient polynomial ring, if possible.
sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen() sage: S = R.quotient(x**29-17*x-1, 'alpha') sage: K = S.number_field() sage: K Number Field in alpha with defining polynomial x^29 - 17*x - 1 sage: alpha = K.gen() sage: alpha**29 17*alpha + 1
) |
Return the polynomial ring of which this ring is the quotient.
sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen() sage: S = R.quotient(x**2-2) sage: S.polynomial_ring() Univariate Polynomial Ring in x over Rational Field
[new_var=None]) |
Returns or sets the print representation of the generator of this quotient ring.
If the optional string argument new_var is given, then the name of the variable is set to new_var. If it is not given, this function returns the current print representation of the generator.
INPUT: new_value -- (optional) string OUTPUT: str -- the name of the generator
sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen() sage: S = R.quotient(x**2-2, 'v') sage: S Univariate Quotient Polynomial Ring in v over Rational Field with modulus x^2 - 2 sage: S.variable() 'v' sage: S.variable('w') sage: S Univariate Quotient Polynomial Ring in w over Rational Field with modulus x^2 - 2 sage: S.variable() 'w'
Instances of class PolynomialQuotientRing also have the following special functions:
__call__,
__cmp__,
__contains__
Further documentation:
x) |
Coerce x into this quotient ring. Anything that can be coerced into the polynomial ring can be coerced into the quotient.
INPUT: x -- object to be coerced OUTPUT: PolynomialQuotientRingElement -- resulting of coercing x into this ring.
sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen() sage: S = R.quotient(x**3-3*x+1, 'alpha') sage: S(x) alpha sage: S(x**3) 3*alpha - 1 sage: S([1,2]) 2*alpha + 1 sage: S([1,2,3,4,5]) 18*alpha^2 + 9*alpha - 3 sage: S(S.gen()+1) alpha + 1 sage: S(S.gen()**10+1) 90*alpha^2 - 109*alpha + 28
other) |
Compare self and other.
sage: Rx = PolynomialRing(RationalField(), 'x'); x = Rx.gen() sage: Ry = PolynomialRing(RationalField(), 'y'); y = Ry.gen() sage: Rx == Ry False sage: Qx = Rx.quotient(x**2+1) sage: Qy = Ry.quotient(y**2+1) sage: Qx == Qy False sage: Qx == Qx True sage: Qz = Rx.quotient(x**2+1) sage: Qz == Qx True
x) |
Returns True if this ring contains x, i.e., x is a polynomial quotient element with parent this ring.
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 False
Note that no coercion is done before checking, so the integer 1 is not in S, but S(1) is.
sage: 1 in S False sage: a = S(1); a 1 sage: a in S True
See About this document... for information on suggesting changes.