
Towards a Quantum Software Modeling Language Carlos A. Pérez-Delgado∗ Hector G. Perez-Gonzalez University of Kent Universidad Autónoma de San Luis Potosí Canterbury, Kent, United Kingdom San Luis Potosí, SLP, México [email protected] [email protected] ABSTRACT Quantum computation has, until today, been studied almost We set down the principles behind a modeling language for quan- exclusively ‘in the small.’ A general understanding of quantum tum software. We present a minimal set of extensions to the well- computation, or, quantum programming ‘in the large’ is yet to be known Unified Modeling Language (UML) that allows it to effec- developed. Here we aim to set the foundations of a general frame- tively model quantum software. These extensions are separate and work for studying, developing, and conveying quantum programs. independent of UML as a whole. As such they can be used to ex- We aim to do so by developing a universal modeling language tend any other software modeling language, or as a basis for a for quantum software. Rather than develop such a language from completely new language. We argue that these extensions are both scratch, we have decided to start from the well-known Unified necessary and sufficient to model, abstractly, any piece of quantum Modeling Language (UML)[3], and introduce a minimum set of software. Finally, we provide a small set of examples that showcase extensions that allow it to effectively model quantum software. the effectiveness of the extension set. Assuming UML to be a shared common-language upon which we can build, allows us to convey our original extensions much CCS CONCEPTS more succinctly. Our extension set can, however, be applied with little or no modification to any other modeling language. • General and reference → General conference proceedings; Design; • Software and its engineering → System descrip- 2 Q-UML tion languages; Unified Modeling Language (UML); Software design engineering; • Theory of computation → Quantum Before discussing in depth the extensions we are introducing, we computation theory; Quantum information theory. make a few fundamental observations on which we base the guiding KEYWORDS principles for our extension set. Our first observation is about the nature of quantum computa- quantum computing, software engineering, UML tion. The central difference between quantum and classical com- ACM Reference Format: putation is in how it achieves its goals. Quantum computers have Carlos A. Pérez-Delgado and Hector G. Perez-Gonzalez. 2020. Towards a access to quantum algorithms[7], and quantum data-structures[8], Quantum Software Modeling Language. In IEEE/ACM 42nd International that are unavailable to classical computers—hence their perfor- Conference on Software Engineering Workshops (ICSEW’20), May 23–29, 2020, mance advantage. Algorithms and data-structures are, however, Seoul, Republic of Korea. ACM, New York, NY, USA, 3 pages. https://doi.org/ implementation details. Algorithms are an essential design choice 10.1145/3387940.3392183 while programming in the small. However, they are more often than not completely ignored in large-scale software architectural 1 INTRODUCTION design. For instance, UML diagrams seldom portray algorithms and Quantum computation rose to prominence after the discovery of data-structures beyond a very high-level design perspective. quantum algorithms[5, 7] that can efficiently perform tasks that It would seem then that quantum computation introduces noth- are intractable classically. These discoveries propelled research and ing to computation that needs to be captured in a software design interest in quantum computation. Today, there exists prototype diagram. This is not the case, and the reason for this is our second quantum hardware with computational capabilities beyond that of observation. Quantum computation changes the very nature of in- any classical machine[1]. Further applications of quantum theory formation itself. Quantum information is much richer than classical to computation have also been made in several areas of theory of information. It is also much more challenging to store, transmit, arXiv:2006.16690v1 [quant-ph] 30 Jun 2020 computing, such as models of computation[6], data structures[8], and receive. If a module (class, object, etc.) needs to store, transmit and cryptography[2]. or receive quantum information, then this is an important design consideration—which needs to be included in any effective software ∗Both authors contributed equally to this research. design. A third observation here is that the classical vs. quantum nature Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed of the information used by a module is an important consideration for profit or commercial advantage and that copies bear this notice and the full citation both when discussing its internal implementation and its interface. on the first page. Copyrights for components of this work owned by others than the Furthermore, these two are separate and independent considera- author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission tions. and/or a fee. Request permissions from [email protected]. A classical module, implementing some classical behavior, would ICSEW’20, May 23–29, 2020, Seoul, Republic of Korea have no need, or capability, to communicate quantum data. A quan- © 2020 Copyright held by the owner/author(s). Publication rights licensed to ACM. ACM ISBN 978-1-4503-7963-2/20/05...$15.00 tum module may or may not have to; i.e. a module’s quantum https://doi.org/10.1145/3387940.3392183 behavior may be completely part of its internal implementation ICSEW’20, May 23–29, 2020, Seoul, Republic of Korea Carlos A. Pérez-Delgado and Hector G. Perez-Gonzalez and not appear as part of its interface. For instance, take a module (5) (Quantum Communication): Quantum and classical mod- implementing Shor’s algorithm. Shor’s algorithm uses quantum ules can communicate with each other as long as their inter- effects to efficiently factor a large integer into its prime factors. faces are compatible, i.e. the quantum module has classical The implementation of this module must necessarily be quantum. inputs and/or outputs that can interface with the classical Both the input (the large integer) and the output (the prime factors), module. consist of classical information. And hence, the interface of such a We will argue in Sec. 2.3 how these extensions are not only nec- module can be strictly classical. essary, but also sufficient in order to design and represent quantum More generally, we can conceive of quantum software modules software. First, in the following two sections we put these principles that have all classical inputs and outputs (like the above example), into practice as a set of concrete extensions to UML. all quantum inputs and outputs, or a mix of both. A quantum soft- ware design must address, for each individual interface element, 2.1 Class Diagram Extensions whether it is classical input/output, or if it is quantum. In short, UML is a very graphical language, meant to convey a lot of meaning whether a module communicates classically or via quantum infor- in a very small amount of space. As such, it makes sense to use a mation, and whether its internal implementation requires quantum graphical way to represent quantum software elements. We chose to hardware are important considerations that need to be captured in do this by use of bold text to denote quantum elements, and double a design document. lines to denote a quantum relationship or quantum communication. The importance of such labelling should be clear. Quantum data can only be stored and transmitted with special hardware designed to do so. More importantly, from an abstract, device-independent, ShorApplication strictly software perspective: quantum and classical information -N:int are not interchangeable. Classical information is clone-able and +start() Euclidian admits fanout operations, while quantum information (in general) QFT -aValue:int -?:qint does not. On the other hand, quantum information has a much -bValue:int larger state-space. +get-QFT-|0? () : qint +get-QFT-inv-|? ?:qint +evaluateGCD() m Finally, it is true that quantum information is strictly a super-set Performs a quantum Get the greatest Fourier transform on of classical information—and hence a quantum module can commu- ShorFactor 1 common factor (GCD) the input state over the nicate any classical information it desires using a quantum interface -N:int of aValue and bValue. group G. The group is element. We argue, however, that using a quantum interface ele- set by subclass. +factor():int ment and messaging when classical would suffice is bad quantum ShorOrder Given an integer N, 1 software design, for the reasons stated above. find one of its prime -N:int QFT_n In summary, the guiding principles behind any quantum software factors. -a:int 1 modeling language must include the following: +or der Fi nd( ) : i nt Performs a quantum Obtain a finite order r Fourier transform on which is the smallest (1) (Quantum Classes): Whenever a software module makes the input state over the positive integer such group GF(2^n) use of quantum information, either as part of its internal that a^r = 1 mod N. state/implementation, or as part of its interface, this must be clearly established in a design document. (2) (Quantum Elements): Each module interface element (e.g. Figure 1: Q-UML class diagram of Shor’s Algorithm. Quan- public functions/methods, public variables) and internal state tum classes and interface elements are presented in bold variables can be either classical or quantum, and must be text, and quantum relationships use double-lines. labelled accordingly. (a) (Quantum Variables): Each variable should be labelled For attributes, the name will be bold if it is represented using as classical or quantum.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages3 Page
-
File Size-