The Exercise
A circuit acts on two qubits, a control and a target. The gate is the phase gate with angle : it leaves alone and multiplies by . The controlled gate applies to the target when the control is and leaves the target alone when the control is . The exercise is to build this gate from controlled NOT (CNOT) gates, which flip the target when the control is , and gates on a single qubit.
The library states one such circuit for every , with two CNOT gates, as an equality of unitaries of the two qubits.
A Quantum System
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 , , determined physically up to a global phase.✦ A unitary of , a closed system evolution of , is an operator on the state space of with (1)✦ For two unitaries and of , the product is the unitary of that applies first and then , so a circuit is the product of its gates with the last gate on the left.✦
The Qubit
The qubit is the quantum system whose state space is , the two dimensional complex Euclidean space.✦ The computational basis states and of the qubit are the pure states whose vectors are the standard basis vectors and of .✦ The Pauli matrices are the complex matrices (2) and for a real vector in three dimensions the matrix is . For a real vector and a real angle , the rotation operator about is the matrix exponential (3)✦ written when the axis is a unit vector . About the axis it is .✦
A gate on the qubit is a unitary of the qubit, read off from its matrix in the computational basis: gives the Pauli gate, the quantum NOT, and gives the rotation gate . For a real angle the phase gate is diagonal in the computational basis, (4)✦ The gate of the exercise is .
Two Qubits
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 .✦ For unitaries of and of , the product unitary of is the tensor product of the two operators.✦ A gate on alone is , with the identity evolution on , and a gate on alone is .
For a unitary of a system , the controlled gate is the unitary of , a control qubit and a target , with (5)✦ where and project onto the basis states of the control. The CNOT gate is , the controlled NOT on two qubits, and for a real angle the controlled phase gate is .
The Claim
Theorem 1. For every natural number , with , the controlled gate on two qubits is the product (6)✦
What Is Checked
The claim is stated over unitaries of the two qubits, the composite system .
About these constructions the library proves that each is a unitary. The controlled gate (5) satisfies (1) for every unitary of every system; is unitary because its diagonal entries have unit modulus, and and because their matrices are.