https://github.com/munich-quantum-toolkit/qusat
MQT QuSAT - Using Satisfiability Testing (SAT) Techniques for Encoding Quantum Computing
https://github.com/munich-quantum-toolkit/qusat
quantum-computing
Last synced: 8 months ago
JSON representation
MQT QuSAT - Using Satisfiability Testing (SAT) Techniques for Encoding Quantum Computing
- Host: GitHub
- URL: https://github.com/munich-quantum-toolkit/qusat
- Owner: munich-quantum-toolkit
- License: mit
- Created: 2022-02-25T12:55:11.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-02T18:44:54.000Z (9 months ago)
- Last Synced: 2025-05-02T19:27:35.138Z (9 months ago)
- Topics: quantum-computing
- Language: C++
- Homepage: https://www.cda.cit.tum.de/research/quantum/
- Size: 12.2 MB
- Stars: 23
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/contributing.md
- License: LICENSE.md
- Support: .github/support.md
Awesome Lists containing this project
README
[](https://pypi.org/project/mqt.qusat/)

[](https://opensource.org/licenses/MIT)
[](https://github.com/munich-quantum-toolkit/qusat/actions/workflows/ci.yml)
[](https://github.com/munich-quantum-toolkit/qusat/actions/workflows/cd.yml)
[](https://codecov.io/gh/munich-quantum-toolkit/qusat)
> [!NOTE]
> This project is currently in low maintenance mode. We will still fix bugs and accept pull requests, but we will not
> actively develop new features.
# MQT QuSAT - A Tool for Utilizing SAT in Quantum Computing
A tool for utilizing satisfiablity testing (SAT) techniques in quantum computing developed as part of the [_Munich Quantum Toolkit (MQT)_](https://mqt.readthedocs.io) [^1] based on methods proposed in:
- [[1]](https://arxiv.org/abs/2203.00698) L. Berent, L. Burgholzer, and R. Wille. Towards a Satisfiability Encoding for Quantum Circuits. International Conference on Theory and Applications of Satisfiability Testing. 2022.
QuSAT builds upon [MQT Core](https://github.com/munich-quantum-toolkit/core), which forms the backbone of the MQT.
The project can be used to
- Encode Clifford circuits in SAT
- Check the equivalence of Clifford circuits using SAT
If you have any questions, feel free to create a [discussion](https://github.com/munich-quantum-toolkit/qusat/discussions) or an [issue](https://github.com/munich-quantum-toolkit/qusat/issues) on [GitHub](https://github.com/munich-quantum-toolkit/qusat).
## Towards a Satisfiability Encoding for Quantum Circuits
The results from the paper can be reproduced by first building the project as described below and then executing the resulting `qusat_test` executable in the build directory.
In order to replicate the full range of results, the `test/test_satencoder.cpp` needs to be modified before building the project.
The corresponding lines to be changed are marked with a `// Paper Evaluation:` comment.
Running the executable, produces several `.json` files containing the experimental data. The python script `/results/visualizer.py` can be used
to plot the respective data.
Note that, as we use a randomized procedure to generate input data, the exact experimental data will slightly vary every time the benchmarks are run.
The experimental data used in the paper is available in `/results` directory.
## System Requirements
Building (and running) is continuously tested under Linux, MacOS, and Windows using the [latest available system versions for GitHub Actions](https://github.com/actions/virtual-environments). However, the implementation should be compatible with any current C++ compiler supporting C++17 and a minimum CMake version of 3.24.
The SMT Solver [Z3 >= 4.8.3](https://github.com/Z3Prover/z3) has to be installed and the dynamic linker has to be able to find the library. This can be accomplished in a multitude of ways:
- Under Ubuntu 20.04 and newer: `sudo apt-get install libz3-dev`
- Under macOS: `brew install z3`
- Alternatively: `pip install z3-solver` and then append the corresponding path to the library path (`LD_LIBRARY_PATH` under Linux, `DYLD_LIBRARY_PATH` under macOS), e.g. via
```bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(python -c "import z3; print(z3.__path__[0]+'/lib')")
```
- Download pre-built binaries from https://github.com/Z3Prover/z3/releases and copy the files to the respective system directories
- Build Z3 from source and install it to the system
## Configuration and Build
To start off, clone this repository using
```shell
git clone https://github.com/munich-quantum-toolkit/qusat mqt-qusat
```
The project uses CMake as the main build configuration tool. Building a project using CMake is a two-stage process. First, CMake needs to be _configured_ by calling
```shell
cmake -S . -B build -DBUILD_MQT_QUSAT_TESTS=ON -DZ3_ROOT=/path/to/z3/
```
This tells CMake to search the current directory `.` (passed via `-S`) for a _CMakeLists.txt_ file and process it into a directory `build` (passed via `-B`). If your installation of Z3 is recent enough, the `Z3_ROOT` can typically be omitted.
After configuring with CMake, the library can be built by calling
```shell
cmake --build build
```
This tries to build the project in the `build` directory (passed via `--build`).
Some operating systems and developer environments explicitly require a configuration to be set, which is why the `--config` flag is also passed to the build command. The flag `--parallel ` may be added to trigger a parallel build.
# Reference
If you use our tool for your research, we would appreciate if you refer to it by citing the appropriate publication:
```
@inproceedings{berent2022sat,
title={Towards a SAT Encoding for Quantum Circuits: A Journey From Classical Circuits to Clifford Circuits and Beyond},
author={Lucas Berent and Lukas Burgholzer and Robert Wille},
year={2022},
booktitle={International Conference on Theory and Applications of Satisfiability Testing},
doi={https://doi.org/10.4230/LIPIcs.SAT.2022.18}
}
```
[^1]: The _[Munich Quantum Toolkit (MQT)](https://mqt.readthedocs.io)_ is a collection of software tools for quantum computing developed by the [Chair for Design Automation](https://www.cda.cit.tum.de/) at the [Technical University of Munich](https://www.tum.de/) as well as the [Munich Quantum Software Company (MQSC)](https://munichquantum.software). Among others, it is part of the [Munich Quantum Software Stack (MQSS)](https://www.munich-quantum-valley.de/research/research-areas/mqss) ecosystem, which is being developed as part of the [Munich Quantum Valley (MQV)](https://www.munich-quantum-valley.de) initiative.
---
## Acknowledgements
The Munich Quantum Toolkit has been supported by the European
Research Council (ERC) under the European Union's Horizon 2020 research and innovation program (grant agreement
No. 101001318), the Bavarian State Ministry for Science and Arts through the Distinguished Professorship Program, as well as the
Munich Quantum Valley, which is supported by the Bavarian state government with funds from the Hightech Agenda Bayern Plus.