This question already has an answer here:

Let's say I'd like to search a database and I have a function $f$ such that $f(x) = 0$ for all incorrect entries and $f(x) = 1$ for all target entries.

The crux of Grover's search seems to be that there exists a way to construct a quantum operator $\hat{f}$ in a way that it takes a superposition of states as input and adds a phase only to the target elements from the superposition.

What guarantee do we have that such a construction exists? For example, if I take a classical hashing function, how do I go about building the quantum equivalent that is able to simultaneously evaluate multiple inputs and assign the phase only to those inputs that fall below some target threshold?


marked as duplicate by D.W. Feb 21 '18 at 16:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.