bell-state.rs 533 B

12345678910111213141516171819202122
  1. //! # Bell State / EPR Pair
  2. //!
  3. //! The Bell State, also known as the EPR pair (after Einstein, Podosky and Rosen)
  4. //! is the simplest example of entanglement.
  5. //!
  6. //! The Bell State is defined as the maximally entangled quantum state of two qubits.
  7. extern crate qcgpu;
  8. use qcgpu::Simulator;
  9. fn main() {
  10. println!("Creating Bell State");
  11. let mut sim = Simulator::new_opencl(2).unwrap();
  12. sim.h(0).unwrap();
  13. sim.cx(0, 1).unwrap();
  14. println!("Measurement Results:");
  15. println!("{}", sim.measure().unwrap());
  16. }