WIP: Fix #15580 - Explicitly build BlueprintCircuits in QPY dump#16048
Draft
debasmita2102 wants to merge 1 commit intoQiskit:mainfrom
Draft
WIP: Fix #15580 - Explicitly build BlueprintCircuits in QPY dump#16048debasmita2102 wants to merge 1 commit intoQiskit:mainfrom
debasmita2102 wants to merge 1 commit intoQiskit:mainfrom
Conversation
eliarbel
reviewed
Apr 16, 2026
Member
eliarbel
left a comment
There was a problem hiding this comment.
Thanks Debasmita for addressing this. This is still in draft mode but I have a couple of comments which I think would help. The original motivation for this was to make sure accessing the _data attribute from Rust is safe, without needing a prior call to data() on the Rust side (which is this line:
qiskit/crates/circuit/src/converters.rs
Line 37 in ceba759
- Your PR branch is old and doesn't even contain the Rust QPY in it, so you'll need to either rebase it over
upstream/main(assuming your qiskit remote is calledupstream) or open a new PR over the currentmain. - We should call
program._build()only if we're using the Rust circuit writer. So I would put theif isinstance(program, BlueprintCircuit)check here:qiskit/qiskit/qpy/binary_io/circuits.py
Lines 1533 to 1534 in 1b0276a
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix Issue #15580 by adding a type-check for BlueprintCircuit in qiskit.qpy.interface.dump
AI/LLM disclosure