Skip to content

Feature: measure arrows option in draw_circuit rust function#16414

Open
OnyxBrumeSky wants to merge 7 commits into
Qiskit:mainfrom
OnyxBrumeSky:feature-15849-measure_arrows
Open

Feature: measure arrows option in draw_circuit rust function#16414
OnyxBrumeSky wants to merge 7 commits into
Qiskit:mainfrom
OnyxBrumeSky:feature-15849-measure_arrows

Conversation

@OnyxBrumeSky

@OnyxBrumeSky OnyxBrumeSky commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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: No specific tools were used .
  • I used the following tool to generate or modify code: Claude (sonnet 4.6) help me understand architecture and implementation. I understand all code added.

Feature: Added the option measure_arrows to the draw_circuit fonction in the rust crate as mentionned in #15849 . Now, lines to show measurements can be displayed or not.

@OnyxBrumeSky OnyxBrumeSky requested a review from a team as a code owner June 11, 2026 14:22
@OnyxBrumeSky OnyxBrumeSky changed the title Feature 15849 measure arrows Feature #15849 measure arrows Jun 11, 2026
@OnyxBrumeSky

Copy link
Copy Markdown
Contributor Author

Hello @eliarbel, I just finished the feature I was assigned to. Please tell me if any changes need to be done. And sorry for this late pr, I was quite busy until now. Thank you and have a great day

@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Jun 11, 2026
@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:

  • @Qiskit/terra-core

@ShellyGarion

Copy link
Copy Markdown
Member

@OnyxBrumeSky - thanks for opening a PR and aim to solve the issue.
We are currently in feature freeze for Qiskit 2.5 release (see https://github.com/Qiskit/qiskit/milestone/93).
Your PR will be reviewed in due time, you do not need to merge it with the main branch.

@eliarbel eliarbel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @OnyxBrumeSky , for working on this! This is a nice start but there is still some work to be done before it's ready to merge. Please see my inline comments.

In addition:

  • Please add a release note to describe the change in the C API. It should contain an features_c entry for the config struct, and I think also features_visualization for the functional change in the drawer.
  • Please update the PR title to something more descriptive since it will be used in the release changelog.
  • Please correct the AI/LLM usage checkboxes in the PR description to accurately reflect your LLM usage.

Comment thread crates/cext/src/circuit.rs Outdated
Comment thread crates/circuit/src/circuit_drawer.rs
Comment thread crates/circuit/src/circuit_drawer.rs Outdated
Comment thread crates/circuit/src/circuit_drawer.rs Outdated
inst.op.view(),
OperationRef::StandardInstruction(StandardInstruction::Measure)
) {
Self::get_label(inst).to_string() // Skip space padding around the label to make Measure box thinner

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Currently your PR does not add the clbit information to the label of the Measure box, when measure_arrows=false. This might be a good place to handle that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hello, I started working on the other suggestions, but I am a bit unsure about this one.

Is there already an implementation of this behavior in the Python drawer that I could refer to?

Otherwise, do you have any suggestion on how the measurement should be drawn in this case?

Would something like this be the expected behavior?

    ┌───┐┌─────┐
q1: ┤ H ├┤M->c1├
    └───┘└─────┘
c1: ════════════

Comment thread crates/circuit/src/circuit_drawer.rs Outdated
Comment thread crates/circuit/src/circuit_drawer.rs Outdated
Comment thread crates/circuit/src/circuit_drawer.rs
Comment thread crates/circuit/src/circuit_drawer.rs
Comment thread crates/circuit/src/circuit_drawer.rs Outdated
@OnyxBrumeSky OnyxBrumeSky changed the title Feature #15849 measure arrows Feature: measure arrows Jun 23, 2026
@OnyxBrumeSky OnyxBrumeSky changed the title Feature: measure arrows Feature: measure arrows option in rust api Jun 23, 2026
@OnyxBrumeSky OnyxBrumeSky changed the title Feature: measure arrows option in rust api Feature: measure arrows option in draw_circuit rust function Jun 23, 2026
…nts drawing when measure_arrows=false. Need to rewrite tests to fit already existing format
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: No status

Development

Successfully merging this pull request may close these issues.

4 participants