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.8.0.tar.gz
(95.8 kB
view details)
Built Distribution
guppylang-0.8.0-py3-none-any.whl
(120.9 kB
view details)
File details
Details for the file guppylang-0.8.0.tar.gz
.
File metadata
- Download URL: guppylang-0.8.0.tar.gz
- Upload date:
- Size: 95.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0eb36cb528f39b247c19ab1f16b7be09014e552dfb1e9f25416684e9f23d9f89 |
|
MD5 | 6618b3eb7e6f54431c62f7c926d81d96 |
|
BLAKE2b-256 | 717c697c0c8603bab0040708b4ebec9116a6260843fb5dc94a480f88607e79ed |
File details
Details for the file guppylang-0.8.0-py3-none-any.whl
.
File metadata
- Download URL: guppylang-0.8.0-py3-none-any.whl
- Upload date:
- Size: 120.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1687991d7da986498d9e10a7d8d11f364187c7b9344ae60eedb0c18642fd55a9 |
|
MD5 | 2158228979a6b11bf9a94802b04a907c |
|
BLAKE2b-256 | b6ad39fef4e5dd817f17cb0a5ef6c30cdaabca290eeb36878774b8bbefdcc741 |