Skip to main content

QIR-QIS

Crates.io PyPI

A compiler that validates and translates QIR (Quantum Intermediate Representation) to Quantinuum QIS (Quantum Instruction Set). This tool enables quantum programs written in QIR to run on Quantinuum's quantum computing systems.

Features

  • QIR Validation: Validates QIR bitcode for correctness and spec compliance
  • QIS Translation: Compiles QIR to Quantinuum's native QIS instruction set
  • Python & Rust API: Use as a Rust library or Python package
  • CLI Tool: Command-line interface for quick compilation

See qtm-qir-reference.md for details on supported QIR features and their mapping to Quantinuum QIS.

Installation

From Source (Rust)

Requirements:

  • Rust >= 1.91.0
  • LLVM 21
# Point llvm-sys to your LLVM 21 installation
export LLVM_SYS_211_PREFIX=/path/to/llvm21

cargo build --release

The compiled binary will be available at target/release/qir-qis.

Python Package

Requirements:

  • Python >= 3.10, < 3.15
  • uv (recommended) or pip

Available pre-built wheels:

  • Linux: x86_64 (manylinux_2_28), aarch64 (manylinux_2_28)
  • macOS: x86_64, arm64 (Apple Silicon)
  • Windows: x86_64

All wheels support Python 3.10+ using the stable ABI (abi3).

# Using uv (recommended)
uv pip install qir-qis

# Using pip
pip install qir-qis

Usage

Command Line

Compile a QIR LLVM IR file to QIS bitcode:

# Basic usage
qir-qis input.ll

# With custom optimization level
qir-qis -O 3 input.ll

# Specify target architecture
qir-qis -t x86-64 input.ll

# Or using cargo
cargo run -- input.ll

This generates input.qis.bc containing the compiled QIS bitcode.

On Windows, the default mode remains conservative: -O 0 -t native. Optimized conversion requires requesting optimization (for example, -O 1) and is supported only with -t x86-64; other optimized target combinations still fail fast to avoid known unstable LLVM 21 paths.

Python API

See examples/python_api.py for a complete working example.

uv run examples/python_api.py

For a more comprehensive example with quantum simulation, see main.py.

Rust API

See examples/rust_api.rs for a complete working example.

cargo run --example rust_api

Platform Notes

Windows support is functional, but a few LLVM integration paths still differ from Linux and macOS:

  • Optimized conversion on Windows is currently supported only when optimization is requested (for example, -O 1) with -t x86-64; other optimized target combinations fail fast instead of entering known unstable LLVM paths.
  • LLVM verifier failures return a generic error on Windows instead of the full verifier message.
  • Native target codegen on Windows uses conservative CPU settings instead of host CPU feature detection.
  • -O0 optimization on Windows is a validation-only fast path and does not rewrite the module triple.

These limitations are implementation details of the current LLVM/Inkwell integration rather than QIR feature differences.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for:

  • How to report issues and submit pull requests
  • Coding standards and commit message format
  • Development workflow and testing requirements

Development setup, test commands, and LLVM upgrade guidance live in DEVELOPMENT.md. Release notes are available in CHANGELOG.md.

License

Apache-2.0

Copyright Quantinuum

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

qir_qis-0.1.10-cp310-abi3-win_amd64.whl (20.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

qir_qis-0.1.10-cp310-abi3-manylinux_2_28_x86_64.whl (30.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

qir_qis-0.1.10-cp310-abi3-manylinux_2_28_aarch64.whl (29.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

qir_qis-0.1.10-cp310-abi3-macosx_11_0_arm64.whl (21.0 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

qir_qis-0.1.10-cp310-abi3-macosx_10_9_x86_64.whl (21.9 MB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file qir_qis-0.1.10-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: qir_qis-0.1.10-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 20.1 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qir_qis-0.1.10-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 aa4846983015999bb7064a9a4b6b50e927762d4d9d4aeb3258e5a8cc6423791e
MD5 08d01e143e20187f638c4923897608ae
BLAKE2b-256 45760317a3057f786129770b174a9b3658785cad75e6d726bdcd4a9c39ebd6f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for qir_qis-0.1.10-cp310-abi3-win_amd64.whl:

Publisher: wheels-release.yml on Quantinuum/qir-qis

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

File details

Details for the file qir_qis-0.1.10-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qir_qis-0.1.10-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f96c3ff1476539c6bafc46a6559fe8a60975288be962fa601b06f7586a90bb84
MD5 9c75e570cbc7a412859946dbffa9b237
BLAKE2b-256 8360fc7da7ef3b6af107c86658b818a6de1bd59e7896f0c3ca62c1adb4b2fa58

See more details on using hashes here.

Provenance

The following attestation bundles were made for qir_qis-0.1.10-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: wheels-release.yml on Quantinuum/qir-qis

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

File details

Details for the file qir_qis-0.1.10-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for qir_qis-0.1.10-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c9e94ae93e7c57e6362b658737414b25318411545f9370c81c8e219a2e2b1f6c
MD5 c26c775191cd336605c48e402b167465
BLAKE2b-256 6b51e284948b0a38cfd90fc7e5d1d93102e2a159ce215e4bbbc88bc6e09b8d90

See more details on using hashes here.

Provenance

The following attestation bundles were made for qir_qis-0.1.10-cp310-abi3-manylinux_2_28_aarch64.whl:

Publisher: wheels-release.yml on Quantinuum/qir-qis

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

File details

Details for the file qir_qis-0.1.10-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qir_qis-0.1.10-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f1b47b8d51b92787e6538655c3a8d89242299a1d679ecdb8e36fb057a0258487
MD5 968f55e059d333be5e3a133128d4a62e
BLAKE2b-256 c6c085ae182452f5d4c3047a8383994683eaa1cabeff0865123e04f8a0141e29

See more details on using hashes here.

Provenance

The following attestation bundles were made for qir_qis-0.1.10-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: wheels-release.yml on Quantinuum/qir-qis

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

File details

Details for the file qir_qis-0.1.10-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for qir_qis-0.1.10-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0ece39d0ff88673d430c3fc75b8a84de7034a8e21fe6577323c2ac4dfe6d239f
MD5 7fb38eca9666b43c15594110af3cd758
BLAKE2b-256 e399f2748c36f44575148aebd40c5d21ba0bb321a3d661eaabd92093c1ef67f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for qir_qis-0.1.10-cp310-abi3-macosx_10_9_x86_64.whl:

Publisher: wheels-release.yml on Quantinuum/qir-qis

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

Release history Release notifications | RSS feed

0.1.11

5 files

This release

0.1.10 This release

5 files

0.1.9

5 files

0.1.8

5 files

0.1.7

5 files

0.1.6

5 files

0.1.5

5 files

0.1.4

5 files

0.1.3

5 files

0.1.2

5 files

0.1.1

5 files

0.1.0

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page