Lean, informalized

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

Exercise 6.6 - The circuit of Box 6.1 evolves every two qubit state as the conditional phase shift does

The dotted box circuit is a conditional phase shift.

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

Box 6.1 of the book draws a circuit on two qubits inside a dotted box, built from Pauli XX and Hadamard gates around a controlled NOT (CNOT). The exercise is to show that, up to a global phase, the circuit performs the conditional phase shift 2|00⟩⟨00|−I,2\lvert 00 \rangle\langle 00 \rvert - I ,(1) which leaves |00⟩\lvert 00 \rangle alone and changes the sign of every vector orthogonal to it.

Two Qubits

A quantum system SS is a physical system given by its state space, a finite dimensional complex Hilbert space.✦ 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.✦ The qubit is the quantum system whose state space is ℂ2\mathbb{C}^2, and two qubits form the composite qubit⊗qubit\mathrm{qubit} \otimes \mathrm{qubit}.

A state ρ\rho of SS is a positive operator of unit trace on the state space of SS; pure and mixed states alike are states in this sense.✦ A pure state ψ\psi of SS is a unit vector in the state space of SS.✦ The basis states |0⟩\lvert 0 \rangle and |1⟩\lvert 1 \rangle of the qubit are the pure states whose vectors are the standard basis vectors e0e_0 and e1e_1 of ℂ2\mathbb{C}^2.✦ Given pure states ψ\psi of SS and φ\varphi of TT, their product ψ⊗φ\psi \otimes \varphi is the pure state of S⊗TS \otimes T whose vector is the tensor product of the two vectors.✦ The basis state |00⟩\lvert 00 \rangle of two qubits is the product |0⟩⊗|0⟩\lvert 0 \rangle \otimes \lvert 0 \rangle.✦

Gates

A unitary UU of a system SS is an operator on the state space of SS with U†U=UU†=IU^\dagger U = U U^\dagger = I.✦ A unitary UU of SS evolves a state ρ\rho of SS into the state ρ↦UρU†.\rho \;\longmapsto\; U \rho U^\dagger .(2)✦

Unitaries combine in two ways. For unitaries UU and VV of the same system, UU after VV is the unitary UVUV whose operator is the composite of the two, first VV and then UU.✦ For unitaries UU of SS and 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 of SS is the unitary II of SS.✦ Given a unitary VV of TT and a further system SS, the gate VV on the last wires is the product unitary I⊗VI \otimes V of S⊗TS \otimes T.✦

The Hadamard gate HH and the Pauli XX are the unitaries of the qubit whose operators act on ℂ2\mathbb{C}^2 by the matrices H=12(111−1),X=(0110).H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \qquad X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.(3) For a unitary UU of a system SS, the controlled gate C(U)C(U) is the unitary of qubit⊗S\mathrm{qubit} \otimes S, a control qubit and the target SS, whose operator is C(U)=|0⟩⟨0|⊗I+|1⟩⟨1|⊗U.C(U) = \lvert 0 \rangle\langle 0 \rvert \otimes I + \lvert 1 \rangle\langle 1 \rvert \otimes U .(4)✦ The CNOT gate is the controlled gate C(X)C(X) of two qubits, which flips the second qubit when the first is |1⟩\lvert 1 \rangle.✦ The conditional phase shift is the unitary U00U_{00} of two qubits whose operator is (1).✦

The Circuit

The dotted box circuit of Box 6.1 is the unitary of two qubits Ubox=(X⊗X)(I⊗H)CNOT(I⊗H)(X⊗X),U_{\mathrm{box}} = (X \otimes X)\,(I \otimes H)\,\mathrm{CNOT}\,(I \otimes H)\,(X \otimes X),(5)✦ in which the rightmost factor acts first.

The Claim

A global phase eiθe^{i\theta} on a unitary UU meets e−iθe^{-i\theta} on U†U^\dagger in (2) and cancels, so two unitaries compared by the states they produce are compared up to a global phase, as the exercise asks.

Theorem 1. Let ρ\rho be a state of two qubits. Then the dotted box circuit (5) and the conditional phase shift U00U_{00} evolve ρ\rho into the same state: UboxρUbox†=U00ρU00†.U_{\mathrm{box}}\, \rho\, U_{\mathrm{box}}^\dagger = U_{00}\, \rho\, U_{00}^\dagger .(6)✦

What Is Checked

The claim is stated over the states of two qubits and two unitaries of that system, the circuit (5) and the conditional phase shift (1), each acting on states by (2).

The library proves that the matrices (3) are unitary, so that HH and XX are unitaries of the qubit, and that C(U)C(U) in (4) is unitary for every unitary UU of any system, which makes the CNOT a unitary. Composites UVUV and tensor products U⊗VU \otimes V of unitaries are again unitaries, so UboxU_{\mathrm{box}} is one. The operator 2|00⟩⟨00|−I2\lvert 00 \rangle\langle 00 \rvert - I is self adjoint and squares to II, hence is unitary. A product of pure states is a unit vector, since the norm of a product vector is the product of the norms, and conjugating a density operator by a unitary gives a density operator, so (2) is again a state.