Quantum algorithms for factorization, search, and simulation obtain computational advantage by performing control flow such as branching and iteration based on the value of quantum data in superposition. Complicating realization of these algorithms is the fact that in predominant quantum machine models, all control flow as embodied by the program counter is classical, and cannot exist in superposition. In this work, we identify that an alternative model to enable a program counter in superposition faces an obstacle -- no such machine can correctly support control flow constructs with non-injective semantics, including the conventional conditional jump. In fact, prior attempts to support this instruction cause programs to inappropriately collapse the superposition of data, meaning that quantum advantage is lost. We present a quantum machine model that supports both quantum effects on data and data-dependent control flow, using variants of conditional jump with injective semantics. We identify the necessary condition for programs for such a machine to preserve superposition of data, and show that expressible programs coincide with the unitary quantum circuits.
翻译:因式分解、搜索和模拟等量子算法通过基于叠加态中量子数据的数值执行分支与迭代等控制流,从而获得计算优势。这些算法的实现复杂性在于:在主流量子机器模型中,所有由程序计数器体现的控制流均为经典形式,无法存在于叠加态中。本研究发现,实现程序计数器叠加态的替代模型面临一个根本障碍——任何此类机器都无法正确支持非单射语义的控制流结构,包括传统的条件跳转。事实上,先前支持该指令的尝试会导致程序不适当地坍缩数据叠加态,从而丧失量子优势。我们提出一种量子机器模型,该模型采用具有单射语义的条件跳转变体,同时支持量子数据效应与数据依赖型控制流。我们确定了此类机器中程序保持数据叠加态的必要条件,并证明可表达的程序与酉量子电路等价。