Lean, informalized

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

Exercise 4.28 - The gate C5(V2)C^5(V^2) as a circuit on its own six qubits

Five controls on a squared unitary without work qubits.

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 VV be a unitary of one qubit. The gate C5(V2)C^5(V^2) acts on six qubits, five controls and a target: when all five controls are in |1⟩\lvert 1 \rangle it applies VV twice to the target, and otherwise it acts as the identity. The task is to build this gate on the six qubits alone, with no work qubit, as a circuit of gates with fewer controls. Besides VV and its adjoint, the circuit may apply to the target further unitaries of a qubit chosen for the given VV.

Qubits and Unitaries

A quantum system is a physical system whose state space is a finite dimensional complex Hilbert space.✦ The composite system S⊗TS \otimes T of two quantum systems SS and TT is the quantum system whose state space is the tensor product of the state spaces of SS and TT.✦ The qubit QQ is the quantum system whose state space is ℂ2\mathbb{C}^2.✦ A pure state ψ\psi of a system SS is a unit vector in the state space of SS.✦ The computational basis states |0⟩\lvert 0 \rangle and |1⟩\lvert 1 \rangle of the qubit are the pure states given by the standard basis vectors e0e_0 and e1e_1 of ℂ2\mathbb{C}^2.✦

A unitary UU of a system SS is an operator on the state space of SS with U†U=UU†=1U^\dagger U = U U^\dagger = 1, the evolution of SS as a closed system.✦ The adjoint U†U^\dagger of a unitary UU of SS is the unitary of SS given by the adjoint operator, and the identity 11 of SS is the unitary given by the identity operator. For two unitaries UU and VV of SS, the product UVUV is the unitary of SS given by the composite operator: first VV, then UU.✦

For unitaries UU of SS and WW of TT, the product unitary U⊗WU \otimes W is the unitary of S⊗TS \otimes T whose operator is the tensor product of the operators of UU and WW.✦ The gate U⊗1U \otimes 1 applies UU to SS and the identity to TT; the gate 1⊗W1 \otimes W applies the identity to SS and WW to TT.

The Pauli XX gate, the quantum NOT, is the unitary of the qubit whose matrix in the computational basis is X=(0110).X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.(1)✦

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, given by 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 control register of nn qubits around a system SS is the system Q⊗n⊗SQ^{\otimes n} \otimes S of nn control qubits composed on the left of SS one at a time: Q⊗0⊗S=SQ^{\otimes 0} \otimes S = S and Q⊗(n+1)⊗S=Q⊗(Q⊗n⊗S)Q^{\otimes (n+1)} \otimes S = Q \otimes (Q^{\otimes n} \otimes S).✦ For a unitary EE of SS, the gate Cn(E)C^n(E) with nn controls is the unitary of Q⊗n⊗SQ^{\otimes n} \otimes S that applies EE to SS when all nn control qubits are in |1⟩\lvert 1 \rangle and acts as the identity otherwise.✦ The gate Cn(E)C^n(E) is defined one control at a time by C0(E)=E,Cn+1(E)=C(Cn(E)).C^0(E) = E, \qquad C^{n+1}(E) = C\bigl(C^n(E)\bigr).(3)

For a unitary EE of SS, the idle gate 1⊗n⊗E1^{\otimes n} \otimes E is the unitary of Q⊗n⊗SQ^{\otimes n} \otimes S that applies the identity to each of the nn qubits and EE to SS.✦

The Circuit

The circuit is assembled from layers of one shape, each given by a number kk of controls and a unitary WW. Take a number kk of controls, a system MM with a unitary WW, and the register Q⊗k⊗(Q⊗M)Q^{\otimes k} \otimes (Q \otimes M): kk control qubits, one further qubit cc, and MM. The Barenco reduction circuit Rk(W)R_k(W), which is the layer, and its tail Tk(W)T_k(W) are the unitaries of the register Q⊗k⊗(Q⊗M)Q^{\otimes k} \otimes (Q \otimes M) given by Tk(W)=Ck(X⊗1)(1⊗k⊗C(W†))Ck(X⊗1)(1⊗k⊗C(W)),Rk(W)=Ck(1⊗W)Tk(W),\begin{aligned} T_k(W) &= C^k(X \otimes 1)\,\bigl(1^{\otimes k} \otimes C(W^\dagger)\bigr)\, C^k(X \otimes 1)\,\bigl(1^{\otimes k} \otimes C(W)\bigr), \\ R_k(W) &= C^k(1 \otimes W)\,T_k(W), \end{aligned}(4) where X⊗1X \otimes 1 is the NOT on cc with MM idle and 1⊗W1 \otimes W is WW on MM with cc idle. In C(W)C(W) and C(W†)C(W^\dagger) the qubit cc is the control and MM the target.

Number the six qubits 11 to 66 with the target last. For four unitaries V1V_1, V2V_2, V3V_3, V4V_4 of a qubit, the Barenco circuit for five controls is the unitary of Q⊗4⊗(Q⊗Q)Q^{\otimes 4} \otimes (Q \otimes Q) given by B(V1,V2,V3,V4)=R1(1⊗3⊗V4)T2(1⊗2⊗V3)T3(1⊗V2)T4(V1).B(V_1, V_2, V_3, V_4) = R_1\bigl(1^{\otimes 3} \otimes V_4\bigr)\, T_2\bigl(1^{\otimes 2} \otimes V_3\bigr)\,T_3\bigl(1 \otimes V_2\bigr)\,T_4(V_1).(5)✦ In the layer with index kk, qubits 11 to kk are the controls, qubit k+1k+1 is cc, and MM consists of qubits k+2k+2 to 66, on which the unitary of the layer acts on the target alone.

The Claim

The register Q⊗4⊗(Q⊗Q)Q^{\otimes 4} \otimes (Q \otimes Q) of the circuit is the register Q⊗5⊗QQ^{\otimes 5} \otimes Q of five controls around the target, so the circuit and the gate C5(V2)C^5(V^2) act on the same register.

Theorem 1. Let VV be a unitary of a qubit. Then there are unitaries V2V_2, V3V_3, V4V_4 of a qubit such that C5(V2)=B(V,V2,V3,V4).C^5(V^2) = B(V, V_2, V_3, V_4).(6)✦

What Is Checked

The claim is stated over the gate C5(V2)C^5(V^2) with five controls, built from the controlled gate (2) by the recursion (3), and over the circuit (5) with its layers (4).

Of these constructions the library proves that they give unitaries. The matrix (1) is unitary, and the tensor product U⊗WU \otimes W and the product UVUV of two unitaries are again unitary.