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

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.9-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.9-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.9-cp310-abi3-macosx_13_0_x86_64.whl (32.5 MB view details)

Uploaded CPython 3.10+macOS 13.0+ x86-64

selene_hugr_qis_compiler-0.2.9-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.9-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.9-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 988ad30361be977ae74bebb99a5f58334e2fd49e03cc6821b3358fd3d14176f2
MD5 fcd06c7a6a300d4b9f628f7e7320aced
BLAKE2b-256 8f1a0101984c7fb664c1edbe7c7ea250edb345ea89a3d686f09be006eeb68ca0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.9-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e339300b73bfd2530465b76054adf96ec52fb58c9e3911790382136b4e18147b
MD5 8818eccbe47c5f79777fb834ee3e3a5e
BLAKE2b-256 34afb626eb03524be0ad7e6cdc4dbcf609ea3cfebfe251ddc19376da084c2bb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.9-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 794937a2289b5f31ccfaaa6cc61598a1ed3381d202459768bc35be3805654ac0
MD5 e7130fcdcc760b0c41e164a9b463e383
BLAKE2b-256 9fd6309cef12fb0c4705d9073b032ad905e5b937471b48d9faaa8cef060da88d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.9-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 5fb21dff8a06e0cae0d6d95eeceb71b2b587ec53975e7f669d1219e0b3862e19
MD5 6a2a0bbb36d7982a8028ef512a6f7943
BLAKE2b-256 13cbcd1b7764f7eb445900e8b4e08a30a4c17432df8eee7aae6bf247f54abc84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.9-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 96d7abf39e9796af77aae94f0f378a54325868b6cd8874d350f0f87995b82639
MD5 bc62d42f6109354bc4729f01dbdddc17
BLAKE2b-256 babc925d610960692ff68f8f212525081c2df9e1093c778f88ad2cb85bcb3294

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