Repository for group 22 quantum computer simulator bachelor's thesis.
The simulator features a number of examples located under the /examples directory. These are binary crates you can run with cargo.
To run an example, run the following command:
cargo run --example <filename>
Here are all available examples:
grovers
openquasm_example
quantum_teleportation
shors
superdense_coding
Some examples accept parameters. To provide these, use: <br/>
cargo run --example <filename> -- --flag <value>
Here is a list of all parameters for each example that accepts them:
-
Shors
- Number to be factorized:
--number <value>
- How many times to run:
--n-times <value>
- If you want to print debugging messages from the algorithm you need to change an enviroment variable
- For linux:
RUST_LOG=debug cargo run --example shors
- For windows:
$env:RUST_LOG="debug"; cargo run --example shors; $env:RUST_LOG="off"
- For linux:
- Number to be factorized:
-
Grovers
- State to search for:
--target <value>
- Run for statistics of different iteration formulas:
--statistics
- State to search for:
-
Quantum teleportation
- here there are 4 paramaters,
a,b,c
andd
. These correspond to the representation[a+bi, c+di]
of the qubit to be teleported
- here there are 4 paramaters,
For example: <br/>
cargo run --example grovers -- --target 64
We provide suport for enabling the feature "blas" in the ndarray crate. When enabling this feature you need to add the blas-src crate to your dependencies. You also need to choose one of the five supported blas implementations:
accelerate
, which is the one in the Accelerate framework (macOS only),blis
, which is the one in BLIS,intel-mkl
, which is the one in Intel MKL,netlib
, which is the reference one by Netlib, andopenblas
, which is the one in OpenBLAS.
[dependencies]
blas-src = { version = "0.8", features = ["accelerate"] }
blas-src = { version = "0.8", features = ["blis"] }
blas-src = { version = "0.8", features = ["intel-mkl"] }
blas-src = { version = "0.8", features = ["netlib"] }
blas-src = { version = "0.8", features = ["openblas"] }
If you want to use the OpenBLAS implementation your toml should look like this:
blas-src = { version = "0.8", features = ["openblas"], optional = true}
openblas-src = { version = "0.10", features = ["cblas", "system"], optional = true}
And your main rust file needs this line at the top:
extern crate blas_src;
For all implementations you need to install software on your local machine.