-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix typing error in
random_circuit
conditionals (#9651)
The `condition` field is expected to be a comparison of a register or bit with a Python bigint (or bool, which is a subclass). This function could previously output fixed-width Numpy types, however, which could cause problems with subsequent bitmasks if the constructed masker/maskee _was_ a Python bigint and couldn't fit in the Numpy type. The more recent `IfElseOp` enforces the correct typing, it's just the old form that doesn't. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 94e9480)
- Loading branch information
1 parent
d705295
commit 3fb23e5
Showing
3 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/fix-random-circuit-conditional-6067272319986c63.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed a bug in :func:`.random_circuit` with 64 or more qubits and ``conditional=True``, where | ||
the resulting circuit could have an incorrectly typed value in its condition, causing a variety | ||
of failures during transpilation or other circuit operations. Fixed `#9649 | ||
<https://github.com/Qiskit/qiskit-terra/issues/9649>`__. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters