GSoC 2012 Blog Post
Clone this wiki locally
SymPy is a computer algebra system (CAS) written in pure Python. The core allows basic manipulation of expressions, like differentiation or simplification, and it contains many modules for common mathematical tasks, such as limits, integrals, differential equations, series, matrices, quantum physics, geometry, plotting, and code generation.
SymPy has participated in the Google Summer of Code program in previous years under the umbrellas of Python Software Foundation, Portland State University, and the Space Telescope Science Institute, where we were very successful. In fact, several of our core developers, including five of the mentors from this year, started working with SymPy as Google Summer of Code students. We participated in Google Summer of Code 2011 as a standalone organization for the first time. We had excellent contributions as yet more people joined the community. The 2011 report is here. We were accepted to Google Summer of Code 2012 as a standalone organization again, and we would like to share this year's experience in this blog post.
As part of the application process we required each student to submit a patch (as a GitHub pull request) that had to be reviewed and accepted. This allowed us to see that each applicant knew how to use Python as well as communicate effectively during the review process. This also encouraged only serious applicants to apply. We had over 15 mentors available and we ended up with 6 students, all of whom were successful at final evaluations.
We required that the students write weekly blog posts during the course of their development activity, reporting their progress and presenting their further plans. Besides helping the mentors to assess the status of their students, weekly blog reports also set weak intermediate milestones that facilitated more detailed planning. All blogs were synchronized at Planet SymPy.
The 2012 GSoC students for SymPy were
Aleksandar improved the group-theory-related facilities of SymPy, including the tools to deal with permutation groups. Besides contributing the code for calculating the basic characteristics of a group and its elements, like orbits or stabilizers, he added a special version of the Schreier-Sims algorithm, which is the standard algorithm for finding the strong generating set of a permutation group. Aleksandar also contributed a function to find the subgroup of all elements satisfying a certain property. This function allows finding centralizers, normalizers, coset representatives, etc., and is thus a very powerful instrument in analysing the structure of groups.
Bharath implemented the implicit plotting module which allows plotting
implicitly defined functions. This feature is extremely useful for graphical
analysis of equations and having it implemented pushes SymPy forward greatly.
The library supports boolean combinations of functions, as well as
plot_implicit(And(x**2 < y, x < cos(y)))). The implicit
plotting module is based on a paper by
Jeff Tupper that
uses interval arithmetic, which was also contributed by Bharath at the
beginning of the Summer of Code period. Bharath also worked on improving
other areas of the plotting module, such as helping build a new API.
Angadh worked on the extending the work on
physics.mechanics. The main goal of his project was to add another method (Lagrange's method) of deriving the equations of motion of mechanical systems idealized by rigid bodies and/or particles. To do so, Angadh added the functionality to compute the kinetic energy and
specify the potential energy of a system(s), or of a part of it. Then he added the functionality to develop the Lagrangian of said system(s). He then proceeded to add other functionality, also relevant to
physics.mechanics, and then wrote a class to compute equations of motion employing Lagrange's Equations. The class,
LagrangesMethod, can be used to derive the symbolic equations of motion of both holonomic and non-holonomic systems. Apart from this, he also created helper functions to determine the different momenta of a system comprised of rigid bodies and/or particles. This lays the foundations for possibly implementing the Newton-Euler approach to derive the equations of motion of mechanical systems. The work done by Angadh over the summer offers yet another useful set of capabilities to dynamicists using SymPy.
Guru Devanla - Density Operators, Trace and Partial Trace for Quantum Module, mentored by Brian Granger and Sean Vig.
Guru worked on adding support for density matrices to the SymPy quantum mechanics module. Density matrices, also referred to as density operators, provide powerful analysis tools which are particularly useful in quantum computing. Guru also implemented several operations to leverage the power of density matrices, like trace and partial trace, computing entropy, fidelity, etc. These additions complement the powerful quantum computation algorithms in SymPy. The new operators and methods implemented by Guru provide new symbolic tools for researchers studying quantum computing. During the Summer of Code, Guru also provided examples of using the code he contributed in the form of IPython Notebooks.
Sergiu laid the basis for a category theory module in SymPy. In the summer he mainly focused on automated plotting of commutative diagrams and producing LaTeX compatible Xy-pic output. Towards the end of the Summer of Code, Sergiu started working on automatic derivation of the property of a diagram to be commutative, basing on the knowledge that certain other diagrams are commutative. However, due to the restricted timeframe of GSoC, this effort has not yet resulted in functional code. Sergiu will continue the work on the automatic derivation of commutativity in his spare time.
Stefan added the differential geometry module which boosts the ease with which the researchers exploring this domain can apply SymPy in their work. Stefan started by implementing the classes necessary to represent coordinate systems and fields, as well as some basic tools for dealing with integral curves. He then worked on adding tensors, tensor fields, tensor products, wedge products, curvature tensors, etc. to SymPy. Stefan also provided a detailed explanation of how the new module can be used to derive one of the simplest solutions to the Einstein equation in free space (the Schwarzschild solution). During the Summer of Code period Stefan has also contributed significant improvements to the ODE module of SymPy, which include Jordan forms of matrices and generalized eigenvectors.
The code for all these projects is included in the latest release of SymPy, 0.7.2, which was released at the end of the summer. We'd like to thank all the students and mentors this year for their excellent work, and we'd especially like to thank Google for once again for this program, without which none of this great work would exist.
Aaron Meurer and the SymPy Community