Skip to main content

The HUGR-QIS compiler for Selene

This package provides compilation from HUGR to LLVM adhering to the Quantinuum QIS.

Usage

Guppy can produce a HUGR Envelope with:

from guppylang.decorator import guppy

@guppy
def main() -> None:
    # ...

hugr = main.compile()
hugr_envelope = hugr.package.to_bytes()

This can then be compiled to LLVM IR or bitcode using this package:

from qis_compiler import (
    compile_to_llvm_ir,
    compile_to_bitcode,
)

# Compile to LLVM IR for the host system
# and receive it as a string
ir = compile_to_llvm_ir(hugr_envelope)

# Compile to LLVM bitcode for the host system
# and receive it as a bytes object
bitcode = compile_to_bitcode(hugr_envelope)

If you wish to target a specific architecture or platform, you can pass the triple as an argument to the compilation functions:

# Compile to LLVM IR for Apple Silicon
ir_apple_silicon = compile_to_llvm_ir(
    hugr_envelope,
    target_triple="aarch64-apple-darwin",
)
# Compile to LLVM bitcode for x86_64 MSVC
bitcode_apple_silicon = compile_to_bitcode(
    hugr_envelope,
    target_triple="x86_64-windows-msvc",
)

Development

Snapshot testing

This package uses snapshot testing for its compiler output. Sample programs are defined using guppy in the script python/tests/generate_hugrs.py. To add a new test case add a new function to generate the desired HUGR program and call it from the if __name__ == "__main__": block.

The script has self contained dependencies with a pinned guppy version defined in comments at the top of the file. uv will create a virtual environment and install the dependencies when you run the script with uv run python tests/generate_hugrs.py. This can also be done using just regenerate in the python/tests directory.

HUGR regeneration should not be done in conjunction with other changes to the compiler, to isolate possible changes to the snapshots. It should only be required if guppylang updates are required for testing the compiler.

Metadata

Release files for selene-hugr-qis-compiler 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for selene-hugr-qis-compiler 0.4.3
File
selene_hugr_qis_compiler-0.4.3-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
selene_hugr_qis_compiler-0.4.3-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details
selene_hugr_qis_compiler-0.4.3-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details
selene_hugr_qis_compiler-0.4.3-cp310-abi3-macosx_15_0_x86_64.whl CPython 3.10 abi3 macOS 15.0+ x86-64 Details
selene_hugr_qis_compiler-0.4.3-cp310-abi3-macosx_15_0_arm64.whl CPython 3.10 abi3 macOS 15.0+ ARM64 Details

Total release size: 143.9 MB

Release files / selene_hugr_qis_compiler-0.4.3-cp310-abi3-win_amd64.whl

Download URL selene_hugr_qis_compiler-0.4.3-cp310-abi3-win_amd64.whl
Size 24.5 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e20ae29860e47191885d5053d2815e21beabbd12ccb8ad012870af67b06e32a3
BLAKE2b-256 checksum
How to use checksums
4a79a9502cbfcdfd486f2b75b85ae9c0ba296db63db902de1ff3bb43fddd0e3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / selene_hugr_qis_compiler-0.4.3-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL selene_hugr_qis_compiler-0.4.3-cp310-abi3-manylinux_2_28_x86_64.whl
Size 34.6 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
4ee51009bddaff8dd330e4abf99ecc48eebd4535b36e34118bbf5cae99dd379e
BLAKE2b-256 checksum
How to use checksums
42e794833e2c7c189d6280583775e022c5bcde0cf1256918d8ca5469034a8109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / selene_hugr_qis_compiler-0.4.3-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL selene_hugr_qis_compiler-0.4.3-cp310-abi3-manylinux_2_28_aarch64.whl
Size 33.7 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
c193f04c968c485eea4432adcaf66f9a12c523cc5273cf504fbe1af0d6f4aef0
BLAKE2b-256 checksum
How to use checksums
dd03e548a38b76e859d838e4ca9a88e7689fac1a7739b04f14d75718d0ab8120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / selene_hugr_qis_compiler-0.4.3-cp310-abi3-macosx_15_0_x86_64.whl

Download URL selene_hugr_qis_compiler-0.4.3-cp310-abi3-macosx_15_0_x86_64.whl
Size 26.3 MB
Tags CPython 3.10 abi3 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
4dc92ab8a171f3de144e3af3963432e9540ae813440972ee68509ec7f0104b6a
BLAKE2b-256 checksum
How to use checksums
3ab05cd13932db301a694c50ca48bf2aa06bb459aa477d5d2180987b74ffcf68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / selene_hugr_qis_compiler-0.4.3-cp310-abi3-macosx_15_0_arm64.whl

Download URL selene_hugr_qis_compiler-0.4.3-cp310-abi3-macosx_15_0_arm64.whl
Size 24.7 MB
Tags CPython 3.10 abi3 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
be65ad772415daf5c57ccf0a9bb40abb503ca29b021e3e7301ed871490ab41f4
BLAKE2b-256 checksum
How to use checksums
428f9e0bafa85e0ba170886f771a333fee4d28adc2a1264a27e30593ed4d527a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log
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