qiskit
qiskit copied to clipboard
Add conversion transpiler pass from `c_if` to `IfElseOp`
Summary
This is intended to be used to ease the transition from the old-style conditions to the new-style form. Backends may use it in their custom pipelines, so they can guarantee they only need to deal with one form.
A further classical optimisation may be to group IfElseOp
blocks that share the same condition into a single operation, but this would likely be a separate pass, if added, or potentially be the domain of a separate part of the circuit-description/compilation/running pipeline.
Details
Fixes #8601.
Will need rebasing over #8627 and #8615 once they merge, as this depends on them, and currently includes their commits. I just can't look at my screen any more tonight to wait til it merges.
edit: This is now rebased.
cc: @taalexander (this is the pass I wrote for you)
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
Pull Request Test Coverage Report for Build 3147692364
- 47 of 47 (100.0%) changed or added relevant lines in 3 files are covered.
- 2 unchanged lines in 1 file lost coverage.
- Overall coverage remained the same at 84.502%
Files with Coverage Reduction | New Missed Lines | % |
---|---|---|
qiskit/extensions/quantum_initializer/squ.py | 2 | 79.78% |
<!-- | Total: | 2 |
Totals | |
---|---|
Change from base Build 3147690270: | 0% |
Covered Lines: | 60254 |
Relevant Lines: | 71305 |