Anders and Briegel in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

clifford.py 1.3KB

8 anni fa
8 anni fa
8 anni fa
8 anni fa
8 anni fa
8 anni fa
123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. """
  4. Generates and enumerates the 24 elements of the local Clifford group
  5. Following the prescription of Anders (thesis pg. 26):
  6. > Table 2.1: The 24 elements of the local Clifford group. The row index (here called the “sign symbol”) shows how the operator
  7. > U permutes the Pauli operators σ = X, Y, Z under the conjugation σ = ±UσU† . The column index (the “permutation
  8. > symbol”) indicates the sign obtained under the conjugation: For operators U in the I column it is the sign of the permutation
  9. > (indicated on the left). For elements in the X, Y and Z columns, it is this sign only if the conjugated Pauli operator is the one
  10. > indicated by the column header and the opposite sign otherwise.
  11. """
  12. from numpy import *
  13. i = matrix(eye(2, dtype=complex))
  14. px = matrix([[0, 1], [1, 0]], dtype=complex)
  15. py = matrix([[0, -1j], [1j, 0]], dtype=complex)
  16. pz = matrix([[1, 0], [0, -1]], dtype=complex)
  17. h = matrix([[1, 1], [1, -1]], dtype=complex) / sqrt(2)
  18. p = matrix([[1, 0], [0, 1j]], dtype=complex)
  19. permutations = (i, h, p, h*p, h*p*h, h*p*h*p)
  20. signs = (i, px, py, pz)
  21. unitaries = [p*s for p in permutations for s in signs]
  22. # TODO:
  23. # - check that we re-generate the table
  24. # - do conjugation
  25. # - do times table
  26. # - write tests