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

Uploaded CPython 3.10+Windows x86-64

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

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

selene_hugr_qis_compiler-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl (32.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10+macOS 13.0+ x86-64

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

Uploaded CPython 3.10+macOS 13.0+ ARM64

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 32a9471626f26c9844618f3fe4fd7ec82103949961ee62e1512e7514afd3eb8f
MD5 bb59162f8473e8bf783162ffdc9753e8
BLAKE2b-256 12eca503595644750d7183c0fb5cc1565259413aea79a752bebfb0c513c17640

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4d02536165d24a54608f00ee6675058dcd5f3098f54bd9bab16f912759105e8b
MD5 6d370e0ec2cd181603b8d63036b2db17
BLAKE2b-256 34c501162052e4c955eef3282077a7153529fc83eeaaad948ce4d149423320f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 949e00ba7f92e3c0fe55b9370a1e30ad0f2d62d1fc52d43216ab05ea7d0c7243
MD5 19519c4c4b1caf35b7a80b486cbbaae9
BLAKE2b-256 7f2bb97785fd47bd8518d3488bdd0374f09f16419b5759966312c22a0c3d5663

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 5e6fa02b5fd9288a7014b0b59e2922782722ac5696258759751af883293affad
MD5 8fed46033e4d15199dfe79755138d0e7
BLAKE2b-256 105cf7e71298c5c8da2d50b8ed549ac4dcd26b61e74d562a676d975ec82f0f4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 e01471ad92f9069c6a5c63f9aeaada56376a7c9edaaf6bb218e0e3f6142fcaab
MD5 265cec1c99d7f0f3309d698555ba7034
BLAKE2b-256 ce4533b1bb93dd071edc297614ee85d5e8728d46ae042bec4838b64cf4e93769

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