Skip to main content

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_all(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


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.10.0.tar.gz (302.2 kB view details)

Uploaded Source

Built Distribution

guppylang-0.10.0-py3-none-any.whl (147.1 kB view details)

Uploaded Python 3

File details

Details for the file guppylang-0.10.0.tar.gz.

File metadata

  • Download URL: guppylang-0.10.0.tar.gz
  • Upload date:
  • Size: 302.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for guppylang-0.10.0.tar.gz
Algorithm Hash digest
SHA256 e08af3de78ec40d45a4cc10440a80ad405bd7389cbbf06b34a8b6e10f538f867
MD5 208353b661a71a818fa76ebc65ef929b
BLAKE2b-256 dc3d4143a847807039b408c85a2cfa4118e6c60a69d2a51b254b52c7588f2986

See more details on using hashes here.

File details

Details for the file guppylang-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: guppylang-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 147.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for guppylang-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc29a398b231ec25ff3223d3196ba30e0cf653806a9105f328ef2efe2f482fc8
MD5 fb903db8d3d3f3fb01b1f87de7f568f7
BLAKE2b-256 6ecb9aa4ecd941d5958653722267eb7aa853fda3cb2ffc32aab71445f49d43e8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page