An important tool in algorithm design is the ability to build algorithms from other algorithms that run as subroutines. In the case of quantum algorithms, a subroutine may be called on a superposition of different inputs, which complicates things. For example, a classical algorithm that calls a subroutine $Q$ times, where the average probability of querying the subroutine on input $i$ is $p_i$, and the cost of the subroutine on input $i$ is $T_i$, incurs expected cost $Q\sum_i p_i E[T_i]$ from all subroutine queries. While this statement is obvious for classical algorithms, for quantum algorithms, it is much less so, since naively, if we run a quantum subroutine on a superposition of inputs, we need to wait for all branches of the superposition to terminate before we can apply the next operation. We nonetheless show an analogous quantum statement (*): If $q_i$ is the average query weight on $i$ over all queries, the cost from all quantum subroutine queries is $Q\sum_i q_i E[T_i]$. Here the query weight on $i$ for a particular query is the probability of measuring $i$ in the input register if we were to measure right before the query. We prove this result using the technique of multidimensional quantum walks, recently introduced in arXiv:2208.13492. We present a more general version of their quantum walk edge composition result, which yields variable-time quantum walks, generalizing variable-time quantum search, by, for example, replacing the update cost with $\sqrt{\sum_{u,v}\pi_u P_{u,v} E[T_{u,v}^2]}$, where $T_{u,v}$ is the cost to move from vertex $u$ to vertex $v$. The same technique that allows us to compose quantum subroutines in quantum walks can also be used to compose in any quantum algorithm, which is how we prove (*).
翻译:算法设计中的一个重要工具是能够基于作为子程序运行的其他算法来构建算法。在量子算法的情形中,子程序可能以不同输入的叠加态被调用,这使得问题复杂化。例如,一个经典算法调用子程序 $Q$ 次,其中平均查询输入 $i$ 的概率为 $p_i$,子程序在输入 $i$ 上的开销为 $T_i$,则所有子程序查询产生的期望开销为 $Q\sum_i p_i E[T_i]$。尽管这一陈述对经典算法而言显而易见,但对于量子算法则远非如此,因为直观上,如果我们对输入叠加态运行量子子程序,需要等待叠加态的所有分支终止才能应用下一步操作。尽管如此,我们展示了类似的量子陈述 (*):设 $q_i$ 是所有查询中针对 $i$ 的平均查询权重,则所有量子子程序查询产生的开销为 $Q\sum_i q_i E[T_i]$。这里,对于特定查询,$i$ 的查询权重定义为若在查询前立即测量输入寄存器时测量到 $i$ 的概率。我们利用近期在 arXiv:2208.13492 中引入的多维量子游走技术证明了这一结果。我们给出了其量子游走边组合结果的更一般形式,该形式通过将更新开销替换为 $\sqrt{\sum_{u,v}\pi_u P_{u,v} E[T_{u,v}^2]}$(其中 $T_{u,v}$ 是从顶点 $u$ 移动到顶点 $v$ 的开销)等操作,实现了可变时间量子游走,从而推广了可变时间量子搜索。这种允许我们在量子游走中组合量子子程序的同一技术,也可用于任意量子算法中的组合,这正是我们证明 (*) 的方法。