Lean, informalized

Nielsen & Chuang · Chapter 7, Quantum computers: physical realization · p. 339

Exercise 7.51 - The Grover iteration on two spins, written in pulses, equals a shorter sequence up to sign for each marked state

Shortening the Grover iteration on two nuclear spins.

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

Grover’s algorithm on two qubits searches the four basis states |00⟩|00\rangle, |01⟩|01\rangle, |10⟩|10\rangle and |11⟩|11\rangle for the one that an oracle marks, and a single iteration finds it. The iteration applies the oracle OO, which changes the sign of the marked state, then Hadamard gates on both qubits, then the conditional phase shift PP, which changes the sign of every basis state except |00⟩|00\rangle, and Hadamard gates on both qubits once more.✦

In a nuclear magnetic resonance experiment the qubits are two coupled nuclear spins. Every gate becomes a sequence of radio frequency pulses, each a rotation of one spin about the xx axis or the yy axis, and of periods in which the spins evolve freely under their coupling. The exercise is to show that, for each of the four marked states, the iteration shortens to two periods of free evolution, each followed on every spin by a pulse about the yy axis and then a pulse about the xx axis.

Pulses on Two Spins

The library defines each gate of the iteration as a pulse sequence and states the shortening as four identities between operators on the two spins, one for each marked state.

For a real vector n→=(nx,ny,nz)\vec n = (n_x, n_y, n_z) in three dimensions and a real angle θ\theta, the rotation Rn→(θ)R_{\vec n}(\theta) about n→\vec n is the operator on one qubit Rn→(θ)=exp⁡(−iθ2n→⋅σ→),n→⋅σ→=nxX+nyY+nzZ,R_{\vec n}(\theta) = \exp\Bigl(-\frac{i\theta}{2}\, \vec n \cdot \vec\sigma\Bigr), \qquad \vec n \cdot \vec\sigma = n_x X + n_y Y + n_z Z,(1) where XX, YY and ZZ are the Pauli matrices. The pulses are the rotations about xˆ=(1,0,0)\hat x = (1, 0, 0) and yˆ=(0,1,0)\hat y = (0, 1, 0), written Rx(θ)=e−iθX/2R_x(\theta) = e^{-i\theta X/2} and Ry(θ)=e−iθY/2R_y(\theta) = e^{-i\theta Y/2}.

In a product of operators the rightmost factor acts first. For a real angle ss, the sandwich V(s)V(s) is the operator on one spin that places a rotation by ss about xˆ\hat x between two rotations about yˆ\hat y, V(s)=Ry(π/2)Rx(s)Ry(−π/2).V(s) = R_y(\pi/2)\, R_x(s)\, R_y(-\pi/2).(2)✦ On one spin the Hadamard pulse is the operator H=Rx(π)Ry(−π/2),H = R_x(\pi)\, R_y(-\pi/2),(3) and on the two spins the Hadamard pair is H⊗2=H⊗H,H^{\otimes 2} = H \otimes H,(4) the first factor of a tensor product acting on spin 1 and the second on spin 2.

Fix an operator τ\tau on the two spins, in the experiment the free evolution over one period. For real angles s1s_1 and s2s_2 the oracle pulse O(s1,s2)O(s_1, s_2) and the conditional phase shift PP are the operators on the two spins O(s1,s2)=(V(s1)⊗V(s2))τ,O(s_1, s_2) = \bigl(V(s_1) \otimes V(s_2)\bigr)\, \tau,(5) P=(V(π/2)⊗V(π/2))τ.P = \bigl(V(\pi/2) \otimes V(\pi/2)\bigr)\, \tau.(6) With the oracle pulse O(s1,s2)O(s_1, s_2), the Grover iteration in pulse form G(s1,s2)G(s_1, s_2) is the operator on the two spins G(s1,s2)=H⊗2PH⊗2O(s1,s2),G(s_1, s_2) = H^{\otimes 2}\, P\, H^{\otimes 2}\, O(s_1, s_2),(7)

For real angles a1a_1 and a2a_2 the shortened sequence G̃(a1,a2)\tilde G(a_1, a_2) is the operator on the two spins G̃(a1,a2)=[(Rx(−π/2)Ry(−π/2))⊗(Rx(−π/2)Ry(−π/2))]τ[(Rx(a1)Ry(−π/2))⊗(Rx(a2)Ry(−π/2))]τ.\begin{aligned} \tilde G(a_1, a_2) &= \Bigl[\bigl(R_x(-\pi/2)\, R_y(-\pi/2)\bigr) \otimes \bigl(R_x(-\pi/2)\, R_y(-\pi/2)\bigr)\Bigr]\, \tau \\ &\quad \Bigl[\bigl(R_x(a_1)\, R_y(-\pi/2)\bigr) \otimes \bigl(R_x(a_2)\, R_y(-\pi/2)\bigr)\Bigr]\, \tau. \end{aligned}(8)✦

The Claim

The oracle that marks |x1x2⟩|x_1 x_2\rangle takes si=π/2s_i = \pi/2 where xi=0x_i = 0 and si=−π/2s_i = -\pi/2 where xi=1x_i = 1.

Theorem 1. Let τ\tau be any operator on the two spins. For the marked states |00⟩|00\rangle, |01⟩|01\rangle, |10⟩|10\rangle and |11⟩|11\rangle in turn, the Grover iteration in pulse form and the shortened sequence satisfy G(π/2,π/2)=G̃(−π/2,−π/2),G(\pi/2, \pi/2) = \tilde G(-\pi/2, -\pi/2),(9)✦ G(π/2,−π/2)=−G̃(−π/2,π/2),G(\pi/2, -\pi/2) = -\tilde G(-\pi/2, \pi/2),(10)✦ G(−π/2,π/2)=−G̃(π/2,−π/2),G(-\pi/2, \pi/2) = -\tilde G(\pi/2, -\pi/2),(11)✦ G(−π/2,−π/2)=G̃(π/2,π/2).G(-\pi/2, -\pi/2) = \tilde G(\pi/2, \pi/2).(12)✦

What Is Checked

The claim is stated over the Grover iteration in pulse form (7), assembled from the pulses (2) to (6), and over the shortened sequence (8).