Skip to main content

A Python frontend for compiling HUGR to Quantinuum's QIS.

Reason this release was yanked:

Accidentally broke HUGR validation

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

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.8-cp310-abi3-manylinux_2_28_x86_64.whl (34.3 MB view details)

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

selene_hugr_qis_compiler-0.2.8-cp310-abi3-manylinux_2_28_aarch64.whl (33.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

selene_hugr_qis_compiler-0.2.8-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.8-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.8-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e4e4a95a8a0a65ac9b1fef18c98995dee7befefac725a1dba1930b6905320dc9
MD5 56409984fc00047e47f9c6338faa3cd9
BLAKE2b-256 b23fe52cd673e8d5095c440a75677d68734b8c91e736335edb901e40921c48ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.8-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c0341a0ed4a53334dc328ab4346de41b9d579ce85d5ff7d655302d87291f1d64
MD5 97de5ba3b8e2e5d4961e6d9abd9a27ba
BLAKE2b-256 1608782e3ffa554fef4040d12e66d147b4ff66bf91daf5874d0f333903fa361b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.8-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bc7b497577c901e50da362b96fedf3aadd61425981eaca5e7269fecb962aef78
MD5 3df4235e239f31cc87c6adb9fbb69e7c
BLAKE2b-256 de09616f9bf15ce335c3e3fa135cf4a0d5a16f4ce23b86cd55799369544ea590

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.8-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 7842b1046442056198c2ccf334c7ceb9e97c598d18cb95cba626441479ef9d10
MD5 c4e1d714b42d0463d3fa74898561bc29
BLAKE2b-256 61cc06f19a090915b093e9c4267d318acf4bc749df6c88f7a6192e5309ce845f

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