TeamGraphix / graphix

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

Fix Pauli measurement routine #63

Closed shinich1 closed 1 year ago

shinich1 commented 1 year ago

Before submitting, please check the following:

Then, please fill in below:

Context (if applicable):

Description of the change:

  1. Fixed bug in GraphState graph state simulator, specifically,
    • equivalent_graph_E2 method
    • bug in toggling 'loop' in s method
    • behaviour of measure_x and measure_z methods for isolated nodes
  2. Fixed measure method of StatevectorBackend:
    • now we apply s and t signals by Clifford gate, not change of angles.
    • effect of vops in meas_op is now done by application of Clifford gate conjugation on measurement operator, instead of interchanging of measurement axes
  3. Fixed pauli measurement preprocessing routine in pattern.py
    • we treat the signals by applying Clifford gates, not by the change of angles

Related issue:

62

(#56)

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.

masato-fuk commented 1 year ago

@shinichi1 All changes appear to be good. By the way, I find vop makes the code a little complicated. As far as I understand, there shouldn't be any issues with merging vops into measurement angles and planes right after Pauli measurements(if my assumption is incorrect, please disregard this). I believe it would be better to do so because simple structure let users follow up easily. But, I think this modification should be done in another issue...

masato-fuk commented 1 year ago

I'll fix a bug in flow finding algorithm, so please wait a moment.

shinich1 commented 1 year ago

By the way, I find vop makes the code a little complicated. As far as I understand, there shouldn't be any issues with merging vops into measurement angles and planes right after Pauli measurements(if my assumption is incorrect, please disregard this). I believe it would be better to do so because simple structure let users follow up easily. But, I think this modification should be done in another issue...

I agree, we will need to update angles as well as measurement planes, but that should be doable. I agree it would make things look much simpler. could you write up an issue for this?

shinich1 commented 1 year ago

I'll fix a bug in flow finding algorithm, so please wait a moment.

let's do this in a separate issue.