Quotient fields

class sage.categories.quotient_fields.QuotientFields(s=None)

Bases: sage.categories.category.Category

The category of quotient fields over an integral domain

EXAMPLES:

sage: QuotientFields()
Category of quotient fields
sage: QuotientFields().super_categories()
[Category of fields]

TESTS:

sage: TestSuite(QuotientFields()).run()
class ElementMethods
denominator()
derivative(*args)

The derivative of this rational function, with respect to variables supplied in args.

Multiple variables and iteration counts may be supplied; see documentation for the global derivative() function for more details.

See also

_derivative()

EXAMPLES:

sage: F.<x> = Frac(QQ['x'])
sage: (1/x).derivative()
-1/x^2
sage: (x+1/x).derivative(x, 2)
2/x^3
sage: F.<x,y> = Frac(QQ['x,y'])
sage: (1/(x+y)).derivative(x,y)
2/(x^3 + 3*x^2*y + 3*x*y^2 + y^3)
factor(*args, **kwds)

Return the factorization of self over the base ring.

INPUT:

  • *args - Arbitrary arguments suitable over the base ring
  • **kwds - Arbitrary keyword arguments suitable over the base ring

OUTPUT:

  • Factorization of self over the base ring

EXAMPLES:

sage: K.<x> = QQ[]
sage: f = (x^3+x)/(x-3)
sage: f.factor()
(x - 3)^-1 * x * (x^2 + 1)

Here is an example to show that ticket #7868 has been resolved:

sage: R.<x,y> = GF(2)[]
sage: f = x*y/(x+y)
sage: f.factor()
Traceback (most recent call last):
...
NotImplementedError: proof = True factorization not implemented.  Call factor with proof=False.
sage: f.factor(proof=False)
(x + y)^-1 * y * x
numerator()
partial_fraction_decomposition()

Decomposes fraction field element into a whole part and a list of fraction field elements over prime power denominators.

The sum will be equal to the original fraction.

AUTHORS:

  • Robert Bradshaw (2007-05-31)

EXAMPLES:

sage: S.<t> = QQ[]
sage: q = 1/(t+1) + 2/(t+2) + 3/(t-3); q
(6*t^2 + 4*t - 6)/(t^3 - 7*t - 6)
sage: whole, parts = q.partial_fraction_decomposition(); parts
[3/(t - 3), 1/(t + 1), 2/(t + 2)]
sage: sum(parts) == q
True
sage: q = 1/(t^3+1) + 2/(t^2+2) + 3/(t-3)^5
sage: whole, parts = q.partial_fraction_decomposition(); parts
[1/3/(t + 1), 3/(t^5 - 15*t^4 + 90*t^3 - 270*t^2 + 405*t - 243), (-1/3*t + 2/3)/(t^2 - t + 1), 2/(t^2 + 2)]
sage: sum(parts) == q
True

We do the best we can over inexact fields:

sage: R.<x> = RealField(20)[]
sage: q = 1/(x^2 + x + 2)^2 + 1/(x-1); q
(x^4 + 2.0000*x^3 + 5.0000*x^2 + 5.0000*x + 3.0000)/(x^5 + x^4 + 3.0000*x^3 - x^2 - 4.0000)
sage: whole, parts = q.partial_fraction_decomposition(); parts
[1.0000/(x - 1.0000), 1.0000/(x^4 + 2.0000*x^3 + 5.0000*x^2 + 4.0000*x + 4.0000)]
sage: sum(parts)
(x^4 + 2.0000*x^3 + 5.0000*x^2 + 5.0000*x + 3.0000)/(x^5 + x^4 + 3.0000*x^3 - x^2 - 4.0000)

TESTS:

We test partial fraction for irreducible denominators:

sage: R.<x> = ZZ[]
sage: q = x^2/(x-1)
sage: q.partial_fraction_decomposition()
(x + 1, [1/(x - 1)])
sage: q = x^10/(x-1)^5
sage: whole, parts = q.partial_fraction_decomposition()
sage: whole + sum(parts) == q
True

And also over finite fields (see trac #6052, #9945):

sage: R.<x> = GF(2)[]
sage: q = (x+1)/(x^3+x+1)
sage: q.partial_fraction_decomposition()
(0, [(x + 1)/(x^3 + x + 1)])

sage: R.<x> = GF(11)[]
sage: q = x + 1 + 1/(x+1) + x^2/(x^3 + 2*x + 9)
sage: q.partial_fraction_decomposition()
(x + 1, [1/(x + 1), x^2/(x^3 + 2*x + 9)])

And even the rationals:

sage: (26/15).partial_fraction_decomposition()
(1, [1/3, 2/5])
class QuotientFields.ParentMethods
QuotientFields.super_categories(*args, **kwds)

EXAMPLES:

sage: QuotientFields().super_categories()
[Category of fields]

Previous topic

Principal ideal domains

Next topic

Right modules

This Page