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.6.1.tar.gz
(90.8 kB
view details)
Built Distribution
guppylang-0.6.1-py3-none-any.whl
(115.4 kB
view details)
File details
Details for the file guppylang-0.6.1.tar.gz
.
File metadata
- Download URL: guppylang-0.6.1.tar.gz
- Upload date:
- Size: 90.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | efe9baa4f28c318b70af99be373df6bbb53fac637bf681dece30d230ffcf9e81 |
|
MD5 | d9c517fb12850770164ee98f1fffefda |
|
BLAKE2b-256 | 5b158ac19fec62534db5ae494613aadcc83187fe7beaeb27b163417bb1b2679c |
File details
Details for the file guppylang-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: guppylang-0.6.1-py3-none-any.whl
- Upload date:
- Size: 115.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6ece8f72ed87b27bbbcde0083376210d0c59c4d5add1ff42c93310d667177c0 |
|
MD5 | 67e858fb1c5b0f8f73d3f3e5b47c14ed |
|
BLAKE2b-256 | 0d62ac96f7a1f83c0d4d29298db2668dccfe5ed539b500085ec64e8c3a35c176 |