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

Uploaded Source

Built Distribution

guppylang-0.4.0-py3-none-any.whl (108.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for guppylang-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8be8dab33d2375b110fea7138f065852f5c2439d68fb4d70cdf88c789984d968
MD5 0b7c0b8665e2b5cff36e38cd5a521912
BLAKE2b-256 0fa69a0c10b8b016f376f11425ae6b7f596795dc6349e8721b08f57ff003b08d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for guppylang-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88c43b04a03df8b0f64b05238d2533dbce1386172640506d6d3838bafad1522d
MD5 bc8271230eb018c73dc445fa6ff26a42
BLAKE2b-256 25d74a316976bec60f833053c7caa6b9aa9aad30686d27886de28f33c998dd3a

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