TeamGraphix / graphix

measurement-based quantum computing (MBQC) compiler and simulator
https://graphix.readthedocs.io
Apache License 2.0
55 stars 20 forks source link

Resource state visualization #47

Closed shinich1 closed 9 months ago

shinich1 commented 1 year ago

We need a cool visualization of the graph state from the measurement pattern. It would be ideal to be able to read off the following information from the plot:

  1. Underlying graph of the graph state
  2. whether qubits are measured in Pauli or non-Pauli bases
  3. measurement order where applicable
  4. (optional) local Clifford decorations (M[6] of measurement commands M - see here)
  5. (optional) flow or gflow structure of the graph

Please implement this as a new method graphix.pattern.Pattern.view_graph(). Feel free to move the implementation elsewhere (separate file) if code is too long. Do try to tune the colors/etc for a better look for a range of graph size/shapes!

see QAOA example for a flow-based arrangement of graph nodes which gives a linear arrangement of qubits following the measurement order.

pafloxy commented 1 year ago

Hi! I was interested about this project though I still have some questions about it. As much as I understand currently we are still using networkx Graph objects for the visualisation part ? However, I was wondering whether it is possible to have a new class of it s own for this purpose, I have seen a similar implementation for the graph class of pyzx. Do you think it would have any advantages this way ?

shinich1 commented 1 year ago

@pafloxy Yes I think that would work nicely! let's create a new python file, e.g. visualization.py, to place the new class.