bell-state.py 426 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python
  2. """
  3. Bell State / EPR Pair
  4. ---------------------
  5. The Bell State, also known as the EPR pair (after Einstein, Podosky and Rosen)
  6. is the simplest example of entanglement.
  7. The Bell State is defined as the maximally entangled quantum state of two qubits.
  8. """
  9. import qcgpu
  10. print("Creating Bell State")
  11. state = qcgpu.state(2)
  12. state.h(0)
  13. state.cx(0, 1)
  14. print("Measurement Results:")
  15. print(state.measure())