tqec icon indicating copy to clipboard operation
tqec copied to clipboard

Circuit visualizer

Open KabirDubey opened this issue 1 year ago • 1 comments

Describe the solution you'd like Add a feature to the repo that enables users to visualize the Stim circuits it produces.

  • should include the built-in visualizer stim.Circuit.diagram.
  • some discussion can be found in 9/2, 10/2, and 10/9 meetings recordings
  • should help greatly with debugging and provide some granularity to the tool

Please feel free to discuss any further details here.

Additional context Add any other context or screenshots about the feature request here.

https://github.com/QCHackers/tqec/issues/325#issuecomment-2403521249

What would be nice is to be able to superimpose the "image" of a (grid of) logical qubit on the output of stim.Circuit.diagram to help understanding locating the qubits on the stim diagram and understanding their status. We can close this issue too and open a new one with a more detailed description of what would be interesting to have. I think that, on this particular issue, it would be nice to have feedback from everyone to know what would be the best visualisation for everyone.

https://github.com/QCHackers/tqec/issues/325#issuecomment-2405568874

+1 to this. Being able to step forward and backwards through the ticks of the circuit would be great. An alternative view where you just see the plaquettes and a number in each corner giving the time of interaction would also be very useful. A useful way to focus on just hook errors without numbers is to put a line inside the plaquette connecting the last 2 corners touched.

KabirDubey avatar Oct 12 '24 07:10 KabirDubey

I also really liked Adrien's idea of just using Crumble to visualize the circuits since then you can also check detectors etc. Adding colored polygons to assist would be great.

On Sat, Oct 12, 2024, 12:50 AM Kabir Dubey @.***> wrote:

Describe the solution you'd like Add a feature to the repo that enables users to visualize the Stim circuits it produces.

Please feel free to discuss any further details here.

Additional context Add any other context or screenshots about the feature request here.

#325 (comment) https://github.com/QCHackers/tqec/issues/325#issuecomment-2403521249

What would be nice is to be able to superimpose the "image" of a (grid of) logical qubit on the output of stim.Circuit.diagram to help understanding locating the qubits on the stim diagram and understanding their status. We can close this issue too and open a new one with a more detailed description of what would be interesting to have. I think that, on this particular issue, it would be nice to have feedback from everyone to know what would be the best visualisation for everyone.

#325 (comment) https://github.com/QCHackers/tqec/issues/325#issuecomment-2405568874

+1 to this. Being able to step forward and backwards through the ticks of the circuit would be great. An alternative view where you just see the plaquettes and a number in each corner giving the time of interaction would also be very useful. A useful way to focus on just hook errors without numbers is to put a line inside the plaquette connecting the last 2 corners touched.

— Reply to this email directly, view it on GitHub https://github.com/QCHackers/tqec/issues/357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKAXTEZTSGMI3J2HQCHJYTZ3DIFVAVCNFSM6AAAAABP2FRT6GVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4DENRWGM2DCNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

afowler avatar Oct 12 '24 07:10 afowler

Updating this issue given the new RPNGTemplate data structure. Take note of PR #427, which gives an rpng_svg_viewer function that shows plaquette indices, interaction order, and hook errors.

We can build on this foundation to interoperate with Stim circuits and/or Crumble while I continue learning about them myself. Please don't hesitate to reach out if you're new and want to get involved with visualization.

@giangiac can you be assigned to this issue, or are your visualization efforts different?

KabirDubey avatar Dec 26 '24 20:12 KabirDubey

Updating this issue given new visualization methods:

Visualization of observable propagation

Visualization of plaquettes with annotations

Printer of layer-tree circuits in Crumble

These methods seems good enough for visualization for the time-being. Perhaps we can close this issue or leave it as a good first issue for someone interested in using integrating existing methods into a complete GUI. Thoughts @nelimee @inmzhang ?

KabirDubey avatar Mar 19 '25 18:03 KabirDubey

These methods seems good enough for visualization for the time-being. Perhaps we can close this issue or leave it as a good first issue for someone interested in using integrating existing methods into a complete GUI. Thoughts @nelimee @inmzhang ?

I'll implement a few CLI to make the above visualisations easy to obtain, the PR will close the issue.

nelimee avatar Mar 20 '25 08:03 nelimee