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

Uploaded CPython 3.10+Windows x86-64

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc6-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3cfc731fd7f6e10dfd423728a8660797b447c429af639db911fc9ae4cfc5cff2
MD5 dec87ace9266041c7f5de94c2abfc55a
BLAKE2b-256 f6eccd41c2c452ee8ce24c52809ed7a1d779033964f0584769c0c32f9655c107

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc6-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0c2488f8e3511cf364ed77187dc47f2b418c63da3ad45cbd2c58285ed5fc195b
MD5 c0f1d36f6126a562ab2fc689e8d1da7b
BLAKE2b-256 68d915005965ca0e5d9e17e947d1fbb05ba3485c7d9824ef7682fb8881a48e6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc6-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d18d24e1d44568a2aa26a2b0ff0f33695d8aa4aefae19bb81efe2182f0b46adf
MD5 34dd81cff69ddbb58aa9d8d33f8118d4
BLAKE2b-256 093e8e4de7001e07ae71d47ba1ecd50f884138e290ac3cb8b241afbc950195d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc6-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a9c159eb33beaffcdcd288d70126f999518218b1cb95b7a26cce5721b35b8522
MD5 7d4a5aa793e5e56301509666a177c2f3
BLAKE2b-256 43fc0347036fd8dc47c86b233bc43dd0ff01cfe93dcd0ad61b4bdbb7aec4b9e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc6-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 3aa1e3a032277553e55c87ee0e0b609bc28a74ed766ee5ead8aff0fb6192ece8
MD5 fc7afbd6ede245f774c55cc2ae4bb60b
BLAKE2b-256 ea00ce3f4e6104b60b68d94b1c869cbbc99f90fb95893c86fc300c9612b99b82

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