expression series expansion
Iris Lui edited this page Feb 24, 2016
·
13 revisions
The first code for series expansion was a translation of SymPy ring series (the univariate case) using Piranha polynomials with rational coefficients. This has been improved to handle symbolic constants using Piranha polynomials over Expression
s so we have now:
-
series.h
series()
interface and generic implementation - series.cpp Interface implementation
- series_visitor.h Link series to expression tree
-
series_piranha.h, series_piranha.cpp Specific implementations:
URatPSeriesPiranha
andUPSeriesPiranha
-
series_flint.h, series_flint.cpp
URatPSeriesFlint
very fast univariate implementation - heuristics in
series()
to chose between (at the moment)UPSeriesPiranha
andURatPSeriesFlint
for optimal result/speed
In progress:
- Python/SymPy interface---this was first slowing down our good performance because of https://github.com/sympy/sympy/issues/10262 which should be resolved by https://github.com/sympy/sympy/pull/10513 and https://github.com/symengine/symengine.py/issues/48
What's immediately missing from current series IMHO:
-
more functions (
bessel
,gamma
,zeta
...)NOTE : This is handled by #813, but poles need to be special cased and handled like gamma.
-
implement Taylor series starting point parameter
x0
-
continuation of previous: expansion at
oo
, asymptotics withoo
. Example:
>>> y = series(1 / (x+1), x, oo, 3)
>>> str(y)
'x**(-3) - 1/x**2 + 1/x + O(x**(-4), (x, oo))'
- full multivariate expressions (not sure, maybe
1/(1-x-x*y)
works already?) Pari:
? Ser(1/(1-x-x*y))
%2 = 1 + (y + 1)*x + (y^2 + 2*y + 1)*x^2 + (y^3 + 3*y^2 + 3*y + 1)*x^3 + ...
-
SymEngine implementation of
UPSeriesPiranha
with no additional dependencies. (Modifyseries_generic.h
to fit intoseries.h
model)NOTE : currently being handled here