qiskit
qiskit copied to clipboard
"cregbundle set to False" warning should not raised when no classical bits are involved
@Guillermo-Mijares-Vilarino discovered that the following code raises a very confusing warning:
from qiskit.circuit.library import QFT
qft = QFT(3)
qft.decompose().draw('mpl', reverse_bits=True)
RuntimeWarning: Cregbundle set to False since either reverse_bits or wire_order has been set.
wire_order=wire_order,
This fix checks if classical bits are involved before touching cregbundle.
Fixes #8690
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
- @enavarro51
Pull Request Test Coverage Report for Build 3162371682
- 12 of 12 (100.0%) changed or added relevant lines in 2 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage increased (+0.004%) to 84.663%
| Totals | |
|---|---|
| Change from base Build 3162371342: | 0.004% |
| Covered Lines: | 61510 |
| Relevant Lines: | 72653 |
💛 - Coveralls
This PR would be very helpful for the explanation section I'm adding in #8685.
Would you like to make this part of a slightly larger issue surrounding the cregbundle parameter? I've just made #8690 to describe it, although the behaviour has been present for a super long time. Your fix here is good with or without touching that issue, I'm just bringing it up since you're touching the code anyway.
Would you like to make this part of a slightly larger issue surrounding the
cregbundleparameter?
I fixed that one too by changing the way that the default is handled for that parameter.