Skip to content

Instantly share code, notes, and snippets.

@yoongun
Last active January 6, 2020 13:13
Show Gist options
  • Save yoongun/59e6501fcb7c28f4fe21d487d7cc1d93 to your computer and use it in GitHub Desktop.
Save yoongun/59e6501fcb7c28f4fe21d487d7cc1d93 to your computer and use it in GitHub Desktop.
...
#[test]
fn test_collapes_of_state() {
let mut qubit = Qubit{ theta: f64::consts::PI / 2.0, phi: 0.0 };
let want = Qubit::measure(&mut qubit);
for _n in 0..100 {
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