Lean, informalized

Nielsen & Chuang · Chapter 4, Quantum circuits · p. 188

Exercise 4.34 - A controlled UU between two Hadamard gates, read out on the control, measures the observable UU

Measuring a Hermitian unitary with a control qubit.

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

An operator UU on a quantum system that is both unitary and Hermitian is at once a gate and an observable, and as an observable its eigenvalues are ±1\pm 1. The exercise measures the observable with a circuit that uses UU only as a gate. A control qubit is prepared in |0⟩|0\rangle beside the system, which is in a pure state |ψ⟩|\psi\rangle. A Hadamard gate acts on the control, then the controlled gate that applies UU to the system when the control is |1⟩|1\rangle, then a second Hadamard gate on the control; last, the control is measured in the computational basis.

The exercise is to show that this is a measurement of UU on |ψ⟩|\psi\rangle. The outcome 00 comes with the probability of the eigenvalue +1+1 and the outcome 11 with that of −1-1. After the outcome the control is left in |0⟩|0\rangle or |1⟩|1\rangle, and the system in |ψ⟩|\psi\rangle projected onto the matching eigenspace and normalized.

The library states this for a target system SS of any finite dimension, and compares the two measurements outcome by outcome: in the probability of each outcome and in the state it leaves.

Systems and States

A quantum system SS is a physical system whose state space is 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 theirs.✦ The qubit QQ is the two level system with state space ℂ2\mathbb{C}^2; its basis states |0⟩|0\rangle and |1⟩|1\rangle are the standard basis vectors of ℂ2\mathbb{C}^2.

A pure state |ψ⟩|\psi\rangle of SS is a unit vector in the state space of SS.✦ A state ρ\rho of SS is a positive operator of unit trace on the state space of SS, and a pure state |ψ⟩|\psi\rangle gives the state |ψ⟩⟨ψ||\psi\rangle\langle\psi|, the projector onto it. For pure states |ψ⟩|\psi\rangle of SS and |φ⟩|\varphi\rangle of TT, the product |ψ⟩|φ⟩=|ψ⟩⊗|φ⟩|\psi\rangle|\varphi\rangle = |\psi\rangle \otimes |\varphi\rangle is the pure state of S⊗TS \otimes T whose vector is the tensor product of the two.✦

Gates

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 |ψ⟩|\psi\rangle of SS to the pure state U|ψ⟩U|\psi\rangle. Given two unitaries UU and VV of SS, the unitary UU after VV is the product UVUV, first VV and then UU.✦ The identity evolution of SS is the unitary 11.✦ The product unitary U⊗VU \otimes V of a unitary UU of SS and a unitary VV of TT is the unitary of S⊗TS \otimes T whose operator is the tensor product of the two, and a gate UU on the first wires of S⊗TS \otimes T is the unitary U⊗1U \otimes 1, with the identity evolution on TT.

The Hadamard gate HH is the unitary of the qubit whose matrix in the basis |0⟩,|1⟩|0\rangle, |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 C(U)=|0⟩⟨0|⊗1+|1⟩⟨1|⊗U.C(U) = |0\rangle\langle 0| \otimes 1 + |1\rangle\langle 1| \otimes U.(2)✦ The circuit of the exercise is the unitary of Q⊗SQ \otimes S W=(H⊗1)C(U)(H⊗1).W = (H \otimes 1)\, C(U)\, (H \otimes 1).(3)✦

Measurements

A measurement mm on SS with a finite set of outcomes is a family of operators MiM_i on the state space of SS, one for each outcome ii, that satisfies the completeness relation ∑iMi†Mi=1.\sum_i M_i^\dagger M_i = 1.(4)✦ The positive operator valued measure (POVM) of mm has the elements Ei=Mi†MiE_i = M_i^\dagger M_i.✦ Performed on a state ρ\rho of SS, the measurement gives the outcome ii with the probability pm(i∣ρ)=Tr⁡(Eiρ),p_m(i \mid \rho) = \operatorname{Tr}(E_i \rho),(5) and when pm(i∣ρ)≠0p_m(i \mid \rho) \neq 0 the state after the outcome is ρm,i=MiρMi†pm(i∣ρ).\rho_{m,i} = \frac{M_i \rho M_i^\dagger}{p_m(i \mid \rho)}.(6)

The measurement of SS in an orthonormal basis {|bi⟩}\{|b_i\rangle\} is the measurement with the operators Mi=|bi⟩⟨bi|M_i = |b_i\rangle\langle b_i|.✦ The measurement on the first wires of S⊗TS \otimes T made from a measurement on SS with operators MiM_i is the measurement with the same outcomes and the operators Mi⊗1M_i \otimes 1.✦ The measurement of the control mcm_{\mathrm{c}} is the measurement of Q⊗SQ \otimes S in the basis |0⟩,|1⟩|0\rangle, |1\rangle of the qubit, made on the first wires, so that its operators are |0⟩⟨0|⊗1|0\rangle\langle 0| \otimes 1 and |1⟩⟨1|⊗1|1\rangle\langle 1| \otimes 1.✦ Write pcp_{\mathrm{c}} for its probabilities and ρc,i\rho_{\mathrm{c},i} for the states after its outcomes.

Observables

An observable AA on SS is a Hermitian operator on the state space of SS, A†=AA^\dagger = A.✦ Its two operators P±=12(1±A)P_\pm = \tfrac{1}{2}(1 \pm A)(7) are, when A2=1A^2 = 1, the projectors onto its eigenspaces for +1+1 and −1-1. For such an AA, the measurement of AA is the measurement on SS with the operators M0=P+M_0 = P_+ and M1=P−M_1 = P_-, the outcome 00 standing for the eigenvalue +1+1 and the outcome 11 for −1-1.✦

The state |ψ+⟩|\psi_+\rangle after the outcome +1+1 of AA, measured on a pure state |ψ⟩|\psi\rangle of SS with P+|ψ⟩≠0P_+|\psi\rangle \neq 0, is the normalized pure state |ψ+⟩=P+|ψ⟩‖P+|ψ⟩‖.|\psi_+\rangle = \frac{P_+|\psi\rangle}{\lVert P_+|\psi\rangle \rVert}.(8)✦ The state |ψ−⟩|\psi_-\rangle after the outcome −1-1 is formed in the same way from P−P_-, when P−|ψ⟩≠0P_-|\psi\rangle \neq 0.✦

A unitary UU of SS that is Hermitian is an observable with the same operator, and since U†=UU^\dagger = U and U†U=1U^\dagger U = 1 it squares to the identity, U2=1.U^2 = 1.(9) Its measurement mUm_U is the measurement of this observable. Write pUp_U for its probabilities, P±P_\pm for the projectors (7) with A=UA = U, and |ψ±⟩|\psi_\pm\rangle for the states it leaves on |ψ⟩|\psi\rangle.

The Claim

Theorem 1. Let UU be a Hermitian unitary of a system SS and |ψ⟩|\psi\rangle a pure state of SS, and let ρ=|Ψ⟩⟨Ψ|\rho = |\Psi\rangle\langle\Psi| be the state of Q⊗SQ \otimes S that the circuit makes from |0⟩|ψ⟩|0\rangle|\psi\rangle, with |Ψ⟩=W|0⟩|ψ⟩|\Psi\rangle = W|0\rangle|\psi\rangle. Measuring the control on ρ\rho gives each outcome i∈{0,1}i \in \{0, 1\} with the probability that the measurement of UU gives it on |ψ⟩|\psi\rangle, pc(i∣ρ)=pU(i∣|ψ⟩⟨ψ|).p_{\mathrm{c}}(i \mid \rho) = p_U\bigl(i \mid |\psi\rangle\langle\psi|\bigr).(10)✦ If P−|ψ⟩≠0P_-|\psi\rangle \neq 0 and the outcome 11 has nonzero probability, the state after it is ρc,1=|1⟩|ψ−⟩⟨1|⟨ψ−|,\rho_{\mathrm{c},1} = |1\rangle|\psi_-\rangle\langle 1|\langle\psi_-|,(11)✦ and if P+|ψ⟩≠0P_+|\psi\rangle \neq 0 and the outcome 00 has nonzero probability, the state after it is ρc,0=|0⟩|ψ+⟩⟨0|⟨ψ+|.\rho_{\mathrm{c},0} = |0\rangle|\psi_+\rangle\langle 0|\langle\psi_+|.(12)✦

What Is Checked

The claim is stated over the circuit WW of (3), made of the Hadamard gate (1) and the controlled gate (2), and over two measurements: that of the control, and that of UU with its states |ψ±⟩|\psi_\pm\rangle of (8), both with the probabilities (5) and the states after an outcome (6).

About these constructions the library proves that C(U)C(U) is unitary, C(U)†C(U)=C(U)C(U)†=1C(U)^\dagger C(U) = C(U) C(U)^\dagger = 1, and that a Hermitian unitary squares to the identity, (9).