The Exercise
Two qubits pass through a controlled NOT gate , the first qubit acting as control and the second as target. The gate carries an operator on the two qubits to : if leaves a state unchanged, then leaves unchanged. The exercise takes for the Pauli operator acting on the control alone and asks for its image under the gate, written as a product of Pauli operators on the two qubits.
The library gives the answer in two forms: the image as a tensor product of two matrices on one qubit each, and as a product of an operator on the control with an operator on the target.
Two Qubits
The identity and the Pauli matrices and of a qubit are the complex matrices, in the computational basis , , (1)
The two qubits have the basis states with , the first label and the first factor of every tensor product belonging to the control. A matrix on the control acts on the pair as , and a matrix on the target as .
The controlled NOT gate on two qubits, with the first as control and the second as target, is the complex matrix that flips the target exactly when the control is : (2)✦ with addition modulo and the matrix written in the basis , , , . The adjoint is the conjugate transpose of .
The Claim
Theorem 1. Let be the controlled NOT gate on two qubits, with the first qubit as control. Conjugating on the control by gives (3)✦ and, as a product of an operator on each qubit, (4)✦
What Is Checked
The claim is stated over the identity and the Pauli matrices and of (1), and over the controlled NOT gate (2) with the first qubit as control, all as complex matrices in the computational basis. About these the library proves the two identities (3) and (4), as equalities of complex matrices.