Sequential Quantum Gate Decomposer (SQUANDER)
A High-Performance C++/Python Library for Quantum Circuit Decomposition and Optimization
Overview
The Sequential Quantum Gate Decomposer (SQUANDER) is a state-of-the-art computational library designed for training parametric quantum circuits and performing quantum gate synthesis. SQUANDER provides a comprehensive Python interface that enables researchers and developers to conduct advanced numerical experiments in quantum computing, including quantum gate synthesis, variational quantum eigensolver (VQE) applications, and quantum state preparation.
Key Capabilities
SQUANDER excels in decomposing n-qubit unitaries into sequences of one-qubit rotations and two-qubit controlled gates using advanced synthesis methods. The library leverages a high-performance parallel C/C++ framework with gate fusion and vectorized AVX gate kernels, delivering exceptional computational efficiency for quantum circuit simulations.
Optimization Techniques
Beyond conventional gradient-based optimizers (gradient descent, ADAM, and BFGS), SQUANDER incorporates an innovative gradient-free optimization technique that demonstrates robust numerical behavior and is particularly effective in circumventing barren plateaus—a common challenge in quantum circuit training. The library's handcrafted optimization strategies are specifically designed to accommodate the periodicity inherent in quantum optimization landscapes, ensuring resilient numerical efficiency.
Installation
SQUANDER is available as pre-built Python wheels for Windows, Linux, and macOS, making installation straightforward for most users. The package can be installed directly from the Python Package Index (PyPI):
pip install squander
System Requirements
- Python: 3.10 or higher (tested with Python 3.10-3.13)
- Operating Systems: Windows, Linux, macOS
Python Dependencies
The following packages are automatically installed as dependencies:
Development Installation
For developers who wish to build SQUANDER from source or contribute to the project, the following development installation instructions are provided.
Prerequisites
The following dependencies are required to compile and build SQUANDER from source:
Build Tools
- CMake (>=3.10.2)
- C++/C compiler:
- Intel Compiler (>=14.0.1), or
- GNU Compiler Collection (>=v4.8.1)
Libraries
- TBB (Threading Building Blocks) library
- Can be installed via Python package:
pip install tbb-devel - Or system package:
sudo apt install libtbb-dev(Linux)
- Can be installed via Python package:
- LAPACKE
- BLAS Library (choose one):
Optional Tools
Development Build on Unix/Linux/macOS
1. Clone the Repository
git clone https://github.com/rakytap/sequential-quantum-gate-decomposer.git
cd sequential-quantum-gate-decomposer
2. Set Up Environment Variables (if needed)
If TBB is installed at a non-standard location or using GNU compiler:
export TBB_LIB_DIR=path/to/TBB/lib(64)
export TBB_INC_DIR=path/to/TBB/include
Note: When TBB is installed via the tbb-devel Python package, these environment variables are not necessary.
3. Build from Source
The SQUANDER package uses a Python build script (setup.py) that automatically detects the CBLAS library used by NumPy and configures CMake accordingly:
python3 setup.py build_ext
This command compiles the SQUANDER C++ library and builds the Python interface extensions in place.
4. Install in Development Mode
After a successful build, install the package in editable (development) mode:
python -m pip install -e .
Development Build with Conda (Recommended)
We recommend using Anaconda/Miniconda for development environments:
1. Create Environment from Configuration File
conda env create -f conda_env_example.yaml
2. Activate Environment
conda activate qgd
3. Build and Install
python3 setup.py build_ext
python -m pip install -e .
Development Build on Windows
Prerequisites
- CMake must be in the system PATH
- Microsoft Visual C++ compiler
Build Steps
set PATH=%PATH%;C:\Program Files\cmake\bin
set TBB_LOCATION=<Python_Folder>/LocalCache/local-packages
set TBB_INC_DIR=%TBB_LOCATION%/Library/include
set TBB_LIB_DIR=%TBB_LOCATION%/Library/lib
set LIB=<BLAS_Location>/lib;<LAPACK_Location>/lib
python setup.py build_ext -DTBB_HEADER=<TBB_Location>\Library\include\
Install DLL Files
Copy required DLL files to the package directory:
copy "%TBB_LOCATION%\Library\bin\tbb12.dll" .\squander\decomposition
copy "%TBB_LOCATION%\Library\bin\tbbmalloc.dll" .\squander\decomposition
Verify Installation
python -m pytest
Building Distribution Packages
Binary Wheel Distribution
To build a wheel binary for distribution:
python3 setup.py bdist_wheel
The wheel will be created in the dist/ directory. Note that the created wheel is not portable, as it contains hard-coded links to external libraries (TBB and CBLAS).
Source Distribution
To create a portable source distribution:
python3 setup.py sdist
The source distribution tarball will be created in the dist/ directory.
Features
SQUANDER provides a comprehensive suite of tools for quantum circuit manipulation and optimization:
Core Functionality
-
Unitary Decomposition: Decompose unitaries into quantum circuits using multiple methods:
- Standard decomposition (
N_Qubit_Decomposition) - Adaptive decomposition with circuit compression (
N_Qubit_Decomposition_adaptive) - Custom topology decomposition (
N_Qubit_Decomposition_custom) - Tree search decomposition (
N_Qubit_Decomposition_Tree_Search) - Tabu search decomposition (
N_Qubit_Decomposition_Tabu_Search)
- Standard decomposition (
-
Circuit Optimization: Optimize wide quantum circuits using the
Wide_Circuit_Optimizationclass -
State Preparation: Prepare quantum states via adaptive state preparation (
N_Qubit_State_Preparation_adaptive) -
Variational Quantum Algorithms:
- Variational Quantum Eigensolver (VQE) (
Variational_Quantum_Eigensolver) - Generative Quantum Machine Learning (GQML) (
Generative_Quantum_Machine_Learning)
- Variational Quantum Eigensolver (VQE) (
-
Circuit Simulation: High-performance state vector evolution for quantum circuit simulation
-
Circuit Synthesis: SABRE algorithm for qubit routing and mapping
-
Circuit Partitioning: Partition large circuits for efficient decomposition and optimization
-
Qiskit Integration: Seamless integration with Qiskit through the
Qiskit_IOmodule
Python Interface
SQUANDER exposes its C++ functionality through a comprehensive Python interface. The main modules include:
| Module | Description |
|---|---|
squander.decomposition |
Quantum gate decomposition classes for decomposing unitaries and preparing quantum states |
squander.gates |
Quantum gate implementations and circuit building blocks (CNOT, H, RX, RY, RZ, and custom gates) |
squander.VQA |
Classes for VQE and generative quantum machine learning algorithms |
squander.synthesis |
Circuit synthesis tools including SABRE algorithm for qubit routing and mapping |
squander.partitioning |
Circuit partitioning utilities for breaking down large circuits into manageable sub-circuits |
squander.IO_interfaces |
Input/output interfaces including Qiskit integration (Qiskit_IO) |
squander.utils |
Utility functions for working with quantum circuits and unitaries |
squander.nn |
Experimental neural network interface for quantum machine learning |
Example Usage
Comprehensive examples demonstrating SQUANDER's capabilities are available in the examples/ directory:
examples/decomposition/: Examples of unitary decomposition with various methodsexamples/VQE/: Variational quantum eigensolver examplesexamples/state_preparation/: Quantum state preparation examplesexamples/simulation/: Quantum circuit simulation benchmarksexamples/partitioning/: Circuit partitioning examples
Additional usage patterns and test cases can be found in the tests/ directory.
Documentation
Comprehensive documentation for the SQUANDER package is available at:
Citation
If you use SQUANDER in your research, please cite the following publications:
[1] Péter Rakyta, Zoltán Zimborás, Approaching the theoretical limit in quantum gate decomposition, Quantum 6, 710 (2022).
[2] Péter Rakyta, Zoltán Zimborás, Efficient quantum gate decomposition via adaptive circuit compression, arXiv:2203.04426.
[3] Peter Rakyta, Gregory Morse, Jakab Nádori, Zita Majnay-Takács, Oskar Mencer, Zoltán Zimborás, Highly optimized quantum circuits synthesized via data-flow engines, Journal of Computational Physics 500, 112756 (2024).
[4] Jakab Nádori, Gregory Morse, Barna Fülöp Villám, Zita Majnay-Takács, Zoltán Zimborás, Péter Rakyta, Batched Line Search Strategy for Navigating through Barren Plateaus in Quantum Circuit Training, Quantum 9, 1841 (2025).
Posters and Conference Presentations
- Conference talk. Péter Rakyta. Efficient quantum gate decomposition via adaptive circuit compression. GPU Day 2022 - Massive parallel computing for science and industrial application. June 21, 2022, 10:10-10:40. https://gpuday.com/gpu-day-2022
- Conference talk. Péter Rakyta. Simulation of quantum computers on tensor streaming processors. GPU Day 2023. Budapest, Hungary, May 15-16, 2023. https://gpuday.com/gpu-day-2023
- Conference talk (QCW track). Gregory Morse, Peter Rakyta, Tamás Kozsik. Simulation of quantum computers on tensor streaming processors. ICCS 2023 (International Conference on Computational Science), Quantum Computing Workshop (QCW), Prague, Czech Republic. July 3, 2023, 17:40. Program link: https://easychair.org/smart-program/ICCS2023/2023-07-03.html#talk:223488
- Workshop talk. Péter Rakyta. SQUANDER: a classical framework to train quantum circuits. Workshop on Methods and Applications of Quantum Computing with Light and Qubits. Faculty of Nuclear Sciences and Physical Engineering, B-111, Brehova 7, Prague. October 17, 2023, 14:45-15:30. https://indico.fjfi.cvut.cz/event/269/contributions/4309/
- Conference talk. Péter Rakyta. Batched Line Search Strategy for Navigating through Barren Plateaus in Quantum Circuit Training. GPU Day 2025 - Massive parallel computing for science and industrial application. HUN-REN Centre, Budapest. May 22, 2025, 12:00-12:30. https://gpuday.com/gpu-day-2025
- Poster session. Muhammad Al Farizi, Gregory Morse, Jakab Nádori, László Hajas, Péter Rakyta. Scalable Quantum Circuit Design: Partitioning and Optimization Strategies. Quantum Informatics National Laboratory Workshop 2025. Bosch Budapest Innovation Campus, June 5, 2025, 16:30-18:30. https://qi.nemzetilabor.hu/events/quantum-information-national-laboratory-workshop-2025
- Invited lecturer. Gregory Morse. Scalable Globally Optimal Partitioning of Quantum Circuits. Lectures on Modern Scientific Programming 2025, HUN-REN Wigner RCP. November 25, 2025, 9:20-10:30 lecture and 14:00-15:30 hands-on session. https://indico.wigner.hu/event/1709/
- Poster session. Zoltán Kégli, Gregory Morse, Jakab Nádori, Barna Fülöp Villám, Muhammad Al Farizi, Tamás Kozsik, Péter Rakyta. SQUANDER: a classical technique to train quantum circuits. The 13th International Conference on Applied Informatics (ICAI2026). Eszterházy Károly Catholic University, Eger, February 20, 2026, 10:15-11:15. https://icai.uni-eszterhazy.hu/2026/program/
- Conference talk. Zoltán Kégli, Tamás Kozsik, Péter Rakyta. Bounded Exact Channel-Native Fusion of Local Noisy Motifs in Density-Matrix Simulation. The 15th Conference of PhD Students in Computer Science (CSCS2026). University of Szeged, Bolyai Institute, Szeged, Hungary, July 3, 2026, 14:00-15:40. https://www.inf.u-szeged.hu/~cscs/program.html
Acknowledgments
This project was supported by:
- Grant OTKA PD123927
- The Ministry of Innovation and Technology and the National Research, Development and Innovation Office within the Quantum Information National Laboratory of Hungary
Contact
For questions, support, or collaboration inquiries, please contact:
- Zoltán Zimborás (Researcher): zimboras.zoltan@wigner.hu
- Peter Rakyta (Developer): peter.rakyta@ttk.elte.hu
- Gregory Morse (Developer): morse@inf.elte.hu
License
SQUANDER is licensed under the Apache License 2.0. See the LICENSE file for details.
Metadata
Release files for squander 1.9.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 500.6 MB
Release files / squander-1.9.8-cp313-cp313-win_amd64.whl
| Download URL | squander-1.9.8-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 14.5 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
14e54050462d0d58806bddfc9b31e8a5d60143e444f8d062dfa625eaa14fe190
|
|
BLAKE2b-256 checksum How to use checksums |
b0b61234ffc2f9c11ea3609eace333c81383357bd52311d903d5890c8d33d10b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | squander-1.9.8-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 99.2 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b744783e1e80c07a1144e3b3814f783ec8394ee966b9d91ecc2154725c269b64
|
|
BLAKE2b-256 checksum How to use checksums |
7d0f377e1ccb952185a79a536d9297d6f7c95eb7e911f9915723dd8b8d969509
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp313-cp313-macosx_26_0_arm64.whl
| Download URL | squander-1.9.8-cp313-cp313-macosx_26_0_arm64.whl |
|---|---|
| Size | 11.4 MB |
| Tags | CPython 3.13 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1e606e09d9a27d1687c59435ef934a4b0b2dc788198efd1f6ea062b1c549ab0d
|
|
BLAKE2b-256 checksum How to use checksums |
6114dbb112ab81401dc5be7c3c31d1a5b9c102d9a9ae8b5bba1a79004abfbc83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp312-cp312-win_amd64.whl
| Download URL | squander-1.9.8-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 14.5 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1815a5db3974489209e36763df649b4e203a3244f9c35d9044888b8c831d489a
|
|
BLAKE2b-256 checksum How to use checksums |
bb556d20a13fce37244db01bcd651e25eec9cc3fe2eba6cd9f3616fe55c27aa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | squander-1.9.8-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 99.2 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
68c420fa4fe71cec61f01a797f031fefd035cd58cf6c6ae108955026c11be56a
|
|
BLAKE2b-256 checksum How to use checksums |
e09e4684fb3827aa744ac3e41824df8997eff63a2ba1bef6a83312cf46d1bcd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp312-cp312-macosx_26_0_arm64.whl
| Download URL | squander-1.9.8-cp312-cp312-macosx_26_0_arm64.whl |
|---|---|
| Size | 11.4 MB |
| Tags | CPython 3.12 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7816417b40a49690ee30141c77cad5d058dd3369ed269062f580e32fc4491be6
|
|
BLAKE2b-256 checksum How to use checksums |
1cf50d483220c78492871df97f10dc871fb96a50c58dc9f3da05000e25653401
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp311-cp311-win_amd64.whl
| Download URL | squander-1.9.8-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 14.5 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7019d3eb4b03c35be4d174cfc4d990b3e0699e8da124202a87f068591cef0462
|
|
BLAKE2b-256 checksum How to use checksums |
19e950cf550850779a712c8cfaef43cdb7224ab4b8ab62798f2457825a0767a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | squander-1.9.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 99.2 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8e723fc2813c23e8c17e8f7dfbe8c8c7fa9e6097ae0e8ae604e6ac9239090b9e
|
|
BLAKE2b-256 checksum How to use checksums |
3eb779d59a950ae2284550246d455a059261c1b0051d30abd0a2c118136543ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp311-cp311-macosx_26_0_arm64.whl
| Download URL | squander-1.9.8-cp311-cp311-macosx_26_0_arm64.whl |
|---|---|
| Size | 11.4 MB |
| Tags | CPython 3.11 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
198390eb07bb5cef2a49e368309459fec16679976bcabb70d17e39ae587541d6
|
|
BLAKE2b-256 checksum How to use checksums |
49cbbcc7c2d9ae0a0ef2c005a89968d3be30e6a936df78361b1a6016b8d0311b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp310-cp310-win_amd64.whl
| Download URL | squander-1.9.8-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 14.5 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ad3b6ddad6afbc4a411100969f12027e7adff1c120c6a19e63ac28fe1677c0b2
|
|
BLAKE2b-256 checksum How to use checksums |
3616b5b9a0458a98e053ed51b0bb2917d8bb7abbb9839ab94db8d02269ae0d50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | squander-1.9.8-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 99.2 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d9a973a91170a996a9edae6a0ae9dad725cde547c48233d7e013cbb7d01a1f81
|
|
BLAKE2b-256 checksum How to use checksums |
0463f855604b44f5e83d0e68e48f07c53c8dada9495ed1e043465a8503f6d5fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / squander-1.9.8-cp310-cp310-macosx_26_0_arm64.whl
| Download URL | squander-1.9.8-cp310-cp310-macosx_26_0_arm64.whl |
|---|---|
| Size | 11.4 MB |
| Tags | CPython 3.10 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c36815a8523259dab1d4863cbf0a2bbd509ac40fdfb9b2ffde7e79b56534c795
|
|
BLAKE2b-256 checksum How to use checksums |
8da8aa5f1444804f88da5dc23ee9771266512d768b45ef5486188c9c5d307bd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for squander 1.9.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.