Skip to main content
Advanced3 qubitspar 7

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.

Stuck on the concept? Read Grover's Search.

What you are aiming at100 %
|000⟩
|001⟩
|010⟩
|011⟩
|100⟩
|101⟩
|110⟩
|111⟩
What you are producing right now100 %
|000⟩
|001⟩
|010⟩
|011⟩
|100⟩
|101⟩
|110⟩
|111⟩

Heads up: this one is graded on amplitudes, not the histogram. A correct oracle leaves every bar exactly where it is — the two charts above will match long before you are done.

Single qubit
Two qubit
Three qubit
Other

Select a gate to see what it does, then tap a wire — or Tab to a wire and press Enter — to place it.

Gates
0
Par
7
Pick a gate from the palette to start building.

Pick a gate, then tap a cell — or Tab into the grid and use the arrow keys and Enter — to place it.

Generate a fresh target state drill at this difficulty. Every generated puzzle is verified solvable by execution before you see it — the generator runs its own solution through the same simulator and grader that will judge yours.