Grover'ın algoritması, diğer şeylerin yanı sıra, sıralanmamış bir öğe listesinde [ x 0 , x 1 , öğesini aramak için kullanılır . . . , x n - 1 ] uzunluk n . Burada bu konuyla ilgili birçok soru olmasına rağmen , konuyu hala özlüyorum.
Bir listede arama, klasik yol
Normal olarak, bu şekilde bir arama fonksiyonu tasarlamak
.
The wanted element is . I should obtain . Each card can be encoded with bits, the list has elements so we need bits to encode the list. In this case, the oracle will implement the function:
However, the input of Grover's algorithm is not a state of qubits.
(NB: Image of shuffled deck is taken from here)
Grover and its oracle
Several sources (eg. here - graphically explained) say that the input of the algorithm is different: the input is a state taken from the search space where is the number of elements of the list. Each number corresponds to the position of an element in the list.
The input of is now a qubit vector , which must be a superposition of all the items in the search space .
We know
- corresponds to ;
- corresponds to ;
- corresponds to ;
- corresponds to which is the wanted element;
- and so on...
In this case we have
Building the oracle requires us to know that is at position 5. What's the point to execute the algorithm if we have already searched for the element in order to build the oracle?