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

Uploaded CPython 3.10+Windows x86-64

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 085bcbcb9a10aabcf104f9dfb386d7437798774b66c528644a1b0bb0441f2981
MD5 3f9ab7a09af3205ce8dfeecb08f635de
BLAKE2b-256 8606f6382af8547725a359f774928b27dbb5cea1196556f4155b6e15390a5ace

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a4-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 36a4c3017c56f4ab69a376c3dec0988ebc894e6e6f84e337f30da6a3bba7bf9a
MD5 2f21c55a34d8eb2ebb9d85d93335f708
BLAKE2b-256 4c1d27b97fc2f60eca39426fa52e9619b9cfdcb5da93f253fda07d06b50282ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a4-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 44be7680376a2d11ff299b00dfb0a35fde42f41b4131896abf4810ceaafca372
MD5 677dbded718a8ea8b527855824967d36
BLAKE2b-256 7c099e0e2f04c79a4f354579ad92ab3b3c85044656dce31c4816490527fec126

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a4-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 946422dad2b931ce469b643abf2d968e7005edb01737aa2c8677c20c8c0b1785
MD5 9c8b579370f3afa5fd693217c47df461
BLAKE2b-256 d0c022be01ba330d0237d0eacf199c69f8373b26acbbeb98864a31b34fbf45f9

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