Skip to content

Remove QPY warning on deserialising incomplete ParameterVectors#16222

Merged
jakelishman merged 2 commits into
Qiskit:mainfrom
jakelishman:no-warn-vector-qpy
Jun 2, 2026
Merged

Remove QPY warning on deserialising incomplete ParameterVectors#16222
jakelishman merged 2 commits into
Qiskit:mainfrom
jakelishman:no-warn-vector-qpy

Conversation

@jakelishman
Copy link
Copy Markdown
Member

This warning was added with QPY v31 at a time when ParameterVector generated all its elements with unrelated UUIDs. Since qiskit-terra v0.25, we actually have had enough information to completely recreate an entire vector from a single element2, and the circumstances needed to observe the incomplete behaviour are particularly convoluted, and unlikely in practice.


Based on #16221.

The circumstances you can observe the bad behaviour are in the release note - it's pretty convoluted once #16221 is in place. I've separated off this PR from the others to discuss whether we truly want this. I think, with #16221 merged, the warning is no longer serving a meaningful purpose, and it costs us to maintain the tracking for it.

AI/LLM disclosure

  • I didn't use LLM tooling, or only used it privately.
  • I used the following tool to help write this PR description:
  • I used the following tool to generate or modify code:

Footnotes

  1. 5c4cd2b: Fix ParameterVector handling in QPY serialization (Fix ParameterVector handling in QPY serialization #7381)

  2. 5ab231d: Slightly optimize ParameterVector construction (Slightly optimize ParameterVector construction #10403)

@jakelishman jakelishman added this to the 2.5.0 milestone May 21, 2026
@jakelishman jakelishman added on hold Can not fix yet Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. mod: qpy Related to QPY serialization labels May 21, 2026
@jakelishman jakelishman force-pushed the no-warn-vector-qpy branch from d14a9dd to 8e4b783 Compare May 21, 2026 11:13
@coveralls
Copy link
Copy Markdown

coveralls commented May 21, 2026

Coverage Report for CI Build 26823200940

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.07%) to 87.563%

Details

  • Coverage increased (+0.07%) from the base build.
  • Patch coverage: 6 of 6 lines across 2 files are fully covered (100%).
  • 2761 coverage regressions across 91 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

2761 previously-covered lines in 91 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
crates/circuit/src/dag_circuit.rs 749 85.26%
crates/bindgen-cli/src/abi.rs 210 0.0%
crates/circuit/src/circuit_data.rs 210 86.72%
crates/circuit/src/operations.rs 130 82.58%
crates/cext/src/circuit.rs 121 79.58%
qiskit/synthesis/unitary/qsd.py 80 23.65%
crates/cext/src/dag.rs 75 85.27%
crates/transpiler/src/target/mod.rs 68 82.59%
crates/qpy/src/circuit_writer.rs 59 93.25%
crates/circuit/src/bit.rs 56 85.08%

Coverage Stats

Coverage Status
Relevant Lines: 123901
Covered Lines: 108491
Line Coverage: 87.56%
Coverage Strength: 964007.1 hits per line

💛 - Coveralls

This warning was added with QPY v3[^1] at a time when `ParameterVector`
generated all its elements with unrelated UUIDs.  Since `qiskit-terra`
v0.25, we actually _have_ had enough information to completely recreate
an entire vector from a single element[^2], and the circumstances needed
to observe the incomplete behaviour are particularly convoluted, and
unlikely in practice.

[^1]: 5c4cd2b: Fix ParameterVector handling in QPY serialization (Qiskitgh-7381)
[^2]: 5ab231d: Slightly optimize ParameterVector construction (Qiskitgh-10403)
@jakelishman jakelishman force-pushed the no-warn-vector-qpy branch from 8e4b783 to 41a35f5 Compare May 22, 2026 00:26
@jakelishman jakelishman removed the on hold Can not fix yet label May 22, 2026
@jakelishman jakelishman marked this pull request as ready for review May 22, 2026 00:26
@jakelishman jakelishman requested a review from a team as a code owner May 22, 2026 00:26
@qiskit-bot
Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core
  • @mtreinish

Copy link
Copy Markdown
Member

@alexanderivrii alexanderivrii left a comment

Choose a reason for hiding this comment

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

Thanks Jake. This PR is a bit out of my comfort zone, but that was the point when we agreed on round robin.

AI/LLM disclaimer: I have first carefully looked at the changed myself, and then asked my new friend Claude to go over the changes together, so LGTM!

Though one general question: why was it necessary to do the change both in python and in rust: wouldn't just changing the rust code be enough?

And one typo (detected both by me and Claude).

Comment thread releasenotes/notes/no-warn-vector-qpy-28ecc9aefafcfd8e.yaml Outdated
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
@jakelishman
Copy link
Copy Markdown
Member Author

why was it necessary to do the change both in python and in rust: wouldn't just changing the rust code be enough?

The Python code is still live code - the Rust reader only handles QPY >= v13. If it weren't live, we'd have deleted it from the repo.

Copy link
Copy Markdown
Member

@alexanderivrii alexanderivrii left a comment

Choose a reason for hiding this comment

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

Thanks for the quick reply!

@alexanderivrii alexanderivrii enabled auto-merge June 2, 2026 13:34
@alexanderivrii alexanderivrii added this pull request to the merge queue Jun 2, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 2, 2026
@jakelishman jakelishman added this pull request to the merge queue Jun 2, 2026
Merged via the queue into Qiskit:main with commit a6d6595 Jun 2, 2026
47 of 49 checks passed
@jakelishman jakelishman deleted the no-warn-vector-qpy branch June 2, 2026 15:44
@github-project-automation github-project-automation Bot moved this from Ready to Done in Qiskit 2.5 Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. mod: qpy Related to QPY serialization

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants