Skip to content

Implement plot_barriers and initial_state for Rust circuit drawer (#1…#16465

Open
Pravin-raj-03 wants to merge 1 commit into
Qiskit:mainfrom
Pravin-raj-03:fix-rust-drawer-parity
Open

Implement plot_barriers and initial_state for Rust circuit drawer (#1…#16465
Pravin-raj-03 wants to merge 1 commit into
Qiskit:mainfrom
Pravin-raj-03:fix-rust-drawer-parity

Conversation

@Pravin-raj-03

@Pravin-raj-03 Pravin-raj-03 commented Jun 22, 2026

Copy link
Copy Markdown

Fixes #16464

This PR introduces feature parity to the Rust text circuit drawer by implementing the plot_barriers and initial_state arguments.

Changes made:

  • Updated CircuitDrawerConfig in crates/cext/src/circuit.rs to include plot_barriers and initial_state.
  • Added a condition in build_layers inside crates/circuit/src/circuit_drawer.rs to skip parsing StandardInstruction::Barrier when plot_barriers is false, effectively hiding barriers from the VisualizationMatrix.
  • Updated WireInputElement::get_name to properly prepend |0> to qubit wires and 0 to classical/creg wires when the initial_state flag is true.
  • Refactored all existing Rust drawer unit tests to use plot_barriers=true and initial_state=false to ensure the original test expectations are preserved without breaking backwards compatibility.

@Pravin-raj-03 Pravin-raj-03 requested a review from a team as a code owner June 22, 2026 10:18
@Pravin-raj-03 Pravin-raj-03 requested a review from Cryoris June 22, 2026 10:18
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Jun 22, 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

@CLAassistant

CLAassistant commented Jun 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Rust circuit drawer feature parity with the Python text drawer

3 participants