qiskit icon indicating copy to clipboard operation
qiskit copied to clipboard

"cregbundle set to False" warning should not raised when no classical bits are involved

Open 1ucian0 opened this issue 3 years ago • 5 comments
trafficstars

@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

1ucian0 avatar Sep 06 '22 10:09 1ucian0

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

qiskit-bot avatar Sep 06 '22 10:09 qiskit-bot

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 Coverage Status
Change from base Build 3162371342: 0.004%
Covered Lines: 61510
Relevant Lines: 72653

💛 - Coveralls

coveralls avatar Sep 06 '22 10:09 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.

jakelishman avatar Sep 06 '22 16:09 jakelishman

Would you like to make this part of a slightly larger issue surrounding the cregbundle parameter?

I fixed that one too by changing the way that the default is handled for that parameter.

1ucian0 avatar Sep 18 '22 14:09 1ucian0