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

Uploaded CPython 3.10+Windows x86-64

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d7f9f2badf4f9044316747a44ee1198209c85b3ebdb6475e18b81de1bbd84694
MD5 cac584402110c70eb4ca607f0fe9f30e
BLAKE2b-256 7d28f7ab4ee8121fb1bbb975b153014a57974e5f8e00362d6f0ddf766aecf112

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc4-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 357034484a13acee5973fbd01996aa1e13a31fd15ac50c4f1ea658c90d780cee
MD5 b68839e86bb466637874ad58833af8f2
BLAKE2b-256 89e22ba0b65578818231a18a477d30a8878bfc04bbb4214f0b0508e238c465b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc4-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1b97696c1b5c8d24b0a05420b75e6a072fd36df44059df56f8fa332664715c29
MD5 ae755bd7bcac1a1125247bd86b683b62
BLAKE2b-256 2abc1673590bd930b7d5a0887c0583210a42397c9fe481b459e6b3a1ddfc25e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc4-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 9fc60f6e31d8a704e1f44f0e3ebe117ac0f3ab7a4d6548f43e65148e53ce2016
MD5 9985a9b7dbedbf835b531381de327a50
BLAKE2b-256 32df12773dc86f85181ed6e5f4ee47a59d348c65c203d5f6447ea7dac758a00d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc4-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 0d3403fe629eb16bad81a6a9e8672b480f618529630ac0169db44e26914e32c3
MD5 d2c1d2a4533f47f50cb56df32443331e
BLAKE2b-256 94c6afb9cc4da5b58e6f08a3c585be1a97e5ffffe503cc36d58abe711d61fb3c

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