Guppy (programming language)
| Guppy | |
|---|---|
| File:Guppy-logo color v1.png | |
| Paradigm | Quantum |
| Developer | Quantinuum Ltd. |
| Implementation language | Python |
| License | Apache License 2.0 |
| Website | docs |
Lua error in mw.title.lua at line 392: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal'). Guppy is a quantum programming language embedded in Python.[1][2] The open-source language was released by Quantinuum in 2025.[1][3]
Language
[edit | edit source]Guppy enables quantum computing programming above the gate level using conditional logic and the ability to incorporate any quantum error correction code.[4]
By replacing low-level, gate-by-gate programming with structured, dynamic code, the language is designed to make quantum programming accessible to a broader set of developers.[5]
Features
[edit | edit source]Guppy integrates with existing Python codebases and libraries.
It supports real-time feedback and common code logic, including “if/then” statements and “for” loop structures.[1][6]
Guppy can execute various protocols including magic state distillation and injection, quantum teleportation, and other measurement-based routines with a real-time control system.[1]
Guppy automatically optimizes qubit resource management, allowing for automatic reuse of qubits via dynamic allocation and deallocation.[4][6]
Example
[edit | edit source]The following example from the official library demonstrates how to use Guppy for quantum teleportation.[7]
from guppylang import guppy
from guppylang.std.builtins import owned
from guppylang.std.quantum import cx, h, measure, qubit, x, z
@guppy
def teleport(src: qubit @ owned, tgt: qubit) -> None:
"""Teleports the state in `src` to `tgt`."""
# Create ancilla and entangle it with src and tgt
tmp = qubit()
h(tmp)
cx(tmp, tgt)
cx(src, tmp)
# Apply classical corrections
h(src)
if measure(src):
z(tgt)
if measure(tmp):
x(tgt)
teleport.check()
References
[edit | edit source]- ^ a b c d Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).