The Exercise
The Fredkin gate is the controlled swap on three qubits.✦ The first qubit is the control, and the gate acts on the three qubits by (1) Three Toffoli gates (the NOT on the third qubit controlled by the first two) make it, and the first and last of them can be replaced by controlled NOT (CNOT) gates with control on the second qubit and target on the third. Going further, the Fredkin gate is a circuit of six two qubit gates, and also of only five.
Three Qubits
A quantum system is a physical system whose state space is a finite dimensional complex Hilbert space, and the composite system of two systems and is the system whose state space is the tensor product of theirs. A pure state of is a unit vector in the state space of .✦ The qubit is the system with state space ; its basis states and are the pure states given by the standard basis vectors and . Three qubits form the composite , whose factors are the first, second and third qubit from the left.
A unitary of a system is an operator on the state space of with .✦ The identity is a unitary, and for two unitaries and of , after is the unitary , first then . For unitaries of and of , the product unitary of is the tensor product of the two operators; is the gate on the first factor and the gate on the last.
The Gates
The Pauli , the quantum NOT, is the unitary of the qubit with matrix (2)✦ For a unitary of a system , the controlled gate is the unitary of , a control qubit and the target , given by (3) The CNOT gate is the controlled gate of two qubits.✦
The SWAP of two copies of a system is the unitary of given by the isometry . The CNOT with control below, , has its control on the second qubit and its target on the first.✦
For a unitary of the qubit, the doubly controlled gate is the unitary of three qubits that applies to the third when the first two are both .✦ The Toffoli gate is the doubly controlled NOT, and the Fredkin gate and the middle Toffoli gate are the controlled SWAP and the controlled : (4) The middle Toffoli gate flips the second qubit when the first and third are both .✦
Circuits of Two Qubit Gates
A two qubit gate on three qubits is a gate of one of four kinds, each with its unitary of the three qubits: an arbitrary two qubit unitary on the second and third qubits, ; a unitary of the qubit acting on the second or the third qubit, controlled by the first, or ; an arbitrary two qubit unitary on the first and second qubits, the third idle; and one on the first and third, the second idle.✦
The last two kinds act on qubits that the bracketing does not group together, and they are placed by identifications of systems. An identification of a system with a system is a linear isometric bijection from the state space of onto that of .✦ An identification of with carries a unitary of to the unitary of , the relabelling of along .✦ For three systems , and , the regrouping identifies with by , and the swap identifies with by . Together they interchange the first two factors: (5)✦ where is the inverse identification, composes identifications, the right one first, and is the product of the swap with the identity of , acting factor by factor.
For three qubits, the gate of the third kind is , the relabelling of along , and the gate of the fourth kind is .
A circuit of two qubit gates on three qubits is a sequence of such gates; its number of gates is , and its unitary is the product of the unitaries of its gates, (6)
The Claim
Theorem 1. On three qubits, the Fredkin gate is the middle Toffoli gate between two Toffoli gates, (7)✦ and the middle Toffoli gate between two CNOT gates on the second and third qubits, (8)✦ There is a circuit of six two qubit gates whose unitary is the Fredkin gate, (9)✦ and there is a circuit of five, (10)✦
What Is Checked
The four equalities are stated over the Fredkin gate of three qubits, the Toffoli gate, the middle Toffoli gate, the CNOT gate on the second and third qubits, and, for the last two, the unitary (6) of a circuit of two qubit gates together with its number of gates.
About these constructions the library proves that each is a unitary. For every unitary of a system , the controlled gate (3) satisfies ; the matrix (2) is unitary; and products , tensor products and relabellings of unitaries are again unitary.