GSoC 2020 - Week 231 May 2020
highlights of this week’s work are:
This was a long pending issue. Previously, in the codebase the
series expansion of a productwas computed as the
product of expansions of the factors. This approach was correct only when the
leading term of each seriesis a
constantbut not in general.
For example, to compute the expansion of
x = 0to order
O(x**10)it is necessary to compute the series expansion of the function
O(x**20)and thus, computing till order
O(x**10)would not suffice.
The strategy we implemented to resolve this issue was:
- Compute the order
leading term of the productas the
sum of the ordersof the
leading terms of the factors.
- For each factor, compute
n - n0terms of its series expansion (starting from its
leading term of order n1and
ending 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
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
meromorphicat a point, if at that point the
limit of the function exists but is infinite. In these cases, the value of the limit can usually be determined with the help of the
series expansion of that functionand thus, there is no need to invoke the
While working on the implementation of this functionality, we required the
leading termof the
series 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 Infinityas the
leading 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.