SpookyQubits

Grover’s Algorithm Explained With Eight Rooms

Watch on YouTubeRead the transcript

Follow one round of Grover’s search in Ghost Hunt’s eight-room Wave Lab. See how flipping, reflecting, and squaring amplitudes change the odds of finding the ghost.

Play Ghost Hunt Download Ghost Hunt printables (PDF) Open the classroom lesson

Video transcript

0:00 Eight rooms, one ghost

Eight rooms. One ghost. When should you open the door? Ghost Hunt turns that question into a hands-on demo of Grover’s quantum search algorithm.

0:10 Set up Wave Lab

Open Wave Lab. Keep eight rooms and one ghost. Choose Start Over if you’ve already played. Each bar starts at four. The red bar marks the ghost room in this teaching view. All rooms are equally likely. Your chance is one in eight, or twelve point five percent.

0:28 Flip the marked amplitude

Click Flip. The ghost room’s amplitude changes from positive four to negative four. The seven empty rooms stay at four. Add all eight values and divide by eight. The average is three.

0:41 Reflect about the mean

Click Reflect. Imagine a mirror at three, where the gold line was after the flip. Negative four is seven steps below that line. Its reflection is seven steps above, at ten. Each empty room starts one step above the line. Its reflection is one below, at two.

1:00 Square the amplitudes

To calculate the chance, square the amplitudes. Ten squared gives the ghost room a weight of one hundred. Each of the seven other rooms has weight four. The total is one hundred twenty-eight. Divide one hundred by one hundred twenty-eight. That’s about seventy-eight percent after one round.

1:19 Compare the odds

Try Flip plus Reflect once more. The second round gets you to ninety-four point five percent. Now try a third round. The chance drops to thirty-three percent. More rounds can bring the odds back down. If you could stop at round one, two, or three, which would you choose? Round two gives the highest chance of those choices. Try stopping there, and click Look to sample a room. Try it yourself at SpookyQubits.com. The lesson link has the teacher guide and printable game.