瀏覽代碼

Add a test for measure_sequence, closes #13

master
Pete Shadbolt 8 年之前
父節點
當前提交
9bfe0459bd
共有 1 個檔案被更改,包括 10 行新增0 行删除
  1. +10
    -0
      tests/test_measurement.py

+ 10
- 0
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



Loading…
取消
儲存