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

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.3-cp313-cp313-macosx_11_0_arm64.whl (250.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

canopus_quantum-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.3-cp312-cp312-macosx_11_0_arm64.whl (250.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

canopus_quantum-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

canopus_quantum-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

canopus_quantum-0.1.3-cp310-cp310-macosx_11_0_arm64.whl (253.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: canopus_quantum-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 025affd01bbbf7d8387231d0d425927df5b7f8ed17cbda6b631b33c56ce5206a
MD5 a3da775e43a599ccfcd3e18e7b7a27ac
BLAKE2b-256 0e2520a08929de8c0a108aac0733f332fda7ec41097e3690ced3ca902d9041c0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f4e2a94566a3b7cbe6cfaf488ea867c4ab4c05f1776f5d9bb52df4224442ae4c
MD5 08410d282d81d5c7d4c49a361f40953c
BLAKE2b-256 ab3fd81ef0eee39dbc636cd7ab2f71523320445c17626939169396d851389759

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 56883e0e71b1c9486677bdeff41ba9f4909426ff850b550b0253eada3012e503
MD5 454bdc3df8c19704cfa6585d882c8e98
BLAKE2b-256 475042b35088bcabf13ef2a643f03a67ff6d522526726ead0dd43edb668dd0f2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9e6adff8ee21135364abb76e81734b3043ec66cfa3d17c72d62a71e38e30ed16
MD5 458ec33af0f4e28067f2f3709a19c7a3
BLAKE2b-256 f29c427ac995dcbea92990d3df9ebf39f357e720a7f9d12077ac468bdb92d6b7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 33c3a50be2d557ac1cf7eecc481da36f18984a00e89063222735a0a16334eb26
MD5 c1553eb3f07802b10df3692b81ad1ffd
BLAKE2b-256 6bdf3ead6f2cc69730c41c07ed25eb80392926bf901de1a6d52f4044813998f9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 46357e7b33ed2c712a3f7e8afffa94272e6502d1e954ce840f2a77ee75caf726
MD5 19f64329bfbec7e36aee879677a8b7d0
BLAKE2b-256 2e842f11da2e7253c9281922f86fcfc42d20aaad9d54ddc2f8b4ddeb6b8d6ff9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 439676b5969e280eaeb7f08251d1889cc180fcb61d1a8ad77981b966dbff4450
MD5 75abdb8553feccda89ef7a412c765066
BLAKE2b-256 6bb0513d8c22dda511295dd501f3112ec5313ad67ca3d31274dacdc80cda02d9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 203c0fd744cb80a1aa055c68a83d5bafdb236f837aca79da314e4c76c6d2cd2b
MD5 219a67006460914533184fa977f58c7b
BLAKE2b-256 416b9bcee6e972d8d4529383f50ba068d74f670ac53ed45115a1e2d6edf3c0e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a9e938325f6f8094c479654c71abf6e41c4ae053359b34b219d626b1948d5ce
MD5 e5cb9f96ab2b5a2b74ee1baf76a9de54
BLAKE2b-256 b1f19766f4acc5dee3efe498dd60c7fc5f895582b827048c7909cf1da871aad7

See more details on using hashes here.

Provenance

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