Abstract
While loops test a predicate on every iteration. Such measurement collapses quantum superposition, affecting the evolution of the algorithm. We define a while loop primitive using weak measurements, offering a trade-off between the collapse caused and the amount of information gained per iteration. This trade-off is adjusted with a parameter set by the programmer. We give sufficient conditions for the collapse not to affect the evolution in a detrimental way. As an example, we implement Grover's algorithm with a while loop, maintaining the quadratic quantum speed-up.

This publication has 18 references indexed in Scilit: