28.4 Elements of Quotients of Univariate Polynomial Rings

Module: sage.rings.polynomial.polynomial_quotient_ring_element

Elements of Quotients of Univariate Polynomial Rings

We create a quotient of a univariate polynomial ring over $ \mathbf{Z}$ .

sage: R.<x> = ZZ[]
sage: S.<a> = R.quotient(x^3 + 3*x -1)
sage: 2 * a^3
-6*a + 2

Next we make a univeriate polynomial ring over $ \mathbf{Z}[x]/(x^3+3x-1)$ .

sage: S.<y> = S[]

And, we quotient out that by $ y^2 + a$ .

sage: T.<z> = S.quotient(y^2+a)

In the quotient $ z^2$ is $ -a$ .

sage: z^2
-a

And since $ a^3 = -3x + 1$ , we have:

sage: z^6
3*a - 1

sage: R.<x> = PolynomialRing(Integers(9))
sage: S.<a> = R.quotient(x^4 + 2*x^3 + x + 2)
sage: a^100
7*a^3 + 8*a + 7

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3-2)             
sage: a
a
sage: a^3
2

For the purposes of comparison in SAGE the quotient element $ a^3$ is equal to $ x^3$ . This is because when the comparison is performed, the right element is coerced into the parent of the left element, and $ x^3$ coerces to $ a^3$ .

sage: a == x
True
sage: a^3 == x^3
True
sage: x^3
x^3
sage: S(x^3)
2

Author: William Stein

Class: PolynomialQuotientRingElement

class PolynomialQuotientRingElement
Element of a quotient of a polynomial ring.
PolynomialQuotientRingElement( self, parent, polynomial, [check=True])

Create an element of the quotient of a polynomial ring.

Input:

parent
- a quotient of a polynomial ring
polynomial
- a polynomial
check
- bool (optional): whether or not to verify that x is a valid element of the polynomial ring and reduced (mod the modulus).

Functions: charpoly,$ \,$ fcp,$ \,$ field_extension,$ \,$ lift,$ \,$ list,$ \,$ matrix,$ \,$ minpoly,$ \,$ norm,$ \,$ trace

charpoly( self, var)

The characteristic polynomial of this element, which is by definition the characteristic polynomial of right multiplication by this element.

Input:

var
- string - the variable name

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quo(x^3 -389*x^2 + 2*x - 5)
sage: a.charpoly('X')
X^3 - 389*X^2 + 2*X - 5

fcp( self, [var=x])

Return the factorization of the characteristic polynomial of this element.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3 -389*x^2 + 2*x - 5)
sage: a.fcp('x')
x^3 - 389*x^2 + 2*x - 5
sage: S(1).fcp('y')
(y - 1)^3

field_extension( self, names)

Given a polynomial with base ring a quotient ring, return a 3-tuple: a number field defined by the same polynomial, a homomorphism from its parent to the number field sending the generators to one another, and the inverse isomorphism.

Input:

- names - name of generator of output field

Output: # todo: is the return order backwards from the magma convention???
- field
- homomorphism from self to field
- homomorphism from field to self

sage: R.<x> = PolynomialRing(QQ)
sage: S.<alpha> = R.quotient(x^3-2)
sage: F.<a>, f, g = alpha.field_extension()
sage: F 
Number Field in a with defining polynomial x^3 - 2
sage: a = F.gen()
sage: f(alpha)
a
sage: g(a)
alpha

Over a finite field, the corresponding field extension is not a number field:

sage: R.<x> = GF(25,'b')['x']
sage: S.<a> = R.quo(x^3 + 2*x + 1)
sage: F.<b>, g, h = a.field_extension()
sage: h(b^2 + 3)
a^2 + 3
sage: g(x^2 + 2)
b^2 + 2

We do an example involving a relative number field:

sage: R.<x> = QQ['x']
sage: K.<a> = NumberField(x^3-2)
sage: S.<X> = K['X']
sage: Q.<b> = S.quo(X^3 + 2*X + 1)
sage: F, g, h = b.field_extension('c')

Another more awkward example:

sage: R.<x> = QQ['x']
sage: K.<a> = NumberField(x^3-2)
sage: S.<X> = K['X']
sage: f = (X+a)^3 + 2*(X+a) + 1
sage: f
X^3 + 3*a*X^2 + (3*a^2 + 2)*X + 2*a + 3
sage: Q.<z> = S.quo(f)
sage: F.<w>, g, h = z.field_extension()
sage: c = g(z)
sage: f(c)
0
sage: h(g(z))
z
sage: g(h(w))
w

Author Log:

lift( self)

Return lift of this polynomial quotient ring element to the unique equivalent polynomial of degree less than the modulus.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3-2)
sage: b = a^2 - 3
sage: b
a^2 - 3
sage: b.lift()
x^2 - 3

list( self)

Return list of the elements of self, of length the same as the degree of the quotient polynomial ring.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3 + 2*x - 5)
sage: a^10
-134*a^2 - 35*a + 300
sage: (a^10).list()
[300, -35, -134]

matrix( self)

The matrix of right multiplication by this element on the power basis for the quotient ring.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3 + 2*x - 5)
sage: a.matrix()
[ 0  1  0]
[ 0  0  1]
[ 5 -2  0]

minpoly( self)

The minimal polynomial of this element, which is by definition the minimal polynomial of right multiplication by this element.

norm( self)

The norm of this element, which is the norm of the matrix of right multiplication by this element.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3 -389*x^2 + 2*x - 5)
sage: a.norm()
5

trace( self)

The trace of this element, which is the trace of the matrix of right multiplication by this element.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3 -389*x^2 + 2*x - 5)
sage: a.trace()
389

Special Functions: __cmp__,$ \,$ __getitem__,$ \,$ __init__,$ \,$ __int__,$ \,$ __invert__,$ \,$ __iter__,$ \,$ __long__,$ \,$ __neg__,$ \,$ __reduce__,$ \,$ _add_,$ \,$ _div_,$ \,$ _im_gens_,$ \,$ _latex_,$ \,$ _mul_,$ \,$ _repr_,$ \,$ _sub_

__cmp__( self, other)

Compare this element with something else, where equality testing coerces the object on the right, if possible (and necessary).

__int__( self)

Coerce this element to an int if possible.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3-2)
sage: int(S(10))
10
sage: int(a)
Traceback (most recent call last):
...
TypeError: cannot coerce nonconstant polynomial to int

__long__( self)

Coerce this element to a long if possible.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3-2)
sage: long(S(10))
10L
sage: long(a)
Traceback (most recent call last):
...
TypeError: cannot coerce nonconstant polynomial to long

__reduce__( self)

sage: R.<x> = QQ[]
sage: S.<a> = R.quotient(2*x^3 + 3/2*x -1/3)
sage: 2 * a^3
-3/2*a + 1/3
sage: loads(dumps(2*a^3)) == 2*a^3
True

_add_( self, right)

Return the sum of two polynomial ring quotient elements.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3-2)
sage: (a^2 - 4) + (a+2)
a^2 + a - 2
sage: int(1) + a
a + 1

_div_( self, right)

Return the quotient of two polynomial ring quotient elements.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3-2)
sage: (a^2 - 4) / (a+2)
a - 2

_latex_( self)

sage: R.<x> = QQ[]
sage: S.<a> = R.quotient(3*x^3 + 3/2*x -1/3)
sage: latex(a*(3 * a^3) + S.modulus())
-\frac{3}{2} a^{2} + \frac{1}{3} a

_mul_( self, right)

Return the product of two polynomial ring quotient elements.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3-2)
sage: (a^2 - 4) * (a+2)
2*a^2 - 4*a - 6

_repr_( self)

sage: R.<x> = QQ[]
sage: S.<a> = R.quotient(3*x^3 + 3/2*x -1/3)
sage: 3 * a^3 + S.modulus()
-3/2*a + 1/3

_sub_( self, right)

Return the difference of two polynomial ring quotient elements.

sage: R.<x> = PolynomialRing(QQ)
sage: S.<a> = R.quotient(x^3 - 2)
sage: (a^2 - 4) - (a+2)
a^2 - a - 6
sage: int(1) - a
-a + 1

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