Anders and Briegel in Python
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
318B

  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)