Canopus (Canonical-Optimized Placement Utility Suite) is a unified qubit mapping/routing framework tailored to diverse quantum ISAs, i.e., the implementation of the paper "Unifying Qubit Routing Across Diverse Quantum ISAs via Canonical Representation". Its main function is to optimize the layout and routing of qubits on quantum hardware, handling optimal synthesis with diverse ISAs in a unified approach through two-qubit canonical gate representation, providing guidance for hardware-software co-design.
Canopus evokes the name of the second-brightest star in the sky, symbolizing its role as a "navigational" guide for routing qubits through the complex constraints of quantum hardware.
Canopus depends on the monodromy library for Weyl-chamber coverage computation. monodromy is not on PyPI and must be installed manually before pip install canopus-quantum:
pip install git+https://github.com/Youngcius/monodromymonodromy itself needs the lrs binary from lrslib. Platform-specific setup:
macOS
brew install gmp
cd lrslib-073 && make
sudo make installUbuntu / Debian
sudo apt update && sudo apt install -y build-essential libgmp-dev
cd lrslib-073 && make
sudo make installConda (any OS)
conda install -c conda-forge gmp
cd lrslib-073
make INCLUDEDIR="$CONDA_PREFIX/include" LIBDIR="$CONDA_PREFIX/lib"
make prefix=$HOME/.local install
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrcpip install canopus-quantumPre-compiled wheels are published for Linux and macOS on Python 3.10 β 3.13. No Rust toolchain is required for this path.
The distribution name on PyPI is
canopus-quantum; the import name remainscanopus:import canopus
git clone https://github.com/Youngcius/canopus.git
cd canopus
pip install .pip install . runs the maturin build backend in an isolated environment, which:
- Compiles the Rust extension (
canopus.utils._accel) for the active Python version, - Packages the Python sources, and
- Installs the resulting wheel into the current environment.
Prerequisite for source builds: a working Rust toolchain. Install via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shMore end-to-end examples live under ./examples/:
routing.ipynbβ Canopus routing in detailrebasing.ipynbβ Optimal ISA rebase (Bgate,βiSWAP, arbitrary)python route_demo.pyto test the routing effect by Sabre and Canopus on a demo circuitpython route_qft.py <n>β Compare Canopus vs Sabre routing on ann-qubit QFTpython rebase_xxx.pyto test the rebase passes for arbitrary ISAs
canopus/ # Python package
βββ __init__.py
βββ backends.py # Backend / ISA / cost-estimator definitions
βββ basics.py # CanonicalGate, BGate, SQiSWGate
βββ mapping.py # CanopusMapping & SabreMapping transpiler passes
βββ synthesis.py # rebase_to_{canonical, sqisw, zzphase, custom, ...}
βββ decomposition/ # Two-qubit decomposition kernels
βββ extensions/ # Optional integrations (bqskit, ...)
βββ utils/
βββ _core.py # Pure-Python utilities
βββ _accel.cpython-*.so # Rust-compiled accelerator (built by maturin)
βββ _accel.pyi # Type stubs for the Rust extension
src/ # Rust source for the accelerator
βββ lib.rs # PyO3 bindings
Install the dev extras and build the Rust extension in editable mode:
pip install -e ".[dev]"
poe dev # equivalent to: maturin develop --releaseCommon tasks (defined in pyproject.toml):
| Command | Description |
|---|---|
poe dev |
Build & install the Rust extension in editable mode |
poe rebuild |
Clean and rebuild from scratch |
poe build |
Build a redistributable wheel into ./target/wheels/ |
poe clean |
Remove every compiled artifact and cache |
poe lint |
ruff check canopus |
poe fmt |
ruff format canopus |
poe fmt-check |
ruff format --check canopus |
poe typecheck |
mypy canopus |
poe test |
pytest |
poe check |
Aggregate gate that CI runs: lint + fmt-check + test |
See CONTRIBUTING.md for the full contribution workflow.
./experiments/ contains the full evaluation suite that accompanies the paper.
./experiments/eval_qft/β QFT kernel./experiments/eval_qldpc/β QLDPC stabilizer circuits
Evaluation commands are managed via ./experiments/Makefile. First prepare prerequisite files (coupling files, coverage sets, logical-level optimized circuits):
cd experiments && makeThen:
make canopusβ evaluate Canopusmake baselinesβ evaluate baseline compilers (Sabre, TOQM, BQSKit)make sum_resultβ summarize results once routing evaluation completesmake disp_resultβ display summarized routing overheads across compilers, topologies, and ISAs
For fine-grained evaluation, you may also run bench_all.py, bench_all_toqm.py, etc. directly.
If you use Canopus in your work, please cite:
@article{yang2025unifying,
title = {Unifying Qubit Routing Across Diverse Quantum ISAs via Canonical Representation},
author = {Yang, Zhaohui and Zhang, Kai and Tian, Xinyang and Ren, Xiangyu and
Liu, Yingjian and Li, Yunfeng and Ding, Dawei and Chen, Jianxin and Xie, Yuan},
journal = {arXiv preprint arXiv:2511.04608},
year = {2025}
}This project is licensed under the Apache License 2.0 β see the LICENSE file for details.