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

Uploaded Source

Built Distribution

guppylang-0.5.1-py3-none-any.whl (109.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: guppylang-0.5.1.tar.gz
  • Upload date:
  • Size: 85.8 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.5.1.tar.gz
Algorithm Hash digest
SHA256 3136b45a0ad5452ebbf098e909a326d33393088541fc5f966830e2a2d78ef2d0
MD5 5e05122a6b970e772966be1c7d20bf06
BLAKE2b-256 8d6a5ad65218206382e04e9bd1a433d113184ef28d460efd4a4bb7e62462ae63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: guppylang-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 109.5 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.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d688917f83d91b3446159c864281c2cbfc1318e5829d262759fa05c705972224
MD5 7fc7ed5a01fb841c87f9356fe2f3531c
BLAKE2b-256 6fe6fcb2d7b22448ba1b19ddcd4f91fb3340bbd2c9d0e1ba35c9b29b5b236f21

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