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

Uploaded CPython 3.10+Windows x86-64

selene_hugr_qis_compiler-0.2.0a2-cp310-abi3-manylinux_2_28_x86_64.whl (33.1 MB view details)

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

selene_hugr_qis_compiler-0.2.0a2-cp310-abi3-macosx_13_0_x86_64.whl (31.5 MB view details)

Uploaded CPython 3.10+macOS 13.0+ x86-64

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 067de11fff004f02b93de633e5e6d62081e9789771d1f6f5c75c388500c92cf7
MD5 0eadb2b7c49c1b3dde4474df9156df23
BLAKE2b-256 1eeece44a5db1bf3a495d251df83e8875a2fd5049bde0429361312115eadb4b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a2-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c6ac8bec16e95f96cbdde53397ee18ad52b32aa7fd38cf2be1adcb42ecb09454
MD5 f5525ba89cd9077a79a40e7ae5ff3dde
BLAKE2b-256 a1f836034470c91b372dc2f8e3ec4c2552706eac6897c48b5d4e35d840aea1d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a2-cp310-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 d87bc8af7a659edeb59ee054395d0e7db29062798172f34ed91b807f1d271960
MD5 775496d68dde6c3417786782e850b28f
BLAKE2b-256 cfc74426ff899b25b84ca085d6ec913cecd5844b83dbde1ce518afbc6fd2652f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for selene_hugr_qis_compiler-0.2.0a2-cp310-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a358a8817e89bcb5dd3ecb776192b89b5fb5f3d26c851d54e5ec860594575d9f
MD5 995a5c3e307cb32f1ab0e58b33709af9
BLAKE2b-256 0f4817e945c271feb9892f4ee71541785bc7557502b1ce37383cbea2a59b7627

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