https://github.com/softwareqinc/stab
Fast simulation of stabilizer circuits
https://github.com/softwareqinc/stab
Last synced: 4 months ago
JSON representation
Fast simulation of stabilizer circuits
- Host: GitHub
- URL: https://github.com/softwareqinc/stab
- Owner: softwareQinc
- License: mit
- Created: 2022-08-16T16:03:22.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-02T01:10:19.000Z (about 2 years ago)
- Last Synced: 2025-10-11T07:11:31.862Z (8 months ago)
- Language: C++
- Size: 150 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stab
[](https://github.com/softwareQinc/stab/actions)
Efficient simulation of Clifford circuits using the method described in Niel de Beaudrap and Steven Herbert's
paper ["Fast Stabiliser Simulation with Quadratic Form Expansions"](https://quantum-journal.org/papers/q-2022-09-15-803/).
Most functions are implemented from the pseudocode described in the paper.
---
## Pre-requisites
- C++17 compliant compiler, e.g., [GNU gcc](https://gcc.gnu.org/) (`sudo apt install build-essential` to install on
Ubuntu/Debian Linux)
- [CMake](https://cmake.org/) build system (`sudo apt install cmake` to install on Ubuntu/Debian Linux,
or `brew install cmake` to install on macOS)
- [Eigen3](https://eigen.tuxfamily.org/index.php) matrix library version 3.4 or later (`sudo apt install libeigen3-dev`
to install on Ubuntu/Debian Linux, or `brew install eigen` to install on macOS)
### Optional
- [Quantum++](https://github.com/softwareqinc/qpp) quantum computing library
To install Quantum++, execute
```shell
git clone --depth=1 https://github.com/softwareqinc/qpp
cmake -S qpp -B qpp/build
sudo cmake --build qpp/build --target install
```
or `brew install quantum++` to install on macOS, or `sudo pkg install quantum++` to install on FreeBSD.
---
## Setup
From inside the project's root directory, execute
```shell
cmake -B build [-DUSE_QPP=ON/OFF]
cmake --build build --parallel 8
```
The flag `USE_QPP` in the square bracket is optional, set to `OFF` by default.
Note that on Windows you may need to set the `EIGEN3_INSTALL_DIR` environment variable to point to your Eigen
installation, and add the path to `stab-common.dll` (usually `.\build\Debug` or `.\build\Release`) to your `PATH`
environmnt variable. Check out the GitHub actions file [.github/workflows/cmake.yml](.github/workflows/cmake.yml) for
more details and a full **stab** setup on Windows.
---
## Unit testing
To build the unit tests, execute
```shell
cmake --build build --target unit_tests --parallel 8
```
To run the unit tests, execute
```shell
ctest --test-dir build
```