Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parameter idle_wires default flipped to False in all circuit drawers #13865

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Feb 17, 2025

Summary

Closes #12361

Details and comments

As QPUs are getting bigger, also the circuits are growing in terms of qubits.

@1ucian0 1ucian0 requested review from nonhermitian and a team as code owners February 17, 2025 22:16
@qiskit-bot
Copy link
Collaborator

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

@coveralls
Copy link

coveralls commented Feb 18, 2025

Pull Request Test Coverage Report for Build 13541602976

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 23 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.02%) to 87.831%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.23%
crates/qasm2/src/lex.rs 10 91.23%
crates/qasm2/src/parse.rs 12 96.22%
Totals Coverage Status
Change from base Build 13534039243: -0.02%
Covered Lines: 77127
Relevant Lines: 87813

💛 - Coveralls

@1ucian0 1ucian0 added this to the 2.0.0 milestone Feb 24, 2025
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

I was going to say that this is a better default, but then I thought: actually I use the drawers quite a lot for small-scale drawing, and I think suppressing idle wires there by default is quite possibly surprising behaviour.

I wonder if it's worth having idle_wires take a number to use as a cut-off size: if there are n or more idle wires (possibly only count qubit ones), hide them, and if there's fewer, show them? So idle_wires=0 is the same as the current idle_wires=False. We'd have to catch idle_wires=True and turn it into idle_wires=math.inf, potentially.

Alternatively, we ignore the int stuff, and add a third option to idle_wires: "layout". I think this might be the happiest middle-ground: if the circuit has been transpiled to a layout (so the left margin will indicate qubit mapping), then we set idle_wires=False, and if it hasn't, we set idle_wires=True. (Could also call the option "auto" or something.)

I'm not 100% convinced of that, I'm just slightly concerned about breaking usability of drawing small-scale circuits - I would think there's a pretty sizeable number of people who almost invariably draw those, and it'd be confusing if wires are sometimes hidden on them.

Comment on lines +2 to +4
upgrade_visualization:
- |
The default for the parameter ``idle_wires`` changed to ``False`` in all the circuit drawers. If you still want to see wires without instructions, set ``idle_wires=True`` explicitly.
Copy link
Member

Choose a reason for hiding this comment

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

It might help to either explain a bit more, or put in a couple of text-mode drawings just to illustrate the difference? I'm not sure users necessarily know what the option is.

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.

Default to idle_wires=False in drawers
4 participants