Pythonic quantum-classical programming language
Project description
Guppy is a quantum programming language that is fully embedded into Python. It allows you to write high-level hybrid quantum programs with classical control flow and mid-circuit measurements using Pythonic syntax:
from guppylang import guppy
from guppylang.prelude.quantum import cx, h, measure, qubit, x, z
@guppy
def teleport(src: qubit, tgt: qubit) -> qubit:
"""Teleports the state in `src` to `tgt`."""
# Create ancilla and entangle it with src and tgt
tmp = qubit()
tmp, tgt = cx(h(tmp), tgt)
src, tmp = cx(src, tmp)
# Apply classical corrections
if measure(h(src)):
tgt = z(tgt)
if measure(tmp):
tgt = x(tgt)
return tgt
guppy.compile_module()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file guppylang-0.13.1.tar.gz
.
File metadata
- Download URL: guppylang-0.13.1.tar.gz
- Upload date:
- Size: 338.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7603378322df02761618df5cf2cdf08beb4a399bc7901fa065f35d6076460b34 |
|
MD5 | 36d75c22ad18367bb1915360a6a6362f |
|
BLAKE2b-256 | 64425cfcf05f626644e011d4c0448fd3a582f339cd591c0495aec9a45d25bbea |
Provenance
The following attestation bundles were made for guppylang-0.13.1.tar.gz
:
Publisher:
python-wheels.yml
on CQCL/guppylang
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
guppylang-0.13.1.tar.gz
- Subject digest:
7603378322df02761618df5cf2cdf08beb4a399bc7901fa065f35d6076460b34
- Sigstore transparency entry: 149094550
- Sigstore integration time:
- Predicate type:
File details
Details for the file guppylang-0.13.1-py3-none-any.whl
.
File metadata
- Download URL: guppylang-0.13.1-py3-none-any.whl
- Upload date:
- Size: 167.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 518238ea5349623d89aa7066ce693a10576054bac90e2de6a88a14ac6f2f79a8 |
|
MD5 | 4efe5ffa9bf33c7e41053bf5bf896601 |
|
BLAKE2b-256 | 025bd06153d57a9ed51a536ce01ace04a92ef4636e12bc54aa3cd5a6bbc3cfad |
Provenance
The following attestation bundles were made for guppylang-0.13.1-py3-none-any.whl
:
Publisher:
python-wheels.yml
on CQCL/guppylang
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
guppylang-0.13.1-py3-none-any.whl
- Subject digest:
518238ea5349623d89aa7066ce693a10576054bac90e2de6a88a14ac6f2f79a8
- Sigstore transparency entry: 149094555
- Sigstore integration time:
- Predicate type: