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

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.0rc5-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.0rc5-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.0rc5-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.0rc5-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.0rc5-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a98e4cc3f27cec5a16235c099e2c05f8c338e7b7cae1b80e908c7659ba141aa0
MD5 f31e5978836b6d89e0db7da182b968d8
BLAKE2b-256 5b3ce7cfade10d15f5908a6edee50732d34012990674ac743406f3a0232275ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc5-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a667920c73508a80d2e1c4800b2ceb2a6b931cc6bb8a71af86c731ed1baa25b1
MD5 d4a860c686056aa53cccf8d32920cafe
BLAKE2b-256 87729311c234f8dd679d7a8202fa6cc3327caf843acae35875d7efba5a42208d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc5-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9247303b45127135909938e1a9a27868832cf0ea498a01ead205edc0122ee616
MD5 262717913826f4b3a27cec69678990b3
BLAKE2b-256 479ce71a3bd9f82dfad5f7db2a0f73b9fe5fd46f4ac00d8d1cbac00df36c4375

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc5-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 73b8c5cc73d2eedd2f38d88175cc0f5cf1108ba82a33dbb1d595720bde47e2bc
MD5 48c3e7985d09f05d13cebd6cb164175d
BLAKE2b-256 49bcdc2fe26a3e5929056feb4f08b3ee42fdaeede154f58b82e316b83873bc19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc5-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 e7d93f445b6bd4aaff4b8d897a1a9585f4e4a9fc01653a18366e8db67636aa6d
MD5 4c73f62dcb6630d7bc3248a033583513
BLAKE2b-256 f87fe37a8036e5b9a9bf7b8ab6c680e15bccd2076437246db4595f2bdd66476b

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