ProductBlogAlgorithmsAboutSign inSign up

Quick Example

Quantum Teleportation: Quantum Circuit Example

Coherent demonstration of qubit-state transfer

What this example teaches

Explore coherent state transfer with deferred measurement.

Expected result

For the fixed |+> input, all eight browser basis outcomes have probability 1/8. The recipient q2 is |+>: measuring q2 in the X basis returns + with probability 1. Basis counts alone do not verify transfer.

Browser bit strings list physical wires q0 first, including auxiliary wires. Native classical-register strings can use another order; inspect the declared measurements.

These are ideal probabilities. Sampled frequencies fluctuate when more than one outcome is possible; they need not match percentages exactly. An ideal outcome with probability 100% has no finite-shot variation. Hardware noise is a separate effect.

Try the example

Open Run in Marqov →

The link opens the editor. Save existing work, then choose Examples → Quantum Teleportation → framework. Click Run, choose an available browser simulator, then click Run in browser. The link does not preselect or execute the example.

Scope and limitations

  • This is a coherent deferred-measurement demonstration, not classical feed-forward between spatially separated devices.

These expected answers describe the fixed circuit. This page does not establish a completed hosted or hardware run. Read the user guide for this example.

Inspect and download the circuit

Inspect the same fixed circuit in five frameworks. Browser execution translates supported circuit definitions into OpenQASM; it does not run general Python. Outside Marqov, Qiskit, Cirq, and Marqov snippets need a separate simulator invocation. PennyLane invokes its QNode and stores sampled counts in result.

OpenQASM
// Quantum Teleportation — coherent deferred-measurement demonstration of |+> transfer
// Joint quantum gates are used; this does not demonstrate separated-party communication.
OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
creg c[3];

// Prepare state to teleport: |+>
h q[0];

// Create Bell pair between q[1] and q[2]
h q[1];
cx q[1],q[2];

// Bell-basis transform (measurements deferred)
cx q[0],q[1];
h q[0];

// Coherent corrections controlled by qubits; not classical feedforward
cx q[1],q[2];
cz q[0],q[2];

measure q -> c;
Download OpenQASM circuit
Qiskit
# Quantum Teleportation — coherent deferred-measurement demonstration of |+> transfer
# Joint quantum gates are used; this does not demonstrate separated-party communication.
from qiskit import QuantumCircuit

qc = QuantumCircuit(3, 3)

# Prepare state to teleport: |+>
qc.h(0)

# Create Bell pair between q1 and q2
qc.h(1)
qc.cx(1, 2)

# Bell-basis transform (measurements deferred)
qc.cx(0, 1)
qc.h(0)

# Coherent corrections controlled by qubits; not classical feedforward
qc.cx(1, 2)
qc.cz(0, 2)

qc.measure([0, 1, 2], [0, 1, 2])
Download Qiskit circuit
Cirq
# Quantum Teleportation — coherent deferred-measurement demonstration of |+> transfer
# Joint quantum gates are used; this does not demonstrate separated-party communication.
import cirq

q0, q1, q2 = cirq.LineQubit.range(3)
circuit = cirq.Circuit([
    # Prepare state to teleport: |+>
    cirq.H(q0),
    # Create Bell pair
    cirq.H(q1),
    cirq.CNOT(q1, q2),
    # Bell-basis transform (measurements deferred)
    cirq.CNOT(q0, q1),
    cirq.H(q0),
    # Coherent corrections controlled by qubits; not classical feedforward
    cirq.CNOT(q1, q2),
    cirq.CZ(q0, q2),
    cirq.measure(q0, q1, q2, key="result"),
])
Download Cirq circuit
PennyLane
# Quantum Teleportation — coherent deferred-measurement demonstration of |+> transfer
# Joint quantum gates are used; this does not demonstrate separated-party communication.
import pennylane as qml

dev = qml.device("default.qubit", wires=3, shots=1000)

@qml.qnode(dev)
def teleportation():
    # Prepare state to teleport: |+>
    qml.Hadamard(wires=0)
    # Create Bell pair
    qml.Hadamard(wires=1)
    qml.CNOT(wires=[1, 2])
    # Bell-basis transform (measurements deferred)
    qml.CNOT(wires=[0, 1])
    qml.Hadamard(wires=0)
    # Coherent corrections controlled by qubits; not classical feedforward
    qml.CNOT(wires=[1, 2])
    qml.CZ(wires=[0, 2])
    return qml.counts()

result = teleportation()
Download PennyLane circuit
Marqov
# Quantum Teleportation — coherent deferred-measurement demonstration of |+> transfer
# Joint quantum gates are used; this does not demonstrate separated-party communication.
from marqov import Circuit

circuit = (
    Circuit()
    .h(0)           # Prepare |+>
    .h(1).cnot(1, 2)  # Bell pair
    .cnot(0, 1).h(0)  # Bell-basis transform (measurements deferred)
    .cnot(1, 2).cz(0, 2)  # Coherent corrections; not classical feedforward
)
Download Marqov circuit

Sources and provenance

These references explain the concept and gate conventions. The snippets originate in Marqov's internal example collection; an upstream code attribution has not been established.

Snapshot identity
Source revision
df5a80cd474144684bf69dbda237b28ce40cc48c
Example version
b91cbaacb42be44788b59a78f81352c4afda205f8c7db47fc403615af41a592b

The source revision identifies the editor collection used for this snapshot. The example version identifies its five exact code variants; neither is evidence of a hosted run.

Go deeper

For a paper-based experiment with scientific comparisons and execution evidence, read Research Replications. Its published scope and availability are separate from this small teaching circuit.

Explore all twelve Quick Examples →