Skip to content

Fix text drawer bindings for control-flow measurements - #17374

Open
Phil Pinto (philpinto) wants to merge 2 commits into
Qiskit:mainfrom
philpinto:fix-text-control-flow-bits
Open

Phil Pinto (philpinto) wants to merge 2 commits into
Qiskit:mainfrom
philpinto:fix-text-control-flow-bits

Conversation

@philpinto

@philpinto Phil Pinto (philpinto) commented Oct 29, 2026 •

Copy link
Copy Markdown

Summary

Fixes #15822.

Resolve control-flow block classical bits to their outer circuit bindings when drawing measurements. Preserve bindings through nested blocks and restore the enclosing binding map after each block. Add a release note and regression coverage comparing composed circuits with equivalent builder-created circuits across eight combinations of nesting, register usage, and bundling, including permuted destination bits.

Validation

  • Built Qiskit 2.7.0.dev0 from source with Python 3.12.11 and Rust 1.91.1.
  • All 177 test methods in test_circuit_text_drawer passed.
  • The new regression fails with the unmodified text drawer.
  • Ruff 0.15.2, Black 25.12.0, and git diff --check passed.
  • Full repository tests and upstream CI have not been run.

Related work

This addresses the existing issue; an earlier proposal, #16060, was closed without merging. This patch includes nested binding resolution and exact-diagram regression checks.

AI/LLM disclosure

  • No part of this submission is LLM generated.
  • Some written text was generated by: OpenAI Codex.
  • Some submitted code was generated by: OpenAI Codex.

Resolve nested block classical bits to their enclosing circuit bindings when drawing measurements. Add regression coverage and a release note for Qiskit issue Qiskit#15822.

Code and text developed with OpenAI Codex assistance.
@philpinto
Phil Pinto (philpinto) requested a review from a team as a code owner October 29, 2026 23:59
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Oct 29, 2026
@CLAassistant

CLAassistant commented Oct 29, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@qiskit-bot

Copy link
Copy Markdown
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

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

@1ucian0 Luciano Bello (1ucian0) moved this to Waiting for contributor in Contributor Monitoring Nov 3, 2026
@philpinto

Phil Pinto (philpinto) commented Nov 3, 2026 •

Copy link
Copy Markdown
Author

Luciano Bello (@1ucian0) I noticed this was moved to “Waiting for contributor,” but I couldn’t find a review comment explaining what’s needed. I’ve updated the branch with main. Is there anything else you’d like me to address?

This branch has not been deployed

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

Labels

Community PR PRs from contributors that are not 'members' of the Qiskit repo mod: visualization qiskit.visualization

Projects

Status: Waiting for contributor

Development

Successfully merging this pull request may close these issues.

Text circuit drawer fails when setting cregbundle=True on non-builder control flow

4 participants