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.

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.1.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.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.1-cp313-cp313-macosx_11_0_arm64.whl (250.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

canopus_quantum-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (250.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

canopus_quantum-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (252.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

canopus_quantum-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (252.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: canopus_quantum-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f786ec497ad5fe6a2b902d7183197d1b24ed2ee510f3be2ec5027667baede761
MD5 96d3a097c27a3ea21caf81107e831bcd
BLAKE2b-256 06cee3d2bc4eae5fb32d75b6da6b2c50e73ace1093241903ad62a9c42878b8f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.1.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.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e659f8e642f4c77ce3e4a52789c3ccbf4adb35ffb8ec4140081412960840a690
MD5 ac8eda732dd1e2c7e9faa09cc08f1d03
BLAKE2b-256 2f506a1080db1604d873d634d159b1965bf480ceaeae83732fdd9a75064224f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.1-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.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bdfa05f8cff5c49e64a5d3bd28403dc1e62616cab5ba9f30c3d7c9664a2a12f3
MD5 b4f5a74f35d57857d75ce0dd58d265e0
BLAKE2b-256 33926218d56a74f4b01d176861b7df5f5a73c9873a35db5cf1cc29aa2c7adc32

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.1-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.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 24cbba4f5052b9986dc9d9c9f7ca5d1e7953e313b9a6588cccdc4ba7cb4638dd
MD5 2d1f02b1e85ec7f2c99480147335ba8a
BLAKE2b-256 92dbd6af3f75cde2bcd4da7acfb69e9f1facc07394807fc39d7d4b436fc87e87

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.1-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.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9141bba6b94583a748827c114983deea2e4468ff2f5a2f2a9893d949b954ff33
MD5 9404dee81cd9700ac380d5587ee53f1a
BLAKE2b-256 832758ae828a987a556068a535a97f1b3cc185c3b9e7fe6773d5196f98993fac

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.1-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.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bca7f21fb48a25659e7e12ffb75db282ae952beb52d776d016590a17c6ce531a
MD5 bbb4293fc509bed690228773f99169bf
BLAKE2b-256 c3cb2668ee05a350bd2e06365d21ae7ec490cee5a13f2e1f920f85181da348a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.1-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.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f29d1462845aff5e8ce5b07fbc6718544430297958f0e497947a02175100c4e3
MD5 32ec5d8a19692e1209231cb527e36bba
BLAKE2b-256 9ad836d81eeb6a6b12207843c75fafd3bbf43014eeb7d62388fe70f7db0467eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.1-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.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72e8c424a3f1d682a135892c72087a7ba2c7c42d0ee96de115115911da5baf0c
MD5 746afcc9ebba44fde29f70db7c19316f
BLAKE2b-256 a6ac57c2b359d9edcb5236559a16ef76e528560c3e02f0353f17848f71c3eec0

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.1-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.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for canopus_quantum-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 78990036f9e7dc79d89ca96b0b2f57f3506bbd4d414449baa917394d86db9c9f
MD5 4fdf3f62c8803795a19702b61291ae56
BLAKE2b-256 248f5497c9adf874fc2114a30926d5993515128c1800ece4937f5d94fcc3b651

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopus_quantum-0.1.1-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