forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Expr
support to QPY for conditions and targets (Qiskit#10392)
* Add `Expr` support to QPY for conditions and targets This adds support to QPY for the current `Expr` nodes, for *all* instruction parameters and conditions. The `Expr` tree is written out to the file in a sort of forwards Polish notation; each node has a type code and header, followed by a type-code-specific number of `Expr` children. While only `IfElseOp.condition`, `WhileLoopOp.condition` and `SwitchCaseOp.target` are allowed to have these nodes in Terra's data model right now, the QPY serialisation does not need to have this arbitrary restriction, and it's much easier just to write the general case. The backwards-compatibility guarantees of QPY are now brought to bear on the `Unary.Op` and `Binary.Op` enumeration values. They were already marked in the source code as their values needing to be part of the stable public interface, and their use in things like QPY is the reason why. * Improve documentation of `EXPRESSION` payload * Factor out magic numbers from discriminator sizes
- Loading branch information
1 parent
66d1a7c
commit 876efc4
Showing
8 changed files
with
826 additions
and
35 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
Oops, something went wrong.