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.

12 lines
200B

  1. import chp
  2. import numpy as np
  3. chp.init(5)
  4. chp.act_hadamard(0)
  5. chp.act_cnot(0, 1)
  6. chp.act_phase(0)
  7. for key, value in chp.get_ket().items():
  8. print bin(key), np.exp(1j * value * np.pi/2).round(2)