瀏覽代碼

Seem to have found a problem in Anders' thesis

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

+ 17
- 1
tests/test_clifford.py 查看文件

@@ -6,7 +6,23 @@ def test_identify_pauli():
assert lc.identify_pauli(-lc.px) == (-1, "x")
assert lc.identify_pauli(-lc.pz) == (-1, "z")

def test_crap():
def test_against_anders_table():
assert allclose(lc.vop_unitaries[0], lc.i)
assert allclose(lc.vop_unitaries[10], lc.h)

yb = matrix([[1,0],[0,1j]])
assert allclose(lc.vop_unitaries[5], yb)

xb = matrix([[1,0],[0,-1j]])
assert allclose(lc.vop_unitaries[6], xb)

#ye = matrix([[1,-1j],[-1,-1j]])/sqrt(2)
#print lc.vop_unitaries[17]
#print ye
#assert allclose(lc.vop_unitaries[17], ye)

u = exp(-1j*pi/4)*matrix([[0,1],[1j,0]])
print lc.format_action(lc.identify_pauli(u*p*u.H) for p in lc.paulis)
u = lc.vop_unitaries[4]
print lc.format_action(lc.identify_pauli(u*p*u.H) for p in lc.paulis)


Loading…
取消
儲存