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 decomposition of an instruction with a single qubit and clbit #8614

Merged
merged 2 commits into from
Aug 25, 2022

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Aug 25, 2022

Summary

Fixes #8591.

Details and comments

Added a check to ensure the node that is replaced has the same number of classical bits that the rule we replace it with. Both these are required to be 0 right now as we don't have any gates that contain classical bits. I think this number could be allowed to be <= 1 though -- more than 1 would not necesssarily preserve the order?

@Cryoris Cryoris requested a review from a team as a code owner August 25, 2022 12:05
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@Cryoris Cryoris added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: Bugfix Include in the "Fixed" section of the changelog labels Aug 25, 2022
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For substitute_node the number of arguments needs to be exactly identical, otherwise the connecting edges in the DAG change, and we'd need to do a larger contraction (which substitute_node_with_dag does). Strictly the limitations are actually that the rule has one one element and that the qargs/cargs are passed to the element are identical including order.

@coveralls
Copy link

coveralls commented Aug 25, 2022

Pull Request Test Coverage Report for Build 2926817522

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 84.124%

Totals Coverage Status
Change from base Build 2922089833: 0.003%
Covered Lines: 56649
Relevant Lines: 67340

💛 - Coveralls

@mergify mergify bot merged commit c008008 into Qiskit:main Aug 25, 2022
mergify bot pushed a commit that referenced this pull request Aug 25, 2022
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit c008008)
mergify bot added a commit that referenced this pull request Aug 25, 2022
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit c008008)

Co-authored-by: Julien Gacon <gaconju@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong decomposition rule when decomposing into a single-qubit instruction
4 participants