GSoC 2020 - Week 2
31 May 2020Key highlights
of this week’s work are:
-
-
This was a long pending issue. Previously, in the codebase the
series expansion of a product
was computed as theproduct of expansions of the factors
. This approach was correct only when theleading term of each series
is aconstant
but not in general.For example, to compute the expansion of
f(x)/x**10
atx = 0
to orderO(x**10)
it is necessary to compute the series expansion of the functionf(x)
to orderO(x**20)
and thus, computing till orderO(x**10)
would not suffice.The strategy we implemented to resolve this issue was:
- Compute the order
n0
of theleading term of the product
as thesum of the orders
of theleading terms of the factors
. - For each factor, compute
n - n0
terms of its series expansion (starting from itsleading term of order n1
andending at order n - n0 + n1
). - Multiply the expansions (
truncating at terms of order n
).
I enjoyed implementing all this because at every step we had to ensure that we are not compromising with the efficiency of the code. Finally, this issue was resolved and we ended up adding an extremely optimised implementation of the function to the codebase.
- Compute the order
-
-
Used is_meromorphic() function to speed up limit evaluations
-
In this PR, we made use of the
is_meromorphic()
function of SymPy to speed up limit evaluations for certain type of cases.A function is said to be
meromorphic
at a point, if at that point thelimit of the function exists but is infinite
. In these cases, the value of the limit can usually be determined with the help of theseries expansion of that function
and thus, there is no need to invoke theGruntz algorithm
.While working on the implementation of this functionality, we required the
leading term
of theseries expansion of the function in the limit expression at the point at which the limit needs to be evaluated
.But we came across a weird situation, where for some functions, we got
Complex Infinity
as theleading term
. Thus, we had to rectify the_eval_as_leading_term()
methods of these functions (done in a separate PR).After resolving this issue, we succeeded in adding the required functionality and hence, increased the efficiency of the limit evaluation algorithm of SymPy.
-