The Exercise
Two qubits are given, a control and a target. The controlled NOT (CNOT) gate flips the target exactly when the control is ; the controlled gate applies the phase flip to the target exactly when the control is . The exercise asks for a CNOT gate made of one controlled gate and two Hadamard gates, with the control and the target qubits specified. The library’s answer is an equality of two unitaries of a pair of qubits.
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 vector of unit norm in the state space of , , fixed physically up to a global phase.✦ 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 two level quantum system whose state space is .✦ The basis states and of the qubit are the pure states whose vectors are the standard basis vectors and of .✦ The exercise takes place on the composite system of two qubits, the first factor the control and the second the target.
Unitaries and Gates
A unitary of a quantum system is an operator on the state space of with , a closed system evolution of .✦ The identity evolution of is the unitary whose operator is .✦ Two unitaries and of compose to the unitary after , whose operator is : first acts, then .✦ When is a unitary of and one of a second system , the product unitary is the unitary of whose operator is the tensor product of the two operators.✦ Taking the identity evolution for the first factor gives the gate on the last factor, which applies to and leaves alone.✦
The Hadamard gate , the Pauli or quantum NOT, and the Pauli or phase flip are the unitaries of the qubit whose operators, in the basis , are the matrices (1)
For a unitary of a system , the controlled gate is the unitary of the composite system of a control qubit and the target with operator (2)✦ The CNOT gate is , and the controlled gate, written , is ; both are unitaries of two qubits.
The Claim
Theorem 1. On two qubits, a Hadamard gate on the target, then the controlled gate, then a second Hadamard gate on the target make up the CNOT gate: (3)✦
What Is Checked
The claim is stated over the controlled gate (2) with target on the left and target on the right, and over the gate on the target, composed one after another.
The library proves that the operator (2) is unitary for every unitary of every system, .✦ It proves as well that a unitary after a unitary is unitary, that the tensor product of two unitaries is unitary, and that the three matrices of (1) are unitary.