Every circuit below was executed on this service, and every one links to a certificate from that exact run. The certificate states how far the result can be from the truth, and zcc-verify recomputes that figure without an account and without calling us.
The algorithms every course covers. Each one loads in the console with the right engine already chosen, so you can run it without writing code.
Entanglement
GHZ and Bell states
Put every qubit into one entangled state, where measuring any of them decides the rest.
What the run returned
Only all-zeros and all-ones appear. A GHZ state has no odd-parity outcomes, so anything else would be a bug.
clifford3 qubits
OPENQASM 2.0;
include "qelib1.inc";
// GHZ state: one Hadamard fans out through a chain of CNOTs so all three
// qubits become one linked whole. Measure and they always agree: 000 or 111.
qreg q[3];
creg c[3];
h q[0];
cx q[0],q[1];
cx q[1],q[2];
measure q -> c;
Find a marked item in an unstructured set with quadratically fewer queries than checking each one.
What the run returned
The marked state came back on all 1,000 shots. At this size one iteration is exact, so certainty is the correct outcome rather than a lucky run.
clifford2 qubits
OPENQASM 2.0;
include "qelib1.inc";
// Grover search over 2 qubits (4 items). The oracle marks the target |11>,
// the diffusion step amplifies it, and one iteration finds it with certainty.
qreg q[2];
creg c[2];
h q[0];
h q[1];
// oracle: flip the phase of |11>
cz q[0],q[1];
// diffusion (amplitude amplification)
h q[0];
h q[1];
x q[0];
x q[1];
cz q[0],q[1];
x q[0];
x q[1];
h q[0];
h q[1];
measure q -> c;
Split a graph so as many edges as possible cross the cut, using a variational circuit.
What the run returned
The two dominant outcomes are the alternating assignments, which are exactly the maximum cuts of a four-node ring.
exact.cpu4 qubits
OPENQASM 2.0;
include "qelib1.inc";
// QAOA (p=1) for MaxCut on a 4-node ring (0-1-2-3-0). The answer is the
// alternating partition, so the circuit should concentrate on 0101 and 1010.
qreg q[4];
creg c[4];
h q[0];
h q[1];
h q[2];
h q[3];
// cost layer: exp(-i gamma Z Z) on each edge (angle tuned to 2.3)
cx q[0],q[1];
rz(2.3) q[1];
cx q[0],q[1];
cx q[1],q[2];
rz(2.3) q[2];
cx q[1],q[2];
cx q[2],q[3];
rz(2.3) q[3];
cx q[2],q[3];
cx q[3],q[0];
rz(2.3) q[0];
cx q[3],q[0];
// mixer layer: Rx on each qubit (angle tuned to 0.86)
rx(0.86) q[0];
rx(0.86) q[1];
rx(0.86) q[2];
rx(0.86) q[3];
measure q -> c;
Estimate a molecule's ground-state energy from a parameterized circuit and a Hamiltonian.
What the run returned
Energy of -1.13715 hartree, which is the published ground state of H2 in this basis.
pauli.cpu2 qubits
OPENQASM 2.0;
include "qelib1.inc";
// VQE ansatz for the hydrogen molecule (2-qubit tapered Hamiltonian). This
// single-excitation ansatz prepares a trial ground state; the classical loop
// tunes theta to minimise the measured energy. theta below is near-optimal.
qreg q[2];
creg c[2];
x q[0];
rx(1.5708) q[0];
h q[1];
cx q[1],q[0];
rz(0.2) q[0];
cx q[1],q[0];
rx(-1.5708) q[0];
h q[1];
Where it stops: Two qubits, a tapered Hamiltonian and near-optimal angles supplied. Real chemistry needs a larger active space and the optimization loop that finds those angles.
Recover a hidden bitstring in a single query, where a classical algorithm needs one query per bit.
What the run returned
The hidden string came back on all 1,000 shots, in one query rather than the several a classical search would need.
clifford4 qubits
OPENQASM 2.0;
include "qelib1.inc";
// Bernstein-Vazirani: a hidden string s = 1011 lives inside the oracle. A
// classical computer needs one query per bit; this reads all of s in one shot.
qreg q[5];
creg c[4];
x q[4];
h q[4];
h q[0];
h q[1];
h q[2];
h q[3];
// oracle for s = 1011 (CNOT from each set bit onto the ancilla)
cx q[0],q[4];
cx q[1],q[4];
cx q[3],q[4];
h q[0];
h q[1];
h q[2];
h q[3];
measure q[0] -> c[0];
measure q[1] -> c[1];
measure q[2] -> c[2];
measure q[3] -> c[3];
Move a state from one qubit to another using entanglement and two classical bits.
What the run returned
The receiving qubit carries the state the sender prepared, and the sender's copy is gone, as the no-cloning theorem requires.
exact.cpu3 qubits
OPENQASM 2.0;
include "qelib1.inc";
// Teleportation: q0 holds Alice's state (prepared at ~75% |1>), q1-q2 are an
// entangled pair. After the protocol, Bob's q2 carries Alice's state without
// the qubit itself ever crossing. Measuring q2 reproduces her distribution.
qreg q[3];
creg c[1];
ry(2.0944) q[0];
h q[1];
cx q[1],q[2];
cx q[0],q[1];
h q[0];
cx q[1],q[2];
cz q[0],q[2];
measure q[2] -> c[0];
Sweep a chain of seven neutral atoms adiabatically into the alternating pattern the Rydberg blockade forces on it.
What the run returned
The chain lands in 1010101 on 909 of 1000 shots. Neighbouring atoms sit inside each other's blockade radius, so both cannot be excited, and the ground state at the end of the sweep is the alternating one.
analog.pulser.cpu7 qubits
import numpy as np, pulser
from pulser import Pulse, Register, Sequence
from pulser.devices import AnalogDevice
# Spacing 5.2 um against a 6.40 um blockade radius, so Rb/a = 1.23: near
# neighbours block each other, next-nearest do not. That ratio is what selects
# the alternating pattern. At the device's 5 um minimum there is little room
# below this, and at a = Rb the order collapses.
omega = 4 * np.pi
coords = np.array([[i * 5.2, 0.0] for i in range(7)])
coords -= coords.mean(axis=0)
reg = Register.from_coordinates(coords, prefix="q").with_automatic_layout(AnalogDevice)
seq = Sequence(reg, AnalogDevice)
seq.declare_channel("ising", "rydberg_global")
d0, df = -3 * omega, omega
# Rise, adiabatic detuning sweep, fall. The sweep has to be slow enough that
# the system follows the instantaneous ground state.
seq.add(Pulse.ConstantDetuning(pulser.waveforms.RampWaveform(400, 0.0, omega), d0, 0.0), "ising")
seq.add(Pulse.ConstantAmplitude(omega, pulser.waveforms.RampWaveform(3200, d0, df), 0.0), "ising")
seq.add(Pulse.ConstantDetuning(pulser.waveforms.RampWaveform(400, omega, 0.0), df, 0.0), "ising")
job = client.run_sequence(seq, shots=1000) # 1 = Rydberg
Where it stops: Exact, so only shot noise applies, but the state is integrated in full and that caps the register at 14 atoms. Real neutral-atom hardware runs 100.
Work at sizes a laptop cannot reach, where the choice of engine is the whole problem rather than a detail.
Error correction
Error correction: a distance-501 repetition code
Spread one logical bit across 501 physical qubits, measure the parity of every neighbouring pair, and read the syndrome that says where an error landed.
What the run returned
1,001 qubits, run exactly. A single bit-flip was injected on data qubit 137, and precisely the two parity checks straddling it fired, on every shot. The syndrome names the error rather than merely reporting that one occurred.
clifford1,001 qubits
Where it stops: A repetition code catches bit flips and nothing else; a phase flip passes through it unseen. Real codes such as the surface code measure both, at a cost in qubits. This is the mechanism at a scale that makes the point, not a production code.
An approximate simulator returns a number and, usually, no indication of how wrong that number might be. Tensor-network and Pauli-propagation methods work by discarding weight as they go, and the amount discarded is measurable. Every run here reports it under an open protocol, so a result you quote is one somebody else can check.
Exact and stabilizer runs report zero truncation, which is why several of the certificates above state a bound of zero. That is a claim about the method, not a claim that shot noise has vanished.