TeamGraphix / graphix

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

Gflow from pattern #113

Closed d1ssk closed 5 months ago

d1ssk commented 5 months ago

Before submitting, please check the following:

Then, please fill in below:

Context (if applicable): Current gflow visualization method is based on gflow obtained from graphix.gflow.gflow, which is not always consistent with the pattern. #109

Description of the change: Add a method to obtain gflow which is consistent with the feedforward structure of the patterns. Integrate this to the visualization method which shows gflow structure based on the pattern with the option pattern.draw_graph(gflow_from_pattern=True) Also, add an option meas_plane_indicator to the visualization. If True, measurement plane for each node is showed adjacent to the node.

Related issue:

109

also see that checks (github actions) pass. If lint check keeps failing, try installing black==22.8.0 as behavior seems to vary across versions.

shinich1 commented 5 months ago

Nice, would you be happy to add type hints to visualization.py?

shinich1 commented 5 months ago

@d1ssk let's merge this once the additional error reported in #107 is fixed, as #112 may take some time to complete. we'll add the gflow check later.

d1ssk commented 5 months ago

Understood. I have already corrected the additional error and I'm ready for merging this after your final review.

shinich1 commented 5 months ago

@d1ssk lets squash and merge.