Lean, informalized

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

Exercise 4.22 - Every doubly controlled qubit unitary as a three qubit circuit of at most eight one qubit gates and six controlled NOTs

A doubly controlled gate from six controlled NOTs.

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

Let UU be any unitary acting on one qubit. The gate C2(U)C^2(U) acts on three qubits and applies UU to the third exactly when the first two are both in the state |1⟩\lvert 1 \rangle.✦ The exercise asks for a circuit that builds C2(U)C^2(U), for every UU, from at most eight one qubit gates and at most six controlled NOT (CNOT) gates.

Qubits and Unitaries

A quantum system SS is described 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 quantum system whose state space is the tensor product of their state spaces.✦ A pure state ψ\psi of SS is a unit vector ψ\psi in the state space of SS, ‖ψ‖=1\lVert \psi \rVert = 1.✦

The qubit QQ is the two level system whose state space is ℂ2\mathbb{C}^2 itself, the standard two dimensional complex Euclidean space.✦ Its computational basis states |0⟩\lvert 0 \rangle and |1⟩\lvert 1 \rangle are the pure states given by the standard basis vectors e0e_0 and e1e_1 of ℂ2\mathbb{C}^2.✦ Three qubits form the composite system Q⊗(Q⊗Q)Q \otimes (Q \otimes Q).

A unitary UU of a system SS is a closed system evolution of SS: an operator on the state space of SS with U†U=UU†=1.U^\dagger U = U U^\dagger = 1.(1)✦ The identity evolution of SS is the unitary whose operator is 11.✦ 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.✦ Acting on the first factor of S⊗TS \otimes T, a unitary UU of SS becomes U⊗1U \otimes 1, with the identity evolution on TT; acting on the last factor, a unitary VV of TT becomes 1⊗V1 \otimes V.

Controlled Gates

For a unitary UU of a system SS, the controlled gate C(U)C(U) is the unitary of Q⊗SQ \otimes S, a control qubit followed by the target SS, with operator C(U)=|0⟩⟨0|⊗1+|1⟩⟨1|⊗U.C(U) = \lvert 0 \rangle\langle 0 \rvert \otimes 1 + \lvert 1 \rangle\langle 1 \rvert \otimes U.(2)✦

The Pauli XX gate, the quantum NOT, is the unitary of QQ whose operator is the matrix X=(0110),X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix},(3) and the CNOT gate is the controlled gate C(X)C(X) of Q⊗QQ \otimes Q, with the first qubit as control.

For a unitary UU of the qubit QQ, the doubly controlled gate C2(U)C^2(U) is the unitary of Q⊗(Q⊗Q)Q \otimes (Q \otimes Q) obtained by controlling the controlled gate C(U)C(U) once more, C2(U)=C(C(U)).C^2(U) = C\bigl(C(U)\bigr).(4)

Three Qubit Circuits

A three qubit circuit is a finite sequence of gates on Q⊗(Q⊗Q)Q \otimes (Q \otimes Q), whose factors are its wires 00, 11 and 22. Each of its gates is either a one qubit gate, a unitary gg of QQ on one of the wires, or a CNOT from a control wire cc to a target wire tt.✦ On the three qubits, a one qubit gate gg on wire 00, 11 or 22 is the unitary g⊗1,1⊗(g⊗1),1⊗(1⊗g)g \otimes 1, \qquad 1 \otimes (g \otimes 1), \qquad 1 \otimes (1 \otimes g)(5)✦ respectively. The CNOTs from wire 00 to wire 11, from 00 to 22 and from 11 to 22 are C(X⊗1),C(1⊗X),1⊗CNOT,C(X \otimes 1), \qquad C(1 \otimes X), \qquad 1 \otimes \mathrm{CNOT},(6)✦ and a CNOT on any other pair of wires is the identity.

If G1,…,GnG_1, \dots, G_n are the unitaries of the gates of a circuit in order, the evolution of the circuit is the product G=G1G2⋯Gn,G = G_1 G_2 \cdots G_n,(7) and its gate counts are N1N_1, the number of its one qubit gates, and NCNOTN_{\mathrm{CNOT}}, the number of its CNOTs.

The Claim

Theorem 1. Let UU be a unitary of the qubit QQ. Then there is a three qubit circuit with evolution GG and gate counts N1N_1 and NCNOTN_{\mathrm{CNOT}} such that G=C2(U),N1≤8,NCNOT≤6.G = C^2(U), \qquad N_1 \le 8, \qquad N_{\mathrm{CNOT}} \le 6.(8)✦

What Is Checked

The claim is stated over the doubly controlled gate (4), built from the controlled gate (2), and over the evolution (7) of a circuit whose gates are the one qubit gates (5) and the CNOTs (6), together with the two counts of its gates.

The library proves that these constructions are unitaries.