Mean estimation when you have the source code; or, quantum Monte Carlo methods

Suppose is a real random variable, and one is given access to ``the code'' that generates it (for example, a randomized or quantum circuit whose output is ). We give a quantum procedure that runs the code times and returns an estimate for that with high probability satisfies , where . This dependence on is optimal for quantum algorithms. One may compare with classical algorithms, which can only achieve the quadratically worse . Our method improves upon previous works, which either made additional assumptions about , and/or assumed the algorithm knew an a priori bound on , and/or used additional logarithmic factors beyond . The central subroutine for our result is essentially Grover's algorithm but with complex phases.ally Grover's algorithm but with complex phases.
View on arXiv