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.0a3-cp310-abi3-win_amd64.whl (28.6 MB view details)

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-manylinux_2_28_x86_64.whl (33.2 MB view details)

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

selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-macosx_13_0_x86_64.whl (31.5 MB view details)

Uploaded CPython 3.10+macOS 13.0+ x86-64

selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-macosx_13_0_arm64.whl (28.9 MB view details)

Uploaded CPython 3.10+macOS 13.0+ ARM64

File details

Details for the file selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 278eb4dd030463946cfaeccc8ab836d0b6164b1b916f1081581dea6a363f57bf
MD5 915d4ddff1e4a0cd29458b3cb78197b7
BLAKE2b-256 8ed2597c1d5083f1b9398c318c72ddc3cb2afe4bd5766cdbff1d7de94c04ca82

See more details on using hashes here.

File details

Details for the file selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4e3c4ede566f7868fe0d89ea9888535b950cbe8c4509ea628a40200861e5149e
MD5 e9b0412131e636272b6bf4570c2d9f0c
BLAKE2b-256 99c168d5661a577c6e2ff82ec148ddaa7ac9bcb7a6534a5e8720a55340aac26a

See more details on using hashes here.

File details

Details for the file selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 936d6f4dc2d45f4c5c9683e4f64716841fa879883cbdb888e0161edcd27c71d3
MD5 0e44ea1dae6abd25d06aadc6de009315
BLAKE2b-256 384958683761a69ed239fc8040925260524f2323e1e56bcd1adc06122d9dfa7d

See more details on using hashes here.

File details

Details for the file selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a3-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 f58bb1746f7810c16192ba4a3e5374d6376878a24e43695667c0560dd6af624a
MD5 96f8909fec9d4b186840d37c0a085893
BLAKE2b-256 029be475e2e50f2425da789fef876668d77a3683a062f2ab03cd659cd0df6af0

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