Skip to content

Remove QPY warning on deserialising incomplete ParameterVectors#16222

Open
jakelishman wants to merge 1 commit into
Qiskit:mainfrom
jakelishman:no-warn-vector-qpy
Open

Remove QPY warning on deserialising incomplete ParameterVectors#16222
jakelishman wants to merge 1 commit 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 26261117365

Coverage decreased (-0.004%) to 87.49%

Details

  • Coverage decreased (-0.004%) from the base build.
  • Patch coverage: 6 of 6 lines across 2 files are fully covered (100%).
  • 12 coverage regressions across 3 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

12 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
crates/qasm2/src/parse.rs 6 96.68%
crates/qasm2/src/lex.rs 5 92.03%
crates/circuit/src/parameter/parameter_expression.rs 1 91.04%

Coverage Stats

Coverage Status
Relevant Lines: 123841
Covered Lines: 108348
Line Coverage: 87.49%
Coverage Strength: 960947.64 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

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: Ready

Development

Successfully merging this pull request may close these issues.

3 participants