Reasoning about Recursive Quantum Programs

Most modern (classical) programming languages support recursion. Recursion has also been successfully applied to the design of several quantum algorithms and introduced in a couple of quantum programming languages. So, it can be expected that recursion will become one of the fundamental paradigms of quantum programming. Several program logics have been developed for verification of quantum while-programs. However, there are as yet no general methods for reasoning about (mutual) recursive procedures and ancilla quantum data structure in quantum computing (with measurement). We fill the gap in this paper by proposing a parameterized quantum assertion logic and, based on which, designing a quantum Hoare logic for verifying parameterized recursive quantum programs with ancilla data and probabilistic control. The quantum Hoare logic can be used to prove partial, total, and even probabilistic correctness (by reducing to total correctness) of those quantum programs. In particular, two counterexamples for illustrating incompleteness of non-parameterized assertions in verifying recursive procedures, and, one counterexample for showing the failure of reasoning with exact probabilities based on partial correctness, are constructed. The effectiveness of our logic is shown by three main examples -- recursive quantum Markov chain (with probabilistic control), fixed-point Grover's search, and recursive quantum Fourier sampling.

[1]  Yuan Feng,et al.  Model checking quantum Markov chains , 2012, J. Comput. Syst. Sci..

[2]  Yuan Feng,et al.  Reachability Analysis of Recursive Quantum Markov Chains , 2013, MFCS.

[3]  E. Prugovec̆ki,et al.  Quantum Mechanics In Hilbert Space , 1971 .

[4]  Krysta Marie Svore,et al.  LIQUi|>: A Software Design Architecture and Domain-Specific Language for Quantum Computing , 2014, ArXiv.

[5]  E. Axelsson Computability and Logic , 2008 .

[6]  Lijun Zhang,et al.  QPMC: A Model Checker for Quantum Programs and Protocols , 2015, FM.

[7]  Jan A. Bergstra,et al.  Expressiveness and the Completeness of Hoare's Logic , 1982, J. Comput. Syst. Sci..

[8]  Stephen A. Cook,et al.  Soundness and Completeness of an Axiom System for Program Verification , 1978, SIAM J. Comput..

[9]  Patrick Lincoln,et al.  Linear logic , 1992, SIGA.

[10]  Yuan Feng,et al.  Model-Checking Linear-Time Properties of Quantum Systems , 2010, TOCL.

[11]  Robert W. Floyd,et al.  Assigning Meanings to Programs , 1993 .

[12]  David Jennings,et al.  Provable quantum advantage in randomness processing , 2015, Nature Communications.

[13]  Joost-Pieter Katoen,et al.  On the hardness of analyzing probabilistic programs , 2018, Acta Informatica.

[14]  Joost-Pieter Katoen,et al.  Quantitative separation logic: a logic for reasoning about probabilistic pointer programs , 2018, Proc. ACM Program. Lang..

[15]  Joost-Pieter Katoen,et al.  Weakest Precondition Reasoning for Expected Runtimes of Randomized Algorithms , 2018, J. ACM.

[16]  Li Zhou,et al.  Coupling Techniques for Reasoning about Quantum Programs , 2019, ArXiv.

[17]  Peter Selinger,et al.  Towards a quantum programming language , 2004, Mathematical Structures in Computer Science.

[18]  Ugo Dal Lago,et al.  Ju n 20 14 Probabilistic Recursion Theory and Implicit Complexity ∗ , 2014 .

[19]  Martin Rötteler,et al.  Q#: Enabling Scalable Quantum Computing and Development with a High-level DSL , 2018, RWDSL2018.

[20]  Jonathan Grattage A functional quantum programming language , 2005, 20th Annual IEEE Symposium on Logic in Computer Science (LICS' 05).

[21]  Prakash Panangaden,et al.  Quantum Alternation: Prospects and Problems , 2015, QPL.

[22]  Juliana Kaizer Vizzotto,et al.  From Symmetric Pattern-Matching to Quantum Control , 2018, FoSSaCS.

[23]  Olivier Brunet,et al.  Dynamic Quantum Logic for Quantum Programs , 2003 .

[24]  J GaySimon,et al.  Quantum programming languages: survey and bibliography , 2006 .

[25]  Mingsheng Ying,et al.  Algorithmic analysis of termination problems for quantum programs , 2017, Proc. ACM Program. Lang..

[26]  Sriram Sankaranarayanan,et al.  Probabilistic Program Analysis with Martingales , 2013, CAV.

[27]  Mingsheng Ying,et al.  Floyd--hoare logic for quantum programs , 2011, TOPL.

[28]  Yuan Feng,et al.  Proof rules for the correctness of quantum programs , 2007, Theor. Comput. Sci..

[29]  Lov K. Grover,et al.  Fixed-point quantum search. , 2005, Physical review letters.

[30]  Jennifer Paykin,et al.  QWIRE: a core language for quantum circuits , 2017, POPL.

[31]  Benoît Valiron,et al.  Quipper: a scalable quantum programming language , 2013, PLDI.

[32]  Amr Sabry,et al.  Modeling quantum computing in Haskell , 2003, Haskell '03.

[33]  Mingsheng Ying,et al.  Foundations of Quantum Programming , 2016 .

[34]  Theodore J. Yoder,et al.  Fixed-point quantum search with an optimal number of queries. , 2014, Physical review letters.

[35]  Rohit Chadha,et al.  Reasoning About Imperative Quantum Programs , 2006, MFPS.

[36]  C. A. R. Hoare,et al.  Procedures and parameters: An axiomatic approach , 1971, Symposium on Semantics of Algorithmic Languages.

[37]  B. Valiron,et al.  Quantum computations without definite causal structure , 2009, 0912.0195.

[38]  G. Chiribella Perfect discrimination of no-signalling channels via quantum superposition of causal structures , 2011, 1109.5154.

[39]  Thierry Paul,et al.  Quantum computation and quantum information , 2007, Mathematical Structures in Computer Science.

[40]  Ugo Dal Lago,et al.  On the Termination Problem for Probabilistic Higher-Order Recursive Programs , 2018, 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[41]  Jeff W. Sanders,et al.  Quantum Programming , 2000, MPC.

[42]  Lauretta O. Osho,et al.  Axiomatic Basis for Computer Programming , 2013 .

[43]  Yoshihiko Kakutani,et al.  A Logic for Formal Verification of Quantum Programs , 2009, ASIAN.

[44]  Li Zhou,et al.  An applied quantum Hoare logic , 2019, PLDI.

[45]  Shaopeng Zhu,et al.  Quantitative robustness analysis of quantum programs , 2018, Proc. ACM Program. Lang..

[46]  Umesh V. Vazirani,et al.  Quantum complexity theory , 1993, STOC.

[47]  Dominique Unruh,et al.  Quantum Hoare Logic with Ghost Variables , 2019, 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[48]  Joost-Pieter Katoen,et al.  Reasoning about Recursive Probabilistic Programs* , 2016, 2016 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[49]  Robert Rand,et al.  Verification Logics for Quantum Programs , 2019, ArXiv.

[50]  Annabelle McIver,et al.  A new proof rule for almost-sure termination , 2017, Proc. ACM Program. Lang..

[51]  Kousha Etessami,et al.  Recursive Markov chains, stochastic grammars, and monotone systems of nonlinear equations , 2005, JACM.

[52]  Ugo Dal Lago,et al.  On Higher-Order Probabilistic Subrecursion , 2017, FoSSaCS.

[53]  Ugo Dal Lago,et al.  Probabilistic Recursion Theory and Implicit Computational Complexity , 2014, Sci. Ann. Comput. Sci..

[54]  Chen-Fu Chiang,et al.  Scaffold: Quantum Programming Language , 2012 .

[55]  Bohua Zhan,et al.  Formal Verification of Quantum Algorithms Using Quantum Hoare Logic , 2019, CAV.

[56]  Benjamin Grégoire,et al.  An Assertion-Based Program Logic for Probabilistic Programs , 2018, ESOP.

[57]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[58]  Prakash Panangaden,et al.  Quantum weakest preconditions , 2005, Mathematical Structures in Computer Science.

[59]  Frank S. de Boer,et al.  Verification of Sequential and Concurrent Programs , 1997, Texts and Monographs in Computer Science.

[60]  Simon J. Gay,et al.  Quantum Programming Languages Survey and Bibliography , 2006 .

[61]  Krishnendu Chatterjee,et al.  Algorithmic analysis of qualitative and quantitative termination problems for affine probabilistic programs , 2015, POPL.

[62]  Lov K. Grover A fast quantum mechanical algorithm for database search , 1996, STOC '96.

[63]  Alexandru Baltag,et al.  Quantum logic as a dynamic logic , 2011, Synthese.

[64]  Eric Bach,et al.  One-dimensional quantum walks with absorbing boundaries , 2004, J. Comput. Syst. Sci..

[65]  Xiaodi Wu,et al.  Invariants of quantum programs: characterisations and generation , 2017, POPL.

[66]  Dominique Unruh,et al.  Quantum relational Hoare logic , 2018, Proc. ACM Program. Lang..

[67]  Matthew McKague,et al.  Interactive proofs with efficient quantum prover for recursive Fourier sampling , 2010, Chic. J. Theor. Comput. Sci..

[68]  Krzysztof R. Apt,et al.  Ten Years of Hoare's Logic: A Survey—Part I , 1981, TOPL.

[69]  Peter W. Shor,et al.  Algorithms for quantum computation: discrete logarithms and factoring , 1994, Proceedings 35th Annual Symposium on Foundations of Computer Science.

[70]  Rajagopal Nagarajan,et al.  QMC: A Model Checker for Quantum Systems , 2007, CAV.