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∑_i p_i E[T_i]。虽然这一结论对经典算法而言是显而易见的,但对量子算法则远非如此,因为直观上,如果我们在输入的叠加态上运行量子子程序,则需要等待叠加态的所有分支都终止后才能执行下一步操作。尽管如此,我们证明了一个类似的量子结论(*):若 q_i 是所有查询中在 i 上的平均查询权重,则所有量子子程序查询的开销为 Q∑_i q_i E[T_i]。此处,针对特定查询在 i 上的查询权重是指,若我们在查询前立即测量输入寄存器,测得 i 的概率。我们使用多维量子行走技术(最近在 arXiv:2208.13492 中提出)证明了这一结果。我们提出了其量子行走边组合结果的一个更一般化版本,通过例如将更新开销替换为 √(∑_{u,v} π_u P_{u,v} E[T_{u,v}^2])(其中 T_{u,v} 为从顶点 u 移动到顶点 v 的开销),从而得到可变时间量子行走,推广了可变时间量子搜索。这种允许我们在量子行走中组合量子子程序的技术,同样可用于任何量子算法中的组合,这正是我们证明(*)所采用的方法。