Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unitary Hack]Mix state evolution, and expectation value calculation #22

Open
hongyehu opened this issue May 29, 2024 · 8 comments
Open

Comments

@hongyehu
Copy link
Owner

Implement mixed state quantum evolution, measurement, and expectation values. In the current implementation, the stabilizer state class has an attribute stabilizer_state.r which labels how many stabilizer generators are used to describe the state. For example, for a N qubit stabilizer state, in the gs matrix, the first N rows denote the stabilizer generators in binary vectors, and the second N rows denote the destabilizer generators in binary vectors. And the stabilizer generators used are from stabilizer_state.r to N, while destabilizer generators used are from stabilizer_state.r+N to 2N.

Therefore, if stabilizer_state.r=0, the state is fully stabilized by the first N generators, and the state is pure. And one need to change the evolution, measurement, calculation of expectation functions accordingly to general 0<stabilizer_state.r<=N for the mixed states.

@vietnguyen012
Copy link

Hi, I would like to take up the issue. Can you assign it to me? thank you.

@vietnguyen012
Copy link

vietnguyen012 commented May 30, 2024

Hi, I would like to take up the issue. Can you assign it to me? thank you.

P.S: I've just read the underlying code of pyclifford for the pure state operations, I understand nothing tbh 🙁. Do you have documents or papers explaining the algorithms for doing the projection's evolution, measurement and expectation for pure state or even better mixed states? I really appreciate your help! I am still new to the stabilizer code but I really want to learn more about it by solving this challenge.

@hongyehu
Copy link
Owner Author

@vietnguyen012 according to the unitary fund, the bounty is not assigned to a person until one finishes it. I am happy to help you understand better. I will attach some references on the stabilizer state and its simulation here. If you need extra help, please let me know. :-)

@vietnguyen012
Copy link

vietnguyen012 commented May 31, 2024

yes, I will try to solve it. I am still waiting for your references though.

@vietnguyen012
Copy link

Hi, I noticed that it looks like the measurement function has already implemented measurements with r > 0. Is that right? I need to confirm this.

@dobbse42
Copy link

dobbse42 commented Jun 8, 2024

Hello! I'll be giving this one a shot. In your problem statement you mention that the stabilizer generators go from StabilizerState.r to N, and the destabilizer generators from StabilizerState.r+N to 2N. This differs from the original Aaronson and Gottesman paper in two significant ways: 1) Aaronson and Gottesman place the destabilizers first, and the stabilizers second (I don't think this causes any issues, it's just important to remember when trying to compare the code to the algorithm outlined in the paper). 2) In the mixed case, the stabilizer mixed state is generated by r stabilizers and additionally has r destabilizers, not n-r as you have in the code. There are instead n-r logical X and logical Z operators (see section VIIA on page 11). I believe this to be a bug in your code which has simply not presented itself up to now since r has always been 0. I'm going to start working on implementing the modified operations with the assumption that gs will contain r stabilizers, followed by n-r X operators, followed by r destabilizers, followed by n-r Z operators, but actually making that change might affect other parts of the code. Have I misunderstood anything here, or do you plan for this to be implemented in a different way than I outlined? Additionally, do you expect a partial trace to be implemented for the mixed case (since this is not yet implemented for even the pure case)?Thanks in advance.

@dobbse42
Copy link

dobbse42 commented Jun 11, 2024

After spending a while looking at the code, I am now under the impression that all of the requested functionality has actually already been implemented since the first commit. stabilizer_project, stabilizer_measure, and stabilizer_expect all allow for non-zero r and (I believe) function correctly. The only functionality which I believe may remain to be implemented is actually finding the logical Z and X operators (the "standby operators") when creating a stabilizer mixed state, as I cannot tell if the stabilizer_project function would halt at non-zero r with correct operator values if given stabilizers defining a stabilizer mixed state (and I don't think any of the existing unit tests look for this).

@hongyehu Is there still some desired functionality missing from the stabilizer functions in utils.py? Am I correct in understanding that the existing unit tests do not test for correct values of standby operators for arbitrary stabilizer mixed states, and so this is all that needs to be implemented?

Additionally, in the interest of helping others who might want to contribute to this project: stabilizer_state.r refers to the value "n-r" in the Aaronson and Gottesman paper (the number of logical operators, not the number of stabilizer generators), and stabilizer_state.gs holds the Z operators, followed by the stabilizer generators, followed by the X operators, followed by the destabilizer generators.

@vietnguyen012
Copy link

vietnguyen012 commented Jun 13, 2024

Hi @dobbse42, do you think the r needs to be 0 after the algorithm is finished bc we basically purify the mixed states by representing it as a tableau of a pure state? on the side note, I find it hard to reconcile the algorithm from the paper and pyclifford. Pyclifford uses an observable to interact with the stabilizer states whereas Aaronson and Gottesman's algorithm just manipulates on the state itself. Probably I dont really understand the purpose of those row operations haha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants