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.8.1.tar.gz
(95.8 kB
view details)
Built Distribution
guppylang-0.8.1-py3-none-any.whl
(120.9 kB
view details)
File details
Details for the file guppylang-0.8.1.tar.gz
.
File metadata
- Download URL: guppylang-0.8.1.tar.gz
- Upload date:
- Size: 95.8 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 | eea5158ed66d1edc669acadafdb18eac0cdb977b110e658c8000e5f15b6f597d |
|
MD5 | 4c200c4d025f5313d3fdeb56633544f3 |
|
BLAKE2b-256 | 3f3244070bb843b12b4898536a43f105e1563449b80b276934925a9e2134c37e |
File details
Details for the file guppylang-0.8.1-py3-none-any.whl
.
File metadata
- Download URL: guppylang-0.8.1-py3-none-any.whl
- Upload date:
- Size: 120.9 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 | a76b949470c89b129d534b2d52852dcadb875ecaa11abfb147f2ebf80a8eab58 |
|
MD5 | 2f2fbf5a21fe707b3ed1109d6a34b37f |
|
BLAKE2b-256 | 46798b0603990eb3cf4e311e09fac718009e879c872322e83bc387b480a9a2a0 |