Quantum phase estimation algorithm

Quantum algorithm for eigenvalue estimation

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 are characterized by their phase, and therefore the algorithm can be equivalently described as retrieving either the phase or the eigenvalue itself. The algorithm was initially introduced by Alexei Kitaev in 1995.[1][2]: 246 

Phase estimation is frequently used as a subroutine in other quantum algorithms, such as Shor's algorithm,[2]: 131  the quantum algorithm for linear systems of equations, and the quantum counting algorithm.

Overview of the algorithm

The algorithm operates on two sets of qubits, referred to in this context as registers. The two registers contain n {\displaystyle n} and m {\displaystyle m} qubits, respectively. Let U {\displaystyle U} be a unitary operator acting on the m {\displaystyle m} -qubit register. The eigenvalues of a unitary operator have unit modulus, and are therefore characterized by their phase. Thus if | ψ {\displaystyle |\psi \rangle } is an eigenvector of U {\displaystyle U} , then U | ψ = e 2 π i θ | ψ {\displaystyle U|\psi \rangle =e^{2\pi i\theta }\left|\psi \right\rangle } for some θ R {\displaystyle \theta \in \mathbb {R} } . Due to the periodicity of the complex exponential, we can always assume 0 θ < 1 {\displaystyle 0\leq \theta <1} .

The goal is producing a good approximation for θ {\displaystyle \theta } with a small number of gates and a high probability of success. The quantum phase estimation algorithm achieves this assuming oracular access to U {\displaystyle U} , and having | ψ {\displaystyle |\psi \rangle } available as a quantum state. This means that when discussing the efficiency of the algorithm we only worry about the number of times U {\displaystyle U} needs to be used, but not about the cost of implementing U {\displaystyle U} itself.

More precisely, the algorithm returns with high probability an approximation for θ {\displaystyle \theta } , within additive error ε {\displaystyle \varepsilon } , using n = O ( log ( 1 / ε ) ) {\displaystyle n=O(\log(1/\varepsilon ))} qubits in the first register, and O ( 1 / ε ) {\displaystyle O(1/\varepsilon )} controlled-U operations. Furthermore, we can improve the success probability to 1 Δ {\displaystyle 1-\Delta } for any Δ > 0 {\displaystyle \Delta >0} by using a total of O ( log ( 1 / Δ ) / ε ) {\displaystyle O(\log(1/\Delta )/\varepsilon )} uses of controlled-U, and this is optimal.[3]

Detailed description of the algorithm

The circuit for quantum phase estimation.

State preparation

The initial state of the system is:

| Ψ 0 = | 0 n | ψ , {\displaystyle |\Psi _{0}\rangle =|0\rangle ^{\otimes n}|\psi \rangle ,}

where | ψ {\displaystyle |\psi \rangle } is the m {\displaystyle m} -qubit state that evolves through U {\displaystyle U} . We first apply the n-qubit Hadamard gate operation H n {\displaystyle H^{\otimes n}} on the first register, which produces the state: | Ψ 1 = ( H n I m ) | Ψ 0 = 1 2 n 2 ( | 0 + | 1 ) n | ψ = 1 2 n / 2 j = 0 2 n 1 | j | ψ . {\displaystyle |\Psi _{1}\rangle =(H^{\otimes n}\otimes I_{m})|\Psi _{0}\rangle ={\frac {1}{2^{\frac {n}{2}}}}(|0\rangle +|1\rangle )^{\otimes n}|\psi \rangle ={\frac {1}{2^{n/2}}}\sum _{j=0}^{2^{n}-1}|j\rangle |\psi \rangle .} Note that here we are switching between binary and n {\displaystyle n} -ary representation for the n {\displaystyle n} -qubit register: the ket | j {\displaystyle |j\rangle } on the right-hand side is shorthand for the n {\displaystyle n} -qubit state | j = 0 n 1 | j {\displaystyle |j\rangle \equiv \bigotimes _{\ell =0}^{n-1}|j_{\ell }\rangle } , where j = = 0 n 1 j 2 {\displaystyle j=\sum _{\ell =0}^{n-1}j_{\ell }2^{\ell }} is the binary decomposition of j {\displaystyle j} .

Controlled-U operations

This state | Ψ 1 {\displaystyle |\Psi _{1}\rangle } is then evolved through the controlled-unitary evolution U C {\displaystyle U_{C}} whose action can be written as U C ( | k | ψ ) = | k ( U k | ψ ) , {\displaystyle U_{C}(|k\rangle \otimes |\psi \rangle )=|k\rangle \otimes (U^{k}|\psi \rangle ),} for all k = 0 , . . . , 2 n 1 {\displaystyle k=0,...,2^{n}-1} . This evolution can also be written concisely as U C = k = 0 2 n 1 | k k | U k , {\displaystyle U_{C}=\sum _{k=0}^{2^{n}-1}|k\rangle \!\langle k|\otimes U^{k},} which highlights its controlled nature: it applies U k {\displaystyle U^{k}} to the second register conditionally to the first register being | k {\displaystyle |k\rangle } . Remembering the eigenvalue condition holding for | ψ {\displaystyle |\psi \rangle } , applying U C {\displaystyle U_{C}} to | Ψ 1 {\displaystyle |\Psi _{1}\rangle } thus gives | Ψ 2 U C | Ψ 1 = ( 1 2 n / 2 k = 0 2 n 1 e 2 π i θ k | k ) | ψ , {\displaystyle |\Psi _{2}\rangle \equiv U_{C}|\Psi _{1}\rangle =\left({\frac {1}{2^{n/2}}}\sum _{k=0}^{2^{n}-1}e^{2\pi i\theta k}|k\rangle \right)\otimes |\psi \rangle ,} where we used U k | ψ = e 2 π i k θ | ψ {\displaystyle U^{k}|\psi \rangle =e^{2\pi ik\theta }|\psi \rangle } .

To show that U C {\displaystyle U_{C}} can also be implemented efficiently, observe that we can write U C = = 0 n 1 C ( U 2 ) {\displaystyle U_{C}=\prod _{\ell =0}^{n-1}C_{\ell }(U^{2^{\ell }})} , where C ( U 2 ) {\displaystyle C_{\ell }(U^{2^{\ell }})} denotes the operation of applying U 2 {\displaystyle U^{2^{\ell }}} to the second register conditionally to the {\displaystyle \ell } -th qubit of the first register being | 1 {\displaystyle |1\rangle } . Formally, these gates can be characterized by their action as C ( U k ) ( | j | ψ ) = | j ( U j k | ψ ) . {\displaystyle C_{\ell }(U^{k})(|j\rangle \otimes |\psi \rangle )=|j\rangle \otimes (U^{j_{\ell }k}|\psi \rangle ).} This equation can be interpreted as saying that the state is left unchanged when j = 0 {\displaystyle j_{\ell }=0} , that is, when the {\displaystyle \ell } -th qubit is | 0 {\displaystyle |0\rangle } , while the gate U k {\displaystyle U^{k}} is applied to the second register when the {\displaystyle \ell } -th qubit is | 1 {\displaystyle |1\rangle } . The composition of these controlled-gates thus gives = 0 n 1 C ( U 2 ) ( | j | ψ ) = | j ( U = 0 n 1 j 2 | ψ ) = U C , {\displaystyle \prod _{\ell =0}^{n-1}C_{\ell }(U^{2^{\ell }})(|j\rangle \otimes |\psi \rangle )=|j\rangle \otimes \left(U^{\sum _{\ell =0}^{n-1}j_{\ell }2^{\ell }}|\psi \rangle \right)=U_{C},} with the last step directly following from the binary decomposition j = = 0 n 1 j 2 {\displaystyle j=\sum _{\ell =0}^{n-1}j_{\ell }2^{\ell }} .

From this point onwards, the second register is left untouched, and thus it is convenient to write | Ψ 2 = | Ψ ~ 2 | ψ {\displaystyle |\Psi _{2}\rangle =|{\tilde {\Psi }}_{2}\rangle \otimes |\psi \rangle } , with | Ψ ~ 2 {\displaystyle |{\tilde {\Psi }}_{2}\rangle } the state of the n {\displaystyle n} -qubit register, which is the only one we need to consider for the rest of the algorithm.

Apply inverse quantum Fourier transform

The final part of the circuit involves applying the inverse quantum Fourier transform (QFT) Q F T {\displaystyle {\mathcal {QFT}}} on the first register of | Ψ 2 {\displaystyle |\Psi _{2}\rangle } : | Ψ ~ 3 = Q F T 2 n 1 | Ψ ~ 2 . {\displaystyle |{\tilde {\Psi }}_{3}\rangle ={\mathcal {QFT}}_{2^{n}}^{-1}|{\tilde {\Psi }}_{2}\rangle .} The QFT and its inverse are characterized by their action on basis states as Q F T N | k = N 1 / 2 j = 0 N 1 e 2 π i N j k | j , Q F T N 1 | k = N 1 / 2 j = 0 N 1 e 2 π i N j k | j . {\displaystyle {\begin{aligned}{\mathcal {QFT}}_{N}|k\rangle &=N^{-1/2}\sum _{j=0}^{N-1}e^{{\frac {2\pi i}{N}}jk}|j\rangle ,\\{\mathcal {QFT}}_{N}^{-1}|k\rangle &=N^{-1/2}\sum _{j=0}^{N-1}e^{-{\frac {2\pi i}{N}}jk}|j\rangle .\end{aligned}}} It follows that

| Ψ ~ 3 = 1 2 n 2 k = 0 2 n 1 e 2 π i θ k ( 1 2 n 2 x = 0 2 n 1 e 2 π i k x 2 n | x ) = 1 2 n x = 0 2 n 1 k = 0 2 n 1 e 2 π i k 2 n ( x 2 n θ ) | x . {\displaystyle |{\tilde {\Psi }}_{3}\rangle ={\frac {1}{2^{\frac {n}{2}}}}\sum _{k=0}^{2^{n}-1}e^{2\pi i\theta k}\left({\frac {1}{2^{\frac {n}{2}}}}\sum _{x=0}^{2^{n}-1}e^{\frac {-2\pi ikx}{2^{n}}}|x\rangle \right)={\frac {1}{2^{n}}}\sum _{x=0}^{2^{n}-1}\sum _{k=0}^{2^{n}-1}e^{-{\frac {2\pi ik}{2^{n}}}\left(x-2^{n}\theta \right)}|x\rangle .}

Decomposing the state in the computational basis as | Ψ ~ 3 = x = 0 2 n 1 c x | x , {\textstyle |{\tilde {\Psi }}_{3}\rangle =\sum _{x=0}^{2^{n}-1}c_{x}|x\rangle ,} the coefficients thus equal c x 1 2 n k = 0 2 n 1 e 2 π i k 2 n ( x 2 n θ ) = 1 2 n k = 0 2 n 1 e 2 π i k 2 n ( x a ) e 2 π i δ k , {\displaystyle c_{x}\equiv {\frac {1}{2^{n}}}\sum _{k=0}^{2^{n}-1}e^{-{\frac {2\pi ik}{2^{n}}}(x-2^{n}\theta )}={\frac {1}{2^{n}}}\sum _{k=0}^{2^{n}-1}e^{-{\frac {2\pi ik}{2^{n}}}\left(x-a\right)}e^{2\pi i\delta k},} where we wrote 2 n θ = a + 2 n δ , {\displaystyle 2^{n}\theta =a+2^{n}\delta ,} with a {\displaystyle a} is the nearest integer to 2 n θ {\displaystyle 2^{n}\theta } . The difference 2 n δ {\displaystyle 2^{n}\delta } must by definition satisfy 0 | 2 n δ | 1 2 {\displaystyle 0\leqslant |2^{n}\delta |\leqslant {\tfrac {1}{2}}} . This amounts to approximating the value of θ [ 0 , 1 ] {\displaystyle \theta \in [0,1]} by rounding 2 n θ {\displaystyle 2^{n}\theta } to the nearest integer.

Measurement

The final step involves performing a measurement in the computational basis on the first register. This yields the outcome | y {\displaystyle |y\rangle } with probability Pr ( y ) = | c y | 2 = | 1 2 n k = 0 2 n 1 e 2 π i k 2 n ( y a ) e 2 π i δ k | 2 . {\displaystyle \Pr(y)=|c_{y}|^{2}=\left|{\frac {1}{2^{n}}}\sum _{k=0}^{2^{n}-1}e^{{\frac {-2\pi ik}{2^{n}}}(y-a)}e^{2\pi i\delta k}\right|^{2}.} It follows that Pr ( a ) = 1 {\displaystyle \operatorname {Pr} (a)=1} if δ = 0 {\displaystyle \delta =0} , that is, when θ {\displaystyle \theta } can be written as θ = a / 2 n {\displaystyle \theta =a/2^{n}} , one always finds the outcome y = a {\displaystyle y=a} . On the other hand, if δ 0 {\displaystyle \delta \neq 0} , the probability reads Pr ( a ) = 1 2 2 n | k = 0 2 n 1 e 2 π i δ k | 2 = 1 2 2 n | 1 e 2 π i 2 n δ 1 e 2 π i δ | 2 . {\displaystyle \operatorname {Pr} (a)={\frac {1}{2^{2n}}}\left|\sum _{k=0}^{2^{n}-1}e^{2\pi i\delta k}\right|^{2}={\frac {1}{2^{2n}}}\left|{\frac {1-{e^{2\pi i2^{n}\delta }}}{1-{e^{2\pi i\delta }}}}\right|^{2}.} From this expression we can see that Pr ( a ) 4 π 2 0.405 {\displaystyle \Pr(a)\geqslant {\frac {4}{\pi ^{2}}}\approx 0.405} when δ 0 {\displaystyle \delta \neq 0} . To see this, we observe that from the definition of δ {\displaystyle \delta } we have the inequality | δ | 1 2 n + 1 {\displaystyle |\delta |\leqslant {\tfrac {1}{2^{n+1}}}} , and thus:[4]: 157 [5]: 348  Pr ( a ) = 1 2 2 n | 1 e 2 π i 2 n δ 1 e 2 π i δ | 2 for  δ 0 = 1 2 2 n | 2 sin ( π 2 n δ ) 2 sin ( π δ ) | 2 | 1 e 2 i x | 2 = 4 | sin ( x ) | 2 = 1 2 2 n | sin ( π 2 n δ ) | 2 | sin ( π δ ) | 2 1 2 2 n | sin ( π 2 n δ ) | 2 | π δ | 2 | sin ( π δ ) | | π δ | 1 2 2 n | 2 2 n δ | 2 | π δ | 2 | 2 2 n δ | | sin ( π 2 n δ ) |  for  | δ | 1 2 n + 1 4 π 2 . {\displaystyle {\begin{aligned}\Pr(a)&={\frac {1}{2^{2n}}}\left|{\frac {1-{e^{2\pi i2^{n}\delta }}}{1-{e^{2\pi i\delta }}}}\right|^{2}&&{\text{for }}\delta \neq 0\\[6pt]&={\frac {1}{2^{2n}}}\left|{\frac {2\sin \left(\pi 2^{n}\delta \right)}{2\sin(\pi \delta )}}\right|^{2}&&\left|1-e^{2ix}\right|^{2}=4\left|\sin(x)\right|^{2}\\[6pt]&={\frac {1}{2^{2n}}}{\frac {\left|\sin \left(\pi 2^{n}\delta \right)\right|^{2}}{|\sin(\pi \delta )|^{2}}}\\[6pt]&\geqslant {\frac {1}{2^{2n}}}{\frac {\left|\sin \left(\pi 2^{n}\delta \right)\right|^{2}}{|\pi \delta |^{2}}}&&|\sin(\pi \delta )|\leqslant |\pi \delta |\\[6pt]&\geqslant {\frac {1}{2^{2n}}}{\frac {|2\cdot 2^{n}\delta |^{2}}{|\pi \delta |^{2}}}&&|2\cdot 2^{n}\delta |\leqslant |\sin(\pi 2^{n}\delta )|{\text{ for }}|\delta |\leqslant {\frac {1}{2^{n+1}}}\\[6pt]&\geqslant {\frac {4}{\pi ^{2}}}.\end{aligned}}}

We conclude that the algorithm provides the best n {\displaystyle n} -bit estimate (i.e., one that is within 1 / 2 n {\displaystyle 1/2^{n}} of the correct answer) of θ {\displaystyle \theta } with probability at least 4 / π 2 {\displaystyle 4/\pi ^{2}} . By adding a number of extra qubits on the order of O ( log ( 1 / ϵ ) ) {\displaystyle O(\log(1/\epsilon ))} and truncating the extra qubits the probability can increase to 1 ϵ {\displaystyle 1-\epsilon } .[5]

Toy examples

Consider the simplest possible instance of the algorithm, where only n = 1 {\displaystyle n=1} qubit, on top of the qubits required to encode | ψ {\displaystyle |\psi \rangle } , is involved. Suppose the eigenvalue of | ψ {\displaystyle |\psi \rangle } reads λ = e 2 π i θ {\displaystyle \lambda =e^{2\pi i\theta }} , θ [ 0 , 1 ) {\displaystyle \theta \in [0,1)} . The first part of the algorithm generates the one-qubit state | ϕ 1 2 ( | 0 + λ | 1 ) {\textstyle |\phi \rangle \equiv {\frac {1}{\sqrt {2}}}(|0\rangle +\lambda |1\rangle )} . Applying the inverse QFT amounts in this case to applying a Hadamard gate. The final outcome probabilities are thus p ± = | ± | ϕ | 2 {\displaystyle p_{\pm }=|\langle \pm |\phi \rangle |^{2}} where | ± 1 2 ( | 0 ± | 1 ) {\textstyle |\pm \rangle \equiv {\frac {1}{\sqrt {2}}}(|0\rangle \pm |1\rangle )} , or more explicitly, p ± = | 1 ± λ | 2 4 = 1 ± cos ( 2 π θ ) 2 . {\displaystyle p_{\pm }={\frac {|1\pm \lambda |^{2}}{4}}={\frac {1\pm \cos(2\pi \theta )}{2}}.} Suppose λ = 1 {\displaystyle \lambda =1} , meaning | ϕ = | + {\displaystyle |\phi \rangle =|+\rangle } . Then p + = 1 {\displaystyle p_{+}=1} , p = 0 {\displaystyle p_{-}=0} , and we recover deterministically the precise value of λ {\displaystyle \lambda } from the measurement outcomes. The same applies if λ = 1 {\displaystyle \lambda =-1} .

If on the other hand λ = e 2 π i / 3 {\displaystyle \lambda =e^{2\pi i/3}} , then p ± = [ 1 ± cos ( 2 π / 3 ) ] / 2 {\displaystyle p_{\pm }=[1\pm \cos(2\pi /3)]/2} , that is, p + = 1 / 4 {\displaystyle p_{+}=1/4} and p = 3 / 4 {\displaystyle p_{-}=3/4} . In this case the result is not deterministic, but we still find the outcome | {\displaystyle |-\rangle } as more likely, compatibly with the fact that 2 / 3 {\displaystyle 2/3} is closer to 1 than to 0.

More generally, if λ = e 2 π i θ {\displaystyle \lambda =e^{2\pi i\theta }} , then p + 1 / 2 {\displaystyle p_{+}\geq 1/2} if and only if | θ | 1 / 4 {\displaystyle |\theta |\leq 1/4} . This is consistent with the results above because in the cases λ = ± 1 {\displaystyle \lambda =\pm 1} , corresponding to θ = 0 , 1 / 2 {\displaystyle \theta =0,1/2} , the phase is retrieved deterministically, and the other phases are retrieved with higher accuracy the closer they are to these two.

See also

  • Shor's algorithm
  • Quantum counting algorithm
  • Parity measurement

References

  1. ^ Kitaev, A. Yu (1995-11-20). "Quantum measurements and the Abelian Stabilizer Problem". arXiv:quant-ph/9511026.
  2. ^ a b Nielsen, Michael A. & Isaac L. Chuang (2001). Quantum computation and quantum information (Repr. ed.). Cambridge [u.a.]: Cambridge Univ. Press. ISBN 978-0521635035.
  3. ^ Mande, Nikhil S.; Ronald de Wolf (2023). "Tight Bounds for Quantum Phase Estimation and Related Problems". arXiv:2305.04908 [quant-ph].
  4. ^ Benenti, Guiliano; Casati, Giulio; Strini, Giuliano (2004). Principles of quantum computation and information (Reprinted. ed.). New Jersey [u.a.]: World Scientific. ISBN 978-9812388582.
  5. ^ a b 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.
  • v
  • t
  • e
GeneralTheoremsQuantum
communication
Quantum cryptography
Quantum algorithmsQuantum
complexity theoryQuantum
processor benchmarksQuantum
computing modelsQuantum
error correctionPhysical
implementations
Quantum optics
Ultracold atoms
Spin-based
Superconducting
Quantum
programming
  • Quantum information science
  • Quantum mechanics topics