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.5-cp310-abi3-win_amd64.whl (29.7 MB view details)

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.5-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.5-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.5-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.5-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.5-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ee5f72d287c95dc231690c70b248c2283877e82ade8a1f612ec9d82329cdd647
MD5 3662cbed8f7f506415dc5dee951b36f0
BLAKE2b-256 d0113ffa7e0ffc8db38356606afa0211efcc393c8eefbd7d98dac1a7e5ea7853

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.5-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 66f11cf182d5b6e451ef7742e1b7057dfb94b18770c8664ec09d896d142589c3
MD5 81a55a93de9c4626ba534eb5392e2858
BLAKE2b-256 c93feba5186d414422a39ace5a9130eb9b64c660e52915383140dce47642e732

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.5-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a2feaa540a55a1eb4f55560047490972792c5f1566001d36b7255ef9278ab99a
MD5 3e6c434513c052825df6ee77116a5e3f
BLAKE2b-256 13f8991dcf416d532fb615217bd7e36bf6e644902996e98901d98da01451f7bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.5-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 933c9c4442ca3b4a417207a07eb060ec1f0c4e067ac97b3e17d7ddded56706bc
MD5 14c5b7cc88fc9053aea60000e41b818d
BLAKE2b-256 d59779cbbad3145f764447271a06ad3249f0e3a56c038737ff88a2540c5e7da7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.5-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 47dcfcffe22c25c1d86d76a13ecd482fa9129d0f27a0a81fc05bfaf950466d52
MD5 ed3a93ebe2dd7cc792e503f27f9abc14
BLAKE2b-256 b700157bdf40450d001e4f79b123daa5dad2c87df3a47a6106ec6a12edae45d0

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