-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add option to QuantumCircuit.draw to omit final measurements #13581
Comments
The solution proposed in #4149 which would just align all final measurements would also be nice, that way it is compact but we can still see the measurements. |
Ah that's also a nice idea! |
@Cryoris, @kevinsung, @jakelishman I can take a look at this, at least for the mpl drawer. It does bring up a number of design questions.
since the first 2 measures are at the same depth, it seems reasonable to make these without the double vertical line as pictured in #4149. Having said that, why not make the third measure the same and remove all the double lines to the classical bits since the bit will be indicated either in the measure box or under it?
if we were to put This would free up a lot of space both vertically and horizontially as we move to 100+ qubit drawings, and it should be workable for both the mpl and text drawers. |
I like the idea for the measurements -- if we add the bit we measure into to the measurement box, there's no information in the double vertical lines and we can make the drawing a whole lot cleaner. I'm less certain for the |
I was planning on doing separate PRs for the measures and the ifs, so I'll move ahead on the measure PR if you can assign that to me. In regards to the |
Thanks Edwin! (sorry for the slightly delayed response despite the tag - I just got back from paternity leave.) I'm a bit nervous about committing to actually removing the clbits from the drawings (in Qiskit 2.0 land), but I do see the logic in it. Would we have space to put the clbit information into/near the measurement box in the text drawer as well? |
Yeah, I thought it might be a bit radical to remove the clbits, but realized if we don't need the double vertical lines, we don't really need the clbits. For the mpl drawer, the clbit would appear in the measure box as a param would in a param gate. Might have to move the dial up slightly in the box, and the box would need to expand horizontally if the clbit name was long, but would probably be fine for the average use. For the text drawer, the clbit would also have to appear where a param does now, which means it would add horizontal space to the drawing. For the original issue of final measurements of say 100 qubits, it clearly would use a whole lot less horizontal space, but individual measures would use more. My guess is on average, 2 to 3 old-style measures at the same depth would use about the same horizontal as 1 new style. The same for the Finally I just used 2.0 as a target because that's when |
And one more final comment. The issue has so far been brought up for the mpl drawer. Do we have to do the mpl and text drawers the same? The mpl changes would be a clear improvement in space without loss of information. If that's not true for the text drawer, can we do the mpl and leave the text as is? |
@jakelishman Here are a couple of samples of how the mpl changes would look. |
What should we add?
Often the last operation in a circuit is a measurement of all the qubits, and this takes up a lot of space in the drawing. I would like to add an option to omit final measurements from the drawing.
The text was updated successfully, but these errors were encountered: