Version 1.0 - 10 December 2019
staq is a modern C++17 library for the synthesis, transformation, optimization and compilation of quantum circuits. It is usable either through the provided binary tools, or as a header-only library that can be included to provide direct support for parsing & manipulating circuits written in the openQASM circuit description language.
Inspired by Clang, staq is designed to manipulate openQASM syntax trees directly, rather than through an intermediate representation which makes retrieving the original source code impossible. In particular, openQASM circuits can be inspected and transformed (in most cases) without losing the original source structure. This makes staq ideally suited for source-to-source tranformations, where only specific changes are desired. Likewise, this allows translations to other common circuit description languages and libraries to closely follow the openQASM source.
Check out the Wiki for more information about the library and included tools.
Linux & Mac OS
staq uses CMake for its build system. To build the main staq executable, from the root directory execute
mkdir build && cd build cmake .. make staq
To build the staq tool suite, from the
build directory, enter
make tools. Unit tests can be built with the command
staq is distributed under the MIT license. Please see the
LICENSE file for
Thanks to the excellent EPFL logic synthesis libraries which are used to perform logic synthesis in staq, and in particular Bruno Schmitt's tweedledum library, from which the openQASM parser was adapted.