| Crates.io | qir-qis |
| lib.rs | qir-qis |
| version | 0.1.1 |
| created_at | 2026-01-22 17:56:33.009499+00 |
| updated_at | 2026-01-23 17:51:14.632273+00 |
| description | QIR to Quantinuum QIS (Quantum Instruction Set) compiler |
| homepage | https://github.com/quantinuum/qir-qis |
| repository | https://github.com/quantinuum/qir-qis/ |
| max_upload_size | |
| id | 2062274 |
| size | 416,781 |
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.
See qtm-qir-reference.md for details on supported QIR features and their mapping to Quantinuum QIS.
Requirements:
cargo build --release
The compiled binary will be available at target/release/qir-qis.
Requirements:
Available pre-built wheels:
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
For development installation:
uv sync
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.
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.
See examples/rust_api.rs for a complete working example.
cargo run --example rust_api
# Clone the repository
git clone https://github.com/quantinuum/qir-qis.git
cd qir-qis
# Install Rust dependencies and build
cargo build
# Install Python dependencies
uv sync
# Build Rust binary
cargo build --release
# Build Python package
uv run maturin build --release
Tests require cargo-nextest:
# Run all tests
make test
# Or directly with cargo
cargo nextest run --all-targets --all-features
# Compile a single QIR file
make compile FILE=tests/data/adaptive.ll
# Compile all test files
make allcompile
Test the compiled QIS using Selene quantum simulator:
# Simulate a single file (runs 5 shots by default)
make sim FILE=tests/data/adaptive.ll
# Simulate all test files
make allsim
This will:
# Run linters
make lint
# This runs:
# - prek (pre-commit checks, https://prek.j178.dev/)
# - typos checker
# - cargo clippy
After modifying the Python API:
make stubs
This updates qir_qis.pyi with the latest type signatures.
qir-qis/
├── src/
│ ├── main.rs # CLI entry point
│ ├── lib.rs # Library and Python bindings
│ ├── convert.rs # QIR to QIS conversion logic
│ ├── decompose.rs # Gate decomposition
│ ├── opt.rs # LLVM optimization passes
│ └── utils.rs # Helper utilities
├── tests/
│ ├── data/ # Test QIR files
│ └── snaps/ # Snapshot test results
├── main.py # Example Python usage with simulation
├── Cargo.toml # Rust package configuration
├── pyproject.toml # Python package configuration
└── Makefile # Common development tasks
| Command | Description |
|---|---|
make test |
Run all unit and integration tests |
make compile FILE=<path> |
Compile a single QIR file |
make sim FILE=<path> |
Compile and simulate a QIR file |
make lint |
Run code quality checks |
make stubs |
Regenerate Python type stubs |
make allcompile |
Compile all test files |
make allsim |
Simulate all test files |
Contributions are welcome! Please read CONTRIBUTING.md for:
Quick checklist before submitting:
make testmake lintApache-2.0
Copyright Quantinuum