The Exercise
A controlled NOT (CNOT) gate acts on two qubits: it flips the second, the target, exactly when the first, the control, is .✦ That description is made in the computational basis . The exercise asks how the same gate looks in the basis of the eigenstates and of the Pauli operator : what it does to the four products of these states, and what it does to the computational basis once a Hadamard gate is applied to each qubit before and after it. The library answers with five equalities between pure states of two qubits.
Two Qubits
A quantum system is a physical system whose state space is a finite dimensional complex Hilbert space.✦ The qubit is the two level system whose state space is .✦ The composite system of two quantum systems and is the quantum system whose state space is the tensor product of the state spaces of and ; the gates below act on the composite of two qubits, with state space .✦
A pure state of a quantum system is a unit vector in the state space of .✦ For pure states of and of , the product state is the pure state of whose vector is the tensor product of the two vectors.✦ For two qubits we write for .
The basis state of the qubit, for a bit , is the pure state whose vector is the th standard basis vector of .✦ The states and of the qubit are the pure states whose vectors are (1)
Gates
A unitary of a quantum system is an operator on the state space of with ; it carries a pure state of to the pure state . For unitaries and of , the composite is the unitary of 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 the two operators.✦
The Pauli gate and the Hadamard gate are the unitaries of the qubit whose matrices in the computational basis are (2)
For a unitary of a system , the controlled gate is the unitary of the composite of a control qubit with the target given by (3)✦ The CNOT gate is the controlled gate of two qubits.✦
The Claim
Theorem 1. On products of the states and the CNOT gate acts with control and target exchanged: (4)✦ (5)✦ (6)✦ (7)✦ For bits and , with their sum modulo , the product unitary applied before and after the CNOT gate gives a controlled NOT with the second qubit as control and the first as target: (8)✦
What Is Checked
The claim is stated over the CNOT gate, which is the controlled gate (3) with the Pauli gate as , and over the composite of that gate with the product unitary . The states it is stated over are the product states of two qubits built from the basis states and from the states (1).
The library proves that is unitary for every unitary of a system .✦ It proves the same of the matrices (2), of product unitaries and of composites, and it proves that the vectors (1) have unit norm, as do the tensor product of two unit vectors and the image of a unit vector under a unitary.