Lean, informalized

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

Exercise 7.42 - A diagonal two qubit matrix conjugated by a circuit of two CNOT gates and by its adjoint

Two CNOT gates permute three populations cyclically.

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

Two qubits are in a state ρ1\rho_1 that is diagonal in the computational basis |00⟩|00\rangle, |01⟩|01\rangle, |10⟩|10\rangle, |11⟩|11\rangle, with populations aa, bb, cc, dd.✦ A circuit PP of two controlled NOT (CNOT) gates acts on them: first a CNOT with the first qubit as control, then a CNOT with the second qubit as control.✦ The exercise is to show that the state Pρ1P†P\rho_1P^\dagger after the circuit, and the state P†ρ1PP^\dagger\rho_1P after its adjoint P†P^\dagger, are again diagonal: the population of |00⟩|00\rangle stays in place, and those of the other three basis states are permuted cyclically, in one sense under PP and in the other under P†P^\dagger.

Two Qubits and Two Gates

All matrices below are written in the computational basis, in the order above. The CNOT gate C12C_{12}, with control on the first qubit and target on the second, is the 4×44\times4 matrix that exchanges |10⟩|10\rangle and |11⟩|11\rangle and leaves |00⟩|00\rangle and |01⟩|01\rangle in place: C12=(1000010000010010).C_{12} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}.(1)✦ The CNOT gate C21C_{21}, with control on the second qubit and target on the first, is the 4×44\times4 matrix that exchanges |01⟩|01\rangle and |11⟩|11\rangle and leaves |00⟩|00\rangle and |10⟩|10\rangle in place: C21=(1000000100100100).C_{21} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \end{pmatrix}.(2)✦

The circuit PP on the two qubits is the product of the two gates: P=C21C12.P = C_{21}\, C_{12}.(3)✦

For any four complex numbers aa, bb, cc, dd, not only the populations of a state, the diagonal matrix ρ1\rho_1 is the 4×44\times4 matrix with aa, bb, cc, dd on its diagonal, in the order of the basis, and zeros elsewhere: ρ1=diag⁡(a,b,c,d).\rho_1 = \operatorname{diag}(a, b, c, d).(4)✦ The permuted matrices ρ2\rho_2 and ρ3\rho_3 are the diagonal matrices with the same four numbers in two other orders: ρ2=diag⁡(a,c,d,b),\rho_2 = \operatorname{diag}(a, c, d, b),(5) ρ3=diag⁡(a,d,b,c).\rho_3 = \operatorname{diag}(a, d, b, c).(6)

The Claim

Theorem 1. Let aa, bb, cc, dd be complex numbers, and let ρ1\rho_1, ρ2\rho_2, ρ3\rho_3 be the diagonal matrices (4), (5) and (6) built from them. Then Pρ1P†=ρ2P\rho_1P^\dagger = \rho_2(7)✦ and P†ρ1P=ρ3.P^\dagger\rho_1P = \rho_3.(8)✦

What Is Checked

The claim is stated over the circuit PP of (3), built from the two CNOT matrices (1) and (2), and over the diagonal matrices ρ1\rho_1, ρ2\rho_2, ρ3\rho_3. What the library proves about these constructions is the pair of identities (7) and (8), as equalities of 4×44\times4 complex matrices.