GSoC 2017 Report Abdullah Javed Nesar: Rule based Integrator

Abdullah Javed Nesar edited this page Sep 3, 2017 · 3 revisions

About me :

My name is Abdullah Javed Nesar, I am an undergraduate student at Indian Institute of Technology, Kharagpur.

About the Project

A Rule based integrator nicknamed Rubi is an entirely new module in SymPy, Integrals. It is an implementation of more than 10,000 rules to cover a wide variety of indefinite integration. Currently SymPy uses algorithms for indefinite integration which are too slow and presents results which are not simplified. Rubi utilizes a set of well defined rules which makes it smart to present the results in a more symmetric and simplified manner.

Community bonding period

The plan earlier was to implement a completely new pattern matcher with multiple functionalities which was as efficient as Mathematica’s pattern matcher. As the pattern matcher would be the back bone of Rubi. But later we came across matchpy and we planned to implement it in our module. But because it is implemented in Python3.6 Rubi isn’t capable to support Python version less then 3.6.

Coding period

Finally it was decided that it would be feasible only for Python3.6 and versions above. Rules could be added to MatchPy's ManyToOneReplacer. Thanks to Manuel Krebber for helping us whenever we faced problems with MatchPy. Our plan was to generate code of discrimination-net which was compiled by MatchPy. Code generation of rules would help us to remove the dependency on MatchPy and make the module useable for Python<3.6. Unfortunately, the code generation still has the dependency on MatchPy.

Work Done

  • Utility functions: We have managed to cover majority of the utility functions. Our job was to re-write functions from mathematica to Python.
  • Added rules into SymPy using Python parser.
  • Added tests cases. But unfortunately we could not include all the tests due to performance issue in Python. Tests was taking too long so we decided to include only a few of them.

Future Work

  • Although we have implemented all the rules, but we could not work much on the performance and so it takes too long for Python to compute results. Because of this issue we could not add all the test cases.
  • Working on left out Utility functions. Few of the utility functions were a bit tricky like Dist, FixRhsIntRule etc are yet to be implemented.
  • Extending rules set for a smarter computation and better results.
  • Replacing the SymPy’s pattern matcher with matchpy in utility functions.


I would like to thank my mentor Ondřej Čertík for this project idea and helping me understand the project, I am also thankful to Francesco Bonazzi and Aaron Meurer for helping me from the very beginning at every stage whenever I needed help.


Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.