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.0.tar.gz
(85.8 kB
view details)
Built Distribution
guppylang-0.5.0-py3-none-any.whl
(109.6 kB
view details)
File details
Details for the file guppylang-0.5.0.tar.gz
.
File metadata
- Download URL: guppylang-0.5.0.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 | 18863b02f74138368621ef6dc37b4d240738f34279eaf7b497b3cb5f5ed516f4 |
|
MD5 | 914e31977a3b49db75f1f816cba5ad27 |
|
BLAKE2b-256 | c3af0c3b0a5bf7a574663ab4f8f62abca8143ba306fb6a722891d32b179848d8 |
File details
Details for the file guppylang-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: guppylang-0.5.0-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 | 989af91e61d3140adb7b0fe4a5051e989502ba714d55bfe04093a357a2741176 |
|
MD5 | fada1f4ac4fa73ba2e343f9db19ddcfb |
|
BLAKE2b-256 | acd353ac0ceb5750608da1efdd4f7e74c1b157330167268b8011d946e907176d |