The Exercise
Two qubits, a control and a target, are in a state , pure or mixed. The exercise is to write out explicitly, in the computational basis, the action of the controlled NOT gate (CNOT) on the density matrix of .
Two Qubits
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 .✦ A state of is a positive operator of unit trace on the state space of .✦
The qubit is the quantum system whose state space is , and its computational basis states and are the pure states whose vectors are the standard basis vectors and . The composite system of two systems and is the system whose state space is the tensor product of their state spaces.✦ The product of a pure state of and a pure state of is the pure state of whose vector is the tensor product of the two vectors.✦ Two qubits form the composite system , with the four product basis states for .
The density matrix of a state of two qubits is the complex matrix whose rows and columns are labelled by pairs of bits and whose entries are the matrix elements of between product basis states, (1)✦
The CNOT Gate
A unitary of a system is an operator on the state space of with , where is the identity on the state space of .✦ The evolution of a state of under a unitary of is the state .✦
The Pauli gate, the quantum NOT, is the unitary of the qubit given on by the matrix (2)✦
For a unitary of a system , the controlled gate is the unitary of the composite system of a control qubit and a target given by (3)✦ where is the identity on the state space of .
The CNOT gate is the controlled gate of two qubits, the first the control and the second the target: it flips the target exactly when the control is .✦ On the product basis it therefore sends to , where is the permutation of the four pairs of bits (4)✦ with addition modulo .
The Claim
Theorem 1. Let be a state of two qubits. The density matrix of the evolved state is the density matrix of with its rows and its columns relabelled by : (5)✦ for all .
What Is Checked
The claim is stated over an arbitrary state of two qubits, the CNOT gate as the controlled acting by conjugation, the density matrix (1) in the product basis and the permutation (4) of its labels.
About these constructions the library proves that the controlled gate (3) is unitary, , for every unitary of every system, and that the matrix is unitary, so that the CNOT gate is a unitary of two qubits. It proves as well that conjugating a density operator by a unitary gives a density operator, so that is again a state, and that the tensor product of two unit vectors is a unit vector, so that each is a pure state of the two qubits.