-
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.
QPY previously had rather complicated logic to handle deserialisation of registers that was heavily couched in the old model of registers "owning" the bits they contained. This is no longer the data model of the circuit, so the code was naturally complex to try and make it work. Instead, in deserialisation now we just add the correct number of bit instances to the circuit at the start, and then build up any required registers by using the `indices` field. It's not clear to me how an index ever could be negative here; it's not clear how a register could be in the circuit but its bits aren't added, so it feels like there might be the possibility of a bug I've missed.
- Loading branch information
1 parent
3ce1737
commit 4dbcaba
Showing
3 changed files
with
35 additions
and
111 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
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 a bug in QPY (:mod:`qiskit.qpy`) where circuits containing registers | ||
whose bits occurred in the circuit after loose bits would fail to deserialize. | ||
See `#9094 <https://github.com/Qiskit/qiskit-terra/issues/9094>`__. |
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