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

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.0rc2-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.0rc2-cp310-abi3-manylinux_2_28_aarch64.whl (32.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10+macOS 13.0+ x86-64

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2ec671e25ea21f63a469665b9ee4fab7ffb2e72f173495a5b32d8ccaa247858b
MD5 73e3b560510ee56af8ce2b2d65cb2e3e
BLAKE2b-256 5ee89cc22b4def3478c0c7d7b9aa045c919936e9557dcb1cc3fa4edf527030e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc2-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9d7ab8679d0c2aef8f8d73c55e92c7d957b476407d85d0bf037c3fd1daef5c66
MD5 bca863fe1a1d58c44f82b164bd8470c3
BLAKE2b-256 2f047829baa17139e971c1ce16e56fc12141663722b2d712a2fbf9de66f96d6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc2-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 065f85797131fded035037b8cc606d039d096f2b321696189efaafa51b327d47
MD5 fc438f7af748a03d72b4e01ba8299124
BLAKE2b-256 7fdb65a9f8a23064474aff8efbbeb3d593c04eabf8a2acef987902c19b7f7bce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc2-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 953880edde3a75c1cba6c2fc3ba29e95684b7c944eb968a30bd88f18926926fa
MD5 8cb80ab9d8f63ff613c26da79acd03ee
BLAKE2b-256 c52a06ea8df440c9a65496f01a215893b1591bb7a0e80a76b5f8654e654c8fde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc2-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 098b0a245550a3b09fc02d9f0bebf31d5e5e24c0bb01ef04213d35984e5ed916
MD5 c29212f803514cca2a0430a299ee38d1
BLAKE2b-256 00b5c12ee6aef66184212a3ea62260ef9b81a3aa7d6149c1b7f22159167b2b63

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