Skip to main content
IBM Quantum Platform

The phase estimation problem

This section of the lesson explains the phase estimation problem. We'll begin with a short discussion of the spectral theorem from linear algebra, and then move on to a statement of the phase estimation problem itself.


Spectral theorem

The spectral theorem is an important fact from linear algebra that states that matrices of a certain type, called normal matrices, can be expressed in a simple and useful way. We'll only need this theorem for unitary matrices in this lesson, but down the road in this series we'll apply it to Hermitian matrices as well.

Normal matrices

A square matrix MM with complex number entries is said to be a normal matrix if it commutes with its conjugate transpose: MM=MM.M M^{\dagger} = M^{\dagger} M.

Every unitary matrix UU is normal because

UU=I=UU.U U^{\dagger} = \mathbb{I} = U^{\dagger} U.

Hermitian matrices, which are matrices that equal their own conjugate transpose, are another important class of normal matrices. If HH is a Hermitian matrix, then

HH=H2=HH,H H^{\dagger} = H^2 = H^{\dagger} H,

so HH is normal.

Not every square matrix is normal. For instance, this matrix isn't normal:

(0100)\begin{pmatrix} 0 & 1\\ 0 & 0 \end{pmatrix}

(This is a simple but great example of a matrix that's often very helpful to consider.) It isn't normal because

(0100)(0100)=(0100)(0010)=(1000)\begin{pmatrix} 0 & 1\\ 0 & 0 \end{pmatrix} \begin{pmatrix} 0 & 1\\ 0 & 0 \end{pmatrix}^{\dagger} = \begin{pmatrix} 0 & 1\\ 0 & 0 \end{pmatrix} \begin{pmatrix} 0 & 0\\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 1 & 0\\ 0 & 0 \end{pmatrix}

while

(0100)(0100)=(0010)(0100)=(0001).\begin{pmatrix} 0 & 1\\ 0 & 0 \end{pmatrix}^{\dagger} \begin{pmatrix} 0 & 1\\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 0\\ 1 & 0 \end{pmatrix} \begin{pmatrix} 0 & 1\\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 0\\ 0 & 1 \end{pmatrix}.

Theorem statement

Now here's a statement of the spectral theorem.

Theorem (spectral theorem). Let MM be a normal N×NN\times N complex matrix. There exists an orthonormal basis of NN-dimensional complex vectors {ψ1,,ψN}\bigl\{ \vert\psi_1\rangle,\ldots,\vert\psi_N\rangle \bigr\} along with complex numbers λ1,,λN\lambda_1,\ldots,\lambda_N such that

M=λ1ψ1ψ1++λNψNψN.M = \lambda_1 \vert \psi_1\rangle\langle \psi_1\vert + \cdots + \lambda_N \vert \psi_N\rangle\langle \psi_N\vert.

The expression of a matrix in the form

M=k=1Nλkψkψk(1)M = \sum_{k = 1}^N \lambda_k \vert \psi_k\rangle\langle \psi_k\vert \tag{1}

is commonly called a spectral decomposition. Notice that if MM is a normal matrix expressed in the form (1),(1), then the equation

Mψj=λjψjM \vert \psi_j \rangle = \lambda_j \vert \psi_j \rangle

must be true for every j=1,,N.j = 1,\ldots,N. This is a consequence of the fact that {ψ1,,ψN}\bigl\{ \vert\psi_1\rangle,\ldots,\vert\psi_N\rangle \bigr\} is orthonormal:

Mψj=(k=1Nλkψkψk)ψj=k=1Nλkψkψkψj=λjψjM \vert \psi_j \rangle = \left(\sum_{k = 1}^N \lambda_k \vert \psi_k\rangle\langle \psi_k\vert\right)\vert \psi_j\rangle = \sum_{k = 1}^N \lambda_k \vert \psi_k\rangle\langle \psi_k\vert\psi_j \rangle = \lambda_j \vert\psi_j \rangle

That is, each number λj\lambda_j is an eigenvalue of MM and ψj\vert\psi_j\rangle is an eigenvector corresponding to that eigenvalue.

  • Example 1. Let

    I=(1001),\mathbb{I} = \begin{pmatrix}1 & 0\\0 & 1\end{pmatrix},

    which is normal. The theorem implies that I\mathbb{I} can be written in the form (1)(1) for some choice of λ1,\lambda_1, λ2,\lambda_2, ψ1,\vert\psi_1\rangle, and ψ2.\vert\psi_2\rangle. There are multiple choices that work, including

    λ1=1,λ2=1,ψ1=0,ψ2=1.\lambda_1 = 1, \hspace{5pt} \lambda_2 = 1, \hspace{5pt} \vert\psi_1\rangle = \vert 0\rangle, \hspace{5pt} \vert\psi_2\rangle = \vert 1\rangle.

    Notice that the theorem does not say that the complex numbers λ1,,λN\lambda_1,\ldots,\lambda_N are distinct — we can have the same complex number repeated, which is necessary for this example. These choices work because

    I=00+11.\mathbb{I} = \vert 0\rangle\langle 0\vert + \vert 1\rangle\langle 1\vert.

    Indeed, we could choose {ψ1,ψ2}\{\vert\psi_1\rangle,\vert\psi_2\rangle\} to be any orthonormal basis and the equation will be true. For instance,

    I=+++.\mathbb{I} = \vert +\rangle\langle +\vert + \vert -\rangle\langle -\vert.
  • Example 2. Consider a Hadamard operation.

    H=12(1111)H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1\\[1mm] 1 & -1 \end{pmatrix}

    This is a unitary matrix, so it is normal. The spectral theorem implies that HH can be written in the form (1),(1), and in particular we have

    H=ψπ/8ψπ/8ψ5π/8ψ5π/8H = \vert\psi_{\pi/8}\rangle \langle \psi_{\pi/8}\vert - \vert\psi_{5\pi/8}\rangle \langle \psi_{5\pi/8}\vert

    where

    ψθ=cos(θ)0+sin(θ)1.\vert\psi_{\theta}\rangle = \cos(\theta)\vert 0\rangle + \sin(\theta) \vert 1\rangle.

    More explicitly,

    ψπ/8=2+220+2221,ψ5π/8=2220+2+221.\begin{aligned} \vert\psi_{\pi/8}\rangle & = \frac{\sqrt{2 + \sqrt{2}}}{2}\vert 0\rangle + \frac{\sqrt{2 - \sqrt{2}}}{2}\vert 1\rangle, \\[3mm] \vert\psi_{5\pi/8}\rangle & = -\frac{\sqrt{2 - \sqrt{2}}}{2}\vert 0\rangle + \frac{\sqrt{2 + \sqrt{2}}}{2}\vert 1\rangle. \end{aligned}

    We can check that this decomposition is correct by performing the required calculations:

    ψπ/8ψπ/8ψ5π/8ψ5π/8=(2+242424224)(22424242+24)=H.\vert\psi_{\pi/8}\rangle \langle \psi_{\pi/8}\vert - \vert\psi_{5\pi/8}\rangle \langle \psi_{5\pi/8}\vert = \begin{pmatrix} \frac{2 + \sqrt{2}}{4} & \frac{\sqrt{2}}{4}\\[2mm] \frac{\sqrt{2}}{4} & \frac{2 - \sqrt{2}}{4} \end{pmatrix} - \begin{pmatrix} \frac{2 - \sqrt{2}}{4} & -\frac{\sqrt{2}}{4}\\[2mm] -\frac{\sqrt{2}}{4} & \frac{2 + \sqrt{2}}{4} \end{pmatrix} = H.

As the first example above reveals, there can be some freedom in how eigenvectors are selected. There is, however, no freedom at all in how the eigenvalues are chosen, except for their ordering: the same NN complex numbers λ1,,λN,\lambda_1,\ldots,\lambda_N, which can include repetitions of the same complex number, will always occur in the equation (1)(1) for a given choice of a matrix M.M.

Now let's focus in on unitary matrices. Suppose we have a complex number λ\lambda and a non-zero vector ψ\vert\psi\rangle that satisfy the equation

Uψ=λψ.(2)U\vert\psi\rangle = \lambda\vert\psi\rangle. \tag{2}

That is, λ\lambda is an eigenvalue of UU and ψ\vert\psi\rangle is an eigenvector corresponding to this eigenvalue.

Unitary matrices preserve Euclidean norm, and so we conclude the following from (2).(2).

ψ=Uψ=λψ=λψ\bigl\| \vert\psi\rangle \bigr\| = \bigl\| U \vert\psi\rangle \bigr\| = \bigl\| \lambda \vert\psi\rangle \bigr\| = \vert \lambda \vert \bigl\| \vert\psi\rangle \bigr\|

The condition that ψ\vert\psi\rangle is non-zero implies that ψ0,\bigl\| \vert\psi\rangle \bigr\|\neq 0, so we can cancel it from both sides to obtain

λ=1.\vert \lambda \vert = 1.

This reveals that eigenvalues of unitary matrices must always have absolute value equal to one, so they lie on the unit circle.

T={αC:α=1}\mathbb{T} = \{\alpha\in\mathbb{C} : \vert\alpha\vert = 1\}

(The symbol T\mathbb{T} is a common name for the complex unit circle. The name S1S^1 is also common.)


Phase estimation problem statement

In the phase estimation problem, we're given a quantum state ψ\vert \psi\rangle of nn qubits, along with a unitary quantum circuit that acts on nn qubits. We're promised that ψ\vert \psi\rangle is an eigenvector of the unitary matrix UU that describes the action of the circuit, and our goal is to compute or approximate the eigenvalue λ\lambda to which ψ\vert \psi\rangle corresponds. More precisely, because λ\lambda lies on the complex unit circle, we can write

λ=e2πiθ\lambda = e^{2\pi i \theta}

for a unique real number θ\theta satisfying 0θ<1.0\leq\theta<1. The goal of the problem is to compute or approximate this real number θ.\theta.

Phase estimation problem
Input: A unitary quantum circuit for an nn-qubit operation UU along with an nn-qubit quantum state ψ\vert\psi\rangle
Promise: ψ\vert\psi\rangle is an eigenvector of UU
Output: an approximation to the number θ[0,1)\theta\in[0,1) satisfying Uψ=e2πiθψU\vert\psi\rangle = e^{2\pi i \theta}\vert\psi\rangle

Here are a few remarks about this problem statement:

  1. The phase estimation problem is different from other problems we've seen so far in the course in that the input includes a quantum state. Typically we focus on problems having classical inputs and outputs, but nothing prevents us from considering quantum state inputs like this. In terms of its practical relevance, the phase estimation problem is typically encountered as a subproblem inside of a larger computation, like we'll see in the context of integer factorization later in the lesson.

  2. The statement of the phase estimation problem above isn't specific about what constitutes an approximation of θ,\theta, but we can formulate more precise problem statements depending on our needs and interests. In the context of integer factorization, we'll demand a very precise approximation to θ,\theta, but in other cases we might be satisfied with a very rough approximation. We'll discuss shortly how the precision we require affects the computational cost of a solution.

  3. Notice that as we go from θ=0\theta = 0 toward θ=1\theta = 1 in the phase estimation problem, we're going all the way around the unit circle, starting from e2πi0=1e^{2\pi i \cdot 0} = 1 and moving counter-clockwise toward e2πi1=1.e^{2\pi i \cdot 1} = 1. That is, when we reach θ=1\theta = 1 we're back where we started at θ=0.\theta = 0. So, as we consider the accuracy of approximations, choices of θ\theta near 11 should be considered as being near 0.0. For example, an approximation θ=0.999\theta = 0.999 should be considered as being within 1/10001/1000 of θ=0.\theta = 0.

Was this page helpful?
Report a bug or request content on GitHub.