bell_state.py 531 B

123456789101112131415161718192021222324252627
  1. # -*- coding: utf-8 -*-
  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. def bell_state():
  10. import qcgpu
  11. print("Creating Bell State")
  12. state = qcgpu.State(2)
  13. state.h(0)
  14. state.cx(0, 1)
  15. print("Measurement Results:")
  16. print(state.measure(samples = 1000))
  17. if __name__== "__main__":
  18. bell_state()