Quantum Information and Channels: A formalization blueprint

48 Phase estimation

This chapter writes phase estimation [ 121 , §5.2 ] as a circuit with calls to an oracle, and states its success probability and its number of calls. The circuit is one circuit for every oracle: it consists of plain gates and calls, and the unitary \(U\) enters only through the interpretation of the calls. The inverse Fourier transform is the adjoint of the circuit of Chapter 47, moved from the \(t\) control qubits to the register that also holds the target.

48.1 The circuit

The register has the sites \(0,\dots ,t-1\) of the control register, each with basis \(\{ 0,1\} \), and one target site with basis \(\{ 1,\dots ,m\} \); it is the register of \(t\) qubits extended by the target. Its geometry has a cell of cost \(1\) on every site and on every ordered pair of distinct sites, and the cells of the \(t\) qubits are cells of the register. Its gates are plain gates and calls of an oracle on \(\{ 0,1\} \times \{ 1,\dots ,m\} \). For a vector \(u\in \mathbb {C}^m\) the input is \(\lvert 0\cdots 0\rangle \otimes u\).

Phase estimation [ 121 , Fig. 5.2 and 5.3 ] applies the Hadamard gate to every control qubit; then, for \(j=t-1,\dots ,0\), \(2^{t-1-j}\) calls on the pair of the control qubit \(j\) and the target, each identifying the configurations of the pair with \(\{ 0,1\} \times \{ 1,\dots ,m\} \); then the inverse Fourier transform on the control register; and finally it measures every control qubit in the basis \(\lvert 0\rangle ,\lvert 1\rangle \). The readout of a branch is the integer \(k=\langle x\rangle \) encoded by the measured bits \(x\). The oracle \(U\) on \(\mathbb {C}^m\) interprets every call by the controlled gate of \(U\), so the calls on the qubit \(j\) apply \(U^{2^{t-1-j}}\) controlled by \(j\). The inverse Fourier transform is the adjoint of the circuit of Definition 47.3.1 on the \(t\) qubits, moved to the register with the target idle, its plain gates included among the gates of the register.

48.2 Success probability and number of calls

Phase estimation with \(t\) control qubits calls the oracle \(\sum _{j{\lt}t}2^{t-1-j}=2^t-1\) times.

Proof ▶

The circuit before the measurement has one branch, so its cost is the sum of the costs of its parts. Only the layers of calls contain a call, one each, and there are \(\sum _{j{\lt}t}2^{t-1-j}\) of them. The inverse Fourier transform consists of plain gates included in the sum, and the measurement has no cells, so neither contains a call.

Let \(U\) be an \(m\times m\) matrix and \(u\in \mathbb {C}^m\) a unit vector with \(Uu=e^{2\pi i\varphi }u\), \(\varphi \in \mathbb {R}\). On the input \(\lvert 0\cdots 0\rangle \otimes u\) the readout \(k\) of phase estimation has probability \(\lvert \alpha _k\rvert ^2\), where

\begin{align} \alpha _k& =2^{-t}\sum _{j{\lt}2^t}e^{2\pi ij(\varphi -k/2^t)} \notag \end{align}

[ 121 , eq. (5.24) ] , and \(\sum _k\lvert \alpha _k\rvert ^2=1\). The matrix \(U\) need not be unitary; the circuit is then in general not trace-preserving.

Proof ▶

The circuit has one branch before the measurement. The Hadamard gates map \(\lvert 0\cdots 0\rangle \otimes u\) to \(2^{-t/2}\sum _x\lvert x\rangle \otimes u\). A call controlled by the qubit \(j\) multiplies the component with \(x_j=1\) by the eigenvalue, so the calls give \(2^{-t/2}\sum _xe^{2\pi i\varphi \langle x\rangle }\lvert x\rangle \otimes u\). The inverse Fourier transform, the adjoint of the Fourier matrix of Theorem 47.3.2 tensored with the identity on the target, gives \(\sum _k\alpha _k\lvert k\rangle \otimes u\). The measurement of the control register with outcome \(k\) keeps the component \(\alpha _k\lvert k\rangle \otimes u\), of squared norm \(\lvert \alpha _k\rvert ^2\), and the readout is a bijection from the branches onto the outcomes. The sum of the \(\lvert \alpha _k\rvert ^2\) is \(1\) because the Fourier matrix is unitary (Lemma 47.2.2).

Corollary 48.2.3 Exact phases
✓

Under the hypotheses of Theorem 48.2.2, if \(2^t\varphi \) is an integer congruent to \(k\) modulo \(2^t\), the readout is \(k\) with probability \(1\).

Proof ▶

Then \(\varphi -k/2^t\) is an integer, every term of the sum is \(1\), and \(\alpha _k=1\).

Under the hypotheses of Theorem 48.2.2, let \(n\in \mathbb {N}\), \(\varepsilon {\gt}0\) and \(t=n+\lceil \log _2(2+1/(2\varepsilon ))\rceil \). Then phase estimation with \(t\) control qubits returns an integer \(k\) such that \(k/2^t\) lies within \(2^{-n}\) of \(\varphi \) modulo \(1\) with probability at least \(1-\varepsilon \) [ 121 , eq. (5.35) ] .

Proof ▶

Write \(2^t\varphi =b+\delta \) with \(b\) an integer and \(0\le \delta {\lt}1\), and for an outcome \(k\) let \(r\) be the integer nearest to \(k/2^t-\varphi \) and \(\ell =k-b-2^tr\), so that \(\lvert k/2^t-\varphi -r\rvert =\lvert \ell -\delta \rvert /2^t\le 1/2\); distinct outcomes give distinct \(\ell \). For \(\lvert x-r\rvert \le 1/2\) one has \(\lvert e^{2\pi ix}-1\rvert =2\lvert \sin \pi (x-r)\rvert \ge 4\lvert x-r\rvert \), so summing the geometric series,

\begin{align} \lvert \alpha _k\rvert & \le \frac{2^{-t}\cdot 2}{4\lvert \varphi -k/2^t+r\rvert } =\frac1{2\lvert \ell -\delta \rvert }. \notag \end{align}

Let \(M=2^{t-n}\). An outcome farther than \(2^{-n}\) from \(\varphi \) modulo \(1\) has \(\lvert \ell -\delta \rvert {\gt}M\), hence \(\ell \ge M+1\), with \(\lvert \ell -\delta \rvert \ge \ell -1\), or \(-\ell \ge M\), with \(\lvert \ell -\delta \rvert \ge -\ell \). Since \(1/a^2\le 1/(a-1)-1/a\), a sum of \(1/a^2\) over distinct integers \(a\ge M\) is at most \(1/(M-1)\), so these outcomes have total probability at most \(\frac14\cdot \frac2{M-1}=1/(2(M-1))\). This is the estimate of [ 121 , eqs. (5.30)–(5.34) ] with \(e=M-1\), slightly sharper. Finally \(M\ge 2+1/(2\varepsilon )\) gives \(1/(2(M-1))\le \varepsilon \), and the probabilities of all outcomes sum to \(1\).

48.3 Semiclassical phase estimation

Semiclassical phase estimation [ 94 ] replaces the inverse Fourier transform and the measurement by measurements of the control qubits one at a time, in the order \(0,1,\dots ,t-1\). Griffiths and Niu show that the outcomes have the distribution of the coherent circuit for every input; here this is proved for the input of phase estimation, an eigenvector of the oracle on the target  [ 158 ] . Before the qubit \(j\) is measured it gets the phase gate \(\operatorname {diag}(1,e^{-2\pi i\theta _j})\) with \(\theta _j=\sum _{i{\lt}j}b_i/2^{j-i+1}\), where \(b_i\) is the outcome of the qubit \(i\), and then the Hadamard gate. The circuit branches: the layer measuring the qubit \(j\) depends on the outcomes of the earlier layers. It is the first circuit of these chapters in which the continuation after a layer depends on its outcome. The readout is the integer whose bit at the site \(t-1-j\) is \(b_j\).

Under the hypotheses of Theorem 48.2.2, that is, on the input \(\lvert 0\cdots 0\rangle \otimes u\) with \(Uu=e^{2\pi i\varphi }u\), the readout \(k\) of semiclassical phase estimation has probability \(\lvert \alpha _k\rvert ^2\). Hence it has the success probability of Theorem 48.2.4, and it calls the oracle \(2^t-1\) times.

Proof ▶

After the preparation the control register is the product state \(\bigotimes _j2^{-1/2}(\lvert 0\rangle +e^{2\pi i\varphi 2^{t-1-j}}\lvert 1\rangle )\), tensored with \(u\). Along a branch, the corrected measurement of the qubit \(j\) with outcome \(b_j\) keeps a product state, replacing the factor of the qubit \(j\) by \(\beta _j\lvert b_j\rangle \) with

\begin{align} \beta _j& =\tfrac 12\bigl(1+(-1)^{b_j}e^{-2\pi i\theta _j}e^{2\pi i\varphi 2^{t-1-j}}\bigr), \notag \end{align}

so the branch has probability \(\prod _j\lvert \beta _j\rvert ^2\). For the readout \(k=\sum _jb_j2^j\) one has \(k/2^{j+1}\equiv b_j/2+\theta _j\) modulo \(1\), hence \(\beta _j=\tfrac 12(1+z^{2^{t-1-j}})\) with \(z=e^{2\pi i(\varphi -k/2^t)}\), and

\begin{align} \prod _j\beta _j& =2^{-t}\prod _{s{\lt}t}\bigl(1+z^{2^s}\bigr)=2^{-t}\sum _{l{\lt}2^t}z^l=\alpha _k. \notag \end{align}

The outcomes of the branches are the bit strings, each once, so the readout \(k\) has probability \(\lvert \alpha _k\rvert ^2\). The rest follows from Theorems 48.2.2 and 48.2.4. The measurements contain no calls, so the number of calls is that of the preparation.