skip to main content
research-article

Invariants of quantum programs: characterisations and generation

Authors Info & Claims
Published:01 January 2017Publication History
Skip Abstract Section

Abstract

Program invariant is a fundamental notion widely used in program verification and analysis. The aim of this paper is twofold: (i) find an appropriate definition of invariants for quantum programs; and (ii) develop an effective technique of invariant generation for verification and analysis of quantum programs.

Interestingly, the notion of invariant can be defined for quantum programs in two different ways -- additive invariants and multiplicative invariants -- corresponding to two interpretations of implication in a continuous valued logic: the Lukasiewicz implication and the Godel implication. It is shown that both of them can be used to establish partial correctness of quantum programs.

The problem of generating additive invariants of quantum programs is addressed by reducing it to an SDP (Semidefinite Programming) problem. This approach is applied with an SDP solver to generate invariants of two important quantum algorithms -- quantum walk and quantum Metropolis sampling. Our examples show that the generated invariants can be used to verify correctness of these algorithms and are helpful in optimising quantum Metropolis sampling.

To our knowledge, this paper is the first attempt to define the notion of invariant and to develop a method of invariant generation for quantum programs.

References

  1. D. Aharonov, A. Ambainis, J. Kempe and U. Vazirani, Quantum walks on graphs, In: Proc. of the 33rd ACM Symposium on Theory of Computing (STOC), 2001, pp. 50-59. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. J. Abhari, A. Faruque, M. Dousti, L. Svec, O. Catu, A. Chakrabati, C.-F. Chiang, S. Vanderwilt, J. Black, F. Chong, M. Martonosi, M. Suchara, K. Brown, M. Pedram and T. Brun, Scaffold: Quantum Programming Language, Technical Report TR-934-12, Dept. of Computer Science, Princeton University, 2012.Google ScholarGoogle Scholar
  3. A. Baltag and S. Smets, LQP: The dynamic logic of quantum information, Mathematical Structures in Computer Science, 16(2006)491- 525. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. O. Brunet and P. Jorrand, Dynamic quantum logic for quantum programs, International Journal of Quantum Information, 2(2004)45-54.Google ScholarGoogle ScholarCross RefCross Ref
  5. R. Chadha, P. Mateus and A. Sernadas, Reasoning about imperative quantum programs, Electronic Notes in Theoretical Computer Science, 158(2006)19-39. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Chakarov and S. Sankaranarayanan, Probabilistic program analysis with martingales, In: Proc. of the 25th International Conference Computer Aided Verification (CAV), 2013, Springer LNCS 8044, pp. 511-526.Google ScholarGoogle ScholarCross RefCross Ref
  7. K. Chatterjee, H. F. Fu, P. Novotn´y and R. Hasheminezhad, Algorithmic analysis of qualitative and quantitative termination problems for affine probabilistic programs, In: Proceedings of the 43rd ACM Symposium on Principles of Programming Languages (POPL), 2016, pp. 327-342 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. A. Col´on, S. Sankaranarayanan and H. B. Sipma, Linear invariant generation using non-linear constraint solving, In: Proc. of the 15th International Conference on Computer Aided Verification (CAV), 2003, Springer LNCS, pp. 420-433.Google ScholarGoogle ScholarCross RefCross Ref
  9. M. Col´on and H. Sipma, Synthesis of linear ranking functions, In: Proc. of the 7th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS), 2001, Springer LNCS 2031, pp. 67-81. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. P. Cousot and R. Cousot, Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints, In: Proceedings of the 4th ACM Symposium on Principles of Programming Languages (POPL), 1977, pp. 238-252. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. P. Cousot and N. Halbwachs, Automatic discovery of linear restraints among variables of a program, In: Proceedings of the 5th ACM Symposium on Principles of Programming Languages (POPL), 1978, pp. 84-96. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. H. Derksen and J. Weyman, Quiver representations, Notices of the American Mathematical Society, 52(2005)200-206.Google ScholarGoogle Scholar
  13. E. D’Hondt and P. Panangaden, Quantum weakest preconditions, Mathematical Structures in Computer Science, 16(2006)429-451. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Y. Feng, R. Y. Duan, Z. F. Ji and M. S. Ying, Proof rules for the correctness of quantum programs, Theoretical Computer Science, 386(2007)151-166. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Y. Feng, N. K. Yu and M. S. Ying, Model checking quantum Markov chains, Journal of Computer and System Sciences, 79(2013)1181- 1198.Google ScholarGoogle Scholar
  16. L. M. F. Fioriti and H. Hermanns, Probabilistic termination: Soundness, completeness, and compositionality, In: Proceedings of the 42nd ACM Symposium on Principles of Programming Languages (POPL), 2015, pp. 489-501. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. R. W. Floyd, Assigning meanings to programs, In: Proceedings of the Symposium on Mathematical Aspects of Computer Science, 1967, 19- 33.Google ScholarGoogle ScholarCross RefCross Ref
  18. S. Gay, Quantum programming languages: survey and bibliography, Mathematical Structures in Computer Science, 16(2006)581-600. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. S. Gay, R. Nagarajan, and N. Panaikolaou. QMC: A model checker for quantum systems, In: Proceedings of the 20th International Conference on Computer Aided Verification (CAV), 2008, Springer LNCS 5123, pp. 543-547. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. I.?M. Georgescu, S. Ashhab and F. Nori, Quantum simulation, Reviews of Modern Physics, 86(2014)153-185.Google ScholarGoogle ScholarCross RefCross Ref
  21. S. M. German and B. Wegbreit, A synthesiser of inductive assertions, IEEE Transactions on Software Engineering, 1(1975)68-75. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Grant and S. Boyd. CVX: Matlab software for disciplined convex programming, version 2.0 beta. http://cvxr.com/cvx, September 2013.Google ScholarGoogle Scholar
  23. A. S. Green, P. L. Lumsdaine, N. J. Ross, P. Selinger and B. Valiron, Quipper: A scalable quantum programming language, Proceedings of the 34th ACM Conference on Programming Language Design and Implementation (PLDI), 2013, pp. 333-342. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. F. Gretz, J. -P. Katoen and A. McIver, Prinsys - On a quest for probabilistic loop invariants, in: Proc. 10th International Conference on Quantitative Evaluation of Systems (QEST), 2013, Springer LNCS 8054, pp.193-208. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. Gudder, Quantum Markov chains, Journal of Mathematical Physics, 49(2008) art. no. 072105.Google ScholarGoogle Scholar
  26. S. Gulwani, S. Srivastava and R. Venkatesan, Program analysis as constraint solving, In: Proceedings of 29th ACM Conference on Programming Language Design and Implementation (PLDI), 2008, pp. 281- 292. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. A. Gupta and A. Rybalchenko, InvGen: an efficient invariant generator, Proceedings of the 21st International Conference on Computer Aided Verification (CAV), 2009, pp. 634-640. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. G. Gutoski and X. Wu, Parallel approximation of min-max problems with applications to classical and quantum zero-sum games, Computational Complexity, 22(2013) 385-428.Google ScholarGoogle Scholar
  29. I. Hasuo and N. Hoshino, Semantics of higher-order quantum computation via Geometry of Interaction, In: Proceedings of the 26th IEEE Symposium on Logic in Computer Science (LICS), 2011, 237-246. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Y. Kakutani, A logic for formal verification of quantum programs, in: Proceedings of the 13th Asian Computing Science Conference (ASIAN), 2009, Springer LNCS 5913, pp. 79-93. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. J. -P. Katoen, A. McIver, L. Meinicke and C. C. Morgan, Linearinvariant generation for probabilistic programs - Automated support for proof-based methods, in: Proc. 17th International Symposium on Static Analysis (SAS), 2010, Springer LNCS 6337, pp. 390-406. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. S. Katz and Z. Manna, Logical analysis of programs, Communications of the ACM, 19(1976)188-206. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. H. J. Keisler, Probability quantifiers, In: J. Barwise and S. Feferman (eds.), Model Theoretic Logics, Springer, 1985, pp. 509-556.Google ScholarGoogle Scholar
  34. N. Megiddo, A note on approximate linear programming, Information Processing Letters, 42(1992) 42-53. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. A. McIver and C. C. Morgan, Abstraction, Refinement and Proof of Probabilistic Systems, Springer, Heidelberg, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Y. J. Li, T. Liu, S. L. Wang, N. J. Zhan and M. S. Ying, A theorem prover for quantum Hoare logic and its applications, http://arxiv.org/pdf/1601.03835.pdfGoogle ScholarGoogle Scholar
  37. B. Ömer, Structured Quantum Programming, Ph.D thesis, Technical University of Vienna, 2003.Google ScholarGoogle Scholar
  38. M. Pagani, P. Selinger and B. Valiron, Applying quantitative semantics to higher-order quantum computing, In: Proceedings of 41st ACM Symposium on Principles of Programming Languages (POPL), 2014, pp. 647-658. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. N. Rescher, Many-Valued Logic, McGraw-Hill, 1969.Google ScholarGoogle Scholar
  40. J. W. Sanders and P. Zuliani, Quantum programming, In: Proceedings of 5th International Conference on Mathematics of Program Construction (MPC), 2000, Springer LNCS 1837, Springer pp. 88-99. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. S. Sankaranarayanan, H. B. Sipma and Z. Manna, Non-linear loop invariant generation using Gröbner bases, in: Proceedings of the 31st ACM Symposium on Principles of Programming Languages (POPL), 2004, pp. 318-329. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. P. Selinger, A brief survey of quantum programming languages, In: Proc. of 7th International Symposium on Functional and Logic Programming, 2004, Springer LNCS 2998, pp. 1-6.Google ScholarGoogle ScholarCross RefCross Ref
  43. P. Selinger, Towards a quantum programming language, Mathematical Structures in Computer Science 14, (2004) 527-586. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. M. J. Serna, Approximating linear programming is log-space complete for P, Information Processing Letters, 37(1991) 233-236. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Stanford Invariant Generator, http://theory.stanford.edu/ srirams/Software/sting.html.Google ScholarGoogle Scholar
  46. S. Staton, Algebraic effects, linearity, and quantum programming languages, In: Proceedings of 42nd ACM Symposium on Principles of Programming Languages (POPL), 2015, pp. 395-406. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. K. Temme, T. J. Osborne, K. G. Vollbrecht, D. Poulin, and F. Verstraete. Quantum Metropolis sampling. Nature, 471(2011) 87-90.Google ScholarGoogle Scholar
  48. D. Wecker and K. M. Svore, LIQUi |⟩: A software design architecture and domain-specific language for quantum computing, http://research.microsoft.com/pubs/209634/1402.4467.pdf.Google ScholarGoogle Scholar
  49. M. S. Ying, Floyd-hoare logic for quantum programs, ACM Transactions on Programming Languages and Systems, 33(2011) art no. 19, pp. 1-49. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. M. S. Ying, Foundations of Quantum Programming, Morgan-Kaufmann, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. M. S. Ying and Y. Feng, Quantum loop programs, Acta Informatica, 47(2010)221-250. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. M. S. Ying, Y. J. Li, N. K. Yu and Y. Feng, Model-checking linear-time properties of quantum systems, ACM Transactions on Computational Logic, 15(2014) art. no. 22. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. M. S. Ying, N. K. Yu, Y. Feng and R. Y. Duan, Verification of quantum programs, Science of Computer Programming, 78(2013)1679-1700.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Invariants of quantum programs: characterisations and generation

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!