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

Selene integration tests

The integration tests compile HUGRs from this checkout and use Selene to run the emitted LLVM bitcode. Run them from the repository root.

just tket/test-semantics

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

Total release size: 147.3 MB

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

Download URL selene_hugr_qis_compiler-0.5.3-cp310-abi3-win_amd64.whl
Size 25.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
931ad0de7e2258590cbe74fe4c2bd731204d59769ed6dc58707324cd109cecab
BLAKE2b-256 checksum
How to use checksums
9d3d5920a32106e5fc750e5141987ac70a42ba814be791a8aa3c3400b6019d57
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 24, 2026.

Transparency log

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

Download URL selene_hugr_qis_compiler-0.5.3-cp310-abi3-manylinux_2_28_x86_64.whl
Size 35.2 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
c528249ede1b302d9d77e4477b2d944288c69006669cb06259d44cde3580cb61
BLAKE2b-256 checksum
How to use checksums
23ed25d492fb6e2bb7136d19280b8cf694cdf7a426cf6bb84715c6f063cef3e1
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 24, 2026.

Transparency log

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

Download URL selene_hugr_qis_compiler-0.5.3-cp310-abi3-manylinux_2_28_aarch64.whl
Size 34.4 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
e259a6bff5ee3617138cb071bfc6ffc78387803fd0cb28d2bdd4725239103859
BLAKE2b-256 checksum
How to use checksums
bb40bbec702055a72d639c19278e08d5436234ce8298bcea99d5ef43066125bb
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 24, 2026.

Transparency log

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

Download URL selene_hugr_qis_compiler-0.5.3-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
32dff84c333aa6f5c2401d1f238468b586011db81d7ac84c25f6e5e915359490
BLAKE2b-256 checksum
How to use checksums
b64e912bd8291ac75a97236333e68d4aa5a7ffa3b7f07e30385deb48da168ef1
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 24, 2026.

Transparency log

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

Download URL selene_hugr_qis_compiler-0.5.3-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
c276eb968fd52404eefad4697d1d25014a74c4cbe827b82b0819f1f2c2c8ec03
BLAKE2b-256 checksum
How to use checksums
174796d3ce657bd756544f8c2ae9b96e259eee62339cf2de17167bfaede7d823
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 24, 2026.

Transparency log

Security for selene-hugr-qis-compiler 0.5.3

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.3-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 24, 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.3 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