Lean, informalized

Nielsen & Chuang · Chapter 10, Quantum error-correction · p. 474

Exercise 10.59 - The controlled X1X2X_1X_2 and Z1Z2Z_1Z_2 circuits as CNOTs from the data qubits into an ancilla

Two parity measurements built from CNOT and Hadamard gates.

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 data qubits, numbered 11 and 22, share a circuit with an ancilla qubit. An observable MM of the data with eigenvalues ±1\pm 1, such as the product X1X2X_1X_2 of Pauli XX gates or the product Z1Z2Z_1Z_2 of Pauli ZZ gates on the two data qubits, is measured through the ancilla: it is prepared in |0⟩|0\rangle, a Hadamard gate acts on it, MM acts on the data controlled by the ancilla, a second Hadamard gate acts on the ancilla, and the ancilla is read out in the computational basis. Outcome 00 projects the data onto the +1+1 eigenspace of MM, outcome 11 onto the −1-1 eigenspace.

The controlled MM acts on all three qubits at once. For these two observables the whole circuit can be rebuilt from gates that touch the ancilla and one data qubit at a time. For Z1Z2Z_1Z_2 it is two controlled NOT (CNOT) gates, each with a data qubit as control and the ancilla as target; for X1X2X_1X_2 each of these CNOTs sits between two Hadamard gates on its data qubit. These are the circuits of Figure 10.17.

Qubits and Gates

A quantum system SS is a physical system whose state space is a finite dimensional complex Hilbert space.✦ A pure state ψ\psi of SS is a unit vector ψ\psi in the state space of SS.✦ 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 their state spaces.✦ The qubit QQ is the system whose state space is ℂ2\mathbb{C}^2 itself✦; its basis states |0⟩|0\rangle and |1⟩|1\rangle are the pure states given by the standard basis vectors e0e_0 and e1e_1.✦ The ancilla and the two data qubits form the system Q⊗(Q⊗Q)Q \otimes (Q \otimes Q), the ancilla first.

A unitary UU of a quantum system SS is an operator UU on the state space of SS with U†U=UU†=1U^\dagger U = U U^\dagger = 1.✦ The product UVUV of unitaries UU and VV of SS is the unitary that applies VV first and then UU.✦ 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 theirs.✦ A unitary UU of SS acts on S⊗TS \otimes T as U⊗1U \otimes 1✦, and a unitary VV of TT acts on S⊗TS \otimes T as 1⊗V1 \otimes V✦, where 11 is the identity operator on the other factor.

The Pauli gates XX and ZZ and the Hadamard gate HH are the unitaries of the qubit whose operators are the matrices X=(0110),Z=(100−1),H=12(111−1)X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \qquad Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}, \qquad H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}(1) in the basis |0⟩,|1⟩|0\rangle, |1\rangle. On the data qubits, X1X2=(X⊗1)(1⊗X)X_1X_2 = (X \otimes 1)(1 \otimes X) and Z1Z2=(Z⊗1)(1⊗Z)Z_1Z_2 = (Z \otimes 1)(1 \otimes Z), unitaries of Q⊗QQ \otimes Q.

For a unitary UU of a system SS, the controlled gate C(U)C(U) is the unitary of Q⊗SQ \otimes S, control qubit first, given by C(U)=|0⟩⟨0|⊗1+|1⟩⟨1|⊗U.C(U) = |0\rangle\langle 0| \otimes 1 + |1\rangle\langle 1| \otimes U .(2)✦ The CNOT gate is C(X)C(X) on Q⊗QQ \otimes Q.✦ The SWAP of two copies of a system SS is the unitary of S⊗SS \otimes S given by the isometry x⊗y↦y⊗xx \otimes y \mapsto y \otimes x✦, and the CNOT with control on the second qubit and target on the first is CNOTrev=SWAPCNOTSWAP.\mathrm{CNOT}^{\mathrm{rev}} = \mathrm{SWAP}\; \mathrm{CNOT}\; \mathrm{SWAP} .(3)✦

The measurement circuit K(U)K(U) of a unitary UU of a system SS is the unitary of Q⊗SQ \otimes S that applies a Hadamard gate to the control qubit, then C(U)C(U), then a second Hadamard gate to the control: K(U)=(H⊗1)C(U)(H⊗1).K(U) = (H \otimes 1)\, C(U)\, (H \otimes 1) .(4)✦

Gates on Two of Three Qubits

An identification ee of a quantum system SS with a quantum system TT is a linear isometric bijection from the state space of SS onto that of TT.✦ Identifications have inverses e−1e^{-1}, composites f∘ef \circ e (first ee, then ff) and tensor products e⊗fe \otimes f, which act factor by factor on a composite system; the identity identification 1S1_S of SS with itself is the identity map.✦ The relabelling of a unitary UU of SS along an identification ee of SS with TT is the unitary of TT eUe−1.e\, U\, e^{-1} .(5)✦

For three systems AA, BB and CC, the regrouping αA,B,C\alpha_{A,B,C} identifies A⊗(B⊗C)A \otimes (B \otimes C) with (A⊗B)⊗C(A \otimes B) \otimes C by u⊗(v⊗w)↦(u⊗v)⊗wu \otimes (v \otimes w) \mapsto (u \otimes v) \otimes w✦, and the swap swapA,B\mathrm{swap}_{A,B} identifies A⊗BA \otimes B with B⊗AB \otimes A by u⊗v↦v⊗uu \otimes v \mapsto v \otimes u.✦ The left interchange λA,B,C\lambda_{A,B,C} identifies A⊗(B⊗C)A \otimes (B \otimes C) with B⊗(A⊗C)B \otimes (A \otimes C) by bringing the middle factor to the front: λA,B,C=αB,A,C−1∘(swapA,B⊗1C)∘αA,B,C.\lambda_{A,B,C} = \alpha_{B,A,C}^{-1} \circ (\mathrm{swap}_{A,B} \otimes 1_C) \circ \alpha_{A,B,C} .(6)✦

Write α\alpha and λ\lambda for αQ,Q,Q\alpha_{Q,Q,Q} and λQ,Q,Q\lambda_{Q,Q,Q}. A unitary WW of two qubits, relabelled by (5), acts on the ancilla and qubit 11 as α−1(W⊗1)α\alpha^{-1} (W \otimes 1)\, \alpha, and on the ancilla and qubit 22 as λ(1⊗W)λ−1\lambda\, (1 \otimes W)\, \lambda^{-1}, in both cases with the ancilla as its first qubit.

The block BXB_X for X1X2X_1X_2 is the unitary of Q⊗QQ \otimes Q, ancilla first, that applies a Hadamard gate to the data qubit, then a CNOT from the data qubit into the ancilla, then a second Hadamard gate to the data qubit: BX=(1⊗H)CNOTrev(1⊗H).B_X = (1 \otimes H)\, \mathrm{CNOT}^{\mathrm{rev}}\, (1 \otimes H) .(7)

The Claim

Theorem 1. On the system Q⊗(Q⊗Q)Q \otimes (Q \otimes Q) of an ancilla followed by two data qubits, the circuit (4) for X1X2X_1X_2 equals the block (7) applied first to the ancilla and qubit 22, then to the ancilla and qubit 11, K(X1X2)=[α−1(BX⊗1)α][λ(1⊗BX)λ−1],K(X_1X_2) = \bigl[\alpha^{-1} (B_X \otimes 1)\, \alpha\bigr]\, \bigl[\lambda\, (1 \otimes B_X)\, \lambda^{-1}\bigr] ,(8)✦ and the circuit for Z1Z2Z_1Z_2 equals the reversed CNOT (3) applied in the same way, K(Z1Z2)=[α−1(CNOTrev⊗1)α][λ(1⊗CNOTrev)λ−1].K(Z_1Z_2) = \bigl[\alpha^{-1} (\mathrm{CNOT}^{\mathrm{rev}} \otimes 1)\, \alpha\bigr]\, \bigl[\lambda\, (1 \otimes \mathrm{CNOT}^{\mathrm{rev}})\, \lambda^{-1}\bigr] .(9)✦

What Is Checked

The claim compares unitaries of the three qubits: the circuit (4), built from the Hadamard gate and the controlled gate (2), for the products X1X2X_1X_2 and Z1Z2Z_1Z_2 of Pauli gates on the data qubits; and the reversed CNOT (3) with Hadamard gates, set on pairs of qubits by relabelling (5) along the regrouping and the left interchange (6).

About these constructions the library proves that the operator (2) is unitary for every unitary UU, C(U)†C(U)=C(U)C(U)†=1C(U)^\dagger C(U) = C(U)\, C(U)^\dagger = 1✦, and that the matrices (1) are unitary. Products and tensor products of unitaries are again unitaries, and so is a unitary relabelled along an identification, its adjoint being its inverse.