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

Uploaded Source

Built Distribution

guppylang-0.2.0-py3-none-any.whl (103.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for guppylang-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e80d7be0156f23177ac9faa11c48790e62cb8424387cb4424428d3017b886e60
MD5 b23788682be40c21926fc6bcef0dbcb3
BLAKE2b-256 73b6a102f9644e53dd0b1ec88f75c4f372290ecf304fe39475297b4e4f225c88

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for guppylang-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7867defc327dc00a04f1cb5b059eca3db6b253d2573945b44d179d7cd11e557e
MD5 d9a41abb1afac2f116ee0d52335146dd
BLAKE2b-256 4f13c11d69b1cca9ed95ea19ffeface1d82b8860b81de9c47550006604bbf90d

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