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.5.2.tar.gz
(85.8 kB
view details)
Built Distribution
guppylang-0.5.2-py3-none-any.whl
(109.6 kB
view details)
File details
Details for the file guppylang-0.5.2.tar.gz
.
File metadata
- Download URL: guppylang-0.5.2.tar.gz
- Upload date:
- Size: 85.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7716e5fa15190f9c3cadaec363f4f1a59660251cb7c45b180d96500cec9346f |
|
MD5 | 71d5758068e218ea230cdbf06cec1655 |
|
BLAKE2b-256 | d671351f4f5724c6e17b52077d3130161b5a57635a48e1d404b306a258314856 |
File details
Details for the file guppylang-0.5.2-py3-none-any.whl
.
File metadata
- Download URL: guppylang-0.5.2-py3-none-any.whl
- Upload date:
- Size: 109.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc7f397869c96280fb19ed1eb7ef55e6a3198235e73dabf937cea106e91ee1f4 |
|
MD5 | 4eeb13d8d9e99a1e1d29d205bb7b1d0d |
|
BLAKE2b-256 | 18fa32f9ab7d4ebec72d34ec05040a86ca9cc992b02462bb3c807d0d455abb3e |