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

Uploaded CPython 3.10+Windows x86-64

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a7a1b2a2f4e05646518ff93d646b419be8eb0a33f08c057854a61e19ccfa44a6
MD5 db9ae25a53ebe509884c88bb57c15fa6
BLAKE2b-256 5c342ef445269de8237d2ddaec5df623f5f139184844bd17c10165f0c64bc27f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc3-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fa2e4c007c025f0fecf586f8deb58ed3761c941720ed1e340da57dd3ab6929ee
MD5 dd427c37c7044d91607f0a90ee2cb4ab
BLAKE2b-256 02ad3980eb8413b8d4ccec25dac81729fdc65f1745c405df352db631c095bbb8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc3-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5c40e3890e4521ead8a865843c3089becab1226eb150ce20639695ecbc7e6b75
MD5 dd8bf52824037a509a322e0fa1c22e77
BLAKE2b-256 57c93b804db6fd2048956e93bf8fcdb68a5f5ae25b889e167d09e7031acb0434

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc3-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a8d974f7f8e6829c101cec17c29bc739d5d0c54ef4a2e82452d4ea7487093efc
MD5 7008062dc4df1c424a6bdc9bb35144c7
BLAKE2b-256 0819699496915965e16476a43b5c5fa9d6712a1216e9a490f40c4079d97ef956

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0rc3-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 e89e3c10efb690042a86f75fd444a9866093e312d5d27fa7c2b4c1a5812d7ffa
MD5 961b121672355d12233fa0ba16365b5d
BLAKE2b-256 ff069069aeb653a9d046a2ebafe61a939a37cdb178aa881b747a54b5ebf8e5e7

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