Skip to content

Better pyzx visualization #60

@rafaelha

Description

@rafaelha

Currently, circuits like this

Image

are visualized as the following pyzx diagram

Image

This diagram is technically not correct. What it means to resemble is a version of a "doubled" ZX diagram

Image

where bold vertices imply doubling

Image

and

Image

are measurements and

Image

is the trace.

Detector and observable can be seen to be implemented as the XOR

Image

Unfortunately, pyzx does not support doubled diagrams.

I am not sure what the best way is to go forward. Potentially, one could make a PR into pyzx. I someone has ideas or suggestions, they would be very welcome!

Considerations

  • The visualization should use d3, just like pyzx
  • I'm somewhat against adding a lot of visualization code to tsim itself, so the ideal would be if pyzx supported doubled diagrams
  • There needs to be bold vertices and bold edges
  • Currently, the phase of vertices is used to display a label (rec[i]). Maybe there can be a better solution for labeling vertices

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions