Lean, informalized

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

Exercise 6.7 - The circuits of Figures 6.4 and 6.5 apply the evolution under a projector to the system and give the ancilla qubit back unchanged

Two oracle circuits that evolve a state under a projector.

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 quantum system SS carries a marked pure state |x⟩|x\rangle, and an oracle recognises it by flipping an extra qubit when the system is in |x⟩|x\rangle. The circuit of Figure 6.4 runs the system together with that qubit, prepared in |0⟩|0\rangle, through the oracle, a phase shift by −Δt-\Delta t on the qubit, and the oracle once more. The exercise is to verify that this circuit evolves the system for a time Δt\Delta t under the Hamiltonian |x⟩⟨x||x\rangle\langle x|, taking |φ⟩|\varphi\rangle to e−i|x⟩⟨x|Δt|φ⟩e^{-i|x\rangle\langle x|\Delta t}|\varphi\rangle, and hands the qubit back in |0⟩|0\rangle.✦ The circuit of Figure 6.5 places the first one between W†W^\dagger and WW on the system, for a unitary WW, and is to give the evolution e−i|ψ⟩⟨ψ|Δte^{-i|\psi\rangle\langle\psi|\Delta t} under the projector onto |ψ⟩=W|x⟩|\psi\rangle = W|x\rangle.

The System and the Qubit

A quantum system SS is a physical object whose state space is a finite dimensional complex Hilbert space.✦ A pure state |φ⟩|\varphi\rangle of SS is a unit vector in the state space of SS.✦ The qubit QQ is the two level system whose state space is ℂ2\mathbb{C}^2, and its basis states |0⟩|0\rangle and |1⟩|1\rangle are the standard basis vectors of ℂ2\mathbb{C}^2.

The composite system S⊗TS \otimes T of two systems SS and TT is the system whose state space is the tensor product of their state spaces.✦ For pure states |φ⟩|\varphi\rangle of SS and |χ⟩|\chi\rangle of TT, the product |φ⟩⊗|χ⟩|\varphi\rangle \otimes |\chi\rangle is the pure state of S⊗TS \otimes T whose vector is the tensor product of the two vectors.✦

Unitaries and Hamiltonians

A unitary UU of SS is an operator on the state space of SS with U†U=UU†=1U^\dagger U = U U^\dagger = 1; it carries a pure state |φ⟩|\varphi\rangle of SS to the pure state U|φ⟩U|\varphi\rangle. The adjoint U†U^\dagger of a unitary UU of SS is the unitary of SS whose operator is the Hilbert space adjoint of that of UU.✦ For two unitaries UU and VV of SS, the unitary UVUV, UU after VV, applies first VV and then UU.✦

For a unitary UU of SS and a unitary VV of TT, the product unitary U⊗VU \otimes V is the unitary of S⊗TS \otimes T whose operator is the tensor product of the two operators.✦ The identity evolution 11 of a system is the unitary whose operator is the identity.✦ A gate is a unitary of a system. On S⊗QS \otimes Q, a gate on the system alone is U⊗1U \otimes 1, and a gate on the qubit alone is 1⊗V1 \otimes V, with the identity evolution on the other factor.

An observable AA of SS is a self adjoint operator on the state space of SS, A†=AA^\dagger = A.✦ For a pure state |x⟩|x\rangle of SS, the projector |x⟩⟨x||x\rangle\langle x|, which sends |φ⟩|\varphi\rangle to ⟨x|φ⟩|x⟩\langle x|\varphi\rangle\,|x\rangle, is self adjoint and so an observable of SS; it is the Hamiltonian of the exercise.✦

The propagator U(t1,t2)U(t_1, t_2) of an observable HH of SS, with Planck’s constant ℏ\hbar, from time t1t_1 to time t2t_2 is the unitary of SS U(t1,t2)=exp⁡[−iH(t2−t1)/ℏ],U(t_1, t_2) = \exp\bigl[-iH(t_2 - t_1)/\hbar\bigr],(1) which carries the state at t1t_1 to the state at t2t_2 under the Schrödinger equation. With ℏ=1\hbar = 1, t1=0t_1 = 0, t2=Δtt_2 = \Delta t and H=|x⟩⟨x|H = |x\rangle\langle x|, the propagator (1) is the operation e−i|x⟩⟨x|Δte^{-i|x\rangle\langle x|\Delta t} of the exercise.

The Gates and the Circuits

The Pauli XX, the quantum NOT gate, is the unitary of the qubit with matrix X=(0110)X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}(2)✦ in the basis |0⟩,|1⟩|0\rangle, |1\rangle. The phase gate P(α)P(\alpha) with angle α\alpha is the unitary of the qubit that is diagonal in the basis |0⟩,|1⟩|0\rangle, |1\rangle, with the matrix P(α)=diag(1,eiα),P(\alpha) = \mathrm{diag}\bigl(1, e^{i\alpha}\bigr),(3)✦

The marking oracle OO for a pure state |x⟩|x\rangle of SS is the unitary of S⊗QS \otimes Q with operator O=|x⟩⟨x|⊗X+(1−|x⟩⟨x|)⊗1.O = |x\rangle\langle x| \otimes X + \bigl(1 - |x\rangle\langle x|\bigr) \otimes 1 .(4)✦

For a real time step Δt\Delta t, the circuit of Figure 6.4 is the unitary of S⊗QS \otimes Q Cx(Δt)=O(1⊗P(−Δt))O.C_x(\Delta t) = O\,\bigl(1 \otimes P(-\Delta t)\bigr)\,O .(5)✦ The circuit of Figure 6.5 takes in addition a unitary WW of SS and conjugates the first circuit by WW on the system: CW,x(Δt)=(W⊗1)Cx(Δt)(W†⊗1).C_{W,x}(\Delta t) = (W \otimes 1)\, C_x(\Delta t)\, (W^\dagger \otimes 1) .(6)✦

The Claim

Theorem 1. Let SS be a quantum system, let |x⟩|x\rangle and |φ⟩|\varphi\rangle be pure states of SS, and let Δt\Delta t be a real number. Then the circuit of Figure 6.4, run on |φ⟩|\varphi\rangle with the qubit in |0⟩|0\rangle, gives Cx(Δt)(|φ⟩⊗|0⟩)=(e−i|x⟩⟨x|Δt|φ⟩)⊗|0⟩.C_x(\Delta t)\,\bigl(|\varphi\rangle \otimes |0\rangle\bigr) = \bigl(e^{-i|x\rangle\langle x|\Delta t}|\varphi\rangle\bigr) \otimes |0\rangle .(7)✦ If moreover WW is a unitary of SS and |ψ⟩=W|x⟩|\psi\rangle = W|x\rangle, the circuit of Figure 6.5 gives CW,x(Δt)(|φ⟩⊗|0⟩)=(e−i|ψ⟩⟨ψ|Δt|φ⟩)⊗|0⟩.C_{W,x}(\Delta t)\,\bigl(|\varphi\rangle \otimes |0\rangle\bigr) = \bigl(e^{-i|\psi\rangle\langle\psi|\Delta t}|\varphi\rangle\bigr) \otimes |0\rangle .(8)✦

What Is Checked

The claim is stated over the circuits (5) and (6) acting on the product state |φ⟩⊗|0⟩|\varphi\rangle \otimes |0\rangle, and over the propagator (1), with ℏ=1\hbar = 1, of the projector onto |x⟩|x\rangle or onto W|x⟩W|x\rangle.

About these constructions the library proves that the oracle (4) is unitary, and that the phase gate is unitary because its diagonal entries have unit modulus. Tensor products and composites of unitaries are unitary, so each circuit is a unitary of S⊗QS \otimes Q, and |φ⟩⊗|0⟩|\varphi\rangle \otimes |0\rangle is a pure state because the norm of a product vector is the product of the norms.