Key Takeaways: Chapter 12 — The Deutsch-Jozsa and Bernstein-Vazirani Algorithms — Simple Problems, Exponential Speedup, and the First Taste of Quantum Advantage

  1. The Deutsch-Jozsa algorithm achieves an exponential quantum speedup: 1 query vs. $O(2^n)$ classical queries. It demonstrates that quantum computers can solve certain promise problems exponentially faster than deterministic classical computers.

  2. The Bernstein-Vazirani algorithm learns an $n$-bit hidden string in 1 query vs. $n$ classical queries, demonstrating a polynomial (but optimal) quantum speedup for a non-promise problem. This is a more robust result since it holds even against randomized classical algorithms.

  3. Both algorithms use the same circuit structure: Hadamard gates, oracle query, Hadamard gates, measurement. The difference lies entirely in the oracle and the interpretation of the result.

  4. The Hadamard transform is the Fourier transform over $\mathbb{Z}_2^n$. This perspective unifies these algorithms and connects them to the Quantum Fourier Transform. The key identity $\sum_x (-1)^{x \cdot z} = 2^n \delta_{z,0}$ is the orthogonality of characters.

  5. Phase kickback is the essential mechanism: the oracle encodes $f(x)$ into the phase of the input state, and the final Hadamard transform converts this phase information into measurable computational basis states.

  6. Oracle construction is a practical skill. For any Boolean function, we can build the corresponding unitary oracle using CNOT gates, multi-controlled gates, or the computation-uncomputation pattern.

  7. The exponential gap in Deutsch-Jozsa is against deterministic classical algorithms only. Randomized classical algorithms can solve it with $O(1)$ queries. Bernstein-Vazirani's polynomial speedup is more robust.

  8. These algorithms are templates for more powerful algorithms. The pattern of "Hadamard → Oracle → Hadamard → Measure" generalizes to "Superposition → Oracle → QFT → Measure," which is the template for Shor's algorithm and quantum phase estimation.