Realizability in the Unitary Sphere Alejandro Díaz-Caro, Mauricio Guillermo, Alexandre Miquel, Benoît Valiron
Total Page:16
File Type:pdf, Size:1020Kb
View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Archive Ouverte en Sciences de l'Information et de la Communication Realizability in the Unitary Sphere Alejandro Díaz-Caro, Mauricio Guillermo, Alexandre Miquel, Benoît Valiron To cite this version: Alejandro Díaz-Caro, Mauricio Guillermo, Alexandre Miquel, Benoît Valiron. Realizability in the Unitary Sphere. 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS 2019), Jun 2019, Vancouver, Canada. hal-02175168 HAL Id: hal-02175168 https://hal.archives-ouvertes.fr/hal-02175168 Submitted on 5 Jul 2019 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Realizability in the Unitary Sphere Alejandro D´ıaz-Caro∗y, Mauricio Guillermoz, Alexandre Miquelz, and Benoˆıt Valironx ∗Universidad Nacional de Quilmes, Bernal, Buenos Aires, Argentina yInstituto de Ciencias de la Computacion´ (UBA-CONICET), Buenos Aires, Argentina Email: [email protected] zFacultad de Ingenier´ıa, Universidad de la Republica,´ Montevideo, Uruguay Email: fmguille,amiquelg@fing.edu.uy xLRI, CentraleSupelec,´ Universite´ Paris-Saclay, Orsay, France Email: [email protected] Abstract—In this paper we present a semantics for a linear operations, akin to Boolean gates, are referred to as quantum algebraic lambda-calculus based on realizability. This semantics gates, and they can be combined into linear sequences called characterizes a notion of unitarity in the system, answering a long quantum circuits. Quantum algorithms make use of a quantum standing issue. We derive from the semantics a set of typing rules for a simply-typed linear algebraic lambda-calculus, and show memory to solve a particular classical problem. Such an how it extends both to classical and quantum lambda-calculi. algorithm therefore consists in particular in the description of a quantum circuit. I. INTRODUCTION Several existing languages for describing quantum algo- The linear-algebraic lambda calculus (Lineal) [1]–[3] is an rithms such as Quipper [5] and QWIRE [6] are purely func- extension of the lambda calculus where lambda terms are tional and based on the lambda calculus. However, they only closed under linear combinations over a semiring K. For provide classical control: the quantum memory and the al- instance, if t and r are two lambda terms, then so is α:t + β:r lowed operations are provided as black boxes. These languages with α; β 2 K. The original motivation of [1] for such a are mainly circuit description languages using opaque high- calculus was to set the basis for a future quantum calculus, level operations on circuits. They do not feature quantum where α:t + β:r could be seen as the generalization of the control, in the sense that the operations on quantum data are notion of quantum superposition to the realm of programs (in not programmable. A lambda calculus with linear combinations of terms made which case K is the field C of complex numbers). In quantum computation, data is encoded in the state of a “quantum” would allow to program those “black boxes” set of particles governed by the laws of quantum mechanics. explicitly, and provide an operational meaning to quantum The mathematical formalization postulates that quantum data control. However, when trying to identify quantum data with is modeled as a unit vector in a Hilbert space. The quantum linear combinations of lambda terms, the problem arises analogue to a Boolean value is the quantum bit, that is a linear from the norm condition on quantum superpositions. To be combination of the form φ = αj0i + βj1i, where j0i and j1i quantum-compatible, one cannot have any linear combination respectively correspond to “true” and “false”, and where jαj2+ of programs. Indeed, programs should at the very least yield jβj2 = 1. In other words, the state φ is a linear combination valid quantum superpositions, that is: linear combinations whose l -norm equals 1—a property which turns out to be of the Boolean values “true” and “false”, of l2-norm equal to 2 2 very difficult to preserve along the reduction of programs. 1: it is a unit-vector in the Hilbert space C . A quantum memory consists in a list of registers holding So far, the several attempts at accommodating linear al- quantum bits. The canonical model for interacting with a gebraic lambda calculi with the l2-norm have failed. At one quantum memory is the QRAM model [4]. A fixed set of end of the spectrum, [7] stores lambda terms directly in the elementary operations are allowed on each quantum register. quantum memory, and encodes the reduction process as a Mathematically, these operations are modeled with unitary purely quantum process. Van Tonder shows that this forces maps on the corresponding Hilbert spaces, that is: linear all lambda terms in superposition to be mostly equivalent. At the other end of the spectrum, the linear algebraic approaches maps preserving the l2-norm and the orthogonality. These pioneered by Arrighi and Dowek consider a constraint-free A. D´ıaz-Caro and B. Valiron have been partially supported by PICT calculus and try to recover quantum-like behavior by adding 2015-1208, ECOS-Sud A17C03, and the French-Argentinian International ad-hoc term reductions [1] or type systems [8]–[10]. But if Laboratory SINFIN. B. Valiron has been partially supported by the French National Research Agency (ANR) under the research project SoftQPRO ANR- these approaches yield very expressive models of computa- 17-CE25-0009-02, and by the DGE of the French Ministry of Industry under tions, none of them is managing to precisely characterize linear the research project PIA-GDN/QuantEx P163746-484124. M. Guillermo and combinations of terms of unit l2-norm, or equivalently, the A. Miquel have been partially supported by the Uruguayan National Research & Innovation Agency (ANII) under the research project “Realizability, Forcing unitarity of the representable maps. and Quantum Computing”, FCE 1 2014 1 104800. This paper answers this question by presenting an algebraic lambda calculus together with a type system that enforces represent probabilistic distributions of terms. Also, a simpli- unitarity. For that, we use semantic techniques coming from fication of Lineal, without scalars, can serve as a model for realizability [11] to decide on the unitarity of terms. non-deterministic computations [13]. And, in general, if we Since its creation by Kleene as a semantics for Heyting consider the standard values of the lambda calculus as the arithmetic, realizability has evolved to become a versatile basis, then linear combinations of those form a vector space, toolbox, that can be used both in logic and in functional which can be characterized using types [9]. In [14] a similar programming. Roughly speaking, realizability can be seen as distinction between classical bits (B) and qbits (]B) has been a generalization of the notion of typing where the relation also studied. However, without unitarity, it is impossible to between a term and its type is not defined from a given set of obtain a calculus that could be compiled onto a quantum inference rules, but from the very operational semantics of the machine. Finally, a concrete categorical semantics for such calculus, via a computational interpretation of types seen as a calculus has been recently given in [15]. specifications. Types are first defined as sets of terms verifying An alternative approach for capturing unitarity (of data certain properties, and then, valid typing rules are derived from superpositions and functions) consists to change the language. these properties rather than set up as axioms. Instead of starting with a lambda calculus, [16] defines and The main feature of our realizability model is that types extends a reversible language to express quantum computation. are not interpreted as arbitrary sets of terms or values, but as Lambda calculi with vectorial structures are not specific to subsets of the unit sphere of a particular weak vector space [3], quantum computation. Vaux [17] independently developed the whose vectors are distributions (i.e. weak linear combinations) algebraic lambda calculus (where linear combinations of terms of “pure” values. So that by construction, all functions that are are also terms), initially to study a fragment of the differential correct w.r.t. this semantics preserve the `2-norm. As we shall lambda calculus of [18]. Unlike its quantum-inspired cousin see, this interpretation of types is not only compatible with the Lineal, the algebraic lambda calculus is morally call-by-name, constructions of the simply typed lambda calculus (with sums and [19] shows the formal connection with Lineal. and pairs), but it also allows us to distinguish pure data types Designing an (unconstrainted) algebraic lambda calculus (in (such as the type B of pure Booleans) from quantum data types call-by-name [17] or in call-by-value [1]) raises the problem (such as the type ]B of quantum Booleans). Thanks to these of how to enforce the confluence of reduction. Indeed, if the constraints, the type system we obtain naturally enforces that semi-ring K is a ring, since 0 · t = ~0, it is possible to design a the realizers of the type ]B ! ]B are precisely the functions term Yt reducing both to t and the empty linear combination 2 ~ representing unitary operators of C . 0. A simple solution to recover consistency is to weaken the This realizability model is therefore answering a hard prob- vectorial structure and remove the equality 0 · t = ~0 [3].