diff --git a/abp/graphstate.py b/abp/graphstate.py index 46075aa..87e65a5 100644 --- a/abp/graphstate.py +++ b/abp/graphstate.py @@ -196,7 +196,7 @@ class GraphState(object): for i, j in it.combinations(vngbh, 2): self.toggle_edge(i, j) - self.act_local_rotation(node, "msqz" if result else "msqz_h") + self.act_local_rotation(node, "sqz" if result else "msqz") return result def measure_z(self, node, result): diff --git a/tests/test_measurement_against_anders_and_briegel.py b/tests/test_measurement_against_anders_and_briegel.py index 19314e7..c4633b9 100644 --- a/tests/test_measurement_against_anders_and_briegel.py +++ b/tests/test_measurement_against_anders_and_briegel.py @@ -6,7 +6,7 @@ import dummy N = 2 REPEATS = 10 -PZ = graphsim.lco_Z +m = {1: graphsim.lco_X, 2: graphsim.lco_Y, 3: graphsim.lco_Z} def _test_multiqubit_measurement_pz(): """ Test a multiqubit measurement """ @@ -22,10 +22,12 @@ def _test_multiqubit_measurement_pz(): def test_multiqubit_pz(): - for i in range(10): - a, b = dummy.bell() - assert a == b - print a.measure(0, "pz", 1) - print b.measure(0, PZ, None, 1) - assert a == b - + for measurement in (3, 2,): + for outcome in (0, 1): + a, b = dummy.bell() + a.measure(0, str(measurement), outcome) + b.measure(0, m[measurement], None, outcome) + print a.to_json() + print b.to_json() + assert a == b, (measurement, outcome) +