-
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 single-bit-condition equality in QuantumCircuit and DAGCircuit (#…
…8930) (#8943) * Fix single-bit-condition equality in QuantumCircuit and DAGCircuit Previously, the `condition` of a given operation would not be converted into bit indices in order do the semantic-equality checking that the rest of the qargs and cargs get in a circuit. This caused loose-bit comparisons to produce false negatives. * Improve temporary variable names Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: Matthew Treinish <[email protected]> (cherry picked from commit 3bebd0f) Co-authored-by: Jake Lishman <[email protected]>
- Loading branch information
1 parent
6c4a3b6
commit e3849ad
Showing
4 changed files
with
90 additions
and
8 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
8 changes: 8 additions & 0 deletions
8
releasenotes/notes/fix-circuit-condition-compare-d8d85e5ca47c1416.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,8 @@ | ||
--- | ||
fixes: | ||
- | | ||
The equality checkers for :class:`.QuantumCircuit` and :class:`.DAGCircuit` | ||
(with objects of the same type) will now correctly handle conditions on single | ||
bits. Previously, these would produce false negatives for equality, as the | ||
bits would use "exact" equality checks instead of the "semantic" checks the rest | ||
of the properties of circuit instructions get. |
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
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