GSoC 2010 Report Addison Cugini: Quantum Computation - sympy/sympy GitHub Wiki

GSoC 2010 Quantum Computation Report

About Me

I am Addison Cugini, a physics major entering my fourth year of college at Cal Poly, San Luis Obispo. Beyond physics, I have an interest in computation and computer science.

Introduction

My Google Summer of Code project was to develop a module for Sympy that simulated a quantum computer in a human readable way. This code was to work in conjunction with Matt Curry’s GSoC project which would create a base abstraction for quantum mechanics.

Application Process

My experience with applying for the summer of code was rather hectic. I found out about the program only two days before the application was due, which did not give me a lot of time to write a proposal. I spent the time I had learning as much about quantum computation so that I could write the best proposal possible and hope for the best. Luckily, Dr. Granger (my advisor and a professor at Cal Poly) was very helpful in pointing me toward sources of information on quantum computers. I ended up with very little sleep during the application write up as I had very little time to waste. The application I submitted can be found at: https://docs.google.com/View?id=dfdvw9c_1gx87s2gb

GSoC Project

I really enjoyed working on my project. The first three weeks of the summer of code overlapped with the end of the quarter. Thus, most of my time during those weeks was devoted to school with as much time as possible spent learning about how Sympy uses Python’s built in methods to do symbolic calculations. After school came to an end, I spent a little over 40 hours a week working on my project in a small computer lab at Cal Poly. Initially, my time was split between reading texts on quantum computation and implementing some of the stuff I learned in code. Later on in the summer, my time was mostly spent coding, debugging, thinking and writing comments with very little time spent reading.

My coding time was spent developing classes that represented qbit-kets and the gates which acted on the kets. This involved teaching the objects basic things like how to print themselves as well as more complicated tasks like how to represent themselves in standard matrix form (this was quite difficult in the case of arbitrary gates in which the control and target bits were far apart). The gate objects were also taught how to directly apply themselves to a qbit-ket object in such a way that creating a new type of gate was as simple as defining a matrix. All of these abilities were used in several functions which allow the user to apply, represent or rearrange gates and qbit objects (among other things). Code management was done using git, pushing up changes to my github account. Specific details of what I did can be found on my blog: http://addisoncugini.blogspot.com/

By the time the last few weeks of coding rolled around, I was basically done with what I had promised to complete for the project (save basis transformations which were to be implemented in Matt’s quantum base layer). One of the goals Dr. Granger, Matt and I had set out to do was use Matt’s base quantum code inside my code; Matt had run into some snag’s which had prevented him from progressing as far as we had hoped in his GSoC project so his code did not have all of the things that were needed. Since Matt needed to finish a little more before I could integrate my stuff with his stuff (and he is kind of a slow coder, to be perfectly honest), I helped him implement new multiplication, addition and power classes which would allow the correct application of certain algebraic rules. Implementing this took up the last few weeks of my time.

Conclusion

This project made the summer one of the best ones I have ever had. It was fun learning about quantum computation and coding, rather than getting an internship where I get coffee and make copies like I have in summers past. The last couple of weeks I spent helping Matt allowed me to learn quite a bit about how his code was to work, which was also quite interesting. Working on a coding project like this was a great experience and I’m sure the stuff I learned about python, git, etc will be useful in the future. The code I have produced has not yet been pushed into the main Sympy repository yet; in the future I plan to polish up my work and get the code pushed.