The evolution of quantum hardware is highlighting the need for advances in quantum software engineering that help developers create quantum software with good quality attributes. Specifically, reusability has been traditionally considered an important quality attribute in terms of efficiency of cost and effort. Increasing the reusability of quantum software will help developers create more complex solutions, by reusing simpler components, with better quality attributes, as long as the reused components have also these attributes. This work focuses on the reusability of oracles, a well-known pattern of quantum algorithms that can be used to perform functions used as input by other algorithms. In particular, in this work, we present several guidelines for making reusable quantum oracles. These guidelines include three different levels for oracle reuse: the ideas inspiring the oracle, the function which creates the oracle, and the oracle itself. To demonstrate these guidelines, two different implementations of a range of integers oracle have been built by reusing simpler oracles. The quality of these implementations is evaluated in terms of functionality and quantum circuit depth. Then, we provide an example of documentation following the proposed guidelines for both implementations to foster reuse of the provided oracles. This work aims to be a first point of discussion towards quantum software reusability. Additional work is needed to establish more specific criteria for quantum software reusability.
翻译:量子硬件的发展突显出提高量子软件工程水平的需求,以帮助开发人员创建具有良好质量属性的量子软件。具体而言,可重用性一直被认为是一种重要的质量属性,可提高成本和工作量的效率。通过增加量子软件的可重用性,开发人员可以通过重用更简单的组件来创建更复杂的解决方案,从而获得更好的质量属性,只要重用的组件也具有这些属性。本文着重研究了 Oracle 的可重用性,Oracle 是一种广为人知的量子算法模式,可用于执行其他算法所需的功能作为输入。具体而言,在本文中,我们提出了几个构建可重用量子 Oracle 的指南。这些指南包括三个不同的 Oracle 重用级别:启发 Oracle 的想法、创建 Oracle 的函数和 Oracle 本身。为了演示这些指南,我们通过重用更简单的 Oracle,构建了一个整数范围 Oracle 的两个不同实现。评估这些实现的质量,包括功能和量子电路深度。随后,我们提供了在符合提出的指南的文档中记录这两个实现的示例,以促进提供的 Oracle 的重用。本文旨在成为量子软件可重用性讨论的开头。还需要进一步的工作来建立量子软件可重用性的更具体标准。