-
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.
Browse files
Browse the repository at this point in the history
…8578) * Fix QPY serialisation of ControlledGate with open controls Previously, an incorrect definition and name would be re-instated on QPY deserialisation of a `ControlledGate` instance with open controls. The base name would include the dynamic `_o{ctrl_state}` suffix, causing the suffix to later be duplicated, and the definition would duplicate the logic that added the open controls. This fixes both by stripping the suffix on re-read before it is assigned, and serialising only the "11...1" state definition, since this is what is required and stored by `ControlledGate`. * Add QPY backwards compatibility test Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit a0964c1) Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
- Loading branch information
1 parent
d856313
commit 5e26264
Showing
4 changed files
with
56 additions
and
3 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
6 changes: 6 additions & 0 deletions
6
releasenotes/notes/fix-qpy-controlledgate-open-control-35c8ccb4c7466f4c.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,6 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed QPY serialisation and deserialisation of :class:`.ControlledGate` | ||
with open controls (*i.e.* those whose ``ctrl_state`` is not all ones). | ||
Fixed `#8549 <https://github.com/Qiskit/qiskit-terra/issues/8549>`__. |
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