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.6.0.tar.gz
(90.7 kB
view details)
Built Distribution
guppylang-0.6.0-py3-none-any.whl
(115.4 kB
view details)
File details
Details for the file guppylang-0.6.0.tar.gz
.
File metadata
- Download URL: guppylang-0.6.0.tar.gz
- Upload date:
- Size: 90.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ba2bbed76d099c907c035abd791ff95a1ec2026120444d0681068e8dc1a85ac |
|
MD5 | 8a88b1befb85d9ff17bcce9aa9a82ace |
|
BLAKE2b-256 | d6c3106130d9f41e75d8f703e17e7edcf2a683285e19647d76a2133e595f63ce |
File details
Details for the file guppylang-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: guppylang-0.6.0-py3-none-any.whl
- Upload date:
- Size: 115.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b56df0c2a214c29ad4ea6b47fd2700d78c774e55d35e26f37229810606cf59c |
|
MD5 | ff86673a17f41ce87779117a0665fa6c |
|
BLAKE2b-256 | 6b2cb89ae1cf63c66afb137964189e25b44b4716bcdcc9f2f87249dde66da375 |