rhoforsympy

..where we discuss density operators wrt SymPy

Month: July, 2012

Week 10: Finishing up density matrices!

This week I largely wrapped up most of the items I had listed in the proposal. The current pending PR addresses and completes most of the major features I had proposed to implement. Some minor issues that are still pending should be addressed during the next week.

1. Adjust qapply() to complete some density based operations more gracefully.

2. Relocate the trace.py modules from core to another suggested folder. There have been some discussions on this on the mailing thread, which I plan to re-initiate and get a closure on this week.

Apart from these 2 items, based on some IRC discussions I had with Brian during past week, I have started looking at following 2 items. My plan is to work on the following 2 items during this month.

1. Finish up implementation of Shor’s algorithm currently available here: git

2.  Implement the fidelity and trace distances for density matrices: Ref

Happy Coding!

Some examples for latest pull request

In the latest PR  2 features have been implemented and relevant examples were added to notebook.   Some examples for the first feature, can be found at this post.  Some updates and test cases were added after I had discussed it there.

The second is a minor change to qapply() as seen in  the following 2 examples:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Happy Coding!

Week 8: Trace implementation contd. and more Density ops

This week was primarily spent on 2 tasks.  Getting some of the issues addressed in the currently pending PR 1396. Apart from work on this I have spent some testing some changes I had to make to implement the operations needed when Unitary operations are applied to Density operators.

Some use cases I am currently working on for this are as follows:

1. Using basic kets/bras and generic UnitaryOperator

2. Apply Gates of Density operators with states as Qubits.

Currently, qapply() works on  UnitaryOpearator*Ket correctly. But, as seen in the second print statement Bra*Dagger(UnitaryOperator) does not expand out fully. I am currently working on fixing this so that the second part of the expression expands out smoothly.

Therefore, my goal this week is to complete the implementation of UnitaryOperators applied to Density operators, plus address tasks for current PR and another PR ( related to partial trace on qubits)  I plan to submit this week.

Happy Coding!

Week 7: Tr operations on Qubits

This week has been lot less coding and more of understanding some pieces of codes for next set of changes. As far as the implementation goes, the Tr operations ( including partial trace/reduce density operations) for qubits was implemented.

Some examples of the Tr operations on qubits can be seen here.

An example of an reduced density operation on a mixed-state is shown below

The changes shown above are currently available in my git branch over here. I plan to submit a PR of this branch as soon as the my current PR 1396 is merged.

Another task I have been working on this week is figuring changes needed to qapply() to perform the L and R operations of density matrix. I plan to work on this tasks during next week.

In summary, plan for next week:

1. Address comments on current PR 1396.

2. Submit PR for trace_qubit branch and address any reviews on that.

3. Work on the L and R operations.

With these activities, the next major task that would remain is to set up trace operations for Time Dependent states.  I will start researching on the current implementation of this code to understand where my changes would have to go.

On a side note, we are breaking record temperatures in Chicago this week, and it was tough to keep myself cool without an air-conditioner!  Hope other Chicagoan Sympy members are doing just fine by the beach!

Week 6 : Tr implementation contd…

This week I continued to work on the Tr operator and the related code needed for partial trace operations.  Following up with the list of tasks I had listed out for this week, I got the following items accomplished this week.

1. PR 1333 merged

2. Submitted PR 1396  for review :

This PR has the following changes:

1. Printing ( default, latex and pretty).  The current output does not display the indices.  I would like some input on this from the reviewers on how to incorporate the information on indices into the output.

2. Handles indices in the constructor of Density class and related methods.

3. Handle partial trace operations especially wrt to Density operators.

4. Notebook example, some of which are listed below:

The activities I have in mind for next week are as follows.

1.  Address review comments on latest PR.

2.  Complete the test cases for existing partial trace implementation for Qubits. My plan is to get this changes merged with the current PR. This should happen by Tuesday.

With these 2 activities, I believe most of what is needed for Tr and density matrices could be considered complete. Again, I expect  @ellisonbg and @flacjacket to provide some input on this.   Assuming, this is true, then I plan to start looking at

3. qapply() method to incorporate density op L and R operations.

Aside:

BTW, for Emacs lovers and who love IPython Notebook, there is IPython notebook for Emacs now. I have not tried this yet,  but I plan to try this out this week and post my experience.

Happy coding!