Skip to main content

Pythonic quantum-classical programming language

Project description

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 CITATION.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).

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

Uploaded Source

Built Distribution

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

guppylang-0.21.15-py3-none-any.whl (67.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: guppylang-0.21.15.tar.gz
  • Upload date:
  • Size: 70.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for guppylang-0.21.15.tar.gz
Algorithm Hash digest
SHA256 5fbae0b6ce400efec92a977c3fd9ac6d47073559837fcfa409f5572728676e65
MD5 a33f3d9b66558861e9d0a5578be48584
BLAKE2b-256 4189c1c5e4b61711ac0b91b3e0613a0b5ae7f580148784413180b2334cf83729

See more details on using hashes here.

Provenance

The following attestation bundles were made for guppylang-0.21.15.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-0.21.15-py3-none-any.whl.

File metadata

  • Download URL: guppylang-0.21.15-py3-none-any.whl
  • Upload date:
  • Size: 67.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for guppylang-0.21.15-py3-none-any.whl
Algorithm Hash digest
SHA256 0cf3ac26db1e5d04ec2f9bc317bd343bdcd41bb5fd9a5108b9db2ca4b9267830
MD5 0dace54cc738eaacc5eaefb5e9802bbd
BLAKE2b-256 ce13abe6637c898ea798ce0f6686834bf6afeed53fcb1af8f02d66faf4cfa694

See more details on using hashes here.

Provenance

The following attestation bundles were made for guppylang-0.21.15-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.

Supported by

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