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, qubit, quantum
guppy.load(quantum)
# Teleports the state in `src` to `tgt`.
@guppy
def teleport(src: qubit, tgt: qubit) -> qubit:
# 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
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
guppylang-0.9.0.tar.gz
(96.4 kB
view details)
Built Distribution
guppylang-0.9.0-py3-none-any.whl
(121.5 kB
view details)
File details
Details for the file guppylang-0.9.0.tar.gz
.
File metadata
- Download URL: guppylang-0.9.0.tar.gz
- Upload date:
- Size: 96.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 255cba4133c999c5f7f660c02853f46ffebb01bfca7f7caeb11444996e681e0c |
|
MD5 | 02085b0d8fb3a696397c4a313bc63ac5 |
|
BLAKE2b-256 | 4e9bf0063c88df621e037d628b1253af91d2da9b20ed9e4a9f7b37aa7bd33446 |
File details
Details for the file guppylang-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: guppylang-0.9.0-py3-none-any.whl
- Upload date:
- Size: 121.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c88385759369cffa0da79cb67f86f97f6ea323e32d3ddf00df275c37c970c019 |
|
MD5 | 218719559b297798afe135225588a5e8 |
|
BLAKE2b-256 | 51d140959ecb34cf1deede418958d2e99b80566e53a16e050d76eb82c83a511b |