Lean, informalized

Nielsen & Chuang · Chapter 6, Quantum search algorithms · p. 254

Exercise 6.4 - A number of Grover iterations up to π4N/M\frac{\pi}{4}\sqrt{N/M} finds one of MM solutions with probability at least one half

Searching for several solutions succeeds at least half the time.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The Exercise

A search space holds NN items, of which MM are solutions, with 0<M≤N/20 < M \le N/2. Let |α⟩|\alpha\rangle be the normalized sum of the basis states of the N−MN - M items that are not solutions, and |β⟩|\beta\rangle the normalized sum of those of the MM solutions. The search starts in the uniform superposition of all NN items, which in these two vectors is |ψ⟩=cos⁡θ2|α⟩+sin⁡θ2|β⟩,|\psi\rangle = \cos\frac{\theta}{2}\,|\alpha\rangle + \sin\frac{\theta}{2}\,|\beta\rangle,(1)✦ with sin⁡(θ/2)=M/N\sin(\theta/2) = \sqrt{M/N}.

Each Grover iteration GG rotates this state in the plane of |α⟩|\alpha\rangle and |β⟩|\beta\rangle through the angle θ\theta. After RR iterations the state makes the angle (2R+1)θ/2(2R+1)\theta/2 with |α⟩|\alpha\rangle, and measuring it finds a solution with probability sin⁡2((2R+1)θ/2)\sin^2\bigl((2R+1)\theta/2\bigr). The exercise is to show that some number of iterations no larger than π4N/M\frac{\pi}{4}\sqrt{N/M} brings this probability to one half or more.

A Qubit for the Plane

The library takes that plane for a qubit. A quantum system SS is a physical system whose state space is a finite dimensional complex Hilbert space, and the qubit is the two level system whose state space is ℂ2\mathbb{C}^2 itself. The standard basis vector |i⟩|i\rangle of ℂd\mathbb{C}^d is the vector with entry 11 in place ii and 00 in every other place.✦ On the qubit, |0⟩|0\rangle stands for |α⟩|\alpha\rangle and |1⟩|1\rangle for |β⟩|\beta\rangle.

For a vector |u⟩|u\rangle of ℂn\mathbb{C}^n, the reflection about |u⟩|u\rangle is the n×nn \times n complex matrix 2|u⟩⟨u|−I,2|u\rangle\langle u| - I,(2)✦ which for a unit vector |u⟩|u\rangle reflects every vector about the line through |u⟩|u\rangle. The oracle OO, which flips the sign of every solution, is on the qubit the reflection (2) about |0⟩|0\rangle.✦

For an angle θ\theta, the Grover iteration GG of the qubit is the oracle followed by the reflection about the starting state |ψ⟩|\psi\rangle of (1): G=(2|ψ⟩⟨ψ|−I)O.G = \bigl(2|\psi\rangle\langle\psi| - I\bigr)\,O.(3)✦

A pure state |φ⟩|\varphi\rangle of a system SS is a unit vector in the state space of SS.✦ After RR iterations the qubit is in the pure state |ψR⟩=GR|ψ⟩|\psi_R\rangle = G^R|\psi\rangle, the state that is measured below.

Measuring the Qubit

A state ρ\rho of SS is a positive operator of unit trace on the state space of SS.✦ A pure state |φ⟩|\varphi\rangle of SS gives the state |φ⟩⟨φ||\varphi\rangle\langle\varphi|, the projector onto |φ⟩|\varphi\rangle.✦

A measurement on SS with a finite set of outcomes is a family of measurement operators MiM_i on the state space of SS, one for each outcome ii, that satisfies the completeness relation ∑iMi†Mi=I.\sum_i M_i^\dagger M_i = I.(4)✦ The effect of a measurement {Mi}\{M_i\} for the outcome ii is the operator Ei=Mi†MiE_i = M_i^\dagger M_i, and the family {Ei}\{E_i\} is its positive operator valued measure (POVM).

When a measurement {Mi}\{M_i\} on SS is performed on a state ρ\rho of SS, the probability of the outcome ii is given by the Born rule, p(i)=Tr⁡(Eiρ)=Tr⁡(MiρMi†).p(i) = \operatorname{Tr}(E_i\,\rho) = \operatorname{Tr}(M_i\,\rho\,M_i^\dagger).(5)✦

The projective measurement of SS in an orthonormal basis {|bi⟩}\{|b_i\rangle\} is the measurement whose operator for the outcome ii is the projector |bi⟩⟨bi||b_i\rangle\langle b_i|.✦ The solution measurement is the projective measurement of the qubit in the basis |0⟩,|1⟩|0\rangle, |1\rangle, so that outcome 11 finds a solution and outcome 00 an item that is not one.✦

The Claim

Theorem 1. Let MM and NN be real numbers with 0<M≤N/20 < M \le N/2, and let the angle θ\theta satisfy 0<θ≤π/20 < \theta \le \pi/2 and sin⁡(θ/2)=M/N\sin(\theta/2) = \sqrt{M/N}. Then there is a number RR of Grover iterations such that, with p(1)p(1) the probability of outcome 11 when the solution measurement is performed on |ψR⟩⟨ψR||\psi_R\rangle\langle\psi_R|, p(1)≥12andR≤π4NM.p(1) \ge \frac{1}{2} \qquad\text{and}\qquad R \le \frac{\pi}{4}\sqrt{\frac{N}{M}}.(6)✦

What Is Checked

The claim is stated over the probability (5) of outcome 11 of the solution measurement on the state |ψR⟩⟨ψR||\psi_R\rangle\langle\psi_R|, where |ψR⟩|\psi_R\rangle comes from RR applications of the Grover iteration (3) to the starting state (1) on the qubit.

About these constructions the library proves that GR|ψ⟩G^R|\psi\rangle has unit norm for every angle θ\theta and every RR, which makes |ψR⟩|\psi_R\rangle a pure state, and that the projector onto a unit vector is positive with unit trace, so that |ψR⟩⟨ψR||\psi_R\rangle\langle\psi_R| is a state. It proves the completeness relation (4) for the projectors onto an orthonormal basis, which makes the solution measurement a measurement, and that each effect Mi†MiM_i^\dagger M_i is positive.