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

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.4-cp310-abi3-manylinux_2_28_x86_64.whl (34.2 MB view details)

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

selene_hugr_qis_compiler-0.2.4-cp310-abi3-manylinux_2_28_aarch64.whl (33.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

selene_hugr_qis_compiler-0.2.4-cp310-abi3-macosx_13_0_x86_64.whl (32.5 MB view details)

Uploaded CPython 3.10+macOS 13.0+ x86-64

selene_hugr_qis_compiler-0.2.4-cp310-abi3-macosx_13_0_arm64.whl (29.8 MB view details)

Uploaded CPython 3.10+macOS 13.0+ ARM64

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ede45bd254b71e0798f0911f98f3b7bbb2a28b204a1f548be55fc24ca1a6155f
MD5 d27a03f1706199910b19ce991957ca19
BLAKE2b-256 a26935c81216689a41cc9662a06a3a3b260b9375944d4b294f1e6efebeab427a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.4-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 95114f0254d010a08659e525c63f4a4534952bf91700a4943c9690c3d217fd39
MD5 bc0ab8a48397bfe3b0cc1c8735f4a110
BLAKE2b-256 d04b598df29a9aae9b8564b6654bc9455ac8767e7b8425073afad635a9e8261e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.4-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 300b54fab6d02e23c41f849a389bec5eff30cee07f184e9ff279ec6e3af6d853
MD5 f9b6be45376ea2040a946bf74f78441c
BLAKE2b-256 c6e8336b49900593879bce61edbfb344918856f75b3472c4632e46c090a1bb35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.4-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 835778d3dbdf91b0b7a51e03032638ed14b715c191a95adf991e9ee9b22e1e48
MD5 27b3e70d5e7ba91b5d3bd766d1c7f576
BLAKE2b-256 6af66b00823b6e3e9f68502e5130ed09f3cc58a8d634e95c35d5efbe3ea6cf4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.4-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a0093d38654ad3ce94b8d76849ac635815b06e0b058db9337f228d328bbe6b5b
MD5 b07b5f9ca821df2354e3a45b8af7eb4f
BLAKE2b-256 4f6673cc6dc040f62be6775fedf5ba9aac81ee8a3c6ba6b26adaf3b0899c67b1

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