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

Uploaded Source

Built Distribution

guppylang-0.7.0-py3-none-any.whl (119.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: guppylang-0.7.0.tar.gz
  • Upload date:
  • Size: 94.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1024-azure

File hashes

Hashes for guppylang-0.7.0.tar.gz
Algorithm Hash digest
SHA256 16705885f10e5b41f0e571698b9279de03273e37bf861df8586d77a28ecd738b
MD5 c35060600133c0e1c3592cd68427f504
BLAKE2b-256 9e322978e6ecb8ef28331e7dbdcb05acd72d07d58d0712be22b3c30bc395ad1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: guppylang-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 119.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1024-azure

File hashes

Hashes for guppylang-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1afb2e8d9fbcdac5c946a9186f7229ee0e55b7100425a55ad7fafbf69c454d2a
MD5 2e7fb7b725e71f0f6ce6de15db9ba25e
BLAKE2b-256 52e2b332ab1c8571f5a1c6165d29840c7d3d1770a01726e40c592e97b12e78c9

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