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

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-1.0.0a3.tar.gz (72.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.0a3-py3-none-any.whl (69.1 kB view details)

Uploaded Python 3

File details

Details for the file guppylang-1.0.0a3.tar.gz.

File metadata

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

File hashes

Hashes for guppylang-1.0.0a3.tar.gz
Algorithm Hash digest
SHA256 f2a09dfa0f116fb4190fa60df51f74794d3a0144fb74e6907e21dce277fda647
MD5 f9428ead096657c710ef60c849593ffb
BLAKE2b-256 a23c9aa9f4d034f91e8c026a493ba346ed2e825f6ddccb8e3c8f0fe1d011a6dd

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for guppylang-1.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 d87c90e5bebc795080656d318243244aa22e3fc03c03c9ebb51288d69b6a3b38
MD5 a606b5d0b16996c63334aad9c1ea990c
BLAKE2b-256 62c18758acda01c0699e1f9a7a54d0c72c8f552ddf3e91d9f2e6e57a80b28ffa

See more details on using hashes here.

Provenance

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