Anders and Briegel in Python
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

test_conjugation.py 532B

123456789101112131415
  1. from anders_briegel import graphsim
  2. import itertools
  3. #//! replaces op by trans * op * trans^dagger and returns a phase,
  4. #/*! either +1 or -1 (as RightPhase(0) or RightPhase(2)) */
  5. #RightPhase conjugate (const LocCliffOp trans);
  6. def test_conjugation():
  7. """ Test that clifford.conugate() agrees with graphsim.LocCliffOp.conjugate """
  8. for i, j in it.product(range(4), range(24)):
  9. a = graphsim.LocCliffOp(i)
  10. b = graphsim.LocCliffOp(j)
  11. output = a.conjugate(b)
  12. print i, j, a.op, b.op, output.ph