Skip to main content

ISA-aware qubit mapping/routing framework tailored to advanced quantum instruction sets, built on canonical two-qubit gate representation.

Project description

🧭 Canopus: Canonical-Optimized Placement Utility Suite for Quantum Compilation

PyPI License CI Python Conference

Canopus (Canonical-Optimized Placement Utility Suite) is a qubit mapping/routing framework tailored to advanced quantum ISAs. 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 Architecture

Installation

Prerequisite: monodromy (+ lrslib)

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/monodromy

monodromy itself needs the lrs binary from lrslib. Platform-specific setup:

macOS
brew install gmp
cd lrslib-073 && make
sudo make install
Ubuntu / Debian
sudo apt update && sudo apt install -y build-essential libgmp-dev
cd lrslib-073 && make
sudo make install
Conda (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 ~/.bashrc

From PyPI (recommended)

pip install canopus-quantum

Pre-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 remains canopus:

import canopus

From source

git clone https://github.com/Youngcius/canopus.git
cd canopus
pip install .

pip install . runs the maturin build backend in an isolated environment, which:

  1. Compiles the Rust extension (canopus.utils._accel) for the active Python version,
  2. Packages the Python sources, and
  3. 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 | sh

Usage

More end-to-end examples live under ./examples/:

  • routing.ipynb — Canopus routing in detail
  • rebasing.ipynb — Optimal ISA rebase (B gate, √iSWAP, arbitrary)
  • python route_demo.py to test the routing effect by Sabre and Canopus on a demo circuit
  • python route_qft.py <n> — Compare Canopus vs Sabre routing on an n-qubit QFT
  • python rebase_xxx.py to test the rebase passes for arbitrary ISAs

Package layout

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

Development

Install the dev extras and build the Rust extension in editable mode:

pip install -e ".[dev]"
poe dev          # equivalent to: maturin develop --release

Common 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.

Evaluation artifact

./experiments/ contains the full evaluation suite that accompanies the paper.

Case studies

Benchmark suite

Evaluation commands are managed via ./experiments/Makefile. First prepare prerequisite files (coupling files, coverage sets, logical-level optimized circuits):

cd experiments && make

Then:

  • make canopus — evaluate Canopus
  • make baselines — evaluate baseline compilers (Sabre, TOQM, BQSKit)
  • make sum_result — summarize results once routing evaluation completes
  • make 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.

Citation

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}
}

License

This project is licensed under the Apache License 2.0 — see the LICENSE file for details.

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

canopus_quantum-0.1.4.tar.gz (12.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

canopus_quantum-0.1.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (279.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.4-cp313-cp313-macosx_11_0_arm64.whl (249.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

canopus_quantum-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.4-cp312-cp312-macosx_11_0_arm64.whl (250.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

canopus_quantum-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (279.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (252.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

canopus_quantum-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.4-cp310-cp310-macosx_11_0_arm64.whl (252.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file canopus_quantum-0.1.4.tar.gz.

File metadata

  • Download URL: canopus_quantum-0.1.4.tar.gz
  • Upload date:
  • Size: 12.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for canopus_quantum-0.1.4.tar.gz
Algorithm Hash digest
SHA256 abc7d934c815e2dc4dedbf148b3f4f3bc69facca367bb81a56ee90f3e13b623b
MD5 aced5735c07e0180a1149b37f030bfa1
BLAKE2b-256 50a57c1c51bfbe206cc7a90012f8630a01b3ab47b7a3bbc26f6d38c21445c292

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.4.tar.gz:

Publisher: release.yml on Youngcius/canopus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canopus_quantum-0.1.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4f38e24c114e0dadbfd8592f8667791a5b589d140d26292ad9070e97a1bc241b
MD5 bda098c77b71cc84edf225a0934a23fb
BLAKE2b-256 bac80eb438c7a05e99c67d4ec4898e3d8822b486a5458b0845cfad0e22b27382

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Youngcius/canopus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canopus_quantum-0.1.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 21ca34173d089d8d2e9dedc1372d1f4c8fd69b076928047c343bdc864c0d9333
MD5 82aeccd63b49a4a8bd3d4cdf00ea1264
BLAKE2b-256 d26368b7a79f5c486661d6f017bed797eace7bd5a92f750f35aeff85668dd296

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.4-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on Youngcius/canopus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canopus_quantum-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8916212f0a2e5363db914b6a5e4c67257fd0e3b8020da80fa6abc9be0050e588
MD5 6a9e65225f618a5b41704ec8db56454d
BLAKE2b-256 0adafc91c5971d6e725f4188a5a72e4643e792795bccb4c164781fea5e1562a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Youngcius/canopus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canopus_quantum-0.1.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9be68fa7afbb490ca58d1b2970bba45ced828f0e2a3dfd63c1209c8fa91c86a9
MD5 b82265a88023b20b2fec9b5524bf051b
BLAKE2b-256 9536c15d38c1560f99585aaa15185f6e5a6555f52e94b1c11c65481b9994fd27

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.4-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on Youngcius/canopus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canopus_quantum-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cd0cc834ba3213370bc91d811abef7e9ea00d4b41211db461e68d9b298b240e7
MD5 6a69e27ecdab21ca9b21ac64dc5119ef
BLAKE2b-256 237bb5960986ef61e221a5a109ff3660300961b6f29a5d4cc0ff377f698351fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Youngcius/canopus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canopus_quantum-0.1.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 83f1fe5815b049f7f95c4e8ec3824a7cf93f20061e94f0c5b8183069bd44e7ef
MD5 223e84629b6c4679a50ae5fd4082849e
BLAKE2b-256 58e3e4c191e8c8a8851ef9af0ac4b6402d3c12a3e9e38f5f1590110efd0fda4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.4-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on Youngcius/canopus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canopus_quantum-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 96b613d5a21700a0a00210937059f27caaf846e704303a57ad4f2defa9347ab4
MD5 498e9fa911f3e419c3e606c930f499ab
BLAKE2b-256 ecea32e2766e49fdbb5ca330becaae5f1bccedabd9e40a4dfea1a2e21a5007fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Youngcius/canopus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canopus_quantum-0.1.4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a7570eeba025c85d763d78d0cb07e743670ec712b488512cbf45ca327e5b9f05
MD5 f35bc8dbc355a22f8c3e7e2bd5a3875a
BLAKE2b-256 fb634c6784c7489982b75d47310553b882a5428738166a03453cb7bcd2d1f23c

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.4-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on Youngcius/canopus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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