Skip to main content

A Python frontend for compiling HUGR to Quantinuum's QIS.

Project description

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 selene_hugr_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",
)

Project details


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.

selene_hugr_qis_compiler-0.2.6-cp310-abi3-win_amd64.whl (29.7 MB view details)

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.6-cp310-abi3-manylinux_2_28_x86_64.whl (34.3 MB view details)

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

selene_hugr_qis_compiler-0.2.6-cp310-abi3-manylinux_2_28_aarch64.whl (33.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

selene_hugr_qis_compiler-0.2.6-cp310-abi3-macosx_13_0_x86_64.whl (32.7 MB view details)

Uploaded CPython 3.10+macOS 13.0+ x86-64

selene_hugr_qis_compiler-0.2.6-cp310-abi3-macosx_13_0_arm64.whl (30.0 MB view details)

Uploaded CPython 3.10+macOS 13.0+ ARM64

File details

Details for the file selene_hugr_qis_compiler-0.2.6-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.6-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2b2c4938c668a54e229d98d270b98b3df3f5e87fa5658ecc8924096d6090780a
MD5 3c55a7f3e3f52a1b296f4c0cc21d0dfb
BLAKE2b-256 bf1064578d17c6e758654d3948e8dd541fbf17b65b7b033d876d20bcb2c77cd9

See more details on using hashes here.

File details

Details for the file selene_hugr_qis_compiler-0.2.6-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.6-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 921d95ba298d3f1a1ea1bd76367cc82c3f89838ec6fb1cdbb3d7b6035a855be7
MD5 110cd1119124fb60629e31af9ca5095c
BLAKE2b-256 3ad11e50f67dd02da764c93afb1a955eeb6926b77724328dd64e299feca55369

See more details on using hashes here.

File details

Details for the file selene_hugr_qis_compiler-0.2.6-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.6-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 860f7082afad87836faafdc8ecc8321d1722856de0465ac8c2d4ac9c86cae01b
MD5 6f97b76f0ca19b4a2af4b73099b3c3f8
BLAKE2b-256 d811e36b444dc74557af8adac321c89adbbc907047441b381c1c43c95e4bae10

See more details on using hashes here.

File details

Details for the file selene_hugr_qis_compiler-0.2.6-cp310-abi3-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.6-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4350b9b5bf142569d1d8cb1cddb9aa73e63d14d477e1e310dc92637f657a4077
MD5 3dc3ceec8659c3f76f34e6a597a79a1b
BLAKE2b-256 a8a75b614a150f01a9835a0357d4e9cae0920d2e680bcef0c5a2d6355031bfc6

See more details on using hashes here.

File details

Details for the file selene_hugr_qis_compiler-0.2.6-cp310-abi3-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.6-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 d85befade2422911d549c0f526dc3d3a1126a1dfb08c35ae44282491611f6065
MD5 6ef08d3784727ab43d639ea977b1d458
BLAKE2b-256 fd06e936979e9ce8dad55e619dc5fe6d7c2aef573f520c091787a0b0169d86d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page