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.2.0.tar.gz
(83.1 kB
view hashes)
Built Distribution
guppylang-0.2.0-py3-none-any.whl
(103.0 kB
view hashes)
Close
Hashes for guppylang-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7867defc327dc00a04f1cb5b059eca3db6b253d2573945b44d179d7cd11e557e |
|
MD5 | d9a41abb1afac2f116ee0d52335146dd |
|
BLAKE2b-256 | 4f13c11d69b1cca9ed95ea19ffeface1d82b8860b81de9c47550006604bbf90d |