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

Uploaded CPython 3.10+Windows x86-64

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 feb717adaa8078d5966f53d11655a2cf58fca60d3da7b783e77c21fbad5c61a7
MD5 b381555f1b1dba89fc8a3ac570d242b1
BLAKE2b-256 6df7c3d3790792a049bb47fae5a56b0fbd4d8d048bf7fe333a78e24754b6398a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc1-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1be97c66e2e28f39613260ff1808b27c66755d129f88c4e441b118d3ce446b8a
MD5 5919a4cc2ca52fce86304b0edc94eec3
BLAKE2b-256 234aa8275bed75bed3ab91cbb2da5239bf9a7dabddf125205bbea6b6cde9fe83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc1-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1e7738bead69350cece8ec9f50529c97ed82aa7bfffeb79120e65d2dfb1449f4
MD5 40867baadbe3a297329a9a08d0151e04
BLAKE2b-256 6d86a4a28191fee4793332c6fbb1c768131445c566bded2c04e9f15c8003afd0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc1-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f2218a6ae4b641fa2696cfe297323664b5554ae0fbf3fac9b90bd9e9c2963511
MD5 380da03cf4f4de34ff95f4b316da7016
BLAKE2b-256 c4594a5fc1c136cad30115bafdf212ad88d16d9489ef42e8bdc0076ee28e4dec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc1-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 919fcfc95a3c37fbb44dcb753a8281f62f2611a658be64f44b99d51b2b79b64f
MD5 5acab6918f926b1089066950e11cf361
BLAKE2b-256 24ee01422669fbb28581374b8d5413d8aa8e8541b4702479eb1994fa16f18ce6

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