...

/

Quantum Phase Estimation

Quantum Phase Estimation

We'll look at the Quantum Phase Estimation problem, which has a similar solution to Shor's algorithm.

The phase estimation problem

Before we directly address the factorization problem that we solve using Shor’s algorithm, we will take a slight detour and look at a different problem. Don’t worry if you are not sure how these things are related at this point.

Let’s understand the quantum phase estimation (QPE) problem with a simple example. Let’s say we have a unitary operator UU and a quantum state ψ|\psi\rangle. The state ψ|\psi\rangle is the eigenstate of the operator UU, so when the operator is applied to the state, instead of modifying the state and its components, only a phase is applied to it. The phase can be from -1 to +1 and anything in between. In terms of Linear Algebra, the vector ψ|\psi\rangle is the eigenvector of unitary matrix UU.

Uψ=eiθψU|\psi\rangle = e^{i\theta}|\psi\rangle

The question is to find the value of the phase θ\theta that has been applied to the quantum state ψ|\psi\rangle. We can assume we already have UU and ψ|\psi\rangle. When we try to measure the final state, we cannot see the effect of the global phase eiθe^{i\theta} because the probabilities to measure 0s|0\rangle's or 1s|1\rangle's haven’t changed. This doesn’t help us much, so let’s try to figure out how else we could find this phase θ\theta.

Phase kickback

We come back to the technique we’ve been exploiting all this time. If we cannot get information about θ\theta from the global phase, why not turn it into a relative phase of another qubit(s) using phase kickback? We know that relative phases do have an impact that we can see upon measurement. Recall the effect of a CNOT gate on +|+\rangle and |-\rangle. This gives us a hint that we need a controlled operation, so let’s create a controlled version of the UU operator, called CUC-U gate.

Basic solution

Let’s try to understand what’s going on by following the circuit step by step.

ϕ0=ψ0|\phi_0\rangle = |\psi\rangle|0\rangle

We apply the Hadamard gate on our ancilla. This will help us encode the phase information in a relative phase in the superposition of the ancilla qubit.

ϕ1=ψH0|\phi_1\rangle = |\psi\rangle H|0\rangle

ϕ1=ψ0+ψ12|\phi_1\rangle = \frac{|\psi\rangle|0\rangle + |\psi\rangle|1\rangle}{\sqrt2} ...

Access this course and 1400+ top-rated courses and projects.