Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Quantum counting algorithm

From Wikipedia, the free encyclopedia
Quantum algorithm for counting solutions to search problems

TheQuantum counting algorithm is aquantum algorithm for efficiently counting the number of solutions for a given search problem.The algorithm is based on thequantum phase estimation algorithm and onGrover's search algorithm.

Counting problems are common in diverse fields such as statistical estimation, statistical physics, networking, etc. As forquantum computing, 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 whetherany solution exists) as a special case.

The algorithm was devised byGilles Brassard, Peter Høyer and Alain Tapp in 1998.

The problem

[edit]

Consider a finite set{0,1}n{\displaystyle \{0,1\}^{n}} of sizeN=2n{\displaystyle N=2^{n}} and a setB{\displaystyle B} of "solutions" (that is a subset of{0,1}n{\displaystyle \{0,1\}^{n}}). Define:

{f:{0,1}n{0,1}f(x)={1xB0xB{\displaystyle {\begin{cases}f:\left\{0,1\right\}^{n}\to \{0,1\}\\f(x)={\begin{cases}1&x\in B\\0&x\notin B\end{cases}}\end{cases}}}

In other words,f{\displaystyle f} is theindicator function ofB{\displaystyle B}.

Calculate the number of solutionsM=|f1(1)|=|B|{\displaystyle M=\left\vert f^{-1}(1)\right\vert =\vert B\vert }.[1]

Classical solution

[edit]

Without any prior knowledge on the set of solutionsB{\displaystyle B} (or the structure of the functionf{\displaystyle f}), a classical deterministic solution cannot perform better thanΩ(N){\displaystyle \Omega (N)}, because all theN{\displaystyle N} elements of{0,1}n{\displaystyle \{0,1\}^{n}} must be inspected (consider a case where the last element to be inspected is a solution).

The algorithm

[edit]
Quantum counting circuit

Setup

[edit]

The input consists of tworegisters (namely, two parts): the upperp{\displaystyle p} qubits comprise thefirst register, and the lowern{\displaystyle n} qubits are thesecond register.

Create superposition

[edit]

The initial state of the system is|0p|0n{\displaystyle |0\rangle ^{\otimes p}|0\rangle ^{\otimes n}}. After applying multiple bitHadamard gate operation on each of the registers separately, the state of thefirst register is

12p/2(|0+|1)p{\displaystyle {\frac {1}{2^{p/2}}}(|0\rangle +|1\rangle )^{\otimes p}}

and the state of thesecond register is

12n/2(|0+|1)n=1Nx=0N1|x{\displaystyle {\frac {1}{2^{n/2}}}(|0\rangle +|1\rangle )^{\otimes n}={\frac {1}{\sqrt {N}}}\sum _{x=0}^{N-1}|x\rangle }

an equalsuperposition state in the computational basis.

Grover operator

[edit]

Because the size of the space is|{0,1}n|=2n=N{\displaystyle \left\vert \{0,1\}^{n}\right\vert =2^{n}=N} and the number of solutions is|B|=M{\displaystyle \left\vert B\right\vert =M}, we can define the normalized states:[2]: 252 

|α=1NMxB|x,and|β=1MxB|x.{\displaystyle |\alpha \rangle ={\frac {1}{\sqrt {N-M}}}\sum _{x\notin B}{|x\rangle },\qquad {\text{and}}\qquad |\beta \rangle ={\frac {1}{\sqrt {M}}}\sum _{x\in B}{|x\rangle }.}

Note that

NMN|α+MN|β=1Nx=0N1|x,{\displaystyle {\sqrt {\frac {N-M}{N}}}|\alpha \rangle +{\sqrt {\frac {M}{N}}}|\beta \rangle ={\frac {1}{\sqrt {N}}}\sum _{x=0}^{N-1}{|x\rangle },}

which is the state of thesecond register after the Hadamard transform.

Geometric visualization of Grover's algorithm shows that in the two-dimensional space spanned by|α{\displaystyle |\alpha \rangle } and|β{\displaystyle |\beta \rangle }, the Grover operator is acounterclockwise rotation; hence, it can be expressed as

G=[cosθsinθsinθcosθ]{\displaystyle G={\begin{bmatrix}\cos \theta &-\sin \theta \\\sin \theta &\cos \theta \end{bmatrix}}}

in theorthonormal basis{|α,|β}{\displaystyle \{|\alpha \rangle ,|\beta \rangle \}}.[2]: 252 [3]: 149 

From theproperties of rotation matrices we know thatG{\displaystyle G} is aunitary matrix with the twoeigenvaluese±iθ{\displaystyle e^{\pm i\theta }}.[2]: 253 

Estimating the value of θ

[edit]

From here onwards, we follow thequantum phase estimation algorithm scheme: we applycontrolled Grover operations followed by inversequantum Fourier transform; and according to theanalysis, we will find the bestp{\displaystyle p}-bit approximation to thereal numberθ{\displaystyle \theta } (belonging to the eigenvaluese±iθ{\displaystyle e^{\pm i\theta }} of the Grover operator) with probability higher than4π2{\displaystyle {\frac {4}{\pi ^{2}}}}.[4]: 348 [3]: 157 

Note that the second register is actually in asuperposition of theeigenvectors 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θ{\displaystyle \theta }, and with some probability, we approximate2πθ{\displaystyle 2\pi -\theta }; those two approximations are equivalent.[2]: 224–225 

Analysis

[edit]

Assuming that the sizeN{\displaystyle N} of the space is at least twice the number of solutions (namely, assuming thatMN2{\displaystyle M\leq {\tfrac {N}{2}}}), a result of the analysis of Grover's algorithm is:[2]: 254 

sinθ2=MN.{\displaystyle \sin {\frac {\theta }{2}}={\sqrt {\frac {M}{N}}}.}

Thus, if we findθ{\displaystyle \theta }, we can also find the value ofM{\displaystyle M} (becauseN{\displaystyle N} is known).

The error

|ΔM|N=|sin2(θ+Δθ2)sin2(θ2)|{\displaystyle {\frac {\vert \Delta M\vert }{N}}=\left\vert \sin ^{2}\left({\frac {\theta +\Delta \theta }{2}}\right)-\sin ^{2}\left({\frac {\theta }{2}}\right)\right\vert }

is determined by the error within estimation of the value ofθ{\displaystyle \theta }. The quantum phase estimation algorithm finds, with high probability, the bestp{\displaystyle p}-bit approximation ofθ{\displaystyle \theta }; this means that ifp{\displaystyle p} is large enough, we will haveΔθ0{\displaystyle \Delta \theta \approx 0}, hence|ΔM|0{\displaystyle \vert \Delta M\vert \approx 0}.[2]: 263 

Uses

[edit]

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

[edit]

In Grover's search algorithm, the number of iterations that should be done isπ4NM{\displaystyle {\frac {\pi }{4}}{\sqrt {\frac {N}{M}}}}.[2]: 254 [3]: 150 

Thus, ifN{\displaystyle N} is known andM{\displaystyle M} is calculated by the quantum counting algorithm, the number of iterations for Grover's algorithm is easily calculated.

Speeding up NP-complete problems

[edit]

The quantum counting algorithm can be used to speed up solution to problems which areNP-complete.

An example of an NP-complete problem is theHamiltonian cycle problem, which is the problem of determining whether agraphG=(V,E){\displaystyle G=(V,E)} has aHamiltonian cycle.

A simple solution to the Hamiltonian cycle problem is checking, for each ordering of the vertices ofG{\displaystyle 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.[2]: 264  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

[edit]

Quantum existence problem is a special case of quantum counting where we do not want to calculate the value ofM{\displaystyle M}, but we only wish to know whetherM0{\displaystyle M\neq 0} or not.[5]: 147 

A trivial solution to this problem is directly using the quantum counting algorithm: the algorithm yieldsM{\displaystyle M}, so by checking whetherM0{\displaystyle 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 ofM{\displaystyle M}. Quantum phase estimation can be optimized to eliminate this overhead.[5]: 148 

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θ{\displaystyle \theta }, but will suffice to determine whetherM{\displaystyle M} equals zero or not.[2]: 263 

Quantum relation testing problem

[edit]

Quantum relation testingQRT(value,relation){\displaystyle 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.[6] E.g.QRT(5,>){\displaystyle 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.[5]: 152 [7]

See also

[edit]

References

[edit]
  1. ^Brassard, Gilles; HØyer, Peter; Tapp, Alain (1998), Larsen, Kim G.; Skyum, Sven; Winskel, Glynn (eds.),"Quantum counting",Automata, Languages and Programming, vol. 1443, Berlin, Heidelberg: Springer Berlin Heidelberg, pp. 820–831,arXiv:quant-ph/9805082,doi:10.1007/bfb0055105,ISBN 978-3-540-64781-2, retrieved2024-10-16
  2. ^abcdefghiChuang, Michael A. Nielsen & Isaac L. (2001).Quantum computation and quantum information (Repr. ed.). Cambridge [u.a.]: Cambridge Univ. Press.ISBN 978-0521635035.
  3. ^abcBenenti, Guiliano; Strini, Giulio Casati, Giuliano (2004).Principles of quantum computation and information (Reprinted. ed.). New Jersey [u.a.]: World Scientific.ISBN 978-9812388582.{{cite book}}: CS1 maint: multiple names: authors list (link)
  4. ^Cleve, R.; Ekert, A.; Macchiavello, C.; Mosca, M. (8 January 1998). "Quantum algorithms revisited".Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences.454 (1969):339–354.arXiv:quant-ph/9708016.Bibcode:1998RSPSA.454..339C.doi:10.1098/rspa.1998.0164.S2CID 16128238.
  5. ^abcImre, Sandor; Balazs, Ferenc (January 2005).Quantum Computing and Communications - An Engineering Approach. Wiley.ISBN 978-0470869024.
  6. ^Elgaily, Sara; Imre, Sandor (2021). "Constrained Quantum Optimization for Resource Distribution Management".International Journal of Advanced Computer Science and Applications.12 (8).
  7. ^Imre, Sandor (2007). "Quantum Existence Testing and its Application for Finding Extreme Values in Unsorted Databases".IEEE Transactions on Computers.56 (5):706–710.doi:10.1109/TC.2007.1032.S2CID 29588344.
General
Theorems
Quantum
communication
Quantum cryptography
Quantum algorithms
Quantum
complexity theory
Quantum
processor benchmarks
Quantum
computing models
Quantum
error correction
Physical
implementations
Quantum optics
Ultracold atoms
Spin-based
Superconducting
Quantum
programming
Retrieved from "https://en.wikipedia.org/w/index.php?title=Quantum_counting_algorithm&oldid=1306893115"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp