Anders and Briegel in Python
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

19 lines
516B

  1. class Stabilizer(object):
  2. def __init__(self, g):
  3. """ Construct a Stabilizer from a Graphstate """
  4. pass
  5. def to_stabilizer(self):
  6. """ Get the stabilizer tableau. Work in progress!
  7. """
  8. for a, b in it.product(self.node, self.node):
  9. output[a]["sign"] = 1
  10. if a == b:
  11. output[a][b] = "X"
  12. elif a in self.adj[b]:
  13. output[a][b] = "Z"
  14. else:
  15. output[a][b] = "I"
  16. return output