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.2.tar.gz
(90.8 kB
view details)
Built Distribution
guppylang-0.6.2-py3-none-any.whl
(115.4 kB
view details)
File details
Details for the file guppylang-0.6.2.tar.gz
.
File metadata
- Download URL: guppylang-0.6.2.tar.gz
- Upload date:
- Size: 90.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cac30642bc15f71682559c0f863d01c00c62fe0970cee480e63bf09f0708ca7 |
|
MD5 | bf620a54e4035b9c9eb5f56d244448ca |
|
BLAKE2b-256 | d317c7ea7d35edc39889c331d9982e623eae711bbfa50045f17ebccaf37fa0ad |
File details
Details for the file guppylang-0.6.2-py3-none-any.whl
.
File metadata
- Download URL: guppylang-0.6.2-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-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 202344e8a5ae2f463d04b559b0b8bf977a5ae5ccbf7bfb36dc12b13d3eab81fb |
|
MD5 | 62dd4267c3fb289ca06684b0d95e8281 |
|
BLAKE2b-256 | a819bb7a72ada20431715042a378ef352dad779c76530cd6f973210bb79d41b5 |