Skip to content

Instantly share code, notes, and snippets.

@yoongun
Created January 6, 2020 13:11
Show Gist options
  • Save yoongun/f1857d62e28b1f6159e8aa7ddbf902c7 to your computer and use it in GitHub Desktop.
Save yoongun/f1857d62e28b1f6159e8aa7ddbf902c7 to your computer and use it in GitHub Desktop.
...
#[test]
fn test_neasure_default_qubit() {
let mut qubit: Qubit = Default::default();
let want = 0;
let got = Qubit::measure(&mut qubit);
assert_eq!(got, want);
}
#[test]
fn test_measure_configured_as_one_qubit() {
let mut qubit = Qubit{ theta: f64::consts::PI, phi: 0.0 };
let want = 1;
let got = Qubit::measure(&mut qubit);
assert_eq!(got, want);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment