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

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.2-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.2-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.2-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.2-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.2-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 44c2c42ba637529be78ad9a27f5a4cd04d1f9220a18f1ff192082254ada005d0
MD5 d6dd7fb3ec862a1dd0d9978d304e16b8
BLAKE2b-256 03fc67c50643ad442315e21b905c56b9ce1702995005d702f0e4d08afeec9a4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.2-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 24d3ec98a63ccd4cf318e45b25f5aa2a1acc3fa339e0a6cd43f07a3320ee3229
MD5 04d9699bd419e01ce106680b58e50127
BLAKE2b-256 da08491006756e1dcb67afe10ea8264d01a10de0bec063a7192eea1f2168da6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.2-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 72afb183a1eb138c3ba0ded586024e209fd11c425669741756d687742ea4c318
MD5 a4470fea2d09ca6d0a721d9e4d261e9a
BLAKE2b-256 3a5629d092f9d32a5a5e8fb54f3ec614aa4eaa557c0fdb757f52925e6d2c9261

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.2-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 3851c8247bd7c7f48db49f177af6940a9b1cd5cb392702c8f08eb5a958edc6e1
MD5 0a50ee74fe26dc90da52c34fb6c282e2
BLAKE2b-256 98a61730e5592726b603a4624d62f6514b94dc1314e0e427cf12d667f87fe5a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.2-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 e70d699219c003d61979e76612e8497b981f810bfa657bae15fed446c701cf4c
MD5 bf582574459a48e1f4caa1a74616e6b6
BLAKE2b-256 1ff2306f65b652219aaf9ed598b122e5573c2b0d750e9ab7ee438d8c78aeef09

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