The Exercise
A unitary acts on a quantum system . An extra qubit, the control, is prepared in beside a state of . A Hadamard gate acts on the control, then a controlled gate applies to when the control is and leaves alone when it is , and a second Hadamard acts on the control before the control is measured in the computational basis. Find the joint state just before that measurement. Then take to be a qubit and the Pauli or : write the circuit as a controlled-NOT gate (CNOT), with Hadamard gates around it in the case of , and evaluate it on the eigenstates of .
Systems and States
A quantum system comes with a state space, a finite dimensional complex Hilbert space.✦ A pure state of is a vector of unit norm in the state space of .✦
The composite system of two systems and is the system whose state space is the tensor product of their state spaces.✦ For pure states of and of , the product is the pure state of whose vector is the tensor product of the two vectors.✦
The qubit is the quantum system whose state space is .✦ Its basis states and are the pure states whose vectors are the standard basis vectors and of .✦
Unitaries and Gates
A unitary of a system is an operator on the state space of with ✦; it carries a pure state of to the pure state .✦ Two unitaries and of compose to the unitary , which applies first and then ✦, and the identity of is itself a unitary.✦ Given a unitary of and a unitary of , their product unitary is the unitary of whose operator is the tensor product of the two operators.✦ A gate on the first factor alone is ✦, and a gate on the last factor alone is .✦
The Hadamard gate and the Pauli gates and are the unitaries of the qubit whose matrices in the computational basis are (1) The states and are the pure states of the qubit (2) the eigenvectors of with eigenvalues and .
For a unitary of a system , the controlled gate is the unitary of the composite of a control qubit and a target given by (3)✦ The CNOT gate is the controlled gate on two qubits.✦
The SWAP of two copies of a system is the unitary of that exchanges the factors, .✦ The reversed CNOT , the CNOT with control below, is the unitary of two qubits that takes the second qubit as control and the first as target; in terms of the swap it is (4)✦
The Circuit
For a unitary of a system , the circuit measuring is the unitary of that places between two Hadamard gates on the control: (5)✦
The Claim
Theorem 1. Let be a unitary of a system and a vector in the state space of . Then (6)✦
When is Hermitian as well, its eigenvalues are and are the projectors onto its two eigenspaces. For a state of , the control then reads with probability and with probability , and is left in the normalised projection of : the circuit followed by a measurement of the control measures . On an eigenstate of one branch of (6) vanishes, and the control ends in a basis state with unchanged. The Pauli gates and are Hermitian. With a second qubit as target the circuit becomes a controlled-NOT gate.
Theorem 2. Let the target be a qubit and . The circuit is the CNOT with control below, (7)✦ and on the basis states of the target (8)✦ (9)✦
Theorem 3. Let the target be a qubit and . The circuit is the CNOT with control below between two Hadamard gates on the target, (10)✦ and on the eigenstates of (11)✦ (12)✦
What Is Checked
The claims are stated over the circuit of (5), built from the Hadamard gate and the controlled gate of (3), for an arbitrary unitary and for the Pauli gates of (1); over the CNOT with control below of (4); and over product states of , and the states of (2).
About these constructions the library proves that is unitary for every unitary , ✦, and that the matrices of , and are unitary. It proves that composites and tensor products of unitaries are unitary, which makes a unitary of , and that SWAP, an isometry of the state space of onto itself, is a unitary. It proves as well that a unitary carries a unit vector to a unit vector, and that the tensor product of two unit vectors has unit norm.