4.7.1.2 PolynomialQuotientRingElement Objects

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

Create an element of the quotient of a polynomial ring.

INPUT:
    parent -- a quotient of a polynomial ring
    x -- 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).

Instances of class PolynomialQuotientRingElement have the following functions (in addition to inherited functions and special functions):

charpoly,$  $ fcp,$  $ lift,$  $ list,$  $ matrix,$  $ minpoly,$  $ norm,$  $ trace

Further documentation:

charpoly( )

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

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3 -389*x**2 + 2*x - 5, 'a'); a = S.gen()
sage: a.charpoly()
x^3 - 389*x^2 + 2*x - 5

fcp( )

Return the factorization of the characteristic polynomial of this element.

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3 -389*x**2 + 2*x - 5, 'a'); a = S.gen()
sage: a.fcp()
[(x^3 - 389*x^2 + 2*x - 5, 1)]
sage: S(1).fcp()
[(x - 1, 3)]

lift( )

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

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3-2, 'a'); a = S.gen()
sage: b = a**2 - 3
sage: b
a^2 - 3
sage: b.lift()
x^2 - 3

list( )

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

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3 + 2*x - 5, 'a'); a = S.gen()
sage: a**10
-134*a^2 - 35*a + 300
sage: (a**10).list()
[300, -35, -134]

matrix( )

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

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3 + 2*x - 5, 'a'); a = S.gen()
sage: a.matrix()
[ 0  1  0]
[ 0  0  1]
[ 5 -2  0]

minpoly( )

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

norm( )

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

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3 -389*x**2 + 2*x - 5, 'a'); a = S.gen()
sage: a.norm()
5

trace( )

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

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3 -389*x**2 + 2*x - 5, 'a'); a = S.gen()
sage: a.trace()
389

Instances of class PolynomialQuotientRingElement also have the following special functions:

__add__,$  $ __cmp__,$  $ __div__,$  $ __int__,$  $ __invert__,$  $ __long__,$  $ __mul__,$  $ __neg__,$  $ __pow__,$  $ __radd__,$  $ __rdiv__,$  $ __rmul__,$  $ __rsub__,$  $ __sub__

Further documentation:

__add__( right)

Return the sum of two polynomial ring quotient elements.

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3-2, 'a'); a = S.gen()
sage: (a**2 - 4) + (a+2)
a^2 + a - 2
sage: int(1) + a
a + 1

__cmp__( other)

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

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3-2, 'a'); a = S.gen()
sage: S(1) == 1
True
sage: a**3 == 2
True

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

There is no coercion from quotient elements to polynomials, so the other comparison is False:

sage: x == a
False

__div__( right)

Return the quotient of two polynomial ring quotient elements.

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3-2, 'a'); a = S.gen()
sage: (a**2 - 4) / (a+2)
a - 2

__int__( )

Coerce this element to an int if possible.

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3-2, 'a'); a = S.gen()
sage: int(S(10))
10
sage: int(a)
Traceback (most recent call last):
...
ValueError: cannot coerce nonconstant polynomial to int

__long__( )

Coerce this element to a long if possible.

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3-2, 'a'); a = S.gen()
sage: long(S(10))
10
sage: long(a)
Traceback (most recent call last):
...
ValueError: cannot coerce nonconstant polynomial to long

__mul__( right)

Return the product of two polynomial ring quotient elements.

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3-2, 'a'); a = S.gen()
sage: (a**2 - 4) * (a+2)
2*a^2 - 4*a - 6

__pow__( n)

Return a power of a polynomial ring quotient element.

sage: R = PolynomialRing(Integers(9), 'x'); x = R.gen()
sage: S = R.quotient(x**4 + 2*x**3 + x + 2, 'a'); a = S.gen()
sage: a**100
7*a^3 + 8*a + 7

__sub__( right)

Return the difference of two polynomial ring quotient elements.

sage: R = PolynomialRing(RationalField(), 'x'); x = R.gen()
sage: S = R.quotient(x**3-2, 'a'); a = S.gen()
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.