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:
    # ...

package = main.compile()

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

from selene_hugr_qis_compiler import EmulatorState

state = EmulatorState.from_python(package)

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

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

Use EmulatorState.from_bytes(hugr_envelope) when loading a serialized HUGR package.

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

state = EmulatorState.from_python(hugr.package, platform="helios")

# Compile to LLVM IR for Apple Silicon
ir_apple_silicon = state.compile_to_llvm_ir(
    target_triple="aarch64-apple-darwin",
)
# Compile to LLVM bitcode for x86_64 MSVC
bitcode_x86_64_windows = state.compile_to_bitcode(
    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.5.2

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.5.2
File Actions
selene_hugr_qis_compiler-0.5.2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for selene_hugr_qis_compiler-0.5.2-cp310-abi3-win_amd64.whl
selene_hugr_qis_compiler-0.5.2-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for selene_hugr_qis_compiler-0.5.2-cp310-abi3-manylinux_2_28_x86_64.whl
selene_hugr_qis_compiler-0.5.2-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for selene_hugr_qis_compiler-0.5.2-cp310-abi3-manylinux_2_28_aarch64.whl
selene_hugr_qis_compiler-0.5.2-cp310-abi3-macosx_15_0_x86_64.whl CPython 3.10 abi3 macOS 15.0+ x86-64 Details for selene_hugr_qis_compiler-0.5.2-cp310-abi3-macosx_15_0_x86_64.whl
selene_hugr_qis_compiler-0.5.2-cp310-abi3-macosx_15_0_arm64.whl CPython 3.10 abi3 macOS 15.0+ ARM64 Details for selene_hugr_qis_compiler-0.5.2-cp310-abi3-macosx_15_0_arm64.whl

Total release size: 146.9 MB

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

Download URL selene_hugr_qis_compiler-0.5.2-cp310-abi3-win_amd64.whl
Size 25.3 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9ae24ea8d4fb876c0ca0e4d12b5c2272db3a0dfc1b25a457089485cbce36038c
BLAKE2b-256 checksum
How to use checksums
2387fdee0444cc4f2e8dcd0546cb9c0ec5bd16185319364c59c839de2a841b58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

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

Download URL selene_hugr_qis_compiler-0.5.2-cp310-abi3-manylinux_2_28_x86_64.whl
Size 35.1 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
a8b6bc86c832fb8279f1425b60aea7278121c32ad21d55bfd78c6edb72994945
BLAKE2b-256 checksum
How to use checksums
c152b10208afa5a58ac8741eb861c578e5256bfd78e1e8d584dc151feb53a019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

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

Download URL selene_hugr_qis_compiler-0.5.2-cp310-abi3-manylinux_2_28_aarch64.whl
Size 34.3 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
0ce51c1bf760e4b1076d3f59b8d01995bf96b43c2a2e166e6a05d4c2126a68fe
BLAKE2b-256 checksum
How to use checksums
f0abf670afbc0e16e95db39563d4fa614e866855faa59f8578966bd7fe64bc85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

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

Download URL selene_hugr_qis_compiler-0.5.2-cp310-abi3-macosx_15_0_x86_64.whl
Size 26.9 MB
Tags CPython 3.10 abi3 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
a1c92f18417132067841af5a43fe98d5982e7bde73ee6e2ebce5453588b74ed8
BLAKE2b-256 checksum
How to use checksums
72ae495e39b0337e6ba3463fc0c3157fdaccc0671e454d89dc9814fe4cb942be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

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

Download URL selene_hugr_qis_compiler-0.5.2-cp310-abi3-macosx_15_0_arm64.whl
Size 25.3 MB
Tags CPython 3.10 abi3 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
4f417327d3c71aa891e4b23f6a30341302dcacb23f800c824cb0a4ed1bacba77
BLAKE2b-256 checksum
How to use checksums
e35923b544210cd554f14abbd3e52125b9097dcfabd0d3dfb638f1e656d2da46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Security for selene-hugr-qis-compiler 0.5.2

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for selene_hugr_qis_compiler-0.5.2-cp310-abi3-win_amd64.whl

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 Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.2 This release

5 release files Full provenance

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