Abstract
We introduce the notion of linear ranking super-martingale (LRSM) for quantum programs (with nondeterministic choices, namely angelic and demonic choices). Several termination theorems are established showing that the existence of the LRSMs of a quantum program implies its termination. Thus, the termination problems of quantum programs is reduced to realisability and synthesis of LRSMs. We further show that the realisability and synthesis problem of LRSMs for quantum programs can be reduced to an SDP (Semi-Definite Programming) problem, which can be settled with the existing SDP solvers. The techniques developed in this paper are used to analyse the termination of several example quantum programs, including quantum random walks and quantum Bernoulli factory for random number generation. This work is essentially a generalisation of constraint-based approach to the corresponding problems for probabilistic programs developed in the recent literature by adding two novel ideas: (1) employing the fundamental Gleason's theorem in quantum mechanics to guide the choices of templates; and (2) a generalised Farkas' lemma in terms of observables (Hermitian operators) in quantum physics.
Supplemental Material
- D. Aharonov, A. Ambainis, J. Kempe and U. Vazirani, Quantum walks on graphs, In: Proceedings of the 33rd ACM Symposium on Theory of Computing (STOC), 2001, 50-59. Google Scholar
Digital Library
- T. Altenkirch and J. Grattage, A functional quantum programming language, In: Proceedings of the 20th IEEE Symposium on Logic in Computer Science (LICS), 2005, 249-258. Google Scholar
Digital Library
- A. Baltag and S. Smets, LQP: The dynamic logic of quantum information, Mathematical Structures in Computer Science 16(2006)491-525. Google Scholar
Digital Library
- J. Barry, D. T. Barry and S. Aaronson, Quantum partially observable Markov decision processes, Physical Review A, 90(2014) art. no. 032311. Google Scholar
Cross Ref
- O. Bournez and F. Garnier, Proving positive almost-sure termination, In: Proceedingds of the 16th International Conference on Rewriting Techniques and Applications (RTA), 2005, Springer LNCS 3467, 323-337. Google Scholar
Digital Library
- A. R. Bradley, Z. Manna and H. B. Sipma, Linear ranking with reachability, In: Proceedings of the 17th International Conference on Computer Aided Verification (CAV), 2005, Springer LNCS 3576, 491-504. Google Scholar
Digital Library
- O. Brunet and P. Jorrand, Dynamic quantum logic for quantum programs, International Journal of Quantum Information, 2(2004)45-54. Google Scholar
Cross Ref
- R. Chadha, P. Mateus and A. Sernadas, Reasoning about imperative quantum programs, Electronic Notes in Theoretical Computer Science, 158(2006)19-39. Google Scholar
Digital Library
- A. Chakarov and S. Sankaranarayanan, Probabilistic program analysis with martingales, In: Proceedings of the 25th International Conference on Computer Aided Verification (CAV), 2013, Springer LNCS 8044, 511-526. Google Scholar
Digital Library
- K. Chatterjee, H. F. Fu, P. Novotný and R. Hasheminezhad, Algorithmic analysis of qualitative and quantitative termination problems for affine probabilistic programs, In: Proceedings of the 43rd Annual ACM Symposium on Principles of Programming Languages (POPL), 2016, 327-342. Google Scholar
Digital Library
- M. A. Colón and H. B. Sipma, Synthesis of linear ranking functions, In: Proceedings of the 7th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS), 2001, 67-81. Google Scholar
Cross Ref
- M. A. Colón, S. Sankaranarayanan and H. B. Sipma, Linear invariant generation using non-linear constraint solving, In: Proceedings of the 15th International Conference on Computer Aided Verification (CAV), 2003, Springer LNCS, 420-433. Google Scholar
Cross Ref
- H. Dale, D. Jennings and T. Rudolph, Provable quantum advantage in randomness processing, Nature Communications 6(2015), art. no. 8203. Google Scholar
Cross Ref
- H. Derksen and J. Weyman, Quiver representations, Notices of the American Mathematical Society 52 (2005) 200-206.Google Scholar
- A. Dvurečenskij, Gleason’s Theorem and Its Applications, Kluwer, 1993. Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- L. M. F. Fioriti and H. Hermanns, Probabilistic termination: soundness, completeness, and compositionality. In: Proceedings of the 42nd Annual ACM Symposium on Principles of Programming Languages (POPL), 2015, 489-501. Google Scholar
Digital Library
- R. W. Floyd, Assigning meanings to programs, In: Proceedings of the Symposium on Mathematical Aspects of Computer Science, 1967, 19-33. Google Scholar
Cross Ref
- F. G. Foster, On the stochastic matrices associated with certain queuing processes, The Annals of Mathematical Statistics 24(1953)355-360. Google Scholar
Cross Ref
- S. Gay, Quantum programming languages: survey and bibliography, Mathematical Structures in Computer Science 16(2006)581-600. Google Scholar
Digital Library
- 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), Springer LNCS 5123, 2008, 543-547. Google Scholar
Digital Library
- A. M. Gleason, Measures on the closed subspaces of a Hilbert space, Journal of Mathematics and Mechanics 6(1957)885-893. Google Scholar
Cross Ref
- A. S. Green, P. L. Lumsdaine, N. J. Ross, P. Selinger and B. Valiron, Quipper: A scalable quantum programming language, In: Proceedings of the 34th ACM Conference on Programming Language Design and Implementation (PLDI), 2013, 333-342. Google Scholar
Digital Library
- S. Gudder, Quantum Markov chains, Journal of Mathematical Physics 49(2008) art. no. 072105. Google Scholar
Cross Ref
- A. JavadiAbhari, 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 Scholar
- A. JavadiAbhari, S. Patil, D. Kudrow, J. Heckey, A. Lvov, F. T. Chong and M. Martonosi, ScaffCC: Scalable compilation and analysis of quantum programs, Parallel Computing, 45(2015)2-17. Google Scholar
Digital Library
- Y. Kakutani, A logic for formal verification of quantum programs, In: Proceedings of the 13th Asian Computing Science Conference (ASIAN 2009), Springer LNCS 5913, 79-93. Google Scholar
Digital Library
- B. L. Kaminski, J. Katoen, C. Matheja and F. Olmedo, Weakest precondition reasoning for expected run-times of probabilistic programs, In: Proceedings of the 25th European Symposium on Programming Languages and Systems (ESOP 2016), Springer LNCS 9632, 364-389. Google Scholar
Digital Library
- B. L. Kaminski and J. Katoen, A weakest pre-expectation semantics for mixed-sign expectations, In: Proceedings of the 32nd ACM/IEEE Symposium on Logic in Computer Science (LICS 2017), 1-12. Google Scholar
Cross Ref
- M. S. Keane and G. L. O’Brien, A Bernoulli factory, ACM Transactions on Modelling and Computer Simulation 4(1994) 213-219. Google Scholar
Digital Library
- Y. J. Li, N. K. Yu and M. S. Ying, Termination of nondeterministic quantum programs, Acta Informatica 51(2015)1-24. Google Scholar
Digital Library
- T. Liu, Y. J. Li, 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 Scholar
- G. Mitchison and R. Jozsa, Counterfactual computation, Proceedings of the Royal Society of London A 457(2001)1175-1193. Google Scholar
Cross Ref
- F. Olmedo, B. L. Kaminski, J. Katoen and C. Matheja, Reasoning about recursive probabilistic programs, In: Proceedings of the 31st ACM/IEEE Symposium on Logic in Computer Science (LICS 2016), 672-681. Google Scholar
Digital Library
- B. Ömer, Structured Quantum Programming, Ph.D thesis, Technical University of Vienna, 2003.Google Scholar
- J. Paykin, R. Rand and S. Zdancewic, QWIRE: a core language for quantum circuits, In: Proceedings of 44th ACM Symposium on Principles of Programming Languages (POPL), 2017, 846-858. Google Scholar
Digital Library
- A. Podelski and A. Rybalchenko, A complete method for the synthesis of linear ranking functions, In: Proceedings of the 5th International Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI), 2004, 239-251. Google Scholar
Cross Ref
- A. Rybalchenko, Constraint solving for program verification: theory and practice by example, In:Proceedings of the 22nd International Conference on Computer Aided Verification (CAV), 2010, 57-71. Google Scholar
Digital Library
- A Sabry, Modelling quantum computing in Haskell, Proceedings of the 2003 ACM SIGPLAN workshop on Haskell, 39-49.Google Scholar
- J. W. Sanders and P. Zuliani, Quantum programming, In: Proceedings of 5th International Conference on Mathematics of Program Construction (MPC), Springer LNCS 1837, Springer 2000, 88-99.Google Scholar
Cross Ref
- P. Seinger, A brief survey of quantum programming languages, In: Proc. of 7th International Symposium on Functional and Logic Programming, Springer LNCS 2998, 2004, 1-6.Google Scholar
- P. Selinger, Towards a quantum programming language, Mathematical Structures in Computer Science 14 (2004), 527-586. Google Scholar
Digital Library
- 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 Scholar
- M. S. Ying, Floyd-hoare logic for quantum programs, ACM Transactions on Programming Languages and Systems 33(2011), 1-49. Google Scholar
Digital Library
- M. S. Ying, Foundations of Quantum Programming, Morgan-Kaufmann, 2016.Google Scholar
Digital Library
- M. S. Ying and Y. Feng, Quantum loop programs, Acta Informatica 47 (2010), 221-250. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- M. S. Ying, S. G. Ying and X. D. Wu, Invariants of quantum programs: characterisations and generation, In: Proceedings of the 44th ACM Symposium on Principles of Programming Languages (POPL), 2017, 818-832. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- S. G. Ying, Y. Feng, N. K. Yu and M. S. Ying, Reachability probabilities of quantum Markov chains, In: Proceedings of the 24th International Conference on Concurrency Theory (CONCUR), 2013, 334-348. Google Scholar
Digital Library
- S. G. Ying and M. S. Ying, Reachability analysis of quantum Markov decision processes, arXiv:1406.6146Google Scholar
- N. K. Yu and M. S. Ying, Reachability and termination analysis of concurrent quantum programs, In: Proceedings of the 23th International Conference on Concurrency Theory (CONCUR), 2012, 69-83. Google Scholar
Digital Library
- P. Zuliani, Nondeterministic quantum programming, In: Proceedings of the 2nd International Workshop on Quantum Programming Languages (QPL), 2004, 179-195.Google Scholar
Index Terms
Algorithmic analysis of termination problems for quantum programs
Recommendations
Relational proofs for quantum programs
Relational verification of quantum programs has many potential applications in quantum and post-quantum security and other domains. We propose a relational program logic for quantum programs. The interpretation of our logic is based on a quantum ...
Quantum Weakest Preconditions for Reasoning about Expected Runtimes of Quantum Programs
LICS '22: Proceedings of the 37th Annual ACM/IEEE Symposium on Logic in Computer ScienceWe study expected runtimes for quantum programs. Inspired by recent work on probabilistic programs, we first define expected runtime as a generalisation of quantum weakest precondition. Then, we show that the expected runtime of a quantum program can ...
Ket Quantum Programming
Quantum programming languages (QPL) fill the gap between quantum mechanics and classical programming constructions, simplifying the development of quantum applications. However, most QPL addresses the inherent quantum programming problem, neglecting ...






Comments