Anders and Briegel in Python
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

29 lignes
781B

  1. # -*- coding: utf-8 -*-
  2. """
  3. This program generates and caches lookup tables, and handles the Clifford group.
  4. It provides tables for Clifford group multiplication and conjugation,
  5. as well as CZ and decompositions of the 2x2 Cliffords.
  6. """
  7. from tables import *
  8. def conjugate(operator, unitary):
  9. """ Returns transform * vop * transform^dagger and a phase in {+1, -1} """
  10. return measurement_table[operator, unitary]
  11. def use_old_cz():
  12. """ Use the CZ table from A&B's code """
  13. global cz_table
  14. from anders_cz import cz_table
  15. def get_name(i):
  16. """ Get the human-readable name of this clifford """
  17. return "IXYZ"[i & 0x03] + "ABCDEF"[i / 4]
  18. def is_diagonal(v):
  19. """ TODO: remove this. Checks if a VOP is diagonal or not """
  20. return v in {0, 3, 5, 6}