1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! # qsimulator
//!
//! A noiseless state-vector quantum circuit simulator.
//!
//! The crate exposes these main pieces:
//! - [`state::State`] — the `2^n` complex amplitude vector of an `n`-qubit register.
//! - [`gates`] — unitary matrices for the standard gate set.
//! - [`circuit::Circuit`] — a builder that sequences gates and runs them.
//! - [`rng::Rng`] — a seedable RNG used for reproducible measurement sampling.
//! - [`program`] and [`qasm`] — text and OpenQASM 2.0 front ends.
//!
//! ```
//! use qsimulator::Circuit;
//!
//! let mut c = Circuit::new(2);
//! c.h(0).cnot(0, 1); // Bell state
//! let state = c.run();
//! assert!((state.probability(0b00) - 0.5).abs() < 1e-12);
//! assert!((state.probability(0b11) - 0.5).abs() < 1e-12);
//! ```
pub use ;
pub use ParseError;
pub use Rng;
pub use State;