Guppy (programming language)

Quantum programming language From Wikipedia, the free encyclopedia

Guppy is a quantum programming language embedded in Python.[1][2] The open-source language was released by Quantinuum in 2025.[1][3]

DeveloperQuantinuum Ltd.
Implementation languagePython
Quick facts Paradigm, Developer ...
Guppy
ParadigmQuantum
DeveloperQuantinuum Ltd.
Implementation languagePython
LicenseApache License 2.0
Websitedocs.quantinuum.com/guppy/
Close

Language

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

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

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

Related Articles

Wikiwand AI