Grover Search Algorithm
   HOME

TheInfoList



OR:

In
quantum computing Quantum computing is a type of computation whose operations can harness the phenomena of quantum mechanics, such as superposition, interference, and entanglement. Devices that perform quantum computations are known as quantum computers. Though ...
, Grover's algorithm, also known as the quantum search algorithm, refers to a
quantum algorithm In quantum computing, a quantum algorithm is an algorithm which runs on a realistic model of quantum computation, the most commonly used model being the quantum circuit model of computation. A classical (or non-quantum) algorithm is a finite sequ ...
for unstructured search that finds
with high probability In mathematics, an event that occurs with high probability (often shortened to w.h.p. or WHP) is one whose probability depends on a certain number ''n'' and goes to 1 as ''n'' goes to infinity, i.e. the probability of the event occurring can be mad ...
the unique input to a
black box In science, computing, and engineering, a black box is a system which can be viewed in terms of its inputs and outputs (or transfer characteristics), without any knowledge of its internal workings. Its implementation is "opaque" (black). The te ...
function that produces a particular output value, using just O(\sqrt) evaluations of the function, where N is the size of the function's
domain Domain may refer to: Mathematics *Domain of a function, the set of input values for which the (total) function is defined **Domain of definition of a partial function **Natural domain of a partial function **Domain of holomorphy of a function * Do ...
. It was devised by
Lov Grover Lov Kumar Grover (born 1961) is an Indian- American computer scientist. He is the originator of the Grover database search algorithm used in quantum computing. Grover's 1996 algorithm won renown as the second major algorithm proposed for qu ...
in 1996. The analogous problem in classical computation cannot be solved in fewer than O(N) evaluations (because, on average, one has to check half of the domain to get a 50% chance of finding the right input). Charles H. Bennett, Ethan Bernstein,
Gilles Brassard Gilles Brassard, is a faculty member of the Université de Montréal, where he has been a Full Professor since 1988 and Canada Research Chair since 2001. Education and early life Brassard received a Ph.D. in Computer Science from Cornell Unive ...
, and
Umesh Vazirani Umesh Virkumar Vazirani is an Indian-American academic who is the Roger A. Strauch Professor of Electrical Engineering and Computer Science at the University of California, Berkeley, and the director of the Berkeley Quantum Computation Center. Hi ...
proved that any quantum solution to the problem needs to evaluate the function \Omega(\sqrt) times, so Grover's algorithm is
asymptotically optimal In computer science, an algorithm is said to be asymptotically optimal if, roughly speaking, for large inputs it performs at worst a constant factor (independent of the input size) worse than the best possible algorithm. It is a term commonly en ...
. Since classical algorithms for
NP-complete problems In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by trying ...
require exponentially many steps, and Grover's algorithm provides at most a quadratic speedup over the classical solution for unstructured search, this suggests that Grover's algorithm by itself will not provide
polynomial-time In computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations performed by t ...
solutions for NP-complete problems (as the square root of an exponential function is an exponential, not polynomial, function). Unlike other quantum algorithms, which may provide exponential speedup over their classical counterparts, Grover's algorithm provides only a quadratic speedup. However, even quadratic speedup is considerable when N is large, and Grover's algorithm can be applied to speed up broad classes of algorithms. Grover's algorithm could brute-force a 128-bit symmetric cryptographic key in roughly 264 iterations, or a 256-bit key in roughly 2128 iterations. As a result, it is sometimes suggested that symmetric key lengths be doubled to protect against future quantum attacks.


Applications and limitations

Grover's algorithm, along with variants like
amplitude amplification Amplitude amplification is a technique in quantum computing which generalizes the idea behind the Grover's search algorithm, and gives rise to a family of quantum algorithms. It was discovered by Gilles Brassard and Peter Høyer in 1997, and ind ...
, can be used to speed up a broad range of algorithms. In particular, algorithms for NP-complete problems generally contain exhaustive search as a subroutine, which can be sped up by Grover's algorithm. The current best algorithm for
3SAT In logic and computer science, the Boolean satisfiability problem (sometimes called propositional satisfiability problem and abbreviated SATISFIABILITY, SAT or B-SAT) is the problem of determining if there exists an interpretation that satisfie ...
is one such example. Generic
constraint satisfaction problem Constraint satisfaction problems (CSPs) are mathematical questions defined as a set of objects whose state must satisfy a number of constraints or limitations. CSPs represent the entities in a problem as a homogeneous collection of finite constra ...
s also see quadratic speedups with Grover. These algorithms do not require that the input be given in the form of an oracle, since Grover's algorithm is being applied with an explicit function, e.g. the function checking that a set of bits satisfies a 3SAT instance. Grover's algorithm can also give provable speedups for black-box problems in quantum query complexity, including element distinctness and the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
(solved with the Brassard–Høyer–Tapp algorithm). In these types of problems, one treats the oracle function ''f'' as a database, and the goal is to use the quantum query to this function as few times as possible.


Cryptography

Grover's algorithm essentially solves the task of ''function inversion''. Roughly speaking, if we have a function y = f(x) that can be evaluated on a quantum computer, Grover's algorithm allows us to calculate x when given y. Consequently, Grover's algorithm gives broad asymptotic speed-ups to many kinds of
brute-force attack In cryptography, a brute-force attack consists of an attacker submitting many passwords or passphrases with the hope of eventually guessing correctly. The attacker systematically checks all possible passwords and passphrases until the correct ...
s on
symmetric-key cryptography Symmetric-key algorithms are algorithms for cryptography that use the same cryptographic keys for both the encryption of plaintext and the decryption of ciphertext. The keys may be identical, or there may be a simple transformation to go between th ...
, including
collision attack In cryptography, a collision attack on a cryptographic hash tries to find two inputs producing the same hash value, i.e. a hash collision. This is in contrast to a preimage attack where a specific target hash value is specified. There are roughl ...
s and pre-image attacks. However, this may not necessarily be the most efficient algorithm since, for example, the parallel rho algorithm is able to find a collision in SHA2 more efficiently than Grover's algorithm.


Limitations

Grover's original paper described the algorithm as a database search algorithm, and this description is still common. The database in this analogy is a table of all of the function's outputs, indexed by the corresponding input. However, this database is not represented explicitly. Instead, an oracle is invoked to evaluate an item by its index. Reading a full database item by item and converting it into such a representation may take a lot longer than Grover's search. To account for such effects, Grover's algorithm can be viewed as solving an equation or satisfying a constraint. In such applications, the oracle is a way to check the constraint and is not related to the search algorithm. This separation usually prevents algorithmic optimizations, whereas conventional search algorithms often rely on such optimizations and avoid exhaustive search. The major barrier to instantiating a speedup from Grover's algorithm is that the quadratic speedup achieved is too modest to overcome the large overhead of near-term quantum computers. However, later generations of
fault-tolerant Fault tolerance is the property that enables a system to continue operating properly in the event of the failure of one or more faults within some of its components. If its operating quality decreases at all, the decrease is proportional to the ...
quantum computers with better hardware performance may be able to realize these speedups for practical instances of data.


Problem description

As input for Grover's algorithm, suppose we have a function f\colon \ \to \. In the "unstructured database" analogy, the domain represent indices to a database, and if and only if the data that ''x'' points to satisfies the search criterion. We additionally assume that only one index satisfies , and we call this index ''ω''. Our goal is to identify ''ω''. We can access ''f'' with a
subroutine In computer programming, a function or subroutine is a sequence of program instructions that performs a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed. Functions may ...
(sometimes called an
oracle An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. As such, it is a form of divination. Description The word '' ...
) in the form of a
unitary operator In functional analysis, a unitary operator is a surjective bounded operator on a Hilbert space that preserves the inner product. Unitary operators are usually taken as operating ''on'' a Hilbert space, but the same notion serves to define the con ...
''Uω'' that acts as follows: :\begin U_\omega , x\rang = -, x\rang & \text x = \omega \text f(x) = 1, \\ U_\omega , x\rang = , x\rang & \text x \ne \omega \text f(x) = 0. \end This uses the N-dimensional
state space A state space is the set of all possible configurations of a system. It is a useful abstraction for reasoning about the behavior of a given system and is widely used in the fields of artificial intelligence and game theory. For instance, the toy ...
\mathcal, which is supplied by a
register Register or registration may refer to: Arts entertainment, and media Music * Register (music), the relative "height" or range of a note, melody, part, instrument, etc. * ''Register'', a 2017 album by Travis Miller * Registration (organ), th ...
with n = \lceil \log_ N \rceil
qubit In quantum computing, a qubit () or quantum bit is a basic unit of quantum information—the quantum version of the classic binary bit physically realized with a two-state device. A qubit is a two-state (or two-level) quantum-mechanical system, ...
s. This is often written as :U_\omega, x\rang = (-1)^, x\rang. Grover's algorithm outputs ''ω'' with probability at least ''1/2'' using O(\sqrt) applications of ''Uω''. This probability can be made arbitrarily large by running Grover's algorithm multiple times. If one runs Grover's algorithm until ''ω'' is found, the expected number of applications is still O(\sqrt), since it will only be run twice on average.


Alternative oracle definition

This section compares the above oracle U_\omega with an oracle U_f. ''Uω'' is different from the standard quantum oracle for a function ''f''. This standard oracle, denoted here as ''Uf'', uses an ancillary qubit system. The operation then represents an inversion ( NOT gate) on the main system conditioned by the value of ''f''(''x'') from the ancillary system: :\begin U_f , x\rang , y\rang = , x\rang , \neg y\rang & \text x = \omega \text f(x) = 1, \\ U_f , x\rang , y\rang = , x\rang , y\rang & \text x \ne \omega \text f(x) = 0, \end or briefly, : U_f , x\rang , y\rang = , x\rang , y \oplus f(x)\rang. These oracles are typically realized using uncomputation. If we are given ''Uf'' as our oracle, then we can also implement ''Uω'', since ''Uω'' is ''Uf'' when the ancillary qubit is in the state , -\rang = \frac1\big(, 0\rang - , 1\rang\big) = H, 1\rang: : \begin U_f \big( , x\rang \otimes , -\rang \big) &= \frac1 \left( U_f , x\rang , 0\rang - U_f , x\rang , 1\rang \right)\\ &= \frac1 \left(, x\rang , f(x)\rang - , x\rang , 1 \oplus f(x)\rang \right)\\ &= \begin \frac1 \left(-, x\rang , 0\rang + , x\rang , 1\rang\right) & \text f(x) = 1, \\ \frac1 \left( , x\rang , 0\rang - , x\rang , 1\rang \right) & \text f(x) = 0 \end \\ &= (U_\omega , x\rang) \otimes , -\rang \end So, Grover's algorithm can be run regardless of which oracle is given. If ''Uf'' is given, then we must maintain an additional qubit in the state , -\rang and apply ''Uf'' in place of ''Uω''.


Algorithm

The steps of Grover's algorithm are given as follows: # Initialize the system to the uniform superposition over all states
, s\rangle = \frac \sum_^ , x\rangle. # Perform the following "Grover iteration" r(N) times: ## Apply the operator U_\omega ## Apply the ''Grover diffusion'' operator U_s = 2 \left, s\right\rangle \left\langle s\ - I #
Measure Measure may refer to: * Measurement, the assignment of a number to a characteristic of an object or event Law * Ballot measure, proposed legislation in the United States * Church of England Measure, legislation of the Church of England * Mea ...
the resulting quantum state in the computational basis. For the correctly chosen value of r, the output will be , \omega\rang with probability approaching 1 for ''N'' ≫ 1. Analysis shows that this eventual value for r(N) satisfies r(N) \leq \Big\lceil\frac\sqrt\Big\rceil. Implementing the steps for this algorithm can be done using a number of gates linear in the number of qubits. Thus, the gate complexity of this algorithm is O(\log(N)r(N)), or O(\log(N)) per iteration.


Geometric proof of correctness

There is a geometric interpretation of Grover's algorithm, following from the observation that the quantum state of Grover's algorithm stays in a two-dimensional subspace after each step. Consider the plane spanned by , s\rang and , \omega\rang; equivalently, the plane spanned by , \omega\rang and the perpendicular ket \textstyle , s'\rang = \frac\sum_ , x\rang. Grover's algorithm begins with the initial ket , s\rang, which lies in the subspace. The operator U_ is a reflection at the hyperplane orthogonal to , \omega\rang for vectors in the plane spanned by , s'\rang and , \omega\rang, i.e. it acts as a reflection across , s'\rang. This can be seen by writing U_\omega in the form of a
Householder reflection In linear algebra, a Householder transformation (also known as a Householder reflection or elementary reflector) is a linear transformation that describes a reflection about a plane or hyperplane containing the origin. The Householder transformati ...
: : U_\omega = I - 2, \omega\rangle\langle \omega, . The operator U_s = 2 , s\rangle \langle s, - I is a reflection through , s\rang. Both operators U_s and U_ take states in the plane spanned by , s'\rang and , \omega\rang to states in the plane. Therefore, Grover's algorithm stays in this plane for the entire algorithm. It is straightforward to check that the operator U_s U_ of each Grover iteration step rotates the state vector by an angle of \theta = 2\arcsin\tfrac . So, with enough iterations, one can rotate from the initial state , s\rang to the desired output state , \omega\rang. The initial ket is close to the state orthogonal to , \omega\rang: : \lang s', s\rang = \sqrt. In geometric terms, the angle \theta/2 between , s\rang and , s'\rang is given by : \sin \frac = \frac. We need to stop when the state vector passes close to , \omega\rang; after this, subsequent iterations rotate the state vector ''away'' from , \omega\rang, reducing the probability of obtaining the correct answer. The exact probability of measuring the correct answer is : \sin^2\left( \Big( r + \frac \Big)\theta\right), where ''r'' is the (integer) number of Grover iterations. The earliest time that we get a near-optimal measurement is therefore r \approx \pi \sqrt / 4.


Algebraic proof of correctness

To complete the algebraic analysis, we need to find out what happens when we repeatedly apply U_s U_\omega. A natural way to do this is by eigenvalue analysis of a matrix. Notice that during the entire computation, the state of the algorithm is a linear combination of s and \omega. We can write the action of U_s and U_\omega in the space spanned by \ as: : U_s : a , \omega \rang + b , s \rang \mapsto \omega_\rang_\,_, _s_\rang\begin -1_&_-2/\sqrt_\\ 0_&_1_\end\begina\\b\end. So_in_the_basis_\_(which_is_neither_orthogonal_nor_a_basis_of_the_whole_space)_the_action_U_sU_\omega_of_applying_U_\omega_followed_by_U_s_is_given_by_the_matrix :_U_sU_\omega_=_\begin_-1_&_0_\\_2/\sqrt_&_1_\end \begin -1_&_-2/\sqrt_\\ 0_&_1_\end _=_ \begin 1_&_2/\sqrt_\\ -2/\sqrt_&_1-4/N_\end. This_matrix_happens_to_have_a_very_convenient_
Jordan_form In linear algebra, a Jordan normal form, also known as a Jordan canonical form (JCF), is an upper triangular matrix of a particular form called a Jordan matrix representing a linear operator on a finite-dimensional vector space with respect to so ...
._If_we_define_t_=_\arcsin(1/\sqrt),_it_is :_U_sU_\omega_=_M_\begin_e^_&_0_\\_0_&_e^\end_M^_where_M_=_\begin-i_&_i_\\_e^_&_e^_\end. It_follows_that_''r''-th_power_of_the_matrix_(corresponding_to_''r''_iterations)_is_ :_(U_sU_\omega)^r_=_M_\begin_e^_&_0_\\_0_&_e^\end_M^. Using_this_form,_we_can_use_trigonometric_identities_to_compute_the_probability_of_observing_''ω''_after_''r''_iterations_mentioned_in_the_previous_section,_ :\left, \begin\lang\omega, \omega\rang_&_\lang\omega, s\rang\end(U_sU_\omega)^r_\begin0_\\_1\end_\^2_=_\sin^2\left(_(2r+1)t\right). Alternatively,_one_might_reasonably_imagine_that_a_near-optimal_time_to_distinguish_would_be_when_the_angles_2''rt''_and_−2''rt''_are_as_far_apart_as_possible,_which_corresponds_to_2rt_\approx_\pi/2,_or_r_=_\pi/4t_=_\pi/4\arcsin(1/\sqrt)_\approx_\pi\sqrt/4._Then_the_system_is_in_state :_ \omega_\rang_\,_, _s_\rang(U_sU_\omega)^r_\begin0\\1\end_\approx_ \omega_\rang_\,_, _s_\rangM_\begin_i_&_0_\\_0_&_-i\end_M^_\begin0\\1\end_=_, _\omega_\rang_\frac_-_, s_\rang_\frac. A_short_calculation_now_shows_that_the_observation_yields_the_correct_answer_''ω''_with_error_O\left_(\frac_\right).


__Extensions_and_variants_


__Multiple_matching_entries_

If,_instead_of_1_matching_entry,_there_are_''k''_matching_entries,_the_same_algorithm_works,_but_the_number_of_iterations_must_be__\frac_instead_of__\frac. There_are_several_ways_to_handle_the_case_if_''k''_is_unknown._A_simple_solution_performs_optimally_up_to_a_constant_factor:_run_Grover's_algorithm_repeatedly_for_increasingly_small_values_of_''k'',_e.g.,_taking_''k''_=_''N'',_''N''/2,_''N''/4,_...,_and_so_on,_taking_k_=_N/2^t_for_iteration_''t''_until_a_matching_entry_is_found. With_sufficiently_high_probability,_a_marked_entry_will_be_found_by_iteration_t_=_\log_2(N/k)_+_c_for_some_constant_''c''._Thus,_the_total_number_of_iterations_taken_is_at_most :_\frac_\Big(1_+_\sqrt_+_\sqrt_+_\cdots_+_\sqrt\Big)_=_O\big(\sqrt\big)._ A_version_of_this_algorithm_is_used_in_order_to_solve_the_collision_problem_ The_r-to-1_collision_problem_is_an_important_theoretical_problem_in__complexity_theory,__quantum_computing,_and__computational_mathematics._The_collision_problem_most_often_refers_to_the_2-to-1_version:_given_n_even_and_a_function_f:\,\\rightarrow\_...
.


_Quantum_partial_search

A__modification_of_Grover's_algorithm_called_quantum_partial_search_was_described_by_Grover_and_Radhakrishnan_in_2004._In_partial_search,_one_is_not_interested_in_finding_the_exact_address_of_the_target_item,_only_the_first_few_digits_of_the_address._Equivalently,_we_can_think_of_"chunking"_the_search_space_into_blocks,_and_then_asking_"in_which_block_is_the_target_item?"._In_many_applications,_such_a_search_yields_enough_information_if_the_target_address_contains_the_information_wanted._For_instance,_to_use_the_example_given_by_L._K._Grover,_if_one_has_a_list_of_students_organized_by_class_rank,_we_may_only_be_interested_in_whether_a_student_is_in_the_lower_25%,_25–50%,_50–75%_or_75–100%_percentile. To_describe_partial_search,_we_consider_a_database_separated_into_K_blocks,_each_of_size_b_=_N/K._The_partial_search_problem_is_easier._Consider_the_approach_we_would_take_classically_–_we_pick_one_block_at_random,_and_then_perform_a_normal_search_through_the_rest_of_the_blocks_(in_set_theory_language,_the_complement)._If_we_don't_find_the_target,_then_we_know_it's_in_the_block_we_didn't_search._The_average_number_of_iterations_drops_from_N/2_to_(N-b)/2. Grover's_algorithm_requires_\frac\sqrt_iterations._Partial_search_will_be_faster_by_a_numerical_factor_that_depends_on_the_number_of_blocks_K._Partial_search_uses_n_1_global_iterations_and_n_2_local_iterations._The_global_Grover_operator_is_designated_G_1_and_the_local_Grover_operator_is_designated_G_2. The_global_Grover_operator_acts_on_the_blocks._Essentially,_it_is_given_as_follows: #Perform_j_1_standard_Grover_iterations_on_the_entire_database. #Perform_j_2_local_Grover_iterations._A_local_Grover_iteration_is_a_direct_sum_of_Grover_iterations_over_each_block. #Perform_one_standard_Grover_iteration. The_optimal_values_of_j_1_and_j_2_are_discussed_in_the_paper_by_Grover_and_Radhakrishnan._One_might_also_wonder_what_happens_if_one_applies_successive_partial_searches_at_different_levels_of_"resolution"._This_idea_was_studied_in_detail_by_
Vladimir_Korepin Vladimir E. Korepin (born 1951) is a professor at the C. N. Yang Institute of Theoretical Physics of the Stony Brook University. Korepin made research contributions in several areas of mathematics and physics. Educational background Korepin c ...
_and_Xu,_who_called_it_binary_quantum_search._They_proved_that_it_is_not_in_fact_any_faster_than_performing_a_single_partial_search.


_Optimality_

Grover's_algorithm_is_optimal_up_to_sub-constant_factors._That_is,_any_algorithm_that_accesses_the_database_only_by_using_the_operator_''Uω''_must_apply_''Uω''_at_least_a_1-o(1)_fraction_as_many_times_as_Grover's_algorithm._The_extension_of_Grover's_algorithm_to_''k''_matching_entries,_(''N''/''k'')1/2/4,_is_also_optimal._This_result_is_important_in_understanding_the_limits_of_quantum_computation. If_the_Grover's_search_problem_was_solvable_with__''N''_applications_of_''Uω'',_that_would_imply_that_ NP_is_contained_in_ BQP,_by_transforming_problems_in_NP_into_Grover-type_search_problems._The_optimality_of_Grover's_algorithm_suggests_that_quantum_computers_cannot_solve_
NP-Complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
_problems_in_polynomial_time,_and_thus_NP_is_not_contained_in_BQP. It_has_been_shown_that_a_class_of_non-local_ hidden_variable_quantum_computers_could_implement_a_search_of_an_N-item_database_in_at_most_O(\sqrt _steps._This_is_faster_than_the_O(\sqrt)_steps_taken_by_Grover's_algorithm.


_See_also

*_
Amplitude_amplification Amplitude amplification is a technique in quantum computing which generalizes the idea behind the Grover's search algorithm, and gives rise to a family of quantum algorithms. It was discovered by Gilles Brassard and Peter Høyer in 1997, and ind ...
*_
Shor's_algorithm Shor's algorithm is a quantum algorithm, quantum computer algorithm for finding the prime factors of an integer. It was developed in 1994 by the American mathematician Peter Shor. On a quantum computer, to factor an integer N , Shor's algorithm ...
_(for_factorization) *__Brassard–Høyer–Tapp_algorithm_(for_solving_the_collision_problem_ The_r-to-1_collision_problem_is_an_important_theoretical_problem_in__complexity_theory,__quantum_computing,_and__computational_mathematics._The_collision_problem_most_often_refers_to_the_2-to-1_version:_given_n_even_and_a_function_f:\,\\rightarrow\_...
)


_Notes


__References_

*_Grover_L.K.:_
A_fast_quantum_mechanical_algorithm_for_database_search
',_Proceedings,_28th_Annual_ACM_Symposium_on_the_Theory_of_Computing,_(May_1996)_p. 212 *_Grover_L.K.:_
From_Schrödinger's_equation_to_quantum_search_algorithm
',_American_Journal_of_Physics,_69(7):_769–777,_2001._Pedagogical_review_of_the_algorithm_and_its_history. *_Grover_L.K.

''The_Sciences'',_July/August_1999,_pp. 24–30. *_Nielsen,_M.A._and_Chuang,_I.L._''Quantum_computation_and_quantum_information''._Cambridge_University_Press,_2000._Chapter_6.
What's_a_Quantum_Phone_Book?
_Lov_Grover,_Lucent_Technologies


_External_links

*_ *_ *_ *_ *_ *_ *_ {{DEFAULTSORT:Grover's_Algorithm Quantum_algorithms Search_algorithms Post-quantum_cryptographyhtml" ;"title="\omega \rang \, , s \rang] \begin -1 & 0 \\ 2/\sqrt & 1 \end\begina\\b\end. : U_\omega : a , \omega \rang + b , s \rang \mapsto \omega \rang \, , s \rang\begin -1 & -2/\sqrt \\ 0 & 1 \end\begina\\b\end. So in the basis \ (which is neither orthogonal nor a basis of the whole space) the action U_sU_\omega of applying U_\omega followed by U_s is given by the matrix : U_sU_\omega = \begin -1 & 0 \\ 2/\sqrt & 1 \end \begin -1 & -2/\sqrt \\ 0 & 1 \end = \begin 1 & 2/\sqrt \\ -2/\sqrt & 1-4/N \end. This matrix happens to have a very convenient
Jordan form In linear algebra, a Jordan normal form, also known as a Jordan canonical form (JCF), is an upper triangular matrix of a particular form called a Jordan matrix representing a linear operator on a finite-dimensional vector space with respect to so ...
. If we define t = \arcsin(1/\sqrt), it is : U_sU_\omega = M \begin e^ & 0 \\ 0 & e^\end M^ where M = \begin-i & i \\ e^ & e^ \end. It follows that ''r''-th power of the matrix (corresponding to ''r'' iterations) is : (U_sU_\omega)^r = M \begin e^ & 0 \\ 0 & e^\end M^. Using this form, we can use trigonometric identities to compute the probability of observing ''ω'' after ''r'' iterations mentioned in the previous section, :\left, \begin\lang\omega, \omega\rang & \lang\omega, s\rang\end(U_sU_\omega)^r \begin0 \\ 1\end \^2 = \sin^2\left( (2r+1)t\right). Alternatively, one might reasonably imagine that a near-optimal time to distinguish would be when the angles 2''rt'' and −2''rt'' are as far apart as possible, which corresponds to 2rt \approx \pi/2, or r = \pi/4t = \pi/4\arcsin(1/\sqrt) \approx \pi\sqrt/4. Then the system is in state : \omega \rang \, , s \rang(U_sU_\omega)^r \begin0\\1\end \approx \omega \rang \, , s \rangM \begin i & 0 \\ 0 & -i\end M^ \begin0\\1\end = , \omega \rang \frac - , s \rang \frac. A short calculation now shows that the observation yields the correct answer ''ω'' with error O\left (\frac \right).


Extensions and variants


Multiple matching entries

If, instead of 1 matching entry, there are ''k'' matching entries, the same algorithm works, but the number of iterations must be \frac instead of \frac. There are several ways to handle the case if ''k'' is unknown. A simple solution performs optimally up to a constant factor: run Grover's algorithm repeatedly for increasingly small values of ''k'', e.g., taking ''k'' = ''N'', ''N''/2, ''N''/4, ..., and so on, taking k = N/2^t for iteration ''t'' until a matching entry is found. With sufficiently high probability, a marked entry will be found by iteration t = \log_2(N/k) + c for some constant ''c''. Thus, the total number of iterations taken is at most : \frac \Big(1 + \sqrt + \sqrt + \cdots + \sqrt\Big) = O\big(\sqrt\big). A version of this algorithm is used in order to solve the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
.


Quantum partial search

A modification of Grover's algorithm called quantum partial search was described by Grover and Radhakrishnan in 2004. In partial search, one is not interested in finding the exact address of the target item, only the first few digits of the address. Equivalently, we can think of "chunking" the search space into blocks, and then asking "in which block is the target item?". In many applications, such a search yields enough information if the target address contains the information wanted. For instance, to use the example given by L. K. Grover, if one has a list of students organized by class rank, we may only be interested in whether a student is in the lower 25%, 25–50%, 50–75% or 75–100% percentile. To describe partial search, we consider a database separated into K blocks, each of size b = N/K. The partial search problem is easier. Consider the approach we would take classically – we pick one block at random, and then perform a normal search through the rest of the blocks (in set theory language, the complement). If we don't find the target, then we know it's in the block we didn't search. The average number of iterations drops from N/2 to (N-b)/2. Grover's algorithm requires \frac\sqrt iterations. Partial search will be faster by a numerical factor that depends on the number of blocks K. Partial search uses n_1 global iterations and n_2 local iterations. The global Grover operator is designated G_1 and the local Grover operator is designated G_2. The global Grover operator acts on the blocks. Essentially, it is given as follows: #Perform j_1 standard Grover iterations on the entire database. #Perform j_2 local Grover iterations. A local Grover iteration is a direct sum of Grover iterations over each block. #Perform one standard Grover iteration. The optimal values of j_1 and j_2 are discussed in the paper by Grover and Radhakrishnan. One might also wonder what happens if one applies successive partial searches at different levels of "resolution". This idea was studied in detail by
Vladimir Korepin Vladimir E. Korepin (born 1951) is a professor at the C. N. Yang Institute of Theoretical Physics of the Stony Brook University. Korepin made research contributions in several areas of mathematics and physics. Educational background Korepin c ...
and Xu, who called it binary quantum search. They proved that it is not in fact any faster than performing a single partial search.


Optimality

Grover's algorithm is optimal up to sub-constant factors. That is, any algorithm that accesses the database only by using the operator ''Uω'' must apply ''Uω'' at least a 1-o(1) fraction as many times as Grover's algorithm. The extension of Grover's algorithm to ''k'' matching entries, (''N''/''k'')1/2/4, is also optimal. This result is important in understanding the limits of quantum computation. If the Grover's search problem was solvable with ''N'' applications of ''Uω'', that would imply that NP is contained in BQP, by transforming problems in NP into Grover-type search problems. The optimality of Grover's algorithm suggests that quantum computers cannot solve
NP-Complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
problems in polynomial time, and thus NP is not contained in BQP. It has been shown that a class of non-local hidden variable quantum computers could implement a search of an N-item database in at most O(\sqrt steps. This is faster than the O(\sqrt) steps taken by Grover's algorithm.


See also

*
Amplitude amplification Amplitude amplification is a technique in quantum computing which generalizes the idea behind the Grover's search algorithm, and gives rise to a family of quantum algorithms. It was discovered by Gilles Brassard and Peter Høyer in 1997, and ind ...
*
Shor's algorithm Shor's algorithm is a quantum algorithm, quantum computer algorithm for finding the prime factors of an integer. It was developed in 1994 by the American mathematician Peter Shor. On a quantum computer, to factor an integer N , Shor's algorithm ...
(for factorization) * Brassard–Høyer–Tapp algorithm (for solving the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
)


Notes


References

* Grover L.K.:
A fast quantum mechanical algorithm for database search
', Proceedings, 28th Annual ACM Symposium on the Theory of Computing, (May 1996) p. 212 * Grover L.K.:
From Schrödinger's equation to quantum search algorithm
', American Journal of Physics, 69(7): 769–777, 2001. Pedagogical review of the algorithm and its history. * Grover L.K.

''The Sciences'', July/August 1999, pp. 24–30. * Nielsen, M.A. and Chuang, I.L. ''Quantum computation and quantum information''. Cambridge University Press, 2000. Chapter 6.
What's a Quantum Phone Book?
Lov Grover, Lucent Technologies


External links

* * * * * * * {{DEFAULTSORT:Grover's Algorithm Quantum algorithms Search algorithms Post-quantum cryptography>\omega \rang \, , s \rang\begin -1 & 0 \\ 2/\sqrt & 1 \end\begina\\b\end. : U_\omega : a , \omega \rang + b , s \rang \mapsto \omega_\rang_\,_, _s_\rang\begin -1_&_-2/\sqrt_\\ 0_&_1_\end\begina\\b\end. So_in_the_basis_\_(which_is_neither_orthogonal_nor_a_basis_of_the_whole_space)_the_action_U_sU_\omega_of_applying_U_\omega_followed_by_U_s_is_given_by_the_matrix :_U_sU_\omega_=_\begin_-1_&_0_\\_2/\sqrt_&_1_\end \begin -1_&_-2/\sqrt_\\ 0_&_1_\end _=_ \begin 1_&_2/\sqrt_\\ -2/\sqrt_&_1-4/N_\end. This_matrix_happens_to_have_a_very_convenient_
Jordan_form In linear algebra, a Jordan normal form, also known as a Jordan canonical form (JCF), is an upper triangular matrix of a particular form called a Jordan matrix representing a linear operator on a finite-dimensional vector space with respect to so ...
._If_we_define_t_=_\arcsin(1/\sqrt),_it_is :_U_sU_\omega_=_M_\begin_e^_&_0_\\_0_&_e^\end_M^_where_M_=_\begin-i_&_i_\\_e^_&_e^_\end. It_follows_that_''r''-th_power_of_the_matrix_(corresponding_to_''r''_iterations)_is_ :_(U_sU_\omega)^r_=_M_\begin_e^_&_0_\\_0_&_e^\end_M^. Using_this_form,_we_can_use_trigonometric_identities_to_compute_the_probability_of_observing_''ω''_after_''r''_iterations_mentioned_in_the_previous_section,_ :\left, \begin\lang\omega, \omega\rang_&_\lang\omega, s\rang\end(U_sU_\omega)^r_\begin0_\\_1\end_\^2_=_\sin^2\left(_(2r+1)t\right). Alternatively,_one_might_reasonably_imagine_that_a_near-optimal_time_to_distinguish_would_be_when_the_angles_2''rt''_and_−2''rt''_are_as_far_apart_as_possible,_which_corresponds_to_2rt_\approx_\pi/2,_or_r_=_\pi/4t_=_\pi/4\arcsin(1/\sqrt)_\approx_\pi\sqrt/4._Then_the_system_is_in_state :_ \omega_\rang_\,_, _s_\rang(U_sU_\omega)^r_\begin0\\1\end_\approx_ \omega_\rang_\,_, _s_\rangM_\begin_i_&_0_\\_0_&_-i\end_M^_\begin0\\1\end_=_, _\omega_\rang_\frac_-_, s_\rang_\frac. A_short_calculation_now_shows_that_the_observation_yields_the_correct_answer_''ω''_with_error_O\left_(\frac_\right).


__Extensions_and_variants_


__Multiple_matching_entries_

If,_instead_of_1_matching_entry,_there_are_''k''_matching_entries,_the_same_algorithm_works,_but_the_number_of_iterations_must_be__\frac_instead_of__\frac. There_are_several_ways_to_handle_the_case_if_''k''_is_unknown._A_simple_solution_performs_optimally_up_to_a_constant_factor:_run_Grover's_algorithm_repeatedly_for_increasingly_small_values_of_''k'',_e.g.,_taking_''k''_=_''N'',_''N''/2,_''N''/4,_...,_and_so_on,_taking_k_=_N/2^t_for_iteration_''t''_until_a_matching_entry_is_found. With_sufficiently_high_probability,_a_marked_entry_will_be_found_by_iteration_t_=_\log_2(N/k)_+_c_for_some_constant_''c''._Thus,_the_total_number_of_iterations_taken_is_at_most :_\frac_\Big(1_+_\sqrt_+_\sqrt_+_\cdots_+_\sqrt\Big)_=_O\big(\sqrt\big)._ A_version_of_this_algorithm_is_used_in_order_to_solve_the_collision_problem_ The_r-to-1_collision_problem_is_an_important_theoretical_problem_in__complexity_theory,__quantum_computing,_and__computational_mathematics._The_collision_problem_most_often_refers_to_the_2-to-1_version:_given_n_even_and_a_function_f:\,\\rightarrow\_...
.


_Quantum_partial_search

A__modification_of_Grover's_algorithm_called_quantum_partial_search_was_described_by_Grover_and_Radhakrishnan_in_2004._In_partial_search,_one_is_not_interested_in_finding_the_exact_address_of_the_target_item,_only_the_first_few_digits_of_the_address._Equivalently,_we_can_think_of_"chunking"_the_search_space_into_blocks,_and_then_asking_"in_which_block_is_the_target_item?"._In_many_applications,_such_a_search_yields_enough_information_if_the_target_address_contains_the_information_wanted._For_instance,_to_use_the_example_given_by_L._K._Grover,_if_one_has_a_list_of_students_organized_by_class_rank,_we_may_only_be_interested_in_whether_a_student_is_in_the_lower_25%,_25–50%,_50–75%_or_75–100%_percentile. To_describe_partial_search,_we_consider_a_database_separated_into_K_blocks,_each_of_size_b_=_N/K._The_partial_search_problem_is_easier._Consider_the_approach_we_would_take_classically_–_we_pick_one_block_at_random,_and_then_perform_a_normal_search_through_the_rest_of_the_blocks_(in_set_theory_language,_the_complement)._If_we_don't_find_the_target,_then_we_know_it's_in_the_block_we_didn't_search._The_average_number_of_iterations_drops_from_N/2_to_(N-b)/2. Grover's_algorithm_requires_\frac\sqrt_iterations._Partial_search_will_be_faster_by_a_numerical_factor_that_depends_on_the_number_of_blocks_K._Partial_search_uses_n_1_global_iterations_and_n_2_local_iterations._The_global_Grover_operator_is_designated_G_1_and_the_local_Grover_operator_is_designated_G_2. The_global_Grover_operator_acts_on_the_blocks._Essentially,_it_is_given_as_follows: #Perform_j_1_standard_Grover_iterations_on_the_entire_database. #Perform_j_2_local_Grover_iterations._A_local_Grover_iteration_is_a_direct_sum_of_Grover_iterations_over_each_block. #Perform_one_standard_Grover_iteration. The_optimal_values_of_j_1_and_j_2_are_discussed_in_the_paper_by_Grover_and_Radhakrishnan._One_might_also_wonder_what_happens_if_one_applies_successive_partial_searches_at_different_levels_of_"resolution"._This_idea_was_studied_in_detail_by_
Vladimir_Korepin Vladimir E. Korepin (born 1951) is a professor at the C. N. Yang Institute of Theoretical Physics of the Stony Brook University. Korepin made research contributions in several areas of mathematics and physics. Educational background Korepin c ...
_and_Xu,_who_called_it_binary_quantum_search._They_proved_that_it_is_not_in_fact_any_faster_than_performing_a_single_partial_search.


_Optimality_

Grover's_algorithm_is_optimal_up_to_sub-constant_factors._That_is,_any_algorithm_that_accesses_the_database_only_by_using_the_operator_''Uω''_must_apply_''Uω''_at_least_a_1-o(1)_fraction_as_many_times_as_Grover's_algorithm._The_extension_of_Grover's_algorithm_to_''k''_matching_entries,_(''N''/''k'')1/2/4,_is_also_optimal._This_result_is_important_in_understanding_the_limits_of_quantum_computation. If_the_Grover's_search_problem_was_solvable_with__''N''_applications_of_''Uω'',_that_would_imply_that_ NP_is_contained_in_ BQP,_by_transforming_problems_in_NP_into_Grover-type_search_problems._The_optimality_of_Grover's_algorithm_suggests_that_quantum_computers_cannot_solve_
NP-Complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
_problems_in_polynomial_time,_and_thus_NP_is_not_contained_in_BQP. It_has_been_shown_that_a_class_of_non-local_ hidden_variable_quantum_computers_could_implement_a_search_of_an_N-item_database_in_at_most_O(\sqrt _steps._This_is_faster_than_the_O(\sqrt)_steps_taken_by_Grover's_algorithm.


_See_also

*_
Amplitude_amplification Amplitude amplification is a technique in quantum computing which generalizes the idea behind the Grover's search algorithm, and gives rise to a family of quantum algorithms. It was discovered by Gilles Brassard and Peter Høyer in 1997, and ind ...
*_
Shor's_algorithm Shor's algorithm is a quantum algorithm, quantum computer algorithm for finding the prime factors of an integer. It was developed in 1994 by the American mathematician Peter Shor. On a quantum computer, to factor an integer N , Shor's algorithm ...
_(for_factorization) *__Brassard–Høyer–Tapp_algorithm_(for_solving_the_collision_problem_ The_r-to-1_collision_problem_is_an_important_theoretical_problem_in__complexity_theory,__quantum_computing,_and__computational_mathematics._The_collision_problem_most_often_refers_to_the_2-to-1_version:_given_n_even_and_a_function_f:\,\\rightarrow\_...
)


_Notes


__References_

*_Grover_L.K.:_
A_fast_quantum_mechanical_algorithm_for_database_search
',_Proceedings,_28th_Annual_ACM_Symposium_on_the_Theory_of_Computing,_(May_1996)_p. 212 *_Grover_L.K.:_
From_Schrödinger's_equation_to_quantum_search_algorithm
',_American_Journal_of_Physics,_69(7):_769–777,_2001._Pedagogical_review_of_the_algorithm_and_its_history. *_Grover_L.K.

''The_Sciences'',_July/August_1999,_pp. 24–30. *_Nielsen,_M.A._and_Chuang,_I.L._''Quantum_computation_and_quantum_information''._Cambridge_University_Press,_2000._Chapter_6.
What's_a_Quantum_Phone_Book?
_Lov_Grover,_Lucent_Technologies


_External_links

*_ *_ *_ *_ *_ *_ *_ {{DEFAULTSORT:Grover's_Algorithm Quantum_algorithms Search_algorithms Post-quantum_cryptographyhtml" ;"title="\omega \rang \, , s \rang] \begin -1 & 0 \\ 2/\sqrt & 1 \end\begina\\b\end. : U_\omega : a , \omega \rang + b , s \rang \mapsto \omega \rang \, , s \rang\begin -1 & -2/\sqrt \\ 0 & 1 \end\begina\\b\end. So in the basis \ (which is neither orthogonal nor a basis of the whole space) the action U_sU_\omega of applying U_\omega followed by U_s is given by the matrix : U_sU_\omega = \begin -1 & 0 \\ 2/\sqrt & 1 \end \begin -1 & -2/\sqrt \\ 0 & 1 \end = \begin 1 & 2/\sqrt \\ -2/\sqrt & 1-4/N \end. This matrix happens to have a very convenient
Jordan form In linear algebra, a Jordan normal form, also known as a Jordan canonical form (JCF), is an upper triangular matrix of a particular form called a Jordan matrix representing a linear operator on a finite-dimensional vector space with respect to so ...
. If we define t = \arcsin(1/\sqrt), it is : U_sU_\omega = M \begin e^ & 0 \\ 0 & e^\end M^ where M = \begin-i & i \\ e^ & e^ \end. It follows that ''r''-th power of the matrix (corresponding to ''r'' iterations) is : (U_sU_\omega)^r = M \begin e^ & 0 \\ 0 & e^\end M^. Using this form, we can use trigonometric identities to compute the probability of observing ''ω'' after ''r'' iterations mentioned in the previous section, :\left, \begin\lang\omega, \omega\rang & \lang\omega, s\rang\end(U_sU_\omega)^r \begin0 \\ 1\end \^2 = \sin^2\left( (2r+1)t\right). Alternatively, one might reasonably imagine that a near-optimal time to distinguish would be when the angles 2''rt'' and −2''rt'' are as far apart as possible, which corresponds to 2rt \approx \pi/2, or r = \pi/4t = \pi/4\arcsin(1/\sqrt) \approx \pi\sqrt/4. Then the system is in state : \omega \rang \, , s \rang(U_sU_\omega)^r \begin0\\1\end \approx \omega \rang \, , s \rangM \begin i & 0 \\ 0 & -i\end M^ \begin0\\1\end = , \omega \rang \frac - , s \rang \frac. A short calculation now shows that the observation yields the correct answer ''ω'' with error O\left (\frac \right).


Extensions and variants


Multiple matching entries

If, instead of 1 matching entry, there are ''k'' matching entries, the same algorithm works, but the number of iterations must be \frac instead of \frac. There are several ways to handle the case if ''k'' is unknown. A simple solution performs optimally up to a constant factor: run Grover's algorithm repeatedly for increasingly small values of ''k'', e.g., taking ''k'' = ''N'', ''N''/2, ''N''/4, ..., and so on, taking k = N/2^t for iteration ''t'' until a matching entry is found. With sufficiently high probability, a marked entry will be found by iteration t = \log_2(N/k) + c for some constant ''c''. Thus, the total number of iterations taken is at most : \frac \Big(1 + \sqrt + \sqrt + \cdots + \sqrt\Big) = O\big(\sqrt\big). A version of this algorithm is used in order to solve the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
.


Quantum partial search

A modification of Grover's algorithm called quantum partial search was described by Grover and Radhakrishnan in 2004. In partial search, one is not interested in finding the exact address of the target item, only the first few digits of the address. Equivalently, we can think of "chunking" the search space into blocks, and then asking "in which block is the target item?". In many applications, such a search yields enough information if the target address contains the information wanted. For instance, to use the example given by L. K. Grover, if one has a list of students organized by class rank, we may only be interested in whether a student is in the lower 25%, 25–50%, 50–75% or 75–100% percentile. To describe partial search, we consider a database separated into K blocks, each of size b = N/K. The partial search problem is easier. Consider the approach we would take classically – we pick one block at random, and then perform a normal search through the rest of the blocks (in set theory language, the complement). If we don't find the target, then we know it's in the block we didn't search. The average number of iterations drops from N/2 to (N-b)/2. Grover's algorithm requires \frac\sqrt iterations. Partial search will be faster by a numerical factor that depends on the number of blocks K. Partial search uses n_1 global iterations and n_2 local iterations. The global Grover operator is designated G_1 and the local Grover operator is designated G_2. The global Grover operator acts on the blocks. Essentially, it is given as follows: #Perform j_1 standard Grover iterations on the entire database. #Perform j_2 local Grover iterations. A local Grover iteration is a direct sum of Grover iterations over each block. #Perform one standard Grover iteration. The optimal values of j_1 and j_2 are discussed in the paper by Grover and Radhakrishnan. One might also wonder what happens if one applies successive partial searches at different levels of "resolution". This idea was studied in detail by
Vladimir Korepin Vladimir E. Korepin (born 1951) is a professor at the C. N. Yang Institute of Theoretical Physics of the Stony Brook University. Korepin made research contributions in several areas of mathematics and physics. Educational background Korepin c ...
and Xu, who called it binary quantum search. They proved that it is not in fact any faster than performing a single partial search.


Optimality

Grover's algorithm is optimal up to sub-constant factors. That is, any algorithm that accesses the database only by using the operator ''Uω'' must apply ''Uω'' at least a 1-o(1) fraction as many times as Grover's algorithm. The extension of Grover's algorithm to ''k'' matching entries, (''N''/''k'')1/2/4, is also optimal. This result is important in understanding the limits of quantum computation. If the Grover's search problem was solvable with ''N'' applications of ''Uω'', that would imply that NP is contained in BQP, by transforming problems in NP into Grover-type search problems. The optimality of Grover's algorithm suggests that quantum computers cannot solve
NP-Complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
problems in polynomial time, and thus NP is not contained in BQP. It has been shown that a class of non-local hidden variable quantum computers could implement a search of an N-item database in at most O(\sqrt steps. This is faster than the O(\sqrt) steps taken by Grover's algorithm.


See also

*
Amplitude amplification Amplitude amplification is a technique in quantum computing which generalizes the idea behind the Grover's search algorithm, and gives rise to a family of quantum algorithms. It was discovered by Gilles Brassard and Peter Høyer in 1997, and ind ...
*
Shor's algorithm Shor's algorithm is a quantum algorithm, quantum computer algorithm for finding the prime factors of an integer. It was developed in 1994 by the American mathematician Peter Shor. On a quantum computer, to factor an integer N , Shor's algorithm ...
(for factorization) * Brassard–Høyer–Tapp algorithm (for solving the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
)


Notes


References

* Grover L.K.:
A fast quantum mechanical algorithm for database search
', Proceedings, 28th Annual ACM Symposium on the Theory of Computing, (May 1996) p. 212 * Grover L.K.:
From Schrödinger's equation to quantum search algorithm
', American Journal of Physics, 69(7): 769–777, 2001. Pedagogical review of the algorithm and its history. * Grover L.K.

''The Sciences'', July/August 1999, pp. 24–30. * Nielsen, M.A. and Chuang, I.L. ''Quantum computation and quantum information''. Cambridge University Press, 2000. Chapter 6.
What's a Quantum Phone Book?
Lov Grover, Lucent Technologies


External links

* * * * * * * {{DEFAULTSORT:Grover's Algorithm Quantum algorithms Search algorithms Post-quantum cryptography>\omega \rang \, , s \rang\begin -1 & -2/\sqrt \\ 0 & 1 \end\begina\\b\end. So in the basis \ (which is neither orthogonal nor a basis of the whole space) the action U_sU_\omega of applying U_\omega followed by U_s is given by the matrix : U_sU_\omega = \begin -1 & 0 \\ 2/\sqrt & 1 \end \begin -1 & -2/\sqrt \\ 0 & 1 \end = \begin 1 & 2/\sqrt \\ -2/\sqrt & 1-4/N \end. This matrix happens to have a very convenient
Jordan form In linear algebra, a Jordan normal form, also known as a Jordan canonical form (JCF), is an upper triangular matrix of a particular form called a Jordan matrix representing a linear operator on a finite-dimensional vector space with respect to so ...
. If we define t = \arcsin(1/\sqrt), it is : U_sU_\omega = M \begin e^ & 0 \\ 0 & e^\end M^ where M = \begin-i & i \\ e^ & e^ \end. It follows that ''r''-th power of the matrix (corresponding to ''r'' iterations) is : (U_sU_\omega)^r = M \begin e^ & 0 \\ 0 & e^\end M^. Using this form, we can use trigonometric identities to compute the probability of observing ''ω'' after ''r'' iterations mentioned in the previous section, :\left, \begin\lang\omega, \omega\rang & \lang\omega, s\rang\end(U_sU_\omega)^r \begin0 \\ 1\end \^2 = \sin^2\left( (2r+1)t\right). Alternatively, one might reasonably imagine that a near-optimal time to distinguish would be when the angles 2''rt'' and −2''rt'' are as far apart as possible, which corresponds to 2rt \approx \pi/2, or r = \pi/4t = \pi/4\arcsin(1/\sqrt) \approx \pi\sqrt/4. Then the system is in state : \omega_\rang_\,_, _s_\rang\begin -1_&_-2/\sqrt_\\ 0_&_1_\end\begina\\b\end. So_in_the_basis_\_(which_is_neither_orthogonal_nor_a_basis_of_the_whole_space)_the_action_U_sU_\omega_of_applying_U_\omega_followed_by_U_s_is_given_by_the_matrix :_U_sU_\omega_=_\begin_-1_&_0_\\_2/\sqrt_&_1_\end \begin -1_&_-2/\sqrt_\\ 0_&_1_\end _=_ \begin 1_&_2/\sqrt_\\ -2/\sqrt_&_1-4/N_\end. This_matrix_happens_to_have_a_very_convenient_
Jordan_form In linear algebra, a Jordan normal form, also known as a Jordan canonical form (JCF), is an upper triangular matrix of a particular form called a Jordan matrix representing a linear operator on a finite-dimensional vector space with respect to so ...
._If_we_define_t_=_\arcsin(1/\sqrt),_it_is :_U_sU_\omega_=_M_\begin_e^_&_0_\\_0_&_e^\end_M^_where_M_=_\begin-i_&_i_\\_e^_&_e^_\end. It_follows_that_''r''-th_power_of_the_matrix_(corresponding_to_''r''_iterations)_is_ :_(U_sU_\omega)^r_=_M_\begin_e^_&_0_\\_0_&_e^\end_M^. Using_this_form,_we_can_use_trigonometric_identities_to_compute_the_probability_of_observing_''ω''_after_''r''_iterations_mentioned_in_the_previous_section,_ :\left, \begin\lang\omega, \omega\rang_&_\lang\omega, s\rang\end(U_sU_\omega)^r_\begin0_\\_1\end_\^2_=_\sin^2\left(_(2r+1)t\right). Alternatively,_one_might_reasonably_imagine_that_a_near-optimal_time_to_distinguish_would_be_when_the_angles_2''rt''_and_−2''rt''_are_as_far_apart_as_possible,_which_corresponds_to_2rt_\approx_\pi/2,_or_r_=_\pi/4t_=_\pi/4\arcsin(1/\sqrt)_\approx_\pi\sqrt/4._Then_the_system_is_in_state :_ \omega_\rang_\,_, _s_\rang(U_sU_\omega)^r_\begin0\\1\end_\approx_ \omega_\rang_\,_, _s_\rangM_\begin_i_&_0_\\_0_&_-i\end_M^_\begin0\\1\end_=_, _\omega_\rang_\frac_-_, s_\rang_\frac. A_short_calculation_now_shows_that_the_observation_yields_the_correct_answer_''ω''_with_error_O\left_(\frac_\right).


__Extensions_and_variants_


__Multiple_matching_entries_

If,_instead_of_1_matching_entry,_there_are_''k''_matching_entries,_the_same_algorithm_works,_but_the_number_of_iterations_must_be__\frac_instead_of__\frac. There_are_several_ways_to_handle_the_case_if_''k''_is_unknown._A_simple_solution_performs_optimally_up_to_a_constant_factor:_run_Grover's_algorithm_repeatedly_for_increasingly_small_values_of_''k'',_e.g.,_taking_''k''_=_''N'',_''N''/2,_''N''/4,_...,_and_so_on,_taking_k_=_N/2^t_for_iteration_''t''_until_a_matching_entry_is_found. With_sufficiently_high_probability,_a_marked_entry_will_be_found_by_iteration_t_=_\log_2(N/k)_+_c_for_some_constant_''c''._Thus,_the_total_number_of_iterations_taken_is_at_most :_\frac_\Big(1_+_\sqrt_+_\sqrt_+_\cdots_+_\sqrt\Big)_=_O\big(\sqrt\big)._ A_version_of_this_algorithm_is_used_in_order_to_solve_the_collision_problem_ The_r-to-1_collision_problem_is_an_important_theoretical_problem_in__complexity_theory,__quantum_computing,_and__computational_mathematics._The_collision_problem_most_often_refers_to_the_2-to-1_version:_given_n_even_and_a_function_f:\,\\rightarrow\_...
.


_Quantum_partial_search

A__modification_of_Grover's_algorithm_called_quantum_partial_search_was_described_by_Grover_and_Radhakrishnan_in_2004._In_partial_search,_one_is_not_interested_in_finding_the_exact_address_of_the_target_item,_only_the_first_few_digits_of_the_address._Equivalently,_we_can_think_of_"chunking"_the_search_space_into_blocks,_and_then_asking_"in_which_block_is_the_target_item?"._In_many_applications,_such_a_search_yields_enough_information_if_the_target_address_contains_the_information_wanted._For_instance,_to_use_the_example_given_by_L._K._Grover,_if_one_has_a_list_of_students_organized_by_class_rank,_we_may_only_be_interested_in_whether_a_student_is_in_the_lower_25%,_25–50%,_50–75%_or_75–100%_percentile. To_describe_partial_search,_we_consider_a_database_separated_into_K_blocks,_each_of_size_b_=_N/K._The_partial_search_problem_is_easier._Consider_the_approach_we_would_take_classically_–_we_pick_one_block_at_random,_and_then_perform_a_normal_search_through_the_rest_of_the_blocks_(in_set_theory_language,_the_complement)._If_we_don't_find_the_target,_then_we_know_it's_in_the_block_we_didn't_search._The_average_number_of_iterations_drops_from_N/2_to_(N-b)/2. Grover's_algorithm_requires_\frac\sqrt_iterations._Partial_search_will_be_faster_by_a_numerical_factor_that_depends_on_the_number_of_blocks_K._Partial_search_uses_n_1_global_iterations_and_n_2_local_iterations._The_global_Grover_operator_is_designated_G_1_and_the_local_Grover_operator_is_designated_G_2. The_global_Grover_operator_acts_on_the_blocks._Essentially,_it_is_given_as_follows: #Perform_j_1_standard_Grover_iterations_on_the_entire_database. #Perform_j_2_local_Grover_iterations._A_local_Grover_iteration_is_a_direct_sum_of_Grover_iterations_over_each_block. #Perform_one_standard_Grover_iteration. The_optimal_values_of_j_1_and_j_2_are_discussed_in_the_paper_by_Grover_and_Radhakrishnan._One_might_also_wonder_what_happens_if_one_applies_successive_partial_searches_at_different_levels_of_"resolution"._This_idea_was_studied_in_detail_by_
Vladimir_Korepin Vladimir E. Korepin (born 1951) is a professor at the C. N. Yang Institute of Theoretical Physics of the Stony Brook University. Korepin made research contributions in several areas of mathematics and physics. Educational background Korepin c ...
_and_Xu,_who_called_it_binary_quantum_search._They_proved_that_it_is_not_in_fact_any_faster_than_performing_a_single_partial_search.


_Optimality_

Grover's_algorithm_is_optimal_up_to_sub-constant_factors._That_is,_any_algorithm_that_accesses_the_database_only_by_using_the_operator_''Uω''_must_apply_''Uω''_at_least_a_1-o(1)_fraction_as_many_times_as_Grover's_algorithm._The_extension_of_Grover's_algorithm_to_''k''_matching_entries,_(''N''/''k'')1/2/4,_is_also_optimal._This_result_is_important_in_understanding_the_limits_of_quantum_computation. If_the_Grover's_search_problem_was_solvable_with__''N''_applications_of_''Uω'',_that_would_imply_that_ NP_is_contained_in_ BQP,_by_transforming_problems_in_NP_into_Grover-type_search_problems._The_optimality_of_Grover's_algorithm_suggests_that_quantum_computers_cannot_solve_
NP-Complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
_problems_in_polynomial_time,_and_thus_NP_is_not_contained_in_BQP. It_has_been_shown_that_a_class_of_non-local_ hidden_variable_quantum_computers_could_implement_a_search_of_an_N-item_database_in_at_most_O(\sqrt _steps._This_is_faster_than_the_O(\sqrt)_steps_taken_by_Grover's_algorithm.


_See_also

*_
Amplitude_amplification Amplitude amplification is a technique in quantum computing which generalizes the idea behind the Grover's search algorithm, and gives rise to a family of quantum algorithms. It was discovered by Gilles Brassard and Peter Høyer in 1997, and ind ...
*_
Shor's_algorithm Shor's algorithm is a quantum algorithm, quantum computer algorithm for finding the prime factors of an integer. It was developed in 1994 by the American mathematician Peter Shor. On a quantum computer, to factor an integer N , Shor's algorithm ...
_(for_factorization) *__Brassard–Høyer–Tapp_algorithm_(for_solving_the_collision_problem_ The_r-to-1_collision_problem_is_an_important_theoretical_problem_in__complexity_theory,__quantum_computing,_and__computational_mathematics._The_collision_problem_most_often_refers_to_the_2-to-1_version:_given_n_even_and_a_function_f:\,\\rightarrow\_...
)


_Notes


__References_

*_Grover_L.K.:_
A_fast_quantum_mechanical_algorithm_for_database_search
',_Proceedings,_28th_Annual_ACM_Symposium_on_the_Theory_of_Computing,_(May_1996)_p. 212 *_Grover_L.K.:_
From_Schrödinger's_equation_to_quantum_search_algorithm
',_American_Journal_of_Physics,_69(7):_769–777,_2001._Pedagogical_review_of_the_algorithm_and_its_history. *_Grover_L.K.

''The_Sciences'',_July/August_1999,_pp. 24–30. *_Nielsen,_M.A._and_Chuang,_I.L._''Quantum_computation_and_quantum_information''._Cambridge_University_Press,_2000._Chapter_6.
What's_a_Quantum_Phone_Book?
_Lov_Grover,_Lucent_Technologies


_External_links

*_ *_ *_ *_ *_ *_ *_ {{DEFAULTSORT:Grover's_Algorithm Quantum_algorithms Search_algorithms Post-quantum_cryptographyhtml" ;"title="\omega \rang \, , s \rang] \begin -1 & 0 \\ 2/\sqrt & 1 \end\begina\\b\end. : U_\omega : a , \omega \rang + b , s \rang \mapsto \omega \rang \, , s \rang\begin -1 & -2/\sqrt \\ 0 & 1 \end\begina\\b\end. So in the basis \ (which is neither orthogonal nor a basis of the whole space) the action U_sU_\omega of applying U_\omega followed by U_s is given by the matrix : U_sU_\omega = \begin -1 & 0 \\ 2/\sqrt & 1 \end \begin -1 & -2/\sqrt \\ 0 & 1 \end = \begin 1 & 2/\sqrt \\ -2/\sqrt & 1-4/N \end. This matrix happens to have a very convenient
Jordan form In linear algebra, a Jordan normal form, also known as a Jordan canonical form (JCF), is an upper triangular matrix of a particular form called a Jordan matrix representing a linear operator on a finite-dimensional vector space with respect to so ...
. If we define t = \arcsin(1/\sqrt), it is : U_sU_\omega = M \begin e^ & 0 \\ 0 & e^\end M^ where M = \begin-i & i \\ e^ & e^ \end. It follows that ''r''-th power of the matrix (corresponding to ''r'' iterations) is : (U_sU_\omega)^r = M \begin e^ & 0 \\ 0 & e^\end M^. Using this form, we can use trigonometric identities to compute the probability of observing ''ω'' after ''r'' iterations mentioned in the previous section, :\left, \begin\lang\omega, \omega\rang & \lang\omega, s\rang\end(U_sU_\omega)^r \begin0 \\ 1\end \^2 = \sin^2\left( (2r+1)t\right). Alternatively, one might reasonably imagine that a near-optimal time to distinguish would be when the angles 2''rt'' and −2''rt'' are as far apart as possible, which corresponds to 2rt \approx \pi/2, or r = \pi/4t = \pi/4\arcsin(1/\sqrt) \approx \pi\sqrt/4. Then the system is in state : \omega \rang \, , s \rang(U_sU_\omega)^r \begin0\\1\end \approx \omega \rang \, , s \rangM \begin i & 0 \\ 0 & -i\end M^ \begin0\\1\end = , \omega \rang \frac - , s \rang \frac. A short calculation now shows that the observation yields the correct answer ''ω'' with error O\left (\frac \right).


Extensions and variants


Multiple matching entries

If, instead of 1 matching entry, there are ''k'' matching entries, the same algorithm works, but the number of iterations must be \frac instead of \frac. There are several ways to handle the case if ''k'' is unknown. A simple solution performs optimally up to a constant factor: run Grover's algorithm repeatedly for increasingly small values of ''k'', e.g., taking ''k'' = ''N'', ''N''/2, ''N''/4, ..., and so on, taking k = N/2^t for iteration ''t'' until a matching entry is found. With sufficiently high probability, a marked entry will be found by iteration t = \log_2(N/k) + c for some constant ''c''. Thus, the total number of iterations taken is at most : \frac \Big(1 + \sqrt + \sqrt + \cdots + \sqrt\Big) = O\big(\sqrt\big). A version of this algorithm is used in order to solve the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
.


Quantum partial search

A modification of Grover's algorithm called quantum partial search was described by Grover and Radhakrishnan in 2004. In partial search, one is not interested in finding the exact address of the target item, only the first few digits of the address. Equivalently, we can think of "chunking" the search space into blocks, and then asking "in which block is the target item?". In many applications, such a search yields enough information if the target address contains the information wanted. For instance, to use the example given by L. K. Grover, if one has a list of students organized by class rank, we may only be interested in whether a student is in the lower 25%, 25–50%, 50–75% or 75–100% percentile. To describe partial search, we consider a database separated into K blocks, each of size b = N/K. The partial search problem is easier. Consider the approach we would take classically – we pick one block at random, and then perform a normal search through the rest of the blocks (in set theory language, the complement). If we don't find the target, then we know it's in the block we didn't search. The average number of iterations drops from N/2 to (N-b)/2. Grover's algorithm requires \frac\sqrt iterations. Partial search will be faster by a numerical factor that depends on the number of blocks K. Partial search uses n_1 global iterations and n_2 local iterations. The global Grover operator is designated G_1 and the local Grover operator is designated G_2. The global Grover operator acts on the blocks. Essentially, it is given as follows: #Perform j_1 standard Grover iterations on the entire database. #Perform j_2 local Grover iterations. A local Grover iteration is a direct sum of Grover iterations over each block. #Perform one standard Grover iteration. The optimal values of j_1 and j_2 are discussed in the paper by Grover and Radhakrishnan. One might also wonder what happens if one applies successive partial searches at different levels of "resolution". This idea was studied in detail by
Vladimir Korepin Vladimir E. Korepin (born 1951) is a professor at the C. N. Yang Institute of Theoretical Physics of the Stony Brook University. Korepin made research contributions in several areas of mathematics and physics. Educational background Korepin c ...
and Xu, who called it binary quantum search. They proved that it is not in fact any faster than performing a single partial search.


Optimality

Grover's algorithm is optimal up to sub-constant factors. That is, any algorithm that accesses the database only by using the operator ''Uω'' must apply ''Uω'' at least a 1-o(1) fraction as many times as Grover's algorithm. The extension of Grover's algorithm to ''k'' matching entries, (''N''/''k'')1/2/4, is also optimal. This result is important in understanding the limits of quantum computation. If the Grover's search problem was solvable with ''N'' applications of ''Uω'', that would imply that NP is contained in BQP, by transforming problems in NP into Grover-type search problems. The optimality of Grover's algorithm suggests that quantum computers cannot solve
NP-Complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
problems in polynomial time, and thus NP is not contained in BQP. It has been shown that a class of non-local hidden variable quantum computers could implement a search of an N-item database in at most O(\sqrt steps. This is faster than the O(\sqrt) steps taken by Grover's algorithm.


See also

*
Amplitude amplification Amplitude amplification is a technique in quantum computing which generalizes the idea behind the Grover's search algorithm, and gives rise to a family of quantum algorithms. It was discovered by Gilles Brassard and Peter Høyer in 1997, and ind ...
*
Shor's algorithm Shor's algorithm is a quantum algorithm, quantum computer algorithm for finding the prime factors of an integer. It was developed in 1994 by the American mathematician Peter Shor. On a quantum computer, to factor an integer N , Shor's algorithm ...
(for factorization) * Brassard–Høyer–Tapp algorithm (for solving the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
)


Notes


References

* Grover L.K.:
A fast quantum mechanical algorithm for database search
', Proceedings, 28th Annual ACM Symposium on the Theory of Computing, (May 1996) p. 212 * Grover L.K.:
From Schrödinger's equation to quantum search algorithm
', American Journal of Physics, 69(7): 769–777, 2001. Pedagogical review of the algorithm and its history. * Grover L.K.

''The Sciences'', July/August 1999, pp. 24–30. * Nielsen, M.A. and Chuang, I.L. ''Quantum computation and quantum information''. Cambridge University Press, 2000. Chapter 6.
What's a Quantum Phone Book?
Lov Grover, Lucent Technologies


External links

* * * * * * * {{DEFAULTSORT:Grover's Algorithm Quantum algorithms Search algorithms Post-quantum cryptography>\omega \rang \, , s \rang(U_sU_\omega)^r \begin0\\1\end \approx \omega_\rang_\,_, _s_\rang\begin -1_&_-2/\sqrt_\\ 0_&_1_\end\begina\\b\end. So_in_the_basis_\_(which_is_neither_orthogonal_nor_a_basis_of_the_whole_space)_the_action_U_sU_\omega_of_applying_U_\omega_followed_by_U_s_is_given_by_the_matrix :_U_sU_\omega_=_\begin_-1_&_0_\\_2/\sqrt_&_1_\end \begin -1_&_-2/\sqrt_\\ 0_&_1_\end _=_ \begin 1_&_2/\sqrt_\\ -2/\sqrt_&_1-4/N_\end. This_matrix_happens_to_have_a_very_convenient_
Jordan_form In linear algebra, a Jordan normal form, also known as a Jordan canonical form (JCF), is an upper triangular matrix of a particular form called a Jordan matrix representing a linear operator on a finite-dimensional vector space with respect to so ...
._If_we_define_t_=_\arcsin(1/\sqrt),_it_is :_U_sU_\omega_=_M_\begin_e^_&_0_\\_0_&_e^\end_M^_where_M_=_\begin-i_&_i_\\_e^_&_e^_\end. It_follows_that_''r''-th_power_of_the_matrix_(corresponding_to_''r''_iterations)_is_ :_(U_sU_\omega)^r_=_M_\begin_e^_&_0_\\_0_&_e^\end_M^. Using_this_form,_we_can_use_trigonometric_identities_to_compute_the_probability_of_observing_''ω''_after_''r''_iterations_mentioned_in_the_previous_section,_ :\left, \begin\lang\omega, \omega\rang_&_\lang\omega, s\rang\end(U_sU_\omega)^r_\begin0_\\_1\end_\^2_=_\sin^2\left(_(2r+1)t\right). Alternatively,_one_might_reasonably_imagine_that_a_near-optimal_time_to_distinguish_would_be_when_the_angles_2''rt''_and_−2''rt''_are_as_far_apart_as_possible,_which_corresponds_to_2rt_\approx_\pi/2,_or_r_=_\pi/4t_=_\pi/4\arcsin(1/\sqrt)_\approx_\pi\sqrt/4._Then_the_system_is_in_state :_ \omega_\rang_\,_, _s_\rang(U_sU_\omega)^r_\begin0\\1\end_\approx_ \omega_\rang_\,_, _s_\rangM_\begin_i_&_0_\\_0_&_-i\end_M^_\begin0\\1\end_=_, _\omega_\rang_\frac_-_, s_\rang_\frac. A_short_calculation_now_shows_that_the_observation_yields_the_correct_answer_''ω''_with_error_O\left_(\frac_\right).


__Extensions_and_variants_


__Multiple_matching_entries_

If,_instead_of_1_matching_entry,_there_are_''k''_matching_entries,_the_same_algorithm_works,_but_the_number_of_iterations_must_be__\frac_instead_of__\frac. There_are_several_ways_to_handle_the_case_if_''k''_is_unknown._A_simple_solution_performs_optimally_up_to_a_constant_factor:_run_Grover's_algorithm_repeatedly_for_increasingly_small_values_of_''k'',_e.g.,_taking_''k''_=_''N'',_''N''/2,_''N''/4,_...,_and_so_on,_taking_k_=_N/2^t_for_iteration_''t''_until_a_matching_entry_is_found. With_sufficiently_high_probability,_a_marked_entry_will_be_found_by_iteration_t_=_\log_2(N/k)_+_c_for_some_constant_''c''._Thus,_the_total_number_of_iterations_taken_is_at_most :_\frac_\Big(1_+_\sqrt_+_\sqrt_+_\cdots_+_\sqrt\Big)_=_O\big(\sqrt\big)._ A_version_of_this_algorithm_is_used_in_order_to_solve_the_collision_problem_ The_r-to-1_collision_problem_is_an_important_theoretical_problem_in__complexity_theory,__quantum_computing,_and__computational_mathematics._The_collision_problem_most_often_refers_to_the_2-to-1_version:_given_n_even_and_a_function_f:\,\\rightarrow\_...
.


_Quantum_partial_search

A__modification_of_Grover's_algorithm_called_quantum_partial_search_was_described_by_Grover_and_Radhakrishnan_in_2004._In_partial_search,_one_is_not_interested_in_finding_the_exact_address_of_the_target_item,_only_the_first_few_digits_of_the_address._Equivalently,_we_can_think_of_"chunking"_the_search_space_into_blocks,_and_then_asking_"in_which_block_is_the_target_item?"._In_many_applications,_such_a_search_yields_enough_information_if_the_target_address_contains_the_information_wanted._For_instance,_to_use_the_example_given_by_L._K._Grover,_if_one_has_a_list_of_students_organized_by_class_rank,_we_may_only_be_interested_in_whether_a_student_is_in_the_lower_25%,_25–50%,_50–75%_or_75–100%_percentile. To_describe_partial_search,_we_consider_a_database_separated_into_K_blocks,_each_of_size_b_=_N/K._The_partial_search_problem_is_easier._Consider_the_approach_we_would_take_classically_–_we_pick_one_block_at_random,_and_then_perform_a_normal_search_through_the_rest_of_the_blocks_(in_set_theory_language,_the_complement)._If_we_don't_find_the_target,_then_we_know_it's_in_the_block_we_didn't_search._The_average_number_of_iterations_drops_from_N/2_to_(N-b)/2. Grover's_algorithm_requires_\frac\sqrt_iterations._Partial_search_will_be_faster_by_a_numerical_factor_that_depends_on_the_number_of_blocks_K._Partial_search_uses_n_1_global_iterations_and_n_2_local_iterations._The_global_Grover_operator_is_designated_G_1_and_the_local_Grover_operator_is_designated_G_2. The_global_Grover_operator_acts_on_the_blocks._Essentially,_it_is_given_as_follows: #Perform_j_1_standard_Grover_iterations_on_the_entire_database. #Perform_j_2_local_Grover_iterations._A_local_Grover_iteration_is_a_direct_sum_of_Grover_iterations_over_each_block. #Perform_one_standard_Grover_iteration. The_optimal_values_of_j_1_and_j_2_are_discussed_in_the_paper_by_Grover_and_Radhakrishnan._One_might_also_wonder_what_happens_if_one_applies_successive_partial_searches_at_different_levels_of_"resolution"._This_idea_was_studied_in_detail_by_
Vladimir_Korepin Vladimir E. Korepin (born 1951) is a professor at the C. N. Yang Institute of Theoretical Physics of the Stony Brook University. Korepin made research contributions in several areas of mathematics and physics. Educational background Korepin c ...
_and_Xu,_who_called_it_binary_quantum_search._They_proved_that_it_is_not_in_fact_any_faster_than_performing_a_single_partial_search.


_Optimality_

Grover's_algorithm_is_optimal_up_to_sub-constant_factors._That_is,_any_algorithm_that_accesses_the_database_only_by_using_the_operator_''Uω''_must_apply_''Uω''_at_least_a_1-o(1)_fraction_as_many_times_as_Grover's_algorithm._The_extension_of_Grover's_algorithm_to_''k''_matching_entries,_(''N''/''k'')1/2/4,_is_also_optimal._This_result_is_important_in_understanding_the_limits_of_quantum_computation. If_the_Grover's_search_problem_was_solvable_with__''N''_applications_of_''Uω'',_that_would_imply_that_ NP_is_contained_in_ BQP,_by_transforming_problems_in_NP_into_Grover-type_search_problems._The_optimality_of_Grover's_algorithm_suggests_that_quantum_computers_cannot_solve_
NP-Complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
_problems_in_polynomial_time,_and_thus_NP_is_not_contained_in_BQP. It_has_been_shown_that_a_class_of_non-local_ hidden_variable_quantum_computers_could_implement_a_search_of_an_N-item_database_in_at_most_O(\sqrt _steps._This_is_faster_than_the_O(\sqrt)_steps_taken_by_Grover's_algorithm.


_See_also

*_
Amplitude_amplification Amplitude amplification is a technique in quantum computing which generalizes the idea behind the Grover's search algorithm, and gives rise to a family of quantum algorithms. It was discovered by Gilles Brassard and Peter Høyer in 1997, and ind ...
*_
Shor's_algorithm Shor's algorithm is a quantum algorithm, quantum computer algorithm for finding the prime factors of an integer. It was developed in 1994 by the American mathematician Peter Shor. On a quantum computer, to factor an integer N , Shor's algorithm ...
_(for_factorization) *__Brassard–Høyer–Tapp_algorithm_(for_solving_the_collision_problem_ The_r-to-1_collision_problem_is_an_important_theoretical_problem_in__complexity_theory,__quantum_computing,_and__computational_mathematics._The_collision_problem_most_often_refers_to_the_2-to-1_version:_given_n_even_and_a_function_f:\,\\rightarrow\_...
)


_Notes


__References_

*_Grover_L.K.:_
A_fast_quantum_mechanical_algorithm_for_database_search
',_Proceedings,_28th_Annual_ACM_Symposium_on_the_Theory_of_Computing,_(May_1996)_p. 212 *_Grover_L.K.:_
From_Schrödinger's_equation_to_quantum_search_algorithm
',_American_Journal_of_Physics,_69(7):_769–777,_2001._Pedagogical_review_of_the_algorithm_and_its_history. *_Grover_L.K.

''The_Sciences'',_July/August_1999,_pp. 24–30. *_Nielsen,_M.A._and_Chuang,_I.L._''Quantum_computation_and_quantum_information''._Cambridge_University_Press,_2000._Chapter_6.
What's_a_Quantum_Phone_Book?
_Lov_Grover,_Lucent_Technologies


_External_links

*_ *_ *_ *_ *_ *_ *_ {{DEFAULTSORT:Grover's_Algorithm Quantum_algorithms Search_algorithms Post-quantum_cryptographyhtml" ;"title="\omega \rang \, , s \rang] \begin -1 & 0 \\ 2/\sqrt & 1 \end\begina\\b\end. : U_\omega : a , \omega \rang + b , s \rang \mapsto \omega \rang \, , s \rang\begin -1 & -2/\sqrt \\ 0 & 1 \end\begina\\b\end. So in the basis \ (which is neither orthogonal nor a basis of the whole space) the action U_sU_\omega of applying U_\omega followed by U_s is given by the matrix : U_sU_\omega = \begin -1 & 0 \\ 2/\sqrt & 1 \end \begin -1 & -2/\sqrt \\ 0 & 1 \end = \begin 1 & 2/\sqrt \\ -2/\sqrt & 1-4/N \end. This matrix happens to have a very convenient
Jordan form In linear algebra, a Jordan normal form, also known as a Jordan canonical form (JCF), is an upper triangular matrix of a particular form called a Jordan matrix representing a linear operator on a finite-dimensional vector space with respect to so ...
. If we define t = \arcsin(1/\sqrt), it is : U_sU_\omega = M \begin e^ & 0 \\ 0 & e^\end M^ where M = \begin-i & i \\ e^ & e^ \end. It follows that ''r''-th power of the matrix (corresponding to ''r'' iterations) is : (U_sU_\omega)^r = M \begin e^ & 0 \\ 0 & e^\end M^. Using this form, we can use trigonometric identities to compute the probability of observing ''ω'' after ''r'' iterations mentioned in the previous section, :\left, \begin\lang\omega, \omega\rang & \lang\omega, s\rang\end(U_sU_\omega)^r \begin0 \\ 1\end \^2 = \sin^2\left( (2r+1)t\right). Alternatively, one might reasonably imagine that a near-optimal time to distinguish would be when the angles 2''rt'' and −2''rt'' are as far apart as possible, which corresponds to 2rt \approx \pi/2, or r = \pi/4t = \pi/4\arcsin(1/\sqrt) \approx \pi\sqrt/4. Then the system is in state : \omega \rang \, , s \rang(U_sU_\omega)^r \begin0\\1\end \approx \omega \rang \, , s \rangM \begin i & 0 \\ 0 & -i\end M^ \begin0\\1\end = , \omega \rang \frac - , s \rang \frac. A short calculation now shows that the observation yields the correct answer ''ω'' with error O\left (\frac \right).


Extensions and variants


Multiple matching entries

If, instead of 1 matching entry, there are ''k'' matching entries, the same algorithm works, but the number of iterations must be \frac instead of \frac. There are several ways to handle the case if ''k'' is unknown. A simple solution performs optimally up to a constant factor: run Grover's algorithm repeatedly for increasingly small values of ''k'', e.g., taking ''k'' = ''N'', ''N''/2, ''N''/4, ..., and so on, taking k = N/2^t for iteration ''t'' until a matching entry is found. With sufficiently high probability, a marked entry will be found by iteration t = \log_2(N/k) + c for some constant ''c''. Thus, the total number of iterations taken is at most : \frac \Big(1 + \sqrt + \sqrt + \cdots + \sqrt\Big) = O\big(\sqrt\big). A version of this algorithm is used in order to solve the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
.


Quantum partial search

A modification of Grover's algorithm called quantum partial search was described by Grover and Radhakrishnan in 2004. In partial search, one is not interested in finding the exact address of the target item, only the first few digits of the address. Equivalently, we can think of "chunking" the search space into blocks, and then asking "in which block is the target item?". In many applications, such a search yields enough information if the target address contains the information wanted. For instance, to use the example given by L. K. Grover, if one has a list of students organized by class rank, we may only be interested in whether a student is in the lower 25%, 25–50%, 50–75% or 75–100% percentile. To describe partial search, we consider a database separated into K blocks, each of size b = N/K. The partial search problem is easier. Consider the approach we would take classically – we pick one block at random, and then perform a normal search through the rest of the blocks (in set theory language, the complement). If we don't find the target, then we know it's in the block we didn't search. The average number of iterations drops from N/2 to (N-b)/2. Grover's algorithm requires \frac\sqrt iterations. Partial search will be faster by a numerical factor that depends on the number of blocks K. Partial search uses n_1 global iterations and n_2 local iterations. The global Grover operator is designated G_1 and the local Grover operator is designated G_2. The global Grover operator acts on the blocks. Essentially, it is given as follows: #Perform j_1 standard Grover iterations on the entire database. #Perform j_2 local Grover iterations. A local Grover iteration is a direct sum of Grover iterations over each block. #Perform one standard Grover iteration. The optimal values of j_1 and j_2 are discussed in the paper by Grover and Radhakrishnan. One might also wonder what happens if one applies successive partial searches at different levels of "resolution". This idea was studied in detail by
Vladimir Korepin Vladimir E. Korepin (born 1951) is a professor at the C. N. Yang Institute of Theoretical Physics of the Stony Brook University. Korepin made research contributions in several areas of mathematics and physics. Educational background Korepin c ...
and Xu, who called it binary quantum search. They proved that it is not in fact any faster than performing a single partial search.


Optimality

Grover's algorithm is optimal up to sub-constant factors. That is, any algorithm that accesses the database only by using the operator ''Uω'' must apply ''Uω'' at least a 1-o(1) fraction as many times as Grover's algorithm. The extension of Grover's algorithm to ''k'' matching entries, (''N''/''k'')1/2/4, is also optimal. This result is important in understanding the limits of quantum computation. If the Grover's search problem was solvable with ''N'' applications of ''Uω'', that would imply that NP is contained in BQP, by transforming problems in NP into Grover-type search problems. The optimality of Grover's algorithm suggests that quantum computers cannot solve
NP-Complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
problems in polynomial time, and thus NP is not contained in BQP. It has been shown that a class of non-local hidden variable quantum computers could implement a search of an N-item database in at most O(\sqrt steps. This is faster than the O(\sqrt) steps taken by Grover's algorithm.


See also

*
Amplitude amplification Amplitude amplification is a technique in quantum computing which generalizes the idea behind the Grover's search algorithm, and gives rise to a family of quantum algorithms. It was discovered by Gilles Brassard and Peter Høyer in 1997, and ind ...
*
Shor's algorithm Shor's algorithm is a quantum algorithm, quantum computer algorithm for finding the prime factors of an integer. It was developed in 1994 by the American mathematician Peter Shor. On a quantum computer, to factor an integer N , Shor's algorithm ...
(for factorization) * Brassard–Høyer–Tapp algorithm (for solving the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
)


Notes


References

* Grover L.K.:
A fast quantum mechanical algorithm for database search
', Proceedings, 28th Annual ACM Symposium on the Theory of Computing, (May 1996) p. 212 * Grover L.K.:
From Schrödinger's equation to quantum search algorithm
', American Journal of Physics, 69(7): 769–777, 2001. Pedagogical review of the algorithm and its history. * Grover L.K.

''The Sciences'', July/August 1999, pp. 24–30. * Nielsen, M.A. and Chuang, I.L. ''Quantum computation and quantum information''. Cambridge University Press, 2000. Chapter 6.
What's a Quantum Phone Book?
Lov Grover, Lucent Technologies


External links

* * * * * * * {{DEFAULTSORT:Grover's Algorithm Quantum algorithms Search algorithms Post-quantum cryptography>\omega \rang \, , s \rangM \begin i & 0 \\ 0 & -i\end M^ \begin0\\1\end = , \omega \rang \frac - , s \rang \frac. A short calculation now shows that the observation yields the correct answer ''ω'' with error O\left (\frac \right).


Extensions and variants


Multiple matching entries

If, instead of 1 matching entry, there are ''k'' matching entries, the same algorithm works, but the number of iterations must be \frac instead of \frac. There are several ways to handle the case if ''k'' is unknown. A simple solution performs optimally up to a constant factor: run Grover's algorithm repeatedly for increasingly small values of ''k'', e.g., taking ''k'' = ''N'', ''N''/2, ''N''/4, ..., and so on, taking k = N/2^t for iteration ''t'' until a matching entry is found. With sufficiently high probability, a marked entry will be found by iteration t = \log_2(N/k) + c for some constant ''c''. Thus, the total number of iterations taken is at most : \frac \Big(1 + \sqrt + \sqrt + \cdots + \sqrt\Big) = O\big(\sqrt\big). A version of this algorithm is used in order to solve the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
.


Quantum partial search

A modification of Grover's algorithm called quantum partial search was described by Grover and Radhakrishnan in 2004. In partial search, one is not interested in finding the exact address of the target item, only the first few digits of the address. Equivalently, we can think of "chunking" the search space into blocks, and then asking "in which block is the target item?". In many applications, such a search yields enough information if the target address contains the information wanted. For instance, to use the example given by L. K. Grover, if one has a list of students organized by class rank, we may only be interested in whether a student is in the lower 25%, 25–50%, 50–75% or 75–100% percentile. To describe partial search, we consider a database separated into K blocks, each of size b = N/K. The partial search problem is easier. Consider the approach we would take classically – we pick one block at random, and then perform a normal search through the rest of the blocks (in set theory language, the complement). If we don't find the target, then we know it's in the block we didn't search. The average number of iterations drops from N/2 to (N-b)/2. Grover's algorithm requires \frac\sqrt iterations. Partial search will be faster by a numerical factor that depends on the number of blocks K. Partial search uses n_1 global iterations and n_2 local iterations. The global Grover operator is designated G_1 and the local Grover operator is designated G_2. The global Grover operator acts on the blocks. Essentially, it is given as follows: #Perform j_1 standard Grover iterations on the entire database. #Perform j_2 local Grover iterations. A local Grover iteration is a direct sum of Grover iterations over each block. #Perform one standard Grover iteration. The optimal values of j_1 and j_2 are discussed in the paper by Grover and Radhakrishnan. One might also wonder what happens if one applies successive partial searches at different levels of "resolution". This idea was studied in detail by
Vladimir Korepin Vladimir E. Korepin (born 1951) is a professor at the C. N. Yang Institute of Theoretical Physics of the Stony Brook University. Korepin made research contributions in several areas of mathematics and physics. Educational background Korepin c ...
and Xu, who called it binary quantum search. They proved that it is not in fact any faster than performing a single partial search.


Optimality

Grover's algorithm is optimal up to sub-constant factors. That is, any algorithm that accesses the database only by using the operator ''Uω'' must apply ''Uω'' at least a 1-o(1) fraction as many times as Grover's algorithm. The extension of Grover's algorithm to ''k'' matching entries, (''N''/''k'')1/2/4, is also optimal. This result is important in understanding the limits of quantum computation. If the Grover's search problem was solvable with ''N'' applications of ''Uω'', that would imply that NP is contained in BQP, by transforming problems in NP into Grover-type search problems. The optimality of Grover's algorithm suggests that quantum computers cannot solve
NP-Complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
problems in polynomial time, and thus NP is not contained in BQP. It has been shown that a class of non-local hidden variable quantum computers could implement a search of an N-item database in at most O(\sqrt steps. This is faster than the O(\sqrt) steps taken by Grover's algorithm.


See also

*
Amplitude amplification Amplitude amplification is a technique in quantum computing which generalizes the idea behind the Grover's search algorithm, and gives rise to a family of quantum algorithms. It was discovered by Gilles Brassard and Peter Høyer in 1997, and ind ...
*
Shor's algorithm Shor's algorithm is a quantum algorithm, quantum computer algorithm for finding the prime factors of an integer. It was developed in 1994 by the American mathematician Peter Shor. On a quantum computer, to factor an integer N , Shor's algorithm ...
(for factorization) * Brassard–Høyer–Tapp algorithm (for solving the
collision problem The r-to-1 collision problem is an important theoretical problem in complexity theory, quantum computing, and computational mathematics. The collision problem most often refers to the 2-to-1 version: given n even and a function f:\,\\rightarrow\ ...
)


Notes


References

* Grover L.K.:
A fast quantum mechanical algorithm for database search
', Proceedings, 28th Annual ACM Symposium on the Theory of Computing, (May 1996) p. 212 * Grover L.K.:
From Schrödinger's equation to quantum search algorithm
', American Journal of Physics, 69(7): 769–777, 2001. Pedagogical review of the algorithm and its history. * Grover L.K.

''The Sciences'', July/August 1999, pp. 24–30. * Nielsen, M.A. and Chuang, I.L. ''Quantum computation and quantum information''. Cambridge University Press, 2000. Chapter 6.
What's a Quantum Phone Book?
Lov Grover, Lucent Technologies


External links

* * * * * * * {{DEFAULTSORT:Grover's Algorithm Quantum algorithms Search algorithms Post-quantum cryptography