Here we will be talking about the Quantum Fourier transform, a discrete analogue to the Discrete Fourier transform

Discrete Fourier Transform (DST)

Quantum Fourier transform

$$ R_k=\begin{pmatrix} 1 & 0 \\ 0 & e^{2\pi i /2^k}

\end{pmatrix} $$

Screenshot 2025-03-16 114356.png


💼 Case: lets quickly go through the algorithm now that we have the complete circuit

  1. Apply the Hadamard gate on the first qubit $\ket{j_1}$ to get

    $$ \frac{1}{\sqrt{2^1}}(\ket{0} +e^{2\pi i\, 0.j_1} \ket{1} )\ket{j_2\cdots j_n} $$

    where $e^{2\pi i\, 0.j_1}=1$ when $j_1=0$ and $-1$ when $j_1=1$

  2. We apply the controlled-$R_2$ to $R_n$ gate to get

    $$ \frac{1}{\sqrt{2^1}} (\ket{0} +e^{2\pi i\, 0.j_1j_2} \ket{1} )\ket{j_2\ldots j_n} $$

  3. We then go to the second $\ket{j_2}$ and apply the Hadamard and the controlled-$R_2$ to $R_{n-1}$

    $$ \frac{1}{\sqrt{2^2}} (\ket{0} + e^{2\pi i \, 0. j_1j_2\cdots j_n} \ket{1} )\otimes (\ket{0} +e^{2\pi i \, 0. j_2 \cdots j_n } \ket{1} )\ket{j_3\cdots j_n} $$

  4. We repeat this for qubits $\ket{j_3}\cdots \ket{j_n}$ to give out general expression

    $$ \frac{1}{2^{n/2}} (\ket{0} +e^{2\pi i\, 0. j_1j_2\cdots j_n}\ket{1}) \otimes \cdots \otimes (\ket{0}+e^{2\pi i\, 0 . j_n } \ket{1} ) $$

  5. We can then reverse the order by applying swap operations to get

    $$ \frac{1}{2^{\frac{n}{2}}} (\ket{0}+e^{2\pi i\, 0 . j_n } \ket{1} )\otimes \cdots \otimes (\ket{0} +e^{2\pi i\, 0. j_1j_2\cdots j_n}\ket{1}) $$

    our desired expression

💎 Conclusion: the complexity here is $\mathcal O(n^2)$ the FFT scales as $\mathcal O (N\log N )\equiv \mathcal O(2^n n)$