The Exercise
Take two qubits, a control and a target, and a real angle . The exercise asks for a circuit that applies the rotation about the axis to the target when the control is and leaves the target alone when the control is , and for the same circuit with the rotation about the axis. The circuits are built from controlled NOT (CNOT) gates and single qubit gates.
The library states the answer for every real angle as two equalities between unitaries of the two qubits.
Qubits and Unitaries
A quantum system is a physical object whose state space is a finite dimensional complex Hilbert space.✦ 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 qubit is the two level quantum system whose state space is .✦
A pure state of a quantum system is a vector of unit norm in the state space of .✦ The computational basis states and of the qubit are the pure states whose vectors are the standard basis vectors and of .✦
A unitary of a quantum system is an operator on the state space of with , an evolution of as a closed system.✦ The identity evolution of is the unitary .✦ For unitaries and of , the unitary after is their composite : first acts, then .✦
For a unitary of and a unitary of , the product unitary is the unitary of whose operator is the tensor product of the operators of and .✦ The gate on the second factor of is the product unitary , with the identity evolution on and on .✦
Single Qubit Gates
The Pauli matrices are (1) and for a real vector in three dimensions the matrix is . For such a vector and a real angle , the rotation matrix is the complex matrix (2)✦ and for a unit vector it is the rotation by about the axis . The rotations about the coordinate axes are the cases , and of (2): (3) The Hadamard matrix is (4)✦
The Pauli gate, the quantum NOT, is the unitary of the qubit whose matrix in the computational basis is of (1), and the Hadamard gate is the unitary of the qubit whose matrix is (4). For a real angle , the rotation gates , and are the unitaries of the qubit whose matrices in the computational basis are those of (3).
Controlled Gates
For a unitary of a quantum system , the controlled gate is the unitary of the composite of a control qubit with the target given by (5)✦ with and the projectors onto the computational basis states of the control. The CNOT gate is the controlled gate of two qubits, with the Pauli gate acting on the target.✦
The Claim
Theorem 1. Let be a real angle. On two qubits, the first the control and the second the target, the controlled rotations about and about are (6)✦ and (7)✦
What Is Checked
The two equalities are stated over the controlled gate of (5), with the rotation gates and as and with the Pauli gate as in the CNOT, and over the gates , and on the target, composed one after another as unitaries of two qubits.
The library proves that the controlled gate is unitary for every unitary of every quantum system, .✦ The product and the composite of two unitaries are again unitary, and so is each single qubit gate, since its matrix is.