Skip to content

Instantly share code, notes, and snippets.

@shubhamtibra
Last active September 24, 2017 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shubhamtibra/37fd0ebeeda094ed1b57508c8b8484b7 to your computer and use it in GitHub Desktop.
Save shubhamtibra/37fd0ebeeda094ed1b57508c8b8484b7 to your computer and use it in GitHub Desktop.
Google Summer of Code 2016 | Project: Implementation of Holonomic Functions in SymPy

About me

Hi! My name is Subham Tibra and I am majoring in Mathematics and Computing at I.I.T. Kharagpur.

Github Profile: @shubhamtibra

My Project

This GSoC project adds a module for holonomic hunctions in SymPy.

Holonomic function is a family of special type of functions in Mathematics. My job is to write classes for representation of folonomic function and to write algorithms for various operations on them.

Demo of my work

I will show you an application of this module.

For instance, consider the cosine function cos(x). You might remember that its indefinite integral is sin(x). You can do that using this module in the following manner:

In [1]: from sympy import *

In [2]: init_session()
IPython console for SymPy 1.0.1.dev (Python 2.7.12-64-bit) (ground types: python)

These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> init_printing()

Documentation can be found at http://docs.sympy.org/dev


In [3]: from sympy.holonomic import *

In [5]: expr_to_holonomic(cos(x)).integrate(x).to_expr()
Out[5]: sin(x)

As you can see Out[5]: gives you the integral of cos(x) that is sin(x).

There are lots of other things this module can do but that'd be too much to explain here. If you are interested you can look it up here.

Work done

Fortunately I have been able to complete all of the work I proposed. A new module supporting most of the needed operations was added in SymPy.

Code Written during the period

All of the code was written in Python. I am providing link to the Pull Requests that I worked on during the GSoC period.

Merged

  1. A basic representation of Holonomic Functions and Differential Operator
  2. Using Polynomials in the module holonomic and Implement conversion to Hypergeometric.
  3. Recurrence Operators and Recurrence Relations for Holonomic Functions.
  4. Numerical Methods for Holonomic Functions
  5. Convert Expressions/Functions to Holonomic Functions.
  6. Optimization in module holonomic and Implementing RK4 for numerical computation.
  7. Finding and then solving Bugs in module sympy/holonomic
  8. Convert expression to holonomic
  9. Convert Holonomic Functions to Hypergeometric and eventually to expressions/functions.
  10. Fixing issues in Holonomic Functions
  11. Making the module holonomic usable
  12. Convert Meijer G-function and better support for Singular Points (regular).
  13. Automatically find domain for the polynomial coefficients of the differential equation and support for singular initial conditions in integrate, mul and add.
  14. More support for computing singular initial conditions in expr_to_holonomic.

Open (as of 20 August 2016)

  1. [WIP] Fixing some bugs and writing Sphinx documentation for the module holonomic.

This is the list of my commits to SymPy repo. These are my contribution figures at the end of GSoC:

186 commits / 7,036 ++ / 2,860 --

Weekly Reports

Below is the link of the blog I created solely for weekly updates of this project.

Link: https://shubhamtibra.wordpress.com/

Status of the Project after my work

Even though I have fulfilled my proposals, the project can be extended. This project was started in this GSoC only and I hope other developers will join the project and make it better and more useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment