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.

il y a 8 ans
12345678910111213141516171819202122232425262728
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. """
  4. Exposes a few basic QI operators
  5. """
  6. import numpy as np
  7. from scipy.linalg import sqrtm
  8. id = np.matrix(np.eye(2, dtype=complex))
  9. px = np.matrix([[0, 1], [1, 0]], dtype=complex)
  10. py = np.matrix([[0, -1j], [1j, 0]], dtype=complex)
  11. pz = np.matrix([[1, 0], [0, -1]], dtype=complex)
  12. ha = np.matrix([[1, 1], [1, -1]], dtype=complex) / np.sqrt(2)
  13. ph = np.matrix([[1, 0], [0, 1j]], dtype=complex)
  14. sqy = sqrtm(1j * py)
  15. msqy = sqrtm(-1j * py)
  16. sqz = sqrtm(1j * pz)
  17. msqz = sqrtm(-1j * pz)
  18. sqx = sqrtm(1j * px)
  19. msqx = sqrtm(-1j * px)
  20. paulis = (px, py, pz)
  21. common_us = id, px, py, pz, ha, ph, sqz, msqz, sqy, msqy, sqx, msqx
  22. names = "identity", "px", "py", "pz", "hadamard", "phase", "sqz", "msqz", "sqy", "msqy", "sqx", "msqx"
  23. by_name = dict(zip(names, common_us))