A single qubit simulation in Rust
First, build the project
cargo build
then run the program with the command below.
./target/debug/qubit-rust
cargo run
The simulation of a qubit which is initialized with the Hadamarad gate will be measured 1000 times and show you a result on the screen.
There are tests for
- Initialize a qubit with |0> state
- Measuring the qubit and get a proper result
- Check whether a measurement induces collapse of state to the qubit
You can test these with the command below.
cargo test