Skip to main content

Guppy

pypi codecov py-version

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
from guppylang.std.builtins import owned
from guppylang.std.quantum import cx, h, measure, qubit, x, z


@guppy
def teleport(src: qubit @ owned, tgt: qubit) -> None:
    """Teleports the state in `src` to `tgt`."""
    # Create ancilla and entangle it with src and tgt
    tmp = qubit()
    h(tmp)
    cx(tmp, tgt)
    cx(src, tmp)

    # Apply classical corrections
    h(src)
    if measure(src):
        z(tgt)
    if measure(tmp):
        x(tgt)

teleport.check()

Documentation

🌐 Guppy website

📖 Language guide

📒 Example notebooks

Install

Guppy can be installed via pip. Requires Python >= 3.10.

pip install guppylang

Development

See DEVELOPMENT.md for instructions on setting up the development environment.

Attribution

If you use this software, please cite it using CITATIONS.bib or CITATION.cff (click "Cite this repository" in the About section of the repository landing page).

License

This project is licensed under Apache License, Version 2.0 (LICENCE or http://www.apache.org/licenses/LICENSE-2.0).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

guppylang-1.0.1.tar.gz (90.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

guppylang-1.0.1-py3-none-any.whl (87.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: guppylang-1.0.1.tar.gz
  • Upload date:
  • Size: 90.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for guppylang-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4718a0e1edf6c6545a4718c6c115f87f233f27c4a12794b1b9910a18b3ad2d51
MD5 0fc29f2e37e1f42d0d528bd43995d2e9
BLAKE2b-256 84e386d5b8bf2a076805a6a2268d203ac9ea3a0ec8f55584d892a33523c0db8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for guppylang-1.0.1.tar.gz:

Publisher: python-wheels.yml on Quantinuum/guppylang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: guppylang-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 87.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for guppylang-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e30d9dc609a05a62fa123a712a9e84c4239fbc27dfa623a9f837fb0d18414272
MD5 ec0bbefd923b2906ed31b599283c71a1
BLAKE2b-256 9c4f3e4994927382bd670858bff070974b0a034e479f1a9187e183f53af5dcf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for guppylang-1.0.1-py3-none-any.whl:

Publisher: python-wheels.yml on Quantinuum/guppylang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.1

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page