Anders and Briegel in Python
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12 行
324B

  1. from abp import make_tables
  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 = make_tables.normalize_global_phase(m)
  10. assert np.allclose(normalized, u)