An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# stab

[![GitHub actions](https://github.com/softwareqinc/stab/actions/workflows/cmake.yml/badge.svg)](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
```