-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Handle custom operations with overlapping names in QPY #11646
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
117b2a1
Handle custom operations with overlapping names in QPY
mtreinish 136841f
Merge remote-tracking branch 'origin/main' into fix-qpy-custom-gates
mtreinish 7cc8e61
Connect version option from interface to writers
mtreinish 47220d3
Add negative test for bug in qpy version 10
mtreinish c88a9a2
Unify uuid logic in version 11
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
19 changes: 19 additions & 0 deletions
19
releasenotes/notes/fix-qpy-custom-gates-name-conflict-5c4c7df3484f04e0.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,19 @@ | ||
--- | ||
upgrade: | ||
- | | ||
The latest format version of QPY is now :ref:`qpy_version_11` and this | ||
is what is emitted by default when running :func:`.qpy.dump`. | ||
fixes: | ||
- | | ||
Fixed an issue with the QPY serialization when a :class:`.QuantumCircuit` | ||
contained multiple custom instructions instances that have the same | ||
:attr:`~.Instruction.name` attribute. In QPY format versions before | ||
:ref:`qpy_version_11` the QPY payload did not differentiate between | ||
these instances and would only serialize the properties of the first | ||
instance in a circuit. This could potentially cause an incorrect | ||
deserialization if the other properties of the custom instruction were | ||
different but the names were the same. This has been fixed in | ||
QPY :ref:`qpy_version_11` so that each instance of a custom instruction | ||
is serialized individually and there will no longer be a potential | ||
conflict with overlapping names. | ||
Fixes `#8941 <https://github.com/Qiskit/qiskit/issues/8941>`__ |
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.
Wouldn't it make more sense to have this test be part of
TestLoadFromQPY
(intest/python/circuit/test_circuit_load_from_qpy.py
) rather thanTestLayout
? Could this be an opportunity to merge both test files undertest/python/qpy
?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.
It does, but for this PR I just left it as is. I'll push a follow up PR after this merges that unifies the tests into a single module under
tests/python/qpy