Quantum Counting
   HOME

TheInfoList



OR:

The Quantum counting algorithm is a
quantum algorithm In quantum computing, a quantum algorithm is an algorithm that 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 seq ...
for efficiently counting the number of solutions for a given search problem. The algorithm is based on the
quantum phase estimation algorithm In quantum computing, the quantum phase estimation algorithm is a quantum algorithm to estimate the phase corresponding to an eigenvalue of a given unitary operator. Because the eigenvalues of a unitary operator always have unit modulus, they a ...
and on Grover's search algorithm. Counting problems are common in diverse fields such as statistical estimation, statistical physics, networking, etc. As for
quantum computing A quantum computer is a computer that exploits quantum mechanical phenomena. On small scales, physical matter exhibits properties of wave-particle duality, both particles and waves, and quantum computing takes advantage of this behavior using s ...
, the ability to perform quantum counting efficiently is needed in order to use Grover's search algorithm (because running Grover's search algorithm requires knowing how many solutions exist). Moreover, this algorithm solves the quantum existence problem (namely, deciding whether ''any'' solution exists) as a special case. The algorithm was devised by
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 Univers ...
, Peter Høyer and Alain Tapp in 1998.


The problem

Consider a finite set \^n of size N=2^n and a set B of "solutions" (that is a subset of \^n ). Define: : \begin f : \left\^n \to \ \\ f(x) = \begin 1 & x \in B \\ 0 & x \notin B \end \end In other words, f is the
indicator function In mathematics, an indicator function or a characteristic function of a subset of a set is a function that maps elements of the subset to one, and all other elements to zero. That is, if is a subset of some set , then the indicator functio ...
of B. Calculate the number of solutions M = \left\vert f^(1) \right\vert = \vert B \vert.


Classical solution

Without any prior knowledge on the set of solutions B (or the structure of the function f), a classical deterministic solution cannot perform better than \Omega(N), because all the N elements of \^n must be inspected (consider a case where the last element to be inspected is a solution).


The algorithm


Setup

The input consists of two registers (namely, two parts): the upper p qubits comprise the ''first register'', and the lower n qubits are the ''second register''.


Create superposition

The initial state of the system is , 0\rangle^, 0\rangle^. After applying multiple bit Hadamard gate operation on each of the registers separately, the state of the ''first register'' is :\frac(, 0\rangle + , 1\rangle)^ and the state of the ''second register'' is :\frac(, 0\rangle + , 1\rangle)^ = \frac\sum_^, x\rangle an equal
superposition In mathematics, a linear combination or superposition is an expression constructed from a set of terms by multiplying each term by a constant and adding the results (e.g. a linear combination of ''x'' and ''y'' would be any expression of the form ...
state in the computational basis.


Grover operator

Because the size of the space is \left\vert \^n \right\vert = 2^n = N and the number of solutions is \left\vert B \right\vert = M , we can define the normalized states: : , \alpha\rangle = \frac \sum_, \qquad \text \qquad , \beta\rangle = \frac \sum_. Note that : \sqrt, \alpha\rangle + \sqrt, \beta\rangle = \frac\sum_^, which is the state of the ''second register'' after the Hadamard transform. Geometric visualization of Grover's algorithm shows that in the two-dimensional space spanned by , \alpha\rangle and , \beta\rangle, the Grover operator is a
counterclockwise rotation Two-dimensional rotation can occur in two possible directions or senses of rotation. Clockwise motion (abbreviated CW) proceeds in the same direction as a clock's hands relative to the observer: from the top to the right, then down and then to ...
; hence, it can be expressed as : G = \begin \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta\end in the
orthonormal basis In mathematics, particularly linear algebra, an orthonormal basis for an inner product space V with finite Dimension (linear algebra), dimension is a Basis (linear algebra), basis for V whose vectors are orthonormal, that is, they are all unit vec ...
\. From the properties of rotation matrices we know that G is a
unitary matrix In linear algebra, an invertible complex square matrix is unitary if its matrix inverse equals its conjugate transpose , that is, if U^* U = UU^* = I, where is the identity matrix. In physics, especially in quantum mechanics, the conjugate ...
with the two
eigenvalues In linear algebra, an eigenvector ( ) or characteristic vector is a vector that has its direction unchanged (or reversed) by a given linear transformation. More precisely, an eigenvector \mathbf v of a linear transformation T is scaled by a ...
e^.


Estimating the value of θ

From here onwards, we follow the
quantum phase estimation algorithm In quantum computing, the quantum phase estimation algorithm is a quantum algorithm to estimate the phase corresponding to an eigenvalue of a given unitary operator. Because the eigenvalues of a unitary operator always have unit modulus, they a ...
scheme: we apply controlled Grover operations followed by inverse
quantum Fourier transform In quantum computing, the quantum Fourier transform (QFT) is a linear transformation on qubit, quantum bits, and is the quantum analogue of the discrete Fourier transform. The quantum Fourier transform is a part of many quantum algorithms, notably ...
; and according to the
analysis Analysis (: analyses) is the process of breaking a complex topic or substance into smaller parts in order to gain a better understanding of it. The technique has been applied in the study of mathematics and logic since before Aristotle (38 ...
, we will find the best p-bit approximation to the
real number In mathematics, a real number is a number that can be used to measure a continuous one- dimensional quantity such as a duration or temperature. Here, ''continuous'' means that pairs of values can have arbitrarily small differences. Every re ...
\theta (belonging to the eigenvalues e^ of the Grover operator) with probability higher than \frac. Note that the second register is actually in a
superposition In mathematics, a linear combination or superposition is an expression constructed from a set of terms by multiplying each term by a constant and adding the results (e.g. a linear combination of ''x'' and ''y'' would be any expression of the form ...
of the
eigenvectors In linear algebra, an eigenvector ( ) or characteristic vector is a Vector (mathematics and physics), vector that has its direction (geometry), direction unchanged (or reversed) by a given linear map, linear transformation. More precisely, an e ...
of the Grover operator (while in the original quantum phase estimation algorithm, the second register is the required eigenvector). This means that with some probability, we approximate \theta, and with some probability, we approximate 2\pi - \theta; those two approximations are equivalent.


Analysis

Assuming that the size N of the space is at least twice the number of solutions (namely, assuming that M \leq \tfrac ), a result of the analysis of Grover's algorithm is: : \sin = \sqrt. Thus, if we find \theta, we can also find the value of M (because N is known). The error : \frac = \left \vert \sin^2 \left( \frac \right) - \sin^2 \left( \frac \right) \right \vert is determined by the error within estimation of the value of \theta. The quantum phase estimation algorithm finds, with high probability, the best p-bit approximation of \theta; this means that if p is large enough, we will have \Delta \theta \approx 0, hence \vert \Delta M \vert \approx 0 .


Uses


Grover's search algorithm for an initially-unknown number of solutions

In Grover's search algorithm, the number of iterations that should be done is \frac\sqrt. Thus, if N is known and M is calculated by the quantum counting algorithm, the number of iterations for Grover's algorithm is easily calculated.


Speeding up NP-complete problems

The quantum counting algorithm can be used to speed up solution to problems which are
NP-complete In computational complexity theory, NP-complete problems are the hardest of the problems to which ''solutions'' can be verified ''quickly''. Somewhat more precisely, a problem is NP-complete when: # It is a decision problem, meaning that for any ...
. An example of an NP-complete problem is the Hamiltonian cycle problem, which is the problem of determining whether a
graph Graph may refer to: Mathematics *Graph (discrete mathematics), a structure made of vertices and edges **Graph theory, the study of such graphs and their properties *Graph (topology), a topological space resembling a graph in the sense of discret ...
G=(V,E) has a
Hamiltonian cycle In the mathematics, mathematical field of graph theory, a Hamiltonian path (or traceable path) is a path (graph theory), path in an undirected or directed graph that visits each vertex (graph theory), vertex exactly once. A Hamiltonian cycle (or ...
. A simple solution to the Hamiltonian cycle problem is checking, for each ordering of the vertices of G, whether it is a Hamiltonian cycle or not. Searching through all the possible orderings of the graph's vertices can be done with quantum counting followed by Grover's algorithm, achieving a speedup of the square root, similar to Grover's algorithm. This approach finds a Hamiltonian cycle (if exists); for determining whether a Hamiltonian cycle exists, the quantum counting algorithm itself is sufficient (and even the quantum existence algorithm, described below, is sufficient).


Quantum existence problem

Quantum existence problem is a special case of quantum counting where we do not want to calculate the value of M, but we only wish to know whether M \neq 0 or not. A trivial solution to this problem is directly using the quantum counting algorithm: the algorithm yields M, so by checking whether M \neq 0 we get the answer to the existence problem. This approach involves some overhead information because we are not interested in the value of M. Quantum phase estimation can be optimized to eliminate this overhead. If you are not interested in the control of error probability then using a setup with small number of qubits in the upper register will not produce an accurate estimation of the value of \theta, but will suffice to determine whether M equals zero or not.


Quantum relation testing problem

Quantum relation testing QRT(value,relation). is an extension of quantum existence testing, it decides whether at least one entry can be found in the data base which fulfils the relation to a certain reference value. E.g. QRT(5,>) gives back YES if the data base contains any value larger than 5 else it returns NO. Quantum relation testing combined with classical logarithmic search forms an efficient quantum min/max searching algorithm.


See also

*
Quantum phase estimation algorithm In quantum computing, the quantum phase estimation algorithm is a quantum algorithm to estimate the phase corresponding to an eigenvalue of a given unitary operator. Because the eigenvalues of a unitary operator always have unit modulus, they a ...
*
Grover's algorithm In quantum computing, Grover's algorithm, also known as the quantum search algorithm, is a quantum algorithm for unstructured search that finds with high probability the unique input to a black box function that produces a particular output value, ...
*
Counting problem (complexity) In computational complexity theory and computability theory, a counting problem is a type of computational problem. If ''R'' is a search problem then :c_R(x)=\vert\\vert \, is the corresponding counting function and :\#R=\ denotes the corre ...


References

{{DEFAULTSORT:Quantum counting algorithm Quantum algorithms