Browse Source

Seem to have found a problem in Anders' thesis

master
Pete Shadbolt 8 years ago
parent
commit
340fb097db
1 changed files with 17 additions and 1 deletions
  1. +17
    -1
      tests/test_clifford.py

+ 17
- 1
tests/test_clifford.py View File

@@ -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…
Cancel
Save