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

Uploaded Source

Built Distribution

guppylang-0.3.0-py3-none-any.whl (122.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: guppylang-0.3.0.tar.gz
  • Upload date:
  • Size: 101.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.6 Darwin/22.6.0

File hashes

Hashes for guppylang-0.3.0.tar.gz
Algorithm Hash digest
SHA256 56c3769990f2dba041b134cd09d6730a71237d4dc2f5fd60d8aa64cd8bbd5c2b
MD5 f3adcd09fc0666cb36909fb56a910e77
BLAKE2b-256 da82267ec067c807f866ce17701339b085656906f0b7450fb4cbfa29b28d3f8b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: guppylang-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 122.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.6 Darwin/22.6.0

File hashes

Hashes for guppylang-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e78df844ac480818bfe482111eac02a51dcc65a0614f2fe312c62dee8977085
MD5 883854bbd2be0e87754911e78ef71c5e
BLAKE2b-256 243e4bf35de16376f213dbbe6d42f9866be32ea2d5a8a765f0453fe05ef4e633

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