Blog Posts

  • 14 Aug 2018 » Concluding GSoC 2018: SymPy

    This post summarises the work that I have done during GSoC for SymPy. The links to the Pull Requests are in chronological order under each header. For following the progress made during GSoC, see my weekly posts. This summer has been a great learning experience and has helped me get a good exposure of test-driven development. I plan to actively review the work that has went into this project and continue contributing to SymPy. I am grateful to my mentors, Kalevi and Aaron for reviewing my work, giving me valuable suggestions, and being readily available for discussions. Pull Requests This... read more

    07 Aug 2018 » GSoC 2018: SymPy - Week 12

    The final week of Coding Period has completed. This week, the work was mainly concerned with the documentation and refinements in the discrete module. I started by opening PR #14994 to update Sphinx docs for SymPy. Kalevi and Aaron were kind enough to review the PR and help refine it for the final merge. The documentation for discrete module is now part of the SymPy docs and can be referred here. Late this week, I opened PR #15025 for improvements in the discrete module. Colin helped fix accidental floats in unit tests (which should have been Rationals). After the review,... read more

    28 Jul 2018 » GSoC 2018: SymPy - Week 11

    This week, I started working on adding the final method to convolution module for Intersecting Product. PR #14954 dealt with the addition of intersection_product method. Intersecting Product was implemented using Möbius Transform with superset enumeration (mobius_transform(..., subset=False) and inverse_mobius_transform(..., subset=False)). After minor documentation improvements, the PR was merged successfully. The proposed transforms and convolutions are now part of sympy.discrete. The basic usage for the method is: >>> from sympy import symbols, S, I, intersecting_product >>> u, v, x, y, z = symbols('u v x y z') >>> intersecting_product([u, v], [x, y]) [u*x + u*y + v*x, v*y] >>> intersecting_product([u, v,... read more

    21 Jul 2018 » GSoC 2018: SymPy - Week 10

    This week SymPy 1.2 was released, which included the discrete module. The complete changelog for the SymPy 1.2 is here. I started the week by cleaning up discrete module, improving the API of public convolution method by attending to reviews by Aaron and Kalevi and fixing issue #14901 reported by Aaron in PR #14907. The PR #14907 has been merged successfully and will be part of SymPy 1.2.1. Late this week, I started working on the convolution module for inclusion of covering_product. The PR #14298 included the same with documentation, doctests and unit tests. The implementation of covering_product uses Möbius... read more

    14 Jul 2018 » GSoC 2018: SymPy - Week 9

    The second phase of Coding Period has concluded. This week I worked on implementing Subset Convolution for discrete module. PR #14878 was opened for the same. The PR included unit tests, documentation, and correspondingly subset keyword was added for public convolution method. After discussing the implementation details and references with Kalevi, the approach was finalized. The PR has been merged successfully. The usage for the same is: >>> from sympy.discrete.convolutions import (convolution, convolution_subset) >>> u, v, x, y, z = symbols('u v x y z') >>> convolution_subset([u, v], [x, y]) [u*x, u*y + v*x] >>> convolution([u, v, x], [y, z],... read more

    06 Jul 2018 » GSoC 2018: SymPy - Week 8

    This week I started working on adding Möbius Transform to the discrete module using Yate’s DP (Dynamic Programming) method for implementation as part of PR #14853. The proposed transforms are part of sympy.discrete.transforms module. After discussing with Kalevi, the methods implementing this transform were added with appropriate names. The keyword subset is used as a boolean to choose whether enumeration is done over subsets or supersets. The usage for the transform is: >>> from sympy import mobius_transform, inverse_mobius_transform >>> seq = list(symbols('w x y z')) >>> mobius_transform(seq) [w, w + x, w + y, w + x + y +... read more

    28 Jun 2018 » GSoC 2018: SymPy - Week 6 & 7

    The second phase of Coding Period has started. I started this phase working on recurrence submodule under discrete. After having an initial discussion with Kalevi regarding the functionality to be implemented, I did the proof-of-concept for the same on a remote branch. After the approach was finalized, the implementation was polished before opening the PR. The PR #14816 also included documentation, doctests, and unit tests for the module. The method linrec(coeffs, init, n) takes coefficients, initial values and point of evaluation for the linear recurrence. Usage for a recurrence like f(n) = f(n - 7) + f(n - 13) +... read more

    15 Jun 2018 » GSoC 2018: SymPy - Week 5

    The first phase of Coding Period has concluded. This week, I started working on the convolution for -group using fwht - Dyadic (XOR) Convolution. The PR #14783 dealt with this addition to the module. I had a useful discussion with Kalevi for clearing the API and naming convention. The convolution method uses dyadic=True as the hint which uses convolution_fwht for the implementation. Appropriate documentation, doctests and unit tests are also included. Successive reviews helped in refining the PR, before the final merge later in the week. The usage for the same is: >>> from sympy.discrete.convolutions import (convolution, convolution_fwht) >>> from... read more

    09 Jun 2018 » GSoC 2018: SymPy - Week 4

    Another week of Coding Period has concluded. Starting this week, I worked on PR #14765 for implementing Fast Walsh Hadamard Transform (fwht). As pointed out by Kalevi, symbolic coefficients could be supported by this transform as the general Kronecker matrix only contains +/-1, which means it essentialy requires only addition or subtraction to perform the transformation. Also, the PR review helped fix a minor issue related to string concatenation. Usage for fwht looks like: >>> from sympy import fwht, ifwht, symbols >>> fwht([4, 2, 2, 0, 0, 2, -2, 0]) [8, 0, 8, 0, 8, 8, 0, 0] >>> ifwht(_)... read more

    03 Jun 2018 » GSoC 2018: SymPy - Week 3

    The third week of Coding Period has concluded. I started the week by finalizing the PR #14745. The PR has been merged successfully. The master branch of sympy now contains transforms and convolution submodules under discrete. I have tested corner cases as well. Documentation and Doctests are complete for the transforms and types of convolution that are currently part of master. Late this week, I pushed commits to PR #14712 with the aim of fixing failing tests in test_util.py and test_inequalities.py due to solveset. The remaining tests are failing as solvers can not currently solve the transcendental equations when rewritten... read more

    29 May 2018 » GSoC 2018: SymPy - Week 2

    The second week of Coding Period has concluded. I started the week by finalizing the PR #14725. The PR has been merged successfully. Fast Walsh Hadamard Transform (fwht) will be added along with XOR Convolution at a later point of time. Late this week, I started working on the convolution module PR #14745 with the aim of adding the following along with appropriate tests. Convolution using Fast Fourier Transform (convolution_fft) Convolution using Number Theoretic Transform (convolution_ntt) General Convolution method (convolution) Kalevi and Aaron suggested using convolution as the name for the methods instead of conv. I had a detailed discussion... read more

    23 May 2018 » GSoC 2018: SymPy - Week 1

    The first week of Coding Period has concluded. I started the week working on the PR #14712 to fix existing issues #14262 and #12744. There were some complications caused by the PR as it was affecting the solvers module. The failing tests on travis revealed some bugs and issues in solvers. The bugs are fixed, though minor issues still persist. Late this week, I started working on the first PR #14725 as part of my project with the aim of adding the following along with appropriate tests. Discrete Module Transforms Module Fast Fourier Transform (fft) Number Theoretic Transform (ntt) Fast... read more

    16 May 2018 » GSoC 2018: SymPy - Community Bonding

    The community bonding period has concluded. As proposed, I have gone through the existing modules and have thought about various aspects of the implementation which needed to be taken care of. The discussion for the project will take place on gitter under sympy/discrete. Discussion for API is premature but it will shape as the Coding Period commences. Meanwhile, I have control of what all needs to be done in accordance with the proposed timeline. Being familiar with the development workflow and having contributed to SymPy, I assisted new contributors and also helped review existing PRs - #14679, #14698 and #14707.... read more

    24 Apr 2018 » Selected for GSoC 2018: SymPy

    I am extremely glad to inform that my proposal ‘Transforms, Convolution & Linear Recurrence Evaluation’ has been accepted by SymPy for Google Summer of Code 2018. For those unfamiliar, SymPy is a Computer Algebra System (CAS) written entirely in Python. SymPy was started as a project by Ondrej Certik (certik) in 2006. SymPy has participated in every Google Summer of Code since 2007. My official mentors are Aaron Meurer (asmeurer) and Kalevi Suominen (jksuom). Aaron (who also joined from GSoC) is the lead developer of SymPy since 2011. Kalevi (SymPy Member) has mentored for Google Summer of Code in 2016... read more