15.2 Power Series

Module: sage.rings.power_series_ring_element

Author: William Stein

Module-level Functions

is_PowerSeries( x)

Class: PowerSeries

class PowerSeries
PowerSeries( self, parent, prec, [is_gen=False])

Functions: add_bigoh,$  $ base_ring,$  $ common_prec,$  $ copy,$  $ degree,$  $ derivative,$  $ exp,$  $ is_gen,$  $ list,$  $ O,$  $ padded_list,$  $ prec,$  $ truncate,$  $ unit_part,$  $ V,$  $ valuation

add_bigoh( self, prec)

Returns the power series of precision at most prec got by adding $ O(q^$prec$ )$ to f, where q is the variable.

O( self, prec)

Return this series plus $ O(x^$prec$ )$ . Does not change self.

padded_list( self, n)

Return list of coefficients of self up to (but not include $ q^n$ ).

Includes 0's in the list on the right so that the list has length $ n$ .

sage: R.<q> = PowerSeriesRing(QQ)
sage: f = 1 - 17*q + 13*q^2 + 10*q^4 + O(q^7)
sage: f.list()
[1, -17, 13, 0, 10]
sage: f.padded_list(7)
[1, -17, 13, 0, 10, 0, 0]
sage: f.padded_list(10)
[1, -17, 13, 0, 10, 0, 0, 0, 0, 0]
sage: f.padded_list(3)
[1, -17, 13]

prec( self)

The precision of $ ...+O(x^r)$ is by definition $ r$ .

truncate( self, [prec=Infinity])

The polynomial obtained from power series by truncation.

unit_part( self)

Suppose self factors as $ q^n\cdot (a_0 + a_1 q + \cdots)$ with $ a_0$ nonzero. Then this function returns $ a_0 + a_1 q +
\cdots $ .

V( self, n)

If $ f = \sum a_m x^m$ , then this function returns $ \sum a_m x^{nm}$ .

Special Functions: __add__,$  $ __call__,$  $ __div__,$  $ __getitem__,$  $ __getslice__,$  $ __invert__,$  $ __mod__,$  $ __mul__,$  $ __pow__,$  $ __radd__,$  $ __rdiv__,$  $ __setitem__,$  $ __sub__,$  $ _cmp_,$  $ _im_gens_,$  $ _latex_,$  $ _mul_,$  $ _repr_

__invert__( self)

Inverse of the power series, which we assume to have nonzero constant term so that the inverse is again a power series.

sage: R = PowerSeriesRing(RationalField(), 'q')
sage: q = R.gen()
sage: 1/(1+q + O(q**2))
1 - q + O(q^2)
sage: 1/(1+q)
1 - q + q^2 - q^3 + q^4 - q^5 + q^6 - q^7 + q^8 - q^9 + q^10 - q^11 + q^12
- q^13 + q^14 - q^15 + q^16 - q^17 + q^18 - q^19 + O(q^20)
sage: prec = R.default_prec(); prec
20
sage: R.set_default_prec(5)
sage: 1/(1+q)
1 - q + q^2 - q^3 + q^4 + O(q^5)

sage: R.<q> = QQ[['q']]
sage: R.set_default_prec(5)
sage: f = 1 + q + q^2 + O(q^50)
sage: f/10
1/10 + 1/10*q + 1/10*q^2 + O(q^50)
sage: f/(10+q)
1/10 + 9/100*q + 91/1000*q^2 - 91/10000*q^3 + 91/100000*q^4 + O(q^5)

_cmp_( self, right)

Comparison of self and right.

We say two approximate power series are equal, if they agree for all coefficients up to the *minimum* of the precisions of each. Thus, e.g., $ f=1+q+O(q^2)$ is equal to $ g=1+O(q)$ . This is how PARI defines equality of power series, but not how MAGMA defines equality. (MAGMA would declare f and g unequal.) I side with PARI, because even if $ g=1+q+O(q^2)$ , we don't really know whether f equals g, since we don't know the coefficients of $ q^2$ .

Class: PowerSeries_generic_dense

class PowerSeries_generic_dense
PowerSeries_generic_dense( self, parent, [f=False], [prec=True], [check=Infinity], [is_gen=0])

sage: R, q = PowerSeriesRing(C, 'q').objgen()
sage: R
Power Series Ring in q over Complex Field with 53 bits of precision
sage: loads(q.dumps()) == q
True

Functions: copy,$  $ derivative,$  $ integral,$  $ laurent_series,$  $ list,$  $ reversion

integral( self)

The integral of this power series with 0 constant term.

reversion( self)

Return the reversion of f, i.e., the series g such that g(f(x)) = x.

sage: x = PowerSeriesRing(RationalField()).gen()
sage: f = 2*x + 3*x**2 - x**4 + O(x**5)
sage: g = f.reversion()
sage: g
1/2*x - 3/8*x^2 + 9/16*x^3 - 131/128*x^4 + O(x^5)
sage: f(g)
x + O(x^5)
sage: g(f)
x + O(x^5)

Special Functions: __add__,$  $ __call__,$  $ __getitem__,$  $ __getslice__,$  $ __iter__,$  $ __neg__,$  $ __setitem__,$  $ __sub__,$  $ _mul_,$  $ _pari_

__add__( self, right)

sage: x = PowerSeriesRing(ZZ).gen()
sage: f = x^4 + O(x^5); f
x^4 + O(x^5)
sage: g = x^2 + O(x^3); g
x^2 + O(x^3)
sage: f+g
x^2 + O(x^3)

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