Skip to content

Update serialization workaround of non-dt delay gates post qiskit==2.4.0#1380

Merged
bharat-thotakura merged 8 commits into
mainfrom
bt/delay-deserialization-qiskit
Apr 20, 2026
Merged

Update serialization workaround of non-dt delay gates post qiskit==2.4.0#1380
bharat-thotakura merged 8 commits into
mainfrom
bt/delay-deserialization-qiskit

Conversation

@bharat-thotakura

@bharat-thotakura bharat-thotakura commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Fixes recent failing qss checks against qiskit==2.4.0 due to qiskit.circuit.Delay unit information being lost during the deserialization process. Closes: #1379

Signed-off-by: Bharath <bharath.thotakura@infleqtion.com>
Signed-off-by: Bharath <bharath.thotakura@infleqtion.com>
@bharat-thotakura

Copy link
Copy Markdown
Contributor Author

Notebook checks expected to pass after server update

Signed-off-by: Bharath <bharath.thotakura@infleqtion.com>
@bharat-thotakura bharat-thotakura changed the title Workaround for serialization of non-dt delay gates for qiskit~=2.4.0 Workaround for serialization of non-dt delay gates post qiskit~=2.4.0 Apr 17, 2026
@bharat-thotakura bharat-thotakura marked this pull request as ready for review April 17, 2026 20:01
@vtomole vtomole requested a review from Copilot April 17, 2026 20:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements a workaround to restore successful QPY serialization/deserialization of non-dt qiskit.circuit.Delay instructions after the qiskit~=2.4.0 behavior change, addressing recent qss check failures (closes #1379).

Changes:

  • Replaces problematic non-dt Delay instructions with a sentinel Instruction during _prepare_gate to keep QPY serialization working.
  • Adds a corresponding deserialization path to recognize the sentinel and reconstruct the original Delay.
  • Refactors _resolve_gate by extracting special-case resolution into _resolve_specific_gates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread qiskit-superstaq/qiskit_superstaq/serialization.py Outdated
Comment thread qiskit-superstaq/qiskit_superstaq/serialization.py Outdated
@bharat-thotakura bharat-thotakura changed the title Workaround for serialization of non-dt delay gates post qiskit~=2.4.0 Workaround for serialization of non-dt delay gates post qiskit==2.4.0 Apr 17, 2026
Comment thread qiskit-superstaq/qiskit_superstaq/serialization.py Outdated
Signed-off-by: Bharath <bharath.thotakura@infleqtion.com>
@bharat-thotakura bharat-thotakura force-pushed the bt/delay-deserialization-qiskit branch from 4141811 to 9b93793 Compare April 17, 2026 22:52
@bharat-thotakura bharat-thotakura changed the title Workaround for serialization of non-dt delay gates post qiskit==2.4.0 Update serialization workaround of non-dt delay gates post qiskit==2.4.0 Apr 17, 2026

@richrines1 richrines1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@bharat-thotakura

Copy link
Copy Markdown
Contributor Author

^ think you missed the approval button haha

@richrines1

Copy link
Copy Markdown
Contributor

^ think you missed the approval button haha

oh no sorry just noticed this! :/

@bharat-thotakura bharat-thotakura merged commit a17822b into main Apr 20, 2026
18 of 21 checks passed
@bharat-thotakura bharat-thotakura deleted the bt/delay-deserialization-qiskit branch April 20, 2026 19:48
@bharat-thotakura

Copy link
Copy Markdown
Contributor Author

Looks like qiskit==2.4.1 added a fix for this issue. But regardless, the solution in this PR seems good to keep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration test failed

3 participants