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.

test_normalize_global_phase.py 318B

преди 8 години
преди 8 години
1234567891011
  1. from abp import clifford
  2. from abp import qi
  3. import numpy as np
  4. def test_normalize_global_phase():
  5. for i in range(10):
  6. u = qi.pz
  7. phase = np.random.uniform(0, 2*np.pi)
  8. m = np.exp(1j*phase) * u
  9. normalized = clifford.normalize_global_phase(m)
  10. assert np.allclose(normalized, u)