Activity
Crack the code
Grover's algorithm
Detailed instructions for this activity live inside the Qubi app.
This game shows the difference between classical and quantum algorithms. Each team has a lockbox with a two-bit passcode. Teams race to figure out the passcode the fastest.
Each team starts with 2 “input” Qubis and 1 “lockbox” Qubi, all in the “0” (or “up”) position. The lockbox Qubi is “locked” when it is up, and “unlocked” when it is down. A “lock-check” (bit-flip oracle) flips the lockbox Qubi if the input Qubis have the correct passcode.
First, play it classical. A random passcode is selected, and teams guess on their input Qubis. When time is up, perform the lock-check. If they guessed right, the lockbox Qubi flips. If not, reset and try again. It takes at most 4 tries, 2.5 on average.
Now play it quantum. Prepare the input Qubis in the plus states. The lock-check runs once, creating an entangled state that encodes the correct answer. Memorize the Grover diffusion circuit, then run it on your Qubis. The input Qubis now show the correct passcode. First team to do it wins.