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.0.tar.gz
.
File metadata
- Download URL: guppylang-0.13.0.tar.gz
- Upload date:
- Size: 337.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8bbe5fc1c42a4225c2715ba76d5dc1f7f0c56b9b29590f0c03bc54d54ff359b |
|
MD5 | a2baf287c2cd46fec4332e39feb987fd |
|
BLAKE2b-256 | 3a5c7799f3672bfea52103b74237bde607c4613360be64396d7c3c950bec3673 |
Provenance
The following attestation bundles were made for guppylang-0.13.0.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.0.tar.gz
- Subject digest:
d8bbe5fc1c42a4225c2715ba76d5dc1f7f0c56b9b29590f0c03bc54d54ff359b
- Sigstore transparency entry: 148424110
- Sigstore integration time:
- Predicate type:
File details
Details for the file guppylang-0.13.0-py3-none-any.whl
.
File metadata
- Download URL: guppylang-0.13.0-py3-none-any.whl
- Upload date:
- Size: 166.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 | 8dbc7f5c9f51222ec1b8c81ef4eb9f9af3841e0fdec0f23a7ce3480df198f43a |
|
MD5 | 550e8bbe5f6fbf0d76e5af1231f5e6ea |
|
BLAKE2b-256 | a11d0ca70b23cad31ef0f9e58c7c8976b14ab97b9338e55733e6b340c2f6f4af |
Provenance
The following attestation bundles were made for guppylang-0.13.0-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.0-py3-none-any.whl
- Subject digest:
8dbc7f5c9f51222ec1b8c81ef4eb9f9af3841e0fdec0f23a7ce3480df198f43a
- Sigstore transparency entry: 148424112
- Sigstore integration time:
- Predicate type: