A quantum solution for the quantum combination lock
For a classical solution to the quantum combination lock we always needed to perform at least as much guesses as we had digits in the secret code. This is not bad. But can we get better using the properties of qubits, namely superposition and entanglement? It turns out, we can! Let's explore how.
Investigating another black box
A common way to work with quantum algorithm is to prepare an equal superposition and use it for calculation. This is also used in the Bernstein-Vazirani algorithm we want to look into now.
Afterward, open the black box and check how you can retrieve the secret code from the measurement outcomes.
Measurements
Hints
- To prepare an equal superposition of multiple qubits, apply a H gate to every qubit involved.
- The output qubit is the last qubit.
-
A
1001
-
B
0101
-
C
0110
-
D
1101
That's right! The secret code is 0110.
You can now also open the black box to take a look inside.
Not quite! The secret code is actually 0110.
You can now also open the black box to take a look
inside.
-
A
1
-
B
2
-
C
3
-
D
4
That’s correct! Strange, how we just needed one guess and actually the controlling qubits changed. Find out more about how this worked on the next page.
Not quite! It is actually only one guess needed. Find out more about how this worked on the next page.