Skip to content

fix: decompose BlueprintCircuits before re-parametrization to fix QPY…#1045

Open
92meharali wants to merge 1 commit into
qiskit-community:mainfrom
92meharali:fix-issue-1042
Open

fix: decompose BlueprintCircuits before re-parametrization to fix QPY…#1045
92meharali wants to merge 1 commit into
qiskit-community:mainfrom
92meharali:fix-issue-1042

Conversation

@92meharali
Copy link
Copy Markdown

… UUID mismatch (#1042)

When a BlueprintCircuit (e.g. ZZFeatureMap) is passed to ComputeUncompute, its internal gate-level symbolic expressions may use the original parameter UUIDs from the blueprint's own ParameterView even after assign_parameters() is called on the outer circuit. This is because BlueprintCircuits use lazy evaluation via _build(), so the gate-level expressions are not fully materialized until the circuit is iterated or decomposed.

When IBM Runtime serializes the SamplerV2 PUB via QPY for remote execution on real hardware, the expression tree on the backend contains the original blueprint UUID while the BindingsArray keys hold the new re-parametrized UUID, causing:

QpyError: Cannot bind following parameters not present in expression:
{Symbol { name: "x", uuid: ..., index: Some(0), vector: Some(...) }}

Fix: call circuit.decompose() on both input circuits before assigning the new ParameterVectors. This forces full materialization of the circuit's gate-level instructions so that all parameter UUID references are consistent before re-parametrization, QPY serialization, and binding.

Fixes: #1042

Summary

  • Decompose BlueprintCircuits (e.g. ZZFeatureMap) before re-parametrization in BaseStateFidelity._construct_circuits
  • Fixes QpyError: Cannot bind following parameters not present in expression when using ComputeUncompute + SamplerV2 on IBM Runtime
  • Adds regression test and release note

Fixes #1042

Test plan

  • pytest test/state_fidelities/test_compute_uncompute.py
  • CI green on PR
  • (Optional) Reproduce original issue on IBM hardware with ZZFeatureMap + PegasosQSVC

… UUID mismatch (qiskit-community#1042)

When a BlueprintCircuit (e.g. ZZFeatureMap) is passed to ComputeUncompute,
its internal gate-level symbolic expressions may use the original parameter
UUIDs from the blueprint's own ParameterView even after assign_parameters()
is called on the outer circuit. This is because BlueprintCircuits use lazy
evaluation via _build(), so the gate-level expressions are not fully
materialized until the circuit is iterated or decomposed.

When IBM Runtime serializes the SamplerV2 PUB via QPY for remote execution
on real hardware, the expression tree on the backend contains the original
blueprint UUID while the BindingsArray keys hold the new re-parametrized
UUID, causing:

    QpyError: Cannot bind following parameters not present in expression:
    {Symbol { name: "x", uuid: ..., index: Some(0), vector: Some(...) }}

Fix: call circuit.decompose() on both input circuits before assigning the
new ParameterVectors. This forces full materialization of the circuit's
gate-level instructions so that all parameter UUID references are
consistent before re-parametrization, QPY serialization, and binding.

Fixes: qiskit-community#1042
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 16, 2026

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


92meharali seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

ComputeUncompute + FidelityQuantumKernel + SamplerV2 fails on IBM hardware with QPY parameter binding error

2 participants