QuantumPath´s Annealer Compositor Jose Luis Hevia 1, Guido Peterssen 1, Ezequiel Murina 1, Aurelio Martínez 1 , Mario Piattini 1,2 1 aQuantum, Calle Albasanz 16, 28037 Madrid, Spain 2 Alarcos Research Group, University of Castilla-La Mancha, Paseo de la Universidad 4, 13071, Spain Abstract Among the various challenges that quantum computing faces to become a widespread reality are, on the one hand, the need to research and apply the existing software engineering processes; and on the other hand, the shortage of specialized workforce. QPath® is a tool that solves these two challenges, in addition to presenting other advantages for the development of hybrid information systems. In this paper we present the Annealer Compositor that facilitates the definition and execution of annealing algorithms in either quantum annealing or digital annealing computers. Keywords 1 Quantum computing, Quantum toolkits, QuantumPath, Annealer Compositor. 1. Introduction Quantum mechanics, the basis of emerging quantum technologies, provides several features that make us able to use the same nature to solve problems whose complexity makes it unworkable to try to solve them with “classic” computers as we know them – even if they are supercomputers or connect in very large networks that allow the parallel process at global levels. Thanks to the mathematical principles that have emerged in the last century, we have a solid and consistent foundation that allows us to bring quantum mechanics to information systems. In fact, we are already in the fourth era of software development [1], and we must prepare ourselves to take full advantage of it. The “Talavera Manifesto” [2] urges to take care of producing quantum software by applying knowledge and lessons learned from the software engineering field. This implies to apply or adapt the existing software engineering processes, methods, techniques, practices, and principles for the development of quantum software (or it may imply creating new ones) [3]. Another challenge is the shortage of specialized workforce [4]. The situation is so worrying that this is one of the most urgent problems to be solved in the countries that are leading the race in quantum computing technology and that are betting on the quantum industry as a growth engine for their economies. And they are trying, designing, and running large quantum literacy projects as part of huge national quantum projects. to develop quantum software today there is not only the enormous difficulty of having to do it with a new technological and programming paradigm. There is also a wide variety of quantum programming languages, many programming development environments, a wide variety of types of quantum simulators and hardware, and there is still no methodology for developing high- quality quantum software [5]. In this context, it is easy to understand the enormous difficulties to overcome in the creation of “universal” competencies for the development of quantum software. This has been the two main challenges we faced when creating QPath® [6], as a Quantum Software Development & Application Lifecycle Platform. QPath® supports Software Engineering and Programming best practices adoption, assuring the quality of quantum development projects; and it Proceedings of the 2nd Quantum Software and Engineering Workshop (QSET’21), October 19, 2021, Virtual conference EMAIL: Jluis.Hevia@alhambrait.com (A.1); Guido.Peterssen@alhambrait.com (A.2); ezequiel.murina@alhambrait.com (A.3); aurelio.martinez@alhambrait.com (A.4); mario.piattini@uclm.es (A.5) ORCID: 0000-0002-7212-8279 (A.5) ©️ 2021 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) 13 proposes an environment that makes programmers independent of the specific details of each platform and language, following the principle of “write once, run everywhere”. In this way, QPath® supports the execution of quantum process units transparently from the environment in which they are executed. Therefore, it masks the complexities of the different environments by supporting the necessary transformations and automating the whole process through efficient tools. The rest of the paper is organized as follows: Section 2 summarizes the most important characteristics of QPath®; Section 3 provides an overview of quantum annealing. Section 4 explains the new annealing definition interface of QPath®, and Section 5 shows an example. Finally, Section 6 presents the conclusions and future work. 2. First level heading Bearing in mind in these two challenges and the requirements for Quantum Software Platforms [8], we addressed the challenge of designing and developing QPath®. In fact, QPath®: • Enables the quantum software life cycle and engineering. • Enables the integration of quantum/classical information systems with its ecosystem of tools, services and processes that makes it possible to execute quantum process units in a transparent way with respect to the quantum environment in which they are executed. • Supports multidisciplinary teams, allowing them to focus only on the functional knowledge required for the quantum solution in any field of activity: Chemistry, Economy, Financial Services, Energy, Agriculture, Medicine and Health, Privacy and Cryptography, Logistics, Defense and National Security, etc. • Provides an ecosystem of applications to develop quality quantum software applying Software Engineering principles. The objective of facilitating the development of commercial quantum software with QPath® has also been applied to the design of graphical work interfaces, which allow: • Visually design the quantum assets of the application and define the environment´s requirements • Choose the execution target of the preferred quantum computers, assisted by an AI support system with fully automatic processes • Simplify the creation of hybrid systems, integrating the quantum part with the classical one through standard, clear and self-provisioned web services from the quantum application catalog • Explore the results using a unified scheme, without worrying about the language of quantum computers • Manage all the processes and analyze all the stored telemetry • Facilitate the use of the platform with a fully automatic process support system and a reduced learning curve More information about QPath® [8] could be found in the demos available on the web: https://www.aquantum.es/demo/. 3. Quantum annealing Since so many years ago, in glass industry, there is a process that consists in warming a glass and then, a slow cooling driven by a time step protocol. Why we want to do that? Well, in the case of glass pieces, a physical-chemistry property is modified: the material adopts a different molecular structure that prevents spontaneous breakage. The technique is called annealing. In fact, a perturbation of a system followed by a controlled trajectory to the equilibrium may allow to visit a new stable state that could be more interesting for our purposes. Annealing technique was probably initially applied in material industry before the development of a thermodynamic theory that explains the phenomena at a molecular level. Later, the improvement of the annealing processes in industry was possible due a theory that explains which are and how to tune the critical parameters involved. 14 During the interaction between theory and practice, it is common that, in an abstraction stage to develop a theory, a migration of concepts among different disciplines occurs. Returning to the example presented above, annealing is a warming-cooling protocol applied in industries such as the glass production, but also a computational technique applied in theoretical chemistry (simulated annealing), as well as a process that takes place at a hardware level in quantum computing devices (quantum annealing). Thus, the annealing considered here is a technique in the field of computing science inspired by computational chemistry and, in the origin, by chemistry applied to the industry. Lots of computational problems can be tackled using an optimization approach. It includes the definition of relevant variables that describes the properties of the problem we are interested in and pair-wise interactions among these variables. In this context, energy is a real value mathematical function of the variables defined and gives us the information about the intensity of the interactions. We search the minimum values of energy sampling the variables. The annealing starts when we apply a perturbation to the system (a warming) that lets it to access to a wider range of energetic states. Then, we apply a (slow) cooling protocol that allows the system evolves forward to a more stable state, i.e., to a minimum of energy. The collection of the values given to the variables in each sampling step is called configuration. Going from one configuration to other with less energy requires to jump an energetic barrier in most of the cases. This demands more computing time. However, when we deal with a quantum system, a phenomenon called quantum tunneling may occur. Quantum tunneling makes it possible to overcome an energetic barrier without jumping it but “crossing trough the base”. Therefore, there is a less demand of computing time. An annealer is a hardware device that carries out annealing; it can be a digital annealer, such as Fujitsu Digital Annealer [9], or a quantum annealer such as D-Wave Systems [10]. The D-Wave Systems company has released a commercial quantum annealer that is composed by many qubits spatially ordered in a graph geometry and able to interact among them and with two external magnetic fields. The exponential scalability in the number of (stable) qubits is one of the most interesting features of this technology. In D-Wave hardware, qubits initialize in a quantum superposition state due to the action a transversal magnetic field. The quantum annealing protocol starts when a longitudinal magnetic field is slowly turned on while the transversal one is slowly turned off, as it is shown in figure 1. The protocol ends when all the qubits collapse into bit states that encode one of the possible optimized solutions for our computational problem. The Hamiltonian H (the energy of the system, i.e., the energy of the set of qubits) includes the interaction with the transversal (red) and longitudinal (green) external magnetic fields, as well as pair the-wise interaction between the qubits (purple). Figure 1: Quantum annealing protocol as it is implemented in D-Wave hardware. 15 Quantum annealing in computing science promises to resolve NP-hard problems, among others, in an easier way, along with the reduction of the computational resource requirements. The impact of annealing technology will be big thought solutions to NP-hard problems are currently strongly demanded in many industries. Focusing on software development, QUBO (Quadratic Unconstraint Binary Optimization) approach is the logical-mathematical bridge that makes possible the coding of an NP-hard problem, among others, into binary variables and its corresponding pair-wise interactions. The model of the system, i.e., the definition of the variables and the interactions, becomes critical to get the information you need below an error tolerance threshold. Pair-wise interactions are modeled as quadratic terms. That means products that include the variables involved (“purple” term in Figure 1). The interaction of the qubits with the longitudinal external magnetic field is represented as a linear term (“green” term in Figure 1). Both, quadratic and linear term of the Hamiltonian constitute the called Ising model that is equivalent to a QUBO formulation. The Ising Hamiltonian is what the programmer code according to the computational problem she/he wants to resolve. Eventually, a constant energetic term appears. However, it just modifies the absolute value of the total energy which is irrelevant in a minimization interpretation of the results. On the other hand, the first term in the Hamiltonian of Figure 1 (“red” term) is not controlled by the programmer but by a standalone process the annealer executes. In fact, the transversal term is the quantum part of the Hamiltonian that favors the quantum tunneling effect. 4. Quantum annealer compositor Quantum coding can be a pain in your neck even for those with a scientific background. As was mentioned above, DWave System company has released the first commercial quantum annealer together with an SDK called Ocean. In the same way, Fujitsu has created a Digital Annealer using concepts of Quantum Inspired technology. Anyway, programming an “annealer” basically consists in coding an interaction matrix whose dimension scales with the number of variables defined to describe our computational problem. Ocean and Fujitsu -as main examples- work with Python as a programming language and have their own SDK to program their own machines. In this scenario, QPath® appears to make possible commercial quantum software development. QPath® can help you in the design, deployment and execution of your quantum annealing algorithm, providing a set of abstractions, tools, scalable executions, and unified results that simplifies the development stage, being aware the underlying technological details. In fact, you can work with different supported platforms, see Figure 2. 16 Figure 2: Different quantum platforms supported by QPath®. So, all this software technology is agnostic to a specific hardware. Hence, it can be used in other quantum annealers that would be released by different companies in the near future. And you can manage all the assets of a quantum development project in an integrated manner, in a cloud system and stored encrypted from origin to storage, to fulfill the privacy of knowledge premise of the product at all levels. 5. Example We will solve a typical optimization problem: the optimization of a package delivery. Suppose that we have five boxes, each one with a specific weight (1, 2, 3, 4, 4) and a specific price (4, 1, 2, 3, 5). We need to obtain the best combination of weight price to fit a maximum weight about 6 kilograms. To optimize the package delivery, we need to define one class call “box”, for this box we need to define five instances each instance will have its own characteristics (the price and the weight) as input the values. To solve the problem, we need to have two rules: the first rule is to determine that the weight of the packages must be six kilograms, and the second rule is that we want to maximize the price. We need some mathematical expressions, the first quadratic expression in (1) can be developed as the expression in (2). The second rule must be developed using the linear term in (3) in order to do that we will see how the quantum annealer can help us to do that. (1) (2) (3) At the end, the background of this problem consists in the definition of the Hamiltonian that solves the combinatorial problem and the QUBO generation. Using the quantum annealer compositor, we define a new class “box” with 5 instances and specific properties (price and weight) with their corresponding values (see Figure 3). Figure 3: Quantum annealer compositor: Class-Edit. The next step is to create the rules. We must generate a formula that codifies the rule that we have 6 kilograms at maximum weight, using the “interaction” element (see Figure 4). Depending on the type 17 of the interaction (Linear or quadratic), the system will automatically determine how many elements are needed to solve this part. Figure 4: Quantum annealer compositor: Interaction definition. In a similar way we define a new interaction for the quadratic term, and for the second rule. After these definitions, we specify the quantum flow that combines the execution of the boxes annealing process and compile our solution. QPath® transparently creates all the assets that are needed to the execution. We chose in the runtime dashboard the specific quantum machine or simulator that acts as an annealing solver. And in the QPath´s execution dashboard we can see the results of this example (see Figure 5). Figure 5: QPath´s execution dashboard. 6. Conclusions and future work Thanks to recent advances in the application of scientific research in various fields of knowledge to the development of quantum computing, we have stopped talking about quantum computing as something of the future. QPath® is a platform that does not demand a workforce with “universal” competencies for the development of quantum software because, simply, it provides the necessary tools for the development team to focus on the development of the solution without having to worry about the specificities of 18 quantum platforms and their necessary requirements. This allows to accelerate the construction and deployment of quantum applications, abstracting their technical complexities, since programmers can focus on the domain of the problem or business model, needing only the functional knowledge required for the solution. And they can do this in a totally visual environment, even in the case of annealing problems. This will benefit specially novice developers taking their first practical steps in the activities of the quantum software development cycle, from the creation of the quantum algorithm through its development, testing and implementation, to its deployment and reuse. With these facilities for the rapid adoption of quantum development, QPath® makes a very special contribution to the growing global demand for quantum software developers in the emerging quantum industry. We believe that in this way QPath® can significantly contribute to the adoption of quantum technologies and specifically enable companies to develop and deploy applications based on these technologies, safeguarding their investments. Acknowledgments This work is part of “QHealth: Quantum Pharmacogenomics Applied to Aging”, 2020 CDTI Missions Programme (Center for the Development of Industrial Technology of the Ministry of Science and Innovation of Spain) and FEDER. We would like to thank all the aQuantum members for their help and support. References [1] Piattini, M., Peterssen, G., and Pérez-Castillo, R. Quantum Computing: A New Software Engineering Golden Age. ACM SIGSOFT Software Engineering Newsletter 45 (3), June 2020, 12-14. [2] Piattini, M., Peterssen, G., Pérez-Castillo, R., Hevia, J.L., Murina, E., et al. The Talavera Manifesto for Quantum Software Engineering and Programming. QANSWER 2020 QuANtum SoftWare Engineering & pRogramming. Proceedings of the 1st International Workshop on the QuANtum SoftWare Engineering & pRogramming, Talavera de la Reina, Spain, February 11-12, 2020. http://ceur-ws.org/Vol-2561/paper0.pdf. [3] Piattini, M., Serrano, M., Pérez-Castillo, R., Peterssen, G. and Hevia, J.L. (2021). Towards a Quantum Software Engineering. IT Professional, IEEE, 23 (1), 62-66, Jan.-Feb. 2021, doi: 10.1109/MITP.2020.3019522. [4] Peterssen, G. Quantum Technology Impact: The Necessary Workforce for Developing Quantum Software. Proceedings of the 1st International Workshop on the QuANtum SoftWare Engineering & pRogramming (QANSWER), Talavera de la Reina, Spain, 11-12 February 2020. [5] Piattini, M. Requirements for a Robust Quantum Software Development Environment. Cutter Business Technology Journal 34 (4), 2021, 12-17. [6] QuantumPath. https://www.quantumpath.es/ Accessed 1st June 2021. [7] Hevia, J.L. (2020). Requirements for Quantum Software Platforms. Q-SET’20: 1st Quantum Software Engineering and Technology Workshop, October 13, 2020, Denver — Broomfield, Colorado, USA. CEDUR-Ws.org/Vol-2705/short3.pdf. [8] Peterssen, G. and Hevia, J. L. Introduction to quantum software development with QPath. https://www.quantumpath.es/index.php/2021/01/13/introduction-to-quantum-software- development-with-qpath/. The QPath Blog. 2021. [9] Fujitsu Digital Annealer. https://www.fujitsu.com/global/services/business-services/digital- annealer/index.html Accessed 1st June 2021 [10] D-Wave System. https://www.dwavesys.com/ Accessed 1st June 2021 19