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

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.3-cp310-abi3-manylinux_2_28_x86_64.whl (34.2 MB view details)

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

selene_hugr_qis_compiler-0.2.3-cp310-abi3-manylinux_2_28_aarch64.whl (33.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

selene_hugr_qis_compiler-0.2.3-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.3-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.3-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 83ab14b2ed4cd59d5cbc6465c767ab2f4925491f7a47814bde9617fd4f693c2e
MD5 ac0e8bd731d37d99945378b216255d9f
BLAKE2b-256 b72dcd7922b7b6ffcad34f614f8629456dfdbe987b730e78a36755c7e72ec6bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.3-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9c11b663a38cb4f663a4a0fab119cad853a1571f429a893aec50f4c88016650f
MD5 6b092284c267c88fb8059ada585f1c1b
BLAKE2b-256 c430efa90d846bfcadb10453ead6a86d437cf3efeffb0d0bc6f04e978e1f569c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.3-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f20d855bc4984d8d9e032eff3a3d65f07b716228f3ad3ff28383b086cadb6a9d
MD5 c0c89d4a2c1dec6f0e04887eb1d41536
BLAKE2b-256 19ce43954952a41b7b53c92ae04f9a4442a6055f00b1c7351775c6605b51a71c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.3-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a22c7ee8470d3d2e94c8ddf36f3c1b966c303d0e91f6ee053bc71b3335f94d9d
MD5 6df6d31c4517b59fcfcd43a5d98688d1
BLAKE2b-256 51b5ba109d40493741fe2c23b48f46d97d6b5aee5f0331133d4b7823288064b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.3-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 af9769ba50d2f25e2a75265eecee3843988b5af95175d7c79d5efb6191f4865d
MD5 860753adace38a56584c0f5f3bc34bf7
BLAKE2b-256 866a22c7460f9c6595e2ecdae786c2030ebf3f7d5fd298027e2da878bdee1e3d

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