Quantum Bit String Comparators (QBSC) operate on two sequences of n-qubits, enabling the determination of their relationships, such as equality, greater than, or less than. This is analogous to the way conditional statements are used in programming languages. Consequently, QBSCs play a crucial role in various algorithms that can be executed or adapted for quantum computers. The development of efficient and generalized comparators for any $n$-qubit length has long posed a challenge, as they have a high-cost footprint and lead to quantum delays. Comparators that are efficient are associated with inputs of fixed length. As a result, comparators without a generalized circuit cannot be employed at a higher level, though they are well-suited for problems with limited size requirements. In this paper, we introduce a generalized design for the comparison of two $n$-qubit logic states using just two ancillary bits. The design is examined on the basis of qubit requirements, ancillary bit usage, quantum cost, quantum delay, gate operations, and circuit complexity, and is tested comprehensively on various input lengths. The work allows for sufficient flexibility in the design of quantum algorithms, which can accelerate quantum algorithm development.
翻译:量子比特串比较器(QBSC)对两个n量子比特序列进行操作,能够判定它们之间的关系,例如相等、大于或小于。这类似于编程语言中条件语句的使用方式。因此,QBSC在多种可在量子计算机上执行或适配的算法中发挥着关键作用。开发适用于任意n量子比特长度的通用且高效的比较器长期以来一直是一个挑战,因为这类比较器具有较高的资源开销并导致量子延迟。高效的比较器通常与固定长度的输入相关联。因此,缺乏通用电路的比较器虽然适用于规模有限的问题,但无法在更高层次上使用。在本文中,我们提出了一种通用设计,仅使用两个辅助比特即可比较两个n量子比特逻辑状态。我们从量子比特需求、辅助比特使用量、量子成本、量子延迟、门操作和电路复杂度等方面对该设计进行了分析,并在各种输入长度上进行了全面测试。该设计为量子算法的设计提供了充分的灵活性,从而能够加速量子算法的开发。