From 9bfe0459bd274b370ee80a6c7059af3086c3686b Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Tue, 8 Nov 2016 06:47:52 -0800 Subject: [PATCH] Add a test for measure_sequence, closes #13 --- tests/test_measurement.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_measurement.py b/tests/test_measurement.py index d6d494f..19ff1f6 100644 --- a/tests/test_measurement.py +++ b/tests/test_measurement.py @@ -59,3 +59,13 @@ def test_projection(): g.act_local_rotation(0, "hadamard") g.measure(0, "pz", 1) assert np.allclose(g.to_state_vector().state, qi.one) + +def test_measure_sequence(): + """ Simple test of measurement sequences """ + g = GraphState(2, vop="identity") + g.act_cz(0, 1) + assert g.measure_sequence(((0, "px"), (1, "px")), forces=(0, 1)) == [0, 1] + assert len(g.edgelist()) == 0 + assert g.node[1]["vop"] == clifford.pz + +