shots200
compile
lower
emulate
GuppyBell StateMaximally entangled 2-qubit state
# Python host
from guppylang import guppy

# Quantum kernel
@guppy
def bell() -> tuple[qubit, qubit]:
    q0, q1 = qubit(), qubit()
    h(q0)
    cx(q0, q1)
    return q0, q1

@guppy
def main() -> None:
    q0, q1 = bell()
    c0 = measure(q0)
    c1 = measure(q1)

# Compile
hugr = main.compile()

# Run
main.emulator(n_qubits=2).run()
Guppy is Quantinuum's Python-embedded quantum language — functions decorated with @module.guppy are type-checked and compiled directly to HUGR IR.
HUGR IRmain.compile()

Run the pipeline to generate the HUGR IR graph

TKETpytket Circuit

Run the pipeline to compile the TKET circuit

Selenemain.emulator().run()

Run the pipeline to simulate with Selene