A compiler for compute transform uncompute structures with ancilla qubits. This repository provides the base SPARE implementation that contains input circuits stored as dot graphs, where each qubit is annotated as ancillas on the interface. These circuits were generated from the SPARE front-end of Spire and Unqomp compilers. These custom front-ends will be added to the repository. This repostory contains the benchmark generation code in benchmarks, the "dot_files" with the generated circuiits in Spare front-end, "log_files" for output logs, "OUTPUT_JSON" for the output json files, "run_scripts", Spare. We also add the repository for unmodified Unqomp used to get the results for the Unqomp baseline. To run this artifact, please use the docker container as:
docker build -t spare-image .
docker run -it --name spare spare-image
The docker file generates the Spare and all the benchmark results in the repository directly. But a user can run the docker image and implement a modified benchmarks in the Spare front end, run the circut generation and use Spare to run the optimization proces.
Spare compiles quantum circuits with 3 compilation steps which are as follows: Circuit generation -> Rewriter -> Lowering.
The circuit generation from Spare front-ends has not been added to this artifact currently. We plan to add this step in future versions of the artifact.
To generate the results of the tool for all the benchmarks we can run:
./run_scripts/run_all.sh
This code runs the circuit optimization and lowering. The script generates the circuit complexity after Spare optimizations for Unqomp, Spire, Spire length simplified and hand benchmarks. The benchmark results for the Spire, Spire length simplified and hand benchmarks are also generated by Spare code base. For the Unqomp results we just run the Unqomp repository itself which can be run by "run_evaluation.py" inside the Unqomp folder. The generated results are stored in the resulting json files in "OUTPUT_JSON" folder.
We can select the benchmarks used for comparison by selecting a subset of benchmarks in all .sh files inside the "run_scripts" folder.
We hope to maintain a active repository for the project for further updates available at https://github.com/Ritvik1sharma/SPARE