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

Add support for visualising classical variables #10937

Closed
Tracked by #10922
jakelishman opened this issue Oct 2, 2023 · 1 comment · Fixed by #12307
Closed
Tracked by #10922

Add support for visualising classical variables #10937

jakelishman opened this issue Oct 2, 2023 · 1 comment · Fixed by #12307
Assignees
Labels
mod: visualization qiskit.visualization

Comments

@jakelishman
Copy link
Member

jakelishman commented Oct 2, 2023

We will eventually want support for visualising the new Store instruction and the data-flow of classical variables described in Qiskit/RFCs#50. This may prove tricky in the near term because Store will appear as a 0q/0c operation in general, which the drawers have no way of handling yet (they just don't appear).

The text-based expression writing being added in #10869 will likely automatically work, because the variables will have fixed names.

@enavarro51
Copy link
Contributor

enavarro51 commented Oct 12, 2023

Some thoughts on this. Currently there are two sections of wires in the displays, one for qubits and one for clbits/cregs. It would be fairly straightforward to add a third section for classical variables. Each variable would have a wire and measures could point to the variable into which the measure value is being loaded. Conditions containing variables would draw a line in the same form that one is drawn to a clbit or creg.

Having said that, the question comes up as to whether we are going to an expression-only condition in the future. If the old style condition is ultimately going away, along with the c_if, then there really is very little reason for the clbit/creg section or the variable section, since in some cases expressions cannot be fully shown with just open or closed circles on wires.

As quantum computers get larger, drawings will eventually get unmanageable in their current form. One option would be to eliminate the clbit/creg and the variable sections and rely on the expression displayed to show a condition. Measures would have to have something added to indicate what the target is, but this could be done by adding it into the measure box in the qubit section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: visualization qiskit.visualization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants