-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix qpy support for Annotated Operations #11505
Merged
+184
−4
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e6135fb
clifford qpy support + test
alexanderivrii 1ff5c27
release notes
alexanderivrii 27ca7a6
cleanup: checking if instruction is of type Instruction
alexanderivrii f70d7c1
qpy support for annotated operations
alexanderivrii 4915b10
tests and release notes
alexanderivrii 5b47096
changing qpy format for floating-point numbers; updating tests
alexanderivrii 47a46bc
merge conflicts
alexanderivrii 4702925
minor
alexanderivrii 6559e88
fixes
alexanderivrii 4290033
Merge branch 'main' into fix-qpy-annotated
alexanderivrii 5541897
documenting qpy version 11 changes related to annotated ops
alexanderivrii fb6a249
bumping qpy version to 11
alexanderivrii 2d9bde6
changing to version 11 for annotated operations
alexanderivrii 853181e
Merge branch 'main' into fix-qpy-annotated
alexanderivrii 3beff04
Merge branch 'main' into fix-qpy-annotated
alexanderivrii 72096a7
Update qiskit/qpy/binary_io/circuits.py
alexanderivrii 77d044d
exporting AnnotatedOperation + modifiers from qiskit.circuit
alexanderivrii 8fc1674
minor
alexanderivrii edf81aa
qpy_compat test
alexanderivrii afae401
release notes fix?
alexanderivrii e8042ba
Merge branch 'main' into fix-qpy-annotated
mtreinish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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: | ||
- | | ||
QPY (using :func:`.qpy.dump` and :func:`.qpy.load`) will now correctly serialize | ||
and deserialize quantum circuits with annotated operations | ||
(:class:`.AnnotatedOperation`). |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this requires bumping the QPY version to 11 as this is a new struct to represent the modifiers. If someone tried to load a file using this with 0.45 which uses the same qpy version this would result in an error when the loader encounters the annotated operation (actually the new type key would trigger this too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks.
Does this mean that I need to change this line
to
version >= 11 and ...
or does this require more drastic changes? In addition, is this related to #11644?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to change that condition, also bump https://github.com/Qiskit/qiskit/blob/main/qiskit/qpy/common.py#L23 to 11, and also update the format documentation to describe what's new in version 11. I have another PR #11646 that actually is adding version 11 already, you can use this as a model. The two will merge conflict but we can handle that as there will only be version 11 in this release (there is only one format version for each qiskit release).
#11644 will have implications for this, as we'll need to error if someone uses an annotated operation and the
version < 11
(this was something I didn't have to worry about in #11646)