Browse Source

Add a test for measure_sequence, closes #13

master
Pete Shadbolt 8 years ago
parent
commit
9bfe0459bd
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      tests/test_measurement.py

+ 10
- 0
tests/test_measurement.py View File

@@ -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



Loading…
Cancel
Save