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的重用。本研究旨在为量子软件可重用性提供初步讨论基础,后续仍需建立更具体的量子软件可重用性标准。