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

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

canopus_quantum-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

canopus_quantum-0.1.2-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.2-cp311-cp311-macosx_11_0_arm64.whl (252.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

canopus_quantum-0.1.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: canopus_quantum-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 4375a8073d077025d56a0397fbdcc9d4ccc02488668b41c5b8fa79b38f081be1
MD5 6035e3120e692fd1b9f02a3f6f0621f4
BLAKE2b-256 ac7cc487ee98daeb186d988fe077c5ed00e223ccbeef6a6cd2314134ed9fd89d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 82d14416516adbe9ce981a8f802deb6951bec2b689a29e5f08c274d325bdd0d0
MD5 5cae414dc644c10cdd40c884777c94d0
BLAKE2b-256 9d64f6a1273ce0215408e339955681e661c51c80977b75e515618719eac8a295

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8345a436cf72854f1be744cc8ff3197823d4976ad68e65e87b4da4ad1b6cd5fc
MD5 cdaabbe37807bbb9f79169c7ef36e528
BLAKE2b-256 93902ac7390a8208932b4522bd588b2d11f21d86ce9b3f2244df431dc3ca980b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 50b3fbbc68f923cfff0717e737b2818ef1e62ce6549706c7f4400fe7860521a3
MD5 ea5d96573add555cd54399fa54bb9a82
BLAKE2b-256 e4bb4d99a70da7915abd88081f9a261aefd12e03cccc089feb67a72c8f4f436a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 94a983a0871c95923874602d7654eac30b86a66cc599b3ff036456cda8f32576
MD5 27cb6387f4e03e92cf597b5beaf05f0d
BLAKE2b-256 9259685b7046aba1fcdf62ac5fb2609a0b7b9b25e150c6fbf76954a7a3d1a4bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 431ed075ba50a4891e348cfc6a8561e2bc8fa28220c31dce1f838be8079b31b4
MD5 57654249819a2f40bccfc72b883d720f
BLAKE2b-256 69674340bac116723d7507e604769821b9ff178469e2753fb3232490a5aaf5b9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 54b557b69a768571ad9c6baf9e783cf5ced1d24348c5ef6d550af30b258860d6
MD5 442cae48d1b79fbf223eb7b7f516cc56
BLAKE2b-256 97c34f1c051eca8797268fe4a19d76b424de6df56f45d1fa9f78f76e237af09a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6959a064bee05505aae5c8db450b526f7b8f720165d7be3274ee4828107b7c29
MD5 0d721d8d9f6219112bf7789c9b84afcc
BLAKE2b-256 e19009932beaf63a6001042f4f055646ecb8c46d8b3731526e1749d9712dddc1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for canopus_quantum-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1d66fcecfddcf7646466cc1fbd7eb0cd87e06086e9dd41071469e0a96a09dfa4
MD5 16caf286a9b3bc2120b40d886c3cf168
BLAKE2b-256 22f86e80cc52495b2434b3db508495bef7bf66672fd81cc586612758a5fb7359

See more details on using hashes here.

Provenance

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