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

Measurement in Pauli-Y basis leaves qubit in incorrect state #48

Closed
swernli opened this issue Mar 13, 2023 · 0 comments
Closed

Measurement in Pauli-Y basis leaves qubit in incorrect state #48

swernli opened this issue Mar 13, 2023 · 0 comments

Comments

@swernli
Copy link
Collaborator

swernli commented Mar 13, 2023

Currently the implementation of __quantum__qis__measure__body uses the map_paulis and unmap_paulis helper functions to handle switching between the given Pauli basis and the computational basis. However, the Pauli-Y case for those helpers is identitcal (HSH) when really the unmap_pauli should use the adjoint, (HSdgH). This is a simple one line fix, but is missing an adequate test case that would be somewhat complex (verifying not only that the measurement is correct but that subsequent operations are consistent with the measured state). One potential course for verifying the unmapping happens correctly would be repeated measurement, but testing would be needed to confirm that this detects the issue.

swernli added a commit that referenced this issue Mar 14, 2023
This change fixes measurement in the Pauli-Y basis by resolving a but in how basis changes are unmapped after a call to `__quantum__qis__measure__body`. It also introduces a scenario test that verifies the behavior of Pauli-Y measurement using basis changes, assertions, and repeated measurement. Fixes Measurement in Pauli-Y basis leaves qubit in incorrect state #48.
swernli added a commit that referenced this issue Mar 15, 2023
* Fix `unmap_pauli` for Pauli-Y measurement

This change fixes measurement in the Pauli-Y basis by resolving a but in how basis changes are unmapped after a call to `__quantum__qis__measure__body`. It also introduces a scenario test that verifies the behavior of Pauli-Y measurement using basis changes, assertions, and repeated measurement. Fixes Measurement in Pauli-Y basis leaves qubit in incorrect state #48.

* Convert test from bitcode to Rust

* Add comments to test

* Make tests more focused/unit
@swernli swernli closed this as completed Mar 15, 2023
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

1 participant