The Exercise
Two data qubits, numbered and , share a circuit with an ancilla qubit. An observable of the data with eigenvalues , such as the product of Pauli gates or the product of Pauli gates on the two data qubits, is measured through the ancilla: it is prepared in , a Hadamard gate acts on it, 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 projects the data onto the eigenspace of , outcome onto the eigenspace.
The controlled 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 it is two controlled NOT (CNOT) gates, each with a data qubit as control and the ancilla as target; for 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 is a physical system whose state space is a finite dimensional complex Hilbert space.✦ A pure state of is a unit vector in the state space of .✦ The composite system of two quantum systems and is the quantum system whose state space is the tensor product of their state spaces.✦ The qubit is the system whose state space is itself✦; its basis states and are the pure states given by the standard basis vectors and .✦ The ancilla and the two data qubits form the system , the ancilla first.
A unitary of a quantum system is an operator on the state space of with .✦ The product of unitaries and of is the unitary that applies first and then .✦ The product unitary of a unitary of and a unitary of is the unitary of whose operator is the tensor product of theirs.✦ A unitary of acts on as ✦, and a unitary of acts on as ✦, where is the identity operator on the other factor.
The Pauli gates and and the Hadamard gate are the unitaries of the qubit whose operators are the matrices (1) in the basis . On the data qubits, and , unitaries of .
For a unitary of a system , the controlled gate is the unitary of , control qubit first, given by (2)✦ The CNOT gate is on .✦ The SWAP of two copies of a system is the unitary of given by the isometry ✦, and the CNOT with control on the second qubit and target on the first is (3)✦
The measurement circuit of a unitary of a system is the unitary of that applies a Hadamard gate to the control qubit, then , then a second Hadamard gate to the control: (4)✦
Gates on Two of Three Qubits
An identification of a quantum system with a quantum system is a linear isometric bijection from the state space of onto that of .✦ Identifications have inverses , composites (first , then ) and tensor products , which act factor by factor on a composite system; the identity identification of with itself is the identity map.✦ The relabelling of a unitary of along an identification of with is the unitary of (5)✦
For three systems , and , the regrouping identifies with by ✦, and the swap identifies with by .✦ The left interchange identifies with by bringing the middle factor to the front: (6)✦
Write and for and . A unitary of two qubits, relabelled by (5), acts on the ancilla and qubit as , and on the ancilla and qubit as , in both cases with the ancilla as its first qubit.
The block for is the unitary of , 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: (7)
The Claim
Theorem 1. On the system of an ancilla followed by two data qubits, the circuit (4) for equals the block (7) applied first to the ancilla and qubit , then to the ancilla and qubit , (8)✦ and the circuit for equals the reversed CNOT (3) applied in the same way, (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 and 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 , ✦, 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.