Skip to main content

SyReC - A Programming Language for Synthesis of Reversible Circuits

Project description

PyPI OS License: MIT CI Bindings codecov

MQT SyReC - A Programming Language for the Synthesis of Reversible Circuits

A tool for HDL-based synthesis of reversible circuits developed by the Chair for Design Automation at the Technical University of Munich. SyReC is part of the Munich Quantum Toolkit (MQT) and builds upon our quantum functionality representation (QFR).

If you have any questions, feel free to contact us via quantum.cda@xcit.tum.de or by creating an issue on GitHub.

Getting Started

SyReC is available via PyPI for Linux, macOS, and Windows.

  • In order to make the library as easy to use as possible (without compilation), we provide pre-built wheels for most common platforms (64-bit Linux, MacOS, Windows). These can be installed using
    (venv) $ pip install mqt.syrec
    
  • Once installed, start the SyReC editor GUI by running:
    (venv) $ syrec-editor
    

Reference

SyReC has been developed based on methods proposed in the following papers:

[1] Robert Wille, Majid Haghparast, Smaran Adarsh, and Tanmay M. "Towards HDL-based Synthesis of Reversible Circuits with No Additional Lines". In International Conference on Computer Aided Design (ICCAD), 2019
@inproceedings{wille2019towardsHDLsynthesis,
    author = {Wille, Robert and Haghparast, Majid and Adarsh, Smaran and M, Tanmay},
    title = {Towards HDL-based Synthesis of Reversible Circuits with No Additional Lines},
    booktitle = {International Conference on Computer Aided Design},
    year = {2019}
}

If you use our tool for your research, we would appreciate if you cited the appropriate publication.


Documentation for Developers

System requirements

Building (and running) is continuously tested under Linux, MacOS, and Windows using the latest available system versions for GitHub Actions. However, the implementation should be compatible with any current C++ compiler supporting C++17 and a minimum CMake version of 3.14.

Disclaimer: We noticed some issues when compiling with Microsoft's MSCV compiler toolchain. If you are developing under Windows, consider using the clang compiler toolchain. A detailed description of how to set this up can be found here.

Setup, Configure, and Build

To start off, clone this repository using

git clone --recurse-submodules -j8 https://github.com/cda-tum/syrec

Note the --recurse-submodules flag. It is required to also clone all the required submodules. If you happen to forget passing the flag on your initial clone, you can initialize all the submodules by executing git submodule update --init --recursive in the main project directory.

Our projects use 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

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

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). The flag -DCMAKE_BUILD_TYPE=Release tells CMake to configure a Release build ( as opposed to, e.g., a Debug build).

After configuring with CMake, the project can be built by calling

 cmake --build build --config Release

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 <NUMBER_OF_THREADS> may be added to trigger a parallel build.

Building the project this way generates

  • the main library libsyrec.a (Unix) / syrec.lib (Windows) in the build/src directory
  • a test executable syrec_test containing a small set of unit tests in the build/test directory (only if -DBUILD_SYREC_TESTS=ON is passed to CMake during configuration)

Building and Extending the Python Bindings

To extend the Python bindings you can locally install the package in edit mode, so that changes in the Python code are instantly available. The following example assumes you have a virtual environment set up and activated.

(venv) $ pip install --editable .

If you change parts of the C++ code, you have to run this command again to make the changes visible in Python.

In order for your IDE to pick up the bindings code, you might have to set the -DBINDINGS=ON CMake configuration option.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mqt.syrec-0.2.0.tar.gz (1.8 MB view hashes)

Uploaded Source

Built Distributions

mqt.syrec-0.2.0-cp311-cp311-win_amd64.whl (284.1 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

mqt.syrec-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (313.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

mqt.syrec-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (246.0 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

mqt.syrec-0.2.0-cp311-cp311-macosx_10_15_x86_64.whl (514.4 kB view hashes)

Uploaded CPython 3.11 macOS 10.15+ x86-64

mqt.syrec-0.2.0-cp310-cp310-win_amd64.whl (284.1 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

mqt.syrec-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (313.7 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

mqt.syrec-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (246.1 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

mqt.syrec-0.2.0-cp310-cp310-macosx_10_15_x86_64.whl (514.4 kB view hashes)

Uploaded CPython 3.10 macOS 10.15+ x86-64

mqt.syrec-0.2.0-cp39-cp39-win_amd64.whl (284.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

mqt.syrec-0.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (314.1 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

mqt.syrec-0.2.0-cp39-cp39-macosx_11_0_arm64.whl (246.1 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

mqt.syrec-0.2.0-cp39-cp39-macosx_10_15_x86_64.whl (514.5 kB view hashes)

Uploaded CPython 3.9 macOS 10.15+ x86-64

mqt.syrec-0.2.0-cp38-cp38-win_amd64.whl (284.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

mqt.syrec-0.2.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (313.7 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

mqt.syrec-0.2.0-cp38-cp38-macosx_11_0_arm64.whl (246.1 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

mqt.syrec-0.2.0-cp38-cp38-macosx_10_15_x86_64.whl (514.5 kB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

mqt.syrec-0.2.0-cp37-cp37m-win_amd64.whl (290.0 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

mqt.syrec-0.2.0-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (318.1 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

mqt.syrec-0.2.0-cp37-cp37m-macosx_10_15_x86_64.whl (512.8 kB view hashes)

Uploaded CPython 3.7m macOS 10.15+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page