Lean, informalized

Nielsen & Chuang · Chapter 5, The quantum Fourier transform and its applications · p. 225

Exercise 5.9 - A controlled gate between two Hadamard gates sorts a state into the eigenspaces of a Hermitian unitary

Measuring a Hermitian unitary with a controlled gate.

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 unitary UU on a quantum system SS that is also Hermitian, U†=UU^\dagger = U, is at once a gate and an observable, and each of its eigenvalues is +1+1 or −1-1. The exercise measures this observable with the help of one qubit. The qubit starts in |0⟩|0\rangle beside a vector |x⟩|x\rangle of SS; a Hadamard gate acts on the qubit, then the controlled gate C(U)C(U) with the qubit as control and SS as target, then a second Hadamard gate on the qubit. Afterwards the qubit holds the outcome: beside its |0⟩|0\rangle stands the part of |x⟩|x\rangle in the +1+1 eigenspace of UU, beside its |1⟩|1\rangle the part in the −1-1 eigenspace.

The library states the exercise in two theorems. One is about the measurement of any observable whose square is the identity and the states its outcomes leave; the other runs the circuit for a Hermitian unitary UU on the input |0⟩⊗|x⟩|0\rangle \otimes |x\rangle.

A Quantum System

A quantum system SS is given by its state space, a finite dimensional complex Hilbert space. The qubit QQ is the two level system whose state space is ℂ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 the state spaces of SS and TT; the circuit acts on Q⊗SQ \otimes S, a control qubit beside the target SS.✦

A pure state ψ\psi of SS is a unit vector |ψ⟩|\psi\rangle in the state space of SS.✦ The basis states |0⟩|0\rangle and |1⟩|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.✦ For a nonzero vector |v⟩|v\rangle in the state space of SS, the normalized pure state of |v⟩|v\rangle is the pure state of SS whose vector is |v⟩|v\rangle divided by its norm.✦ A state ρ\rho of SS is a positive operator of unit trace on the state space of SS, and a pure state ψ\psi gives the state |ψ⟩⟨ψ||\psi\rangle\langle\psi|, the projector onto its vector.

Gates and the Circuit

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, and the identity evolution of SS is the unitary 11. For two unitaries UU and VV of SS, the composite UVUV is the unitary of SS that applies first VV, then UU.✦ Unitaries UU of SS and VV of TT form the product unitary U⊗VU \otimes V of S⊗TS \otimes T, whose operator is the tensor product of the two operators; a gate UU on the first factor of S⊗TS \otimes T is the product U⊗1U \otimes 1 with the identity evolution of TT.

The Hadamard gate HH is the unitary of the qubit whose matrix in the basis |0⟩|0\rangle, |1⟩|1\rangle is H=12(111−1).H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.(1)✦ For a unitary UU of SS, the controlled gate C(U)C(U) is the unitary of Q⊗SQ \otimes S with operator C(U)=|0⟩⟨0|⊗1+|1⟩⟨1|⊗U,C(U) = |0\rangle\langle 0| \otimes 1 + |1\rangle\langle 1| \otimes U,(2) The measuring circuit of UU is the unitary of Q⊗SQ \otimes S (H⊗1)C(U)(H⊗1).(H \otimes 1)\, C(U)\, (H \otimes 1).(3)

Observables and Their Measurement

An observable AA on SS is a Hermitian operator on the state space of SS, A†=AA^\dagger = A.✦ A pure state ψ\psi of SS is an eigenstate of AA with eigenvalue μ\mu, a real number, when A|ψ⟩=μ|ψ⟩A|\psi\rangle = \mu|\psi\rangle.✦ A Hermitian unitary UU of SS, regarded as an observable, is the observable of SS whose operator is UU itself.✦

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, with ∑iMi†Mi=1.\sum_i M_i^\dagger M_i = 1.(4)✦ The positive operator valued measure (POVM) of the measurement is the family of positive effects Ei=Mi†MiE_i = M_i^\dagger M_i. Performed on a state ρ\rho of SS, the measurement gives the outcome ii with probability p(i)=Tr⁡(Eiρ)=Tr⁡(MiρMi†),p(i) = \operatorname{Tr}(E_i \rho) = \operatorname{Tr}(M_i \rho M_i^\dagger),(5) and when p(i)≠0p(i) \neq 0 the state ρi\rho_i after the outcome ii is the state of SS ρi=MiρMi†p(i).\rho_i = \frac{M_i \rho M_i^\dagger}{p(i)}.(6)

The projectors P+P_+ and P−P_- of an observable AA of SS are the operators P+=12(1+A),P−=12(1−A),P_+ = \tfrac{1}{2}(1 + A), \qquad P_- = \tfrac{1}{2}(1 - A),(7) which project onto the +1+1 and −1-1 eigenspaces of AA when A2=1A^2 = 1. For such an observable, the sign measurement of AA is the measurement on SS with two outcomes, 00 and 11, and operators M0=P+M_0 = P_+ and M1=P−M_1 = P_-: the projective measurement of AA, the outcome 00 standing for the eigenvalue +1+1 and the outcome 11 for −1-1.✦

For a pure state ψ\psi of SS with P+|ψ⟩≠0P_+|\psi\rangle \neq 0, the state ψ+\psi_+ after the outcome +1+1 in the measurement of AA is the normalized pure state of P+|ψ⟩P_+|\psi\rangle.✦ For an observable AA of SS with A2=1A^2 = 1 and a pure state ψ\psi of SS with P−|ψ⟩≠0P_-|\psi\rangle \neq 0, the state ψ−\psi_- of ψ\psi after the outcome −1-1 in the sign measurement of AA is the pure state of SS with vector |ψ−⟩=P−|ψ⟩‖P−|ψ⟩‖.|\psi_-\rangle = \frac{P_-|\psi\rangle}{\lVert P_-|\psi\rangle \rVert}.(8)✦

The Claim

Theorem 1. Let AA be an observable of a system SS with A2=1A^2 = 1, and let ψ\psi be a pure state of SS. If P+|ψ⟩≠0P_+|\psi\rangle \neq 0, the state ψ+\psi_+ is an eigenstate of AA with eigenvalue +1+1: A|ψ+⟩=|ψ+⟩.A|\psi_+\rangle = |\psi_+\rangle.(9)✦ If P−|ψ⟩≠0P_-|\psi\rangle \neq 0, the state ψ−\psi_- is an eigenstate of AA with eigenvalue −1-1: A|ψ−⟩=−|ψ−⟩.A|\psi_-\rangle = -|\psi_-\rangle.(10)✦ If P−|ψ⟩≠0P_-|\psi\rangle \neq 0 and the outcome 11 of the sign measurement of AA on ρ=|ψ⟩⟨ψ|\rho = |\psi\rangle\langle\psi| has probability p(1)≠0p(1) \neq 0, the state after that outcome is the state of ψ−\psi_-: ρ1=P−ρP−†p(1)=|ψ−⟩⟨ψ−|.\rho_1 = \frac{P_- \rho P_-^\dagger}{p(1)} = |\psi_-\rangle\langle\psi_-|.(11)✦

A Hermitian unitary UU, regarded as an observable, squares to the identity, U2=1U^2 = 1, so it has a sign measurement, with operators M0=12(1+U)M_0 = \tfrac{1}{2}(1 + U) and M1=12(1−U)M_1 = \tfrac{1}{2}(1 - U).

Theorem 2. Let UU be a Hermitian unitary of a system SS, and let M0M_0 and M1M_1 be the operators of the sign measurement of UU, regarded as an observable. For every vector |x⟩|x\rangle in the state space of SS, the measuring circuit of UU acts on |0⟩⊗|x⟩|0\rangle \otimes |x\rangle as (H⊗1)C(U)(H⊗1)(|0⟩⊗|x⟩)=|0⟩⊗M0|x⟩+|1⟩⊗M1|x⟩.(H \otimes 1)\, C(U)\, (H \otimes 1)\,\bigl(|0\rangle \otimes |x\rangle\bigr) = |0\rangle \otimes M_0|x\rangle + |1\rangle \otimes M_1|x\rangle.(12)✦

What Is Checked

The first theorem is stated over the sign measurement of an observable with A2=1A^2 = 1, its projectors (7), the states (8) its outcomes leave, and the general rule (6) for the state after an outcome, taken on |ψ⟩⟨ψ||\psi\rangle\langle\psi|. The second is stated over the measuring circuit (3), with the Hadamard gate (1) and the controlled gate (2).

About these constructions the library proves that the Hadamard matrix and the controlled gate are unitary, and that composites and tensor products of unitaries are again unitary, so the circuit is a unitary of Q⊗SQ \otimes S. It proves as well that the projector onto a unit vector, and the state after an outcome of nonzero probability, are density operators.