Anders and Briegel in Python
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

22 строки
797B

  1. from anders_briegel import graphsim
  2. from abp import clifford
  3. import itertools
  4. #//! replaces op by trans * op * trans^dagger and returns a phase,
  5. #/*! either +1 or -1 (as RightPhase(0) or RightPhase(2)) */
  6. def test_conjugation():
  7. """ Test that clifford.conugate() agrees with graphsim.LocCliffOp.conjugate """
  8. for operation_index, transform_index in itertools.product(range(4), range(24)):
  9. transform = graphsim.LocCliffOp(transform_index)
  10. operation = graphsim.LocCliffOp(operation_index)
  11. phase = operation.conjugate(transform).ph
  12. phase = [1, 0, -1][phase]
  13. new_operation = operation.op
  14. NEW_OPERATION, PHASE = clifford.conjugate(operation_index, transform_index)
  15. assert new_operation == NEW_OPERATION
  16. assert PHASE == phase