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

Revise handling of classical register #13

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

d1ssk
Copy link
Contributor

@d1ssk d1ssk commented Sep 7, 2023

Before submitting, please check the following:

  • Make sure you have tests for the new code and that test passes (run pytest)
  • format added code and tests by black -l 120 <filename>
  • If applicable, add a line to the [unreleased] part of CHANGELOG.md, following keep-a-changelog.

Then, please fill in below:

Context (if applicable):

In the previous handling of the classical register, the conversion to a circuit only succeeded if the node index was an integer sequence from 0 to the number of nodes.

Description of the change:

  • In the to_qiskit method, the implementation was changed to use a dictionary that maintains the correspondence between the index of the classical register and the node index.
  • This dictionary is added to the attributes of IBMQBackend and is also used when formatting the results of simulation or actual execution.
  • A test was added in which random pattern is converted into qiskit circuit after processing Pauli measurements.

Related issue:
#12

also see that checks (github actions) pass.
If lint check keeps failing, try installing black==22.8.0 as behavior seems to vary across versions.

@d1ssk d1ssk linked an issue Sep 7, 2023 that may be closed by this pull request
graphix_ibmq/runner.py Outdated Show resolved Hide resolved
@d1ssk d1ssk merged commit ae6b500 into master Sep 11, 2023
10 checks passed
@d1ssk d1ssk deleted the 12-bug-index-mismatch-in-classical-register branch September 11, 2023 10:18
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]: Index mismatch in classical register
2 participants