We are given a black box function
- constant everywhere (i.e. either 0 or 1 everywhere)
- OR balanced (i.e. exactly half the inputs give 0)
We want to find whether
Classically we need
Quantum improves:
The setting
Let
The algorithm
Step 1
Initialize all qubits in state
Step 2
Step 3
where
Step 4
Discard the last qubit i.e. left with
Note that:
If
If
Let
Take inner product
if
Thus
Step 5
Apply
Step 6
Measure these
- If
is constant the outcome is - If
is balanced then mmt outcome is NOT all 0
Conclusion
We have used 1 query of