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

fix a misused 2-qubit sample result type #135

Conversation

jcjaskula-aws
Copy link
Collaborator

@jcjaskula-aws jcjaskula-aws commented Dec 28, 2023

Summary

Measure instructions were wrongly translated. We now construct a 1-qubit sampling instruction.

Details and comments

We were translating a 1-qubit measure instruction into a 2-qubit ZZ observable sampling instruction (using the classical register index for the second qubit). This PR uses the right instruction and renames most of the variables in the function to be clearer.

Fixes #132.

@jcjaskula-aws jcjaskula-aws marked this pull request as ready for review December 29, 2023 00:15
@rmshaffer
Copy link
Collaborator

Probably orthogonal to this change, but it looks like the buggy code was originally added to fix an issue when a circuit has multiple registers: #51. Do you know if that scenario works now?

@jcjaskula-aws
Copy link
Collaborator Author

jcjaskula-aws commented Jan 4, 2024

Probably orthogonal to this change, but it looks like the buggy code was originally added to fix an issue when a circuit has multiple registers: #51. Do you know if that scenario works now?

Yes, I added a test to confirm that using multiple registers works correctly out-of-the-box.

@ajberdy ajberdy merged commit 2e2aa27 into qiskit-community:main Jan 11, 2024
8 checks passed
@jcjaskula-aws jcjaskula-aws deleted the jcjaskula-aws/fix_measure_translation branch January 11, 2024 18:45
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

Successfully merging this pull request may close these issues.

[bug] Measurement handling in convert_qiskit_to_braket_circuit sometimes fails
3 participants