Loop Composition in Quantum Algorithms
This work provides a conceptual clarification for quantum algorithm designers, showing that proper modeling of control flow (looping) is crucial for optimal composition.
The authors identify that branching composition in quantum algorithms fails to account for looping, leading to suboptimal performance in Grover's search. By extending branching composition to include looping, they achieve complexity matching prior work.
The quantum circuit model essentially treats every quantum algorithm as a straight-line program. While this view is universal, recent work has shown that it is inconvenient for using different-length quantum subroutines in superposition. Using the quantum walk formalism of quantum algorithms, it is possible to model such branching behaviour, and get better composition in this setting. We apply the above branching composition to Grover's algorithm, which gives a variable-time quantum search algorithm that is worse than previous work. The reason it is worse is because branching composition does not take into account another deviation from straight-line programs: looping. We show that by modifying branching composition to also include looping, we can get a complexity that matches previous work. This highlights the importance of properly modeling the program control flow when designing quantum algorithms.