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.4.0.tar.gz
(85.0 kB
view hashes)
Built Distribution
guppylang-0.4.0-py3-none-any.whl
(108.0 kB
view hashes)
Close
Hashes for guppylang-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88c43b04a03df8b0f64b05238d2533dbce1386172640506d6d3838bafad1522d |
|
MD5 | bc8271230eb018c73dc445fa6ff26a42 |
|
BLAKE2b-256 | 25d74a316976bec60f833053c7caa6b9aa9aad30686d27886de28f33c998dd3a |