Build the circuit
Each challenge gives you a target — a state, a distribution, or a broken circuit — and your job is to build or repair the circuit that produces it. Grading runs entirely in your browser against the same simulator the rest of the site uses, so the verdict is exact and instant.
One question, one answer
A CX with q0 as control and q1 as target is the oracle for a hidden one-bit function f, writing f into q1. This particular f is balanced — f(0) ≠ f(1) — and a classical computer needs two queries to know that. Build the whole circuit, using that CX ONCE and only once, so that q0 reads |1⟩ on every shot: q0 = 1 means balanced, and you asked once. Par is 5.
Picked from today’s UTC date, so everyone gets the same puzzle today.
Flip it
Your qubit starts in |0⟩, as every qubit in this simulator does. Get it to |1⟩ with certainty — the histogram should show a single bar at |1⟩ and nothing anywhere else.
Fair coin
Build a circuit whose measurement is a genuine 50/50 coin flip: half the shots read |0⟩, half read |1⟩.
Read the label
Three qubits, no superposition, no entanglement: put the register into |101⟩ with certainty. The only difficulty is the labelling. Bars are printed MSB-first — q2 q1 q0 — so |101⟩ means q2 = 1, q1 = 0, q0 = 1. Get the wrong qubit and the histogram will tell you immediately.
Make a Bell pair
Two qubits. Half the shots must read |00⟩ and half must read |11⟩ — and |01⟩ and |10⟩ must never appear. The two qubits always agree, but neither one is decided in advance.
The other Bell state
Same idea, opposite correlation. Half the shots must read |01⟩ and half |10⟩ — the two qubits must always DISAGREE. |00⟩ and |11⟩ must never appear.
Uniform over three qubits
Three qubits, eight basis states, and every one of them equally likely: 1/8 = 12.5% each. This is the starting line for almost every quantum algorithm.
Undo the Hadamard
This circuit was meant to leave the qubit exactly where it started — H, then H again, is the identity. Someone slipped an extra gate into the middle and now it lands on |1⟩ every time. Repair it: |0⟩ with certainty. Click a placed gate to remove it.
Broken CNOT
This was supposed to be a Bell pair, and the two gates are the right two gates — but the result is nothing like entangled. Fix it so half the shots read |00⟩ and half read |11⟩.
GHZ for three
Scale the Bell pair up. Three qubits, half the shots reading |000⟩ and half reading |111⟩ — all three always agree, and the other six basis states never appear.
Tilt the coin
A fair coin is one particular superposition; you can dial any other. Build a single-qubit circuit that reads |1⟩ about 15% of the time and |0⟩ the rest — one gate, one angle. The θ slider moves in steps of π/16, and one of those stops lands within a fraction of a percent of the target.
The invisible sign
Produce (|0⟩ − |1⟩)/√2, the state usually written |−⟩. Both outcomes must stay at 50%, and the |1⟩ amplitude must be negative. The histogram cannot see the difference between this and the fair coin — this one is graded on amplitudes.
Read the Y axis
The two gates already on the wire prepare |+i⟩ = (|0⟩ + i|1⟩)/√2 — a state that is perfectly definite along the Y axis and a coin flip along Z. Your detector only measures Z. Add gates so the circuit reads |1⟩ on every single shot, without deleting the preparation.
Kick the phase back
Put q0 into |+⟩ and q1 into |−⟩, then apply CX with q0 as the control and q1 as the target. Predict the result before you check it: the target comes out exactly as it went in, and the CONTROL is the qubit that changes. All four bars stay at 25%; this one is graded on amplitudes, and the target signs say the |1⟩ branch of q0 has picked up a minus.
One question, one answer
A CX with q0 as control and q1 as target is the oracle for a hidden one-bit function f, writing f into q1. This particular f is balanced — f(0) ≠ f(1) — and a classical computer needs two queries to know that. Build the whole circuit, using that CX ONCE and only once, so that q0 reads |1⟩ on every shot: q0 = 1 means balanced, and you asked once. Par is 5.
Route around the coupling map
Entangle q0 with q2 — half the shots reading |000⟩ and half |101⟩, with q1 left clean at |0⟩. The catch is the hardware story: on this imaginary device only NEIGHBOURING qubits are connected, so a two-qubit gate may act on q0-q1 or q1-q2 but never directly on q0-q2. Build the pair on a connected edge and then move it, using CNOTs only. Par is 5.
Gate golf: entangle the top two
Three qubits. Entangle q1 and q2 into a Bell pair — half the shots reading |000⟩ and half reading |110⟩ — while leaving q0 untouched at |0⟩. Par is 2 gates. Hitting the target with more still counts, but the score rewards the shortest circuit.
Mark the state
Build a Grover oracle for |11⟩. Put both qubits into an equal superposition, then flip the SIGN of the |11⟩ amplitude and only that one. The histogram will not move at all — every outcome stays at 25% — and that is the entire point. The grader checks amplitudes.
Borrow a qubit and give it back
Mark |11⟩ on q0 and q1 the way a real algorithm does it: with a scratch qubit. Put q0 and q1 into equal superposition, prepare q2 as a |−⟩ ancilla, use a Toffoli to write the AND of q0 and q1 into it, then UNCOMPUTE the ancilla so it ends at exactly |0⟩ and is unentangled from everything else. The target says all four q2 = 0 bars sit at 25% and every q2 = 1 bar is empty; the signs say |11⟩ carries the minus. Par is 7.
GHZ's awkward cousin
This circuit was meant to build the three-qubit W state — one excitation shared equally between the qubits, so |001⟩, |010⟩ and |100⟩ each come up 33.3% of the time and nothing else ever does. It is one gate short: the excitation gets to the third qubit but the second one never lets go of it, so 33.3% is sitting on |110⟩ instead of |100⟩. Add the missing CNOT. Leave the two rotations alone. Their angles are not multiples of π/16 and the θ slider cannot type them back in.
The two-qubit QFT, missing its last step
This is a two-qubit quantum Fourier transform applied to the input state (|00⟩ + |01⟩)/√2 — the H on q0 is the input, the rest is the transform. The gates are all correct and the output is still wrong: the probabilities land on the right values but the wrong labels. Add the one gate that fixes it, so the histogram reads 50% on |00⟩, 25% on |01⟩, nothing on |10⟩ and 25% on |11⟩.
Finish the teleporter
q0 holds an unknown state — here RY(π/4)|0⟩, which reads |1⟩ about 14.6% of the time — and the circuit already entangles q1 with q2, performs the Bell measurement basis change on q0 and q1, and gets as far as that. It stops before the corrections, so q2 currently comes out uniformly random: teleportation without the classical fix-up moves nothing at all. Add the two conditional corrections so that q2 carries the original state. Target: the four bars with q2 = 0 sit at 21.3% and the four with q2 = 1 at 3.7% — that is q2 holding the original 85/15 split while q0 and q1 read uniform noise.
One full turn of Grover
Search eight items for the marked one, by hand. Mark |111⟩ with a phase, then run one full diffusion step, so the histogram reads 78.1% on |111⟩ and 3.1% on each of the other seven. That 78.1% is the point: one iteration out of the two that N = 8 wants, and the number is the fingerprint of having actually amplified rather than just written the answer down. Par is 21 gates — this is the longest circuit in the catalogue and it is meant to be.
Mark one of eight
A Grover oracle for a three-qubit search: put all three qubits into equal superposition, then flip the sign of the |101⟩ amplitude — and only that one. Every bar stays at 12.5%; the grader checks amplitudes. The catch: the only multi-controlled gate in the palette fires when its controls read |1⟩, and the state you are marking has a 0 in the middle. Par is 8.
Two kicks, one parity
Phase kickback, iterated. Put q0 and q1 into equal superposition, park q2 in |−⟩, then run CX(q0→q2) and CX(q1→q2). Each CX writes its control bit into the ancilla — but the ancilla is in |−⟩, so each write comes back as a sign on the control register instead. Predict the pattern before you build it: the amplitude of every basis state picks up (−1)^(q0⊕q1), and the ancilla's own |1⟩ half carries its |−⟩ minus. All eight bars sit at 12.5%; the grader checks the signs.
Gate golf: move half a Bell pair
The two pre-placed gates entangle q0 with q1. Hand q1's half of the pair to q2, so that half the shots read |000⟩ and half |101⟩ with q1 left clean at |0⟩ — keeping the two starting gates. Par is 4 total, which means TWO added gates. The routing challenge did this with a three-CNOT SWAP for five; the point of this hole is that a full SWAP is more than the job needs. As always, the grader only sees the final state — rebuilding the pair from scratch on q0 and q2 also lands on the target, but then you have practised nothing.
Gate golf: the odd one out
Half the shots must read |011⟩ and half |100⟩ — q0 and q1 always agree with each other, and q2 always disagrees with both. Nothing else ever appears. Par is 4. The state is exactly as entangled as GHZ; the extra gate pays for the disagreement.
Teleportation, wires crossed
A complete teleporter — payload RY(3π/8) on q0, entangled pair, Bell-basis change, and both corrections — that still delivers noise. The builder swapped the classical logic: the X correction is conditioned on q0 and the Z on q1, when the protocol wants exactly the reverse. Repair it (delete the two wrong gates, add the right ones) so q2 carries the payload: every q2 = 0 bar at 17.3%, every q2 = 1 bar at 7.7%.
The transform that turned the wrong way
This circuit prepares (|00⟩ + i|01⟩)/√2 — the H and S at the front — and then runs what was meant to be the two-qubit QFT, bit-reversal SWAP included. The builder copied the controlled phase from a table of the INVERSE transform: the T-gate block in the middle rotates by −π/2 where the forward QFT wants +π/2. Every probability is right except two: 50% sits on |01⟩ and it belongs on |11⟩. One appended gate can fix it — without touching the T gates at all. Target: 25% on |00⟩, 25% on |10⟩, 50% on |11⟩.
W, by hand, within tolerance
Build the three-qubit W state yourself — one excitation shared equally, so |001⟩, |010⟩ and |100⟩ each near 33.3% and every other bar at zero — using only gates you place. The repair challenge handed you the awkward angles; this time the θ slider's π/16 steps are all you get, and 1/3 is not exactly reachable with them: sin²(3π/16) ≈ 30.9%, not 33.3%. The tolerance is 3%, and the slider can get every bar inside it. The zeros are NOT tolerant in spirit: any recipe that leaks probability onto |000⟩, |111⟩ or the two-excitation states will fail long before the thirds do. Par is 10.
Read the phase bit
The three pre-placed gates prepare Φ− = (|00⟩ − |11⟩)/√2, which the histogram cannot tell apart from the Φ+ you built in the Bell challenge: both read 50/50 on |00⟩ and |11⟩. The minus sign is real physics, and there is a measurement that extracts it. Append gates — keeping the preparation — so the circuit ends on |01⟩ with certainty: q0 reads 1 exactly because the phase was −, and q1 reads 0 exactly because the parity was "equal". Par is 5.