The Exercise
The quantum Fourier transform on two qubits is the operator on whose matrix in the computational basis is (1)✦ so that its entry in row and column , both counted from , is . The exercise asks for as a product of two-level unitaries. The library answers with five factors.
Two-level Unitaries
A two-level unitary on is a unitary matrix for which there are two basis indices and , not necessarily distinct, such that (2)✦
The Five Factors
Write for the matrix on that acts on and by the Hadamard matrix and fixes the other two basis states. Three of the factors are of this kind: (3) (4) and (5)
The factor is the matrix on that acts on and by the Hadamard matrix with its second column multiplied by , and fixes and : (6)✦
The last factor, , is the permutation matrix that exchanges and : (7)✦
The Claim
Theorem 1. The Fourier matrix factors as (8)✦ and (9)✦ (10)✦ (11)✦ (12)✦ and (13)✦
What Is Checked
The claim is stated over the Fourier matrix (1) and the five factors (3) to (7), all complex matrices given entry by entry, and over the two-level unitaries of (2). The library shows that each of the five factors is a two-level unitary, acting nontrivially only on its own pair of basis states, and that the product of the five factors in the order of (8) is the Fourier matrix.