Rust implementation of quantum circuits optimization algorithms presented in the following papers:
- BBMerge and FastTMerge algorithms from Optimal number of parametrized rotations and Hadamard gates in parametrized Clifford circuits with non-repeated parameters
- InternalHOpt algorithm from Optimal Hadamard gate count for Clifford+T synthesis of Pauli rotations sequences
- TOHPE and FastTODD algorithms from Lower T-count with faster algorithms
Install rust and run cargo +nightly run -r [OPTIONS] file.qc
where file.qc
is any .qc file. If your machine supports AVX2, it can be enabled with RUSTFLAGS="-C target-cpu=native" cargo run -r [OPTIONS] file.qc
.
[OPTIONS]
are (case-insensitive and in no order):
BBMerge
runs the BBMerge algorithmFastTMerge
runs the FastTMerge algorithmInternalHOpt
runs the InternalHOpt algorithmTOHPE
runs the TOHPE algorithmFastTODD
runs the FastTODD algorithm
If no options are provided, then the FastTMerge, InternalHOpt and FastTODD algorithms will be applied.
The gadgetization of internal Hadamard gates will be done whenever the TOHPE or FastTODD algorithms are applied.
The optimized circuit will be written in the .qc format in the folder circuits/outputs/
.