Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Termination and Universal Termination Problems for Nondeterministic Quantum Programs

Published: 05 December 2024 Publication History

Abstract

Verifying quantum programs has attracted a lot of interest in recent years. In this article, we consider the following two categories of termination problems of quantum programs with nondeterminism, namely:
(1)
(termination) Is an input of a program terminating with probability one under all schedulers? If not, how can a scheduler be synthesized to evidence the nontermination?
(2)
(universal termination) Are all inputs terminating with probability one under their respective schedulers? If yes, a further question asks whether there is a scheduler that forces all inputs to be terminating with probability one together with how to synthesize it; otherwise, how can an input be provided to refute the universal termination?
For the effective verification of the first category, we over-approximate the reachable set of quantum program states by the reachable subspace, whose algebraic structure is a linear space. On the other hand, we study the set of divergent states from which the program terminates with probability zero under some scheduler. The divergent set also has an explicit algebraic structure. Exploiting these explicit algebraic structures, we address the decision problem by a necessary and sufficient condition, i.e., the disjointness of the reachable subspace and the divergent set. Furthermore, the scheduler synthesis is completed in exponential time, whose bottleneck lies in computing the divergent set reported for the first time.
For the second category, we reduce the decision problem to the existence of an invariant subspace, from which the program terminates with probability zero under all schedulers. The invariant subspace is characterized by linear equations and thus can be efficiently computed. The states on that invariant subspace are evidence of the nontermination. Furthermore, the scheduler synthesis is completed by seeking a pattern of finite schedulers that forces all inputs to be terminating with positive probability. The repetition of that pattern yields the desired universal scheduler that forces all inputs to be terminating with probability one. All the problems in the second category are shown, also for the first time, to be solved in polynomial time. Finally, we demonstrate the aforementioned methods via a running example—the quantum Bernoulli factory protocol.

References

[1]
Sheshansh Agrawal, Krishnendu Chatterjee, and Petr Novotný. 2018. Lexicographic Ranking Supermartingales: An Efficient Approach to Termination of Probabilistic Programs. Proceedings of the ACM on Programming Languages 2, POPL (2018), Article 34, 32 pages.
[2]
Shaukat Ali, Tao Yue, and Rui Abreu. 2022. When Software Engineering Meets Quantum Computing. Communications of the ACM 65, 4 (2022), 84–88.
[3]
Thorsten Altenkirch and Jonathan Grattage. 2005. A Functional Quantum Programming Language. In Proceedings of the 20th IEEE Symposium on Logic in Computer Science (LICS ’05). IEEE Computer Society, 249–258.
[4]
Martin Avanzini, Georg Moser, Romain Péchoux, Simon Perdrix, and Vladimir Zamdzhiev. 2022. Quantum Expectation Transformers for Cost Analysis. In Proceedings of the 37th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS ’22). Christel Baier and Dana Fisman (Eds.), ACM, New York, NY, Article 10, 13 pages.
[5]
Christel Baier and Joost-Pieter Katoen. 2008. Principles of Model Checking. MIT Press, Cambridge, MA.
[6]
Gilles Barthe, Thomas Espitau, Marco Gaboardi, Benjamin Grégoire, Justin Hsu, and Pierre-Yves Strub. 2018. An Assertion-Based Program Logic for Probabilistic Programs. In Proceedings of the 27th European Symposium on Programming (ESOP ’18), the European Joint Conferences on Theory and Practice of Software (ETAPS ’18). Amal Ahmed (Ed.), LNCS, Vol. 10801, Springer, Berlin, 117–144.
[7]
Saugata Basu, Richard Pollack, and Marie-Françoise Roy. 2006. Algorithms in Real Algebraic Geometry (2nd ed.). Springer, Berlin.
[8]
Kevin Batz, Tom J. Biskup, Joost-Pieter Katoen, and Tobias Winkler. 2024. Programmatic Strategy Synthesis: Resolving Nondeterminism in Probabilistic Programs. Proceedings of the ACM on Programming Languages 8, POPL (2024), 2792–2820.
[9]
Amir M. Ben-Amram and Samir Genaim. 2014. Ranking Functions for Linear-Constraint Loops. Journal of the ACM 61, 4 (2014), Article 26, 55 pages.
[10]
Aleksandar Chakarov and Sleksandar Sankaranarayanan. 2013. Probabilistic Program Analysis with Martingales. In Proceedings of the 25th International Conference, (CAV ’13). Natasha Sharygina and Helmut Veith (Eds.), LNCS, Vol. 8044, Springer, Berlin, 511–526.
[11]
Krishnendu Chatterjee, Hongfei Fu, and Amir K. Goharshady. 2016. Termination Analysis of Probabilistic Programs through Positivstellensatz’s. In Computer Aided Verification, Proceedings of the 28th International Conference on Computer Aided Verification (CAV ’16). Swarat Chaudhuri and Azadeh Farzan (Eds.), LNCS, Vol. 9779, Springer, Berlin, 3–22.
[12]
Isaac L. Chuang, Neil A. Gershenfeld, and Mark Kubinec. 1998. Experimental Implementation of Fast Quantum Searching. Physical Review Letters 80 (1998), 3408–3411.
[13]
E. M. Clarke, E. A. Emerson, and A. P. Sistla. 1986. Automatic Verification of Finite-State Concurrent Systems Using Temporal Logic Specifications. ACM Transactions on Programming Languages and Systems 8, 2 (1986), 244–263.
[14]
Patrick Cousot and Radhia Cousot. 1977. 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, Robert M. Graham, Michael A. Harrison, and Ravi Sethi (Eds.). ACM, New York, 238–252.
[15]
Christian Dehnert, Sebastian Junges, Joost-Pieter Katoen, and Matthias Volk. 2017. A Storm is Coming: A Modern Probabilistic Model Checker. In Proceedings of the 29th International Conference on Computer Aided Verification (CAV ’17). Rupak Majumdar and Viktor Kuncak (Eds.), Springer, Berlin, 592–600.
[16]
Ellie D’Hondt and Prakash Panangaden. 2006. Quantum Weakest Preconditions. Mathematical Structures in Computer Science 16, 3 (2006), 429–451.
[17]
Edsger W. Dijkstra. 1976. A Discipline of Programming. Prentice-Hall, New York.
[18]
Wang Fang and Mingsheng Ying. 2024. Symbolic Execution for Quantum Error Correction Programs. Proceedings of the ACM on Programming Languages 8, PLDI (2024), 1040–1065.
[19]
Yuan Feng, Runyao Duan, Zheng-Feng Ji, and Mingsheng Ying. 2007. Proof Rules for the Correctness of Quantum Programs. Theoretical Computer Science 386, 1–2 (2007), 151–166.
[20]
Yuan Feng and Sanjiang Li. 2023. Abstract Interpretation, Hoare Logic, and Incorrectness Logic for Quantum Programs. Information and Computation 294 (2023), Article 105077, 22 pages.
[21]
Yuan Feng and Yingte Xu. 2023. Verification of Nondeterministic Quantum Programs. In Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Vol. 3. Tor M. Aamodt, Natalie D. Enright Jerger, and Michael M. Swift (Eds.), ACM, New York, NY, 789–805.
[22]
Yuan Feng and Mingsheng Ying. 2021. Quantum Hoare Logic with Classical Variables. ACM Transactions on Quantum Computing 2, 4, Article 16 (2021), 43 pages.
[23]
Yuan Feng, Nengkun Yu, and Mingsheng Ying. 2013. Model Checking Quantum Markov Chains. Journal of Computer and System Sciences 79, 7 (2013), 1181–1198.
[24]
Luis M. F. Fioriti and Holger Hermanns. 2015. Probabilistic Termination: Soundness, Completeness, and Compositionality. In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’15). Sriram. K. Rajamani and David Walker (Eds.), ACM, New York, NY, 489–501.
[25]
Hongfei Fu and Krishnendu Chatterjee. 2019. Termination of Nondeterministic Probabilistic Programs. In Verification, Model Checking, and Abstract Interpretation - Proceedings of the 20th International Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI ’19). Constantin Enea and Ruzica Piskac (Eds.), LNCS, Vol. 11388, Springer, Berlin, 468–490.
[26]
Google. 2018. Cirq: A Python Library for Writing, Manipulating, and Optimizing Quantum Circuits and Running Them against Quantum Computers and Simulators. Retrieved from https://github.com/quantumlib/Cirq
[27]
Ji Guan, Yuan Feng, Andrea Turrini, and Mingsheng Ying. 2024. Measurement-Based Verification of Quantum Markov Chains. In Proceedings of the 36th International Conference on Computer Aided Verification (CAV ’24). Arie Gurfinkel and Vijay Ganesh (Eds.), LNCS, Vol. 14683, Springer, Berlin, 533–554.
[28]
Jifeng He, Karen Seidel, and Annabelle McIver. 1997. Probabilistic Models for the Guarded Command Language. Science of Computer Programming 28, 2–3 (1997), 171–192.
[29]
Nils Herrmann, Daanish Arya, Marcus W. Doherty, Angus Mingare, Jason C. Pillay, Florian Preis, and Stefan Prestel. 2023. Quantum Utility—Definition and Assessment of a Practical Quantum Advantage. In Proceedings of the IEEE International Conference on Quantum Software (QSW). IEEE Computer Society, 162–174.
[30]
C. A. R. Hoare. 1969. An Axiomatic Basis for Computer Programming. Communications of the ACM 12, 10 (1969), 576–580.
[31]
IBM. 2020. Qiskit: An Open-Source SDK for Working with Quantum Computers at the Level of Pulses, Circuits, and Algorithms. Retrieved from https://github.com/QISKit
[32]
IBM. 2023. IBM Debuts Next-Generation Quantum Processor & IBM Quantum System Two, Extends Roadmap to Advance Era of Quantum Utility. Retrieved from https://newsroom.ibm.com/
[33]
Vasile I. Istrǎţescu. 2001. Fixed Point Theory: An Introduction. Springer, Berlin.
[34]
Hui Jiang, Jianling Fu, Ming Xu, Yuxin Deng, and Zhi-Bin Li. 2024. A Sample-Driven Solving Procedure for the Repeated Reachability of Quantum Continuous-Time Markov Chains. In Proceedings of the 27th ACM International Conference on Hybrid Systems: Computation and Control (HSCC ’24). ACM, New York, NY, Article 9, 12 pages.
[35]
Jiaqing Jiang, Jialin Zhang, and Xiaoming Sun. 2018. Quantum-to-Quantum Bernoulli Factory Problem. Physical Review A 97, 3 (2018), Article 032303, 6 pages.
[36]
Karuna Kadian, Sunita Garhwal, and Ajay Kumar. 2021. Quantum Walk and Its Application Domains: A Systematic Review. Computer Science Review 41 (2021), Article 100419, 52 pages.
[37]
Benjamin L. Kaminski and Joost-Pieter Katoen. 2015. On the Hardness of Almost-Sure Termination. In Proceedings of the 40th International Symposium on Mathematical Foundations of Computer Science (MFCS ’15). Giuseppe F. Italiano, Giovanni Pighizzini, and Donald Sannella (Eds.), LNCS, Vol. 9234, Springer, Berlin, 307–318.
[38]
Benjamin L. Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Federico Olmedo. 2016. Weakest Precondition Reasoning for Expected Run-Times of Probabilistic Programs. In Proceedings of the 25th European Symposium on Programming (ESOP ’16). Peter Thiemann (Ed.), LNCS, Vol. 9632, Springer, Berlin, 364–389.
[39]
Benjamin L. Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Federico Olmedo. 2018. Weakest Precondition Reasoning for Expected Runtimes of Randomized Algorithms. Journal of the ACM 65, 5 (2018), Article 30, 68 pages.
[40]
Joost-Pieter Katoen, Friedrich Gretz, Nils Jansen, Benjamin L. Kaminski, and Federico Olmedo. 2015. Understanding Probabilistic Programs. In Correct System Design. Roland Meyer, André Platzer, and Heike Wehrheim (Eds.), LNCS, Vol. 9360, Springer, Berlin, 15–32.
[41]
M. S. Keane and George L. O’Brien. 1994. A Bernoulli Factory. ACM Transactions on Modeling and Computer Simulation 4, 2 (1994), 213–219.
[42]
Dexter Kozen. 1979. Semantics of Probabilistic Programs. In Proceedings of the 20th Annual Symposium on Foundations of Computer Science. IEEE Computer Society, 101–114.
[43]
Dexter Kozen. 1983. A Probabilistic PDL. In Proceedings of the 15th Annual ACM Symposium on Theory of Computing. David S. Johnson, Ronald Fagin, Michael L. Fredman, David Harel, Richard M. Karp, Nancy A. Lynch, Christos H. Papadimitriou, Ronald L. Rivest, Walter L. Ruzzo, and Joel I. Seiferas (Eds.). ACM, New York, NY, 291–297.
[44]
Marta Kwiatkowska, Gethin Norman, and David Parker. 2011. PRISM 4.0: Verification of Probabilistic Real-Time Systems. In Computer Aided Verification: Proceedings of the 23rd International Conference on Computer Aided Verification (CAV ’11). Ganesh Gopalakrishnan and Shaz Qadeer (Eds.), LNCS, Vol. 6806, Springer, Berlin, 585–591.
[45]
Marco Lewis, Sadegh Soudjani, and Paolo Zuliani. 2023. Formal Verification of Quantum Programs: Theory, Tools, and Challenges. ACM Transactions on Quantum Computing 5, 1 (2023), Article 1, 35 pages.
[46]
Yangjia Li and Mingsheng Ying. 2018. Algorithmic Analysis of Termination Problems for Quantum Programs. Proceedings of the ACM on Programming Languages 2, POPL (2018), Article 35, 29 pages.
[47]
Yangjia Li, Nengkun Yu, and Mingsheng Ying. 2014. Termination of Nondeterministic Quantum Programs. Acta Informatica 51, 1 (2014), 1–24.
[48]
Junyi Liu, Bohua Zhan, Shuling Wang, Shenggang Ying, Tao Liu, Yangjia Li, Mingsheng Ying, and Naijun Zhan. 2019. Formal Verification of Quantum Algorithms Using Quantum Hoare Logic. In Proceedings of the 31st International Conference on Computer Aided Verification (CAV ’19). Isil Dillig and Serdar Tasiran (Eds.), LNCS, Vol. 11562, Springer, Berlin, 187–207.
[49]
Junyi Liu, Li Zhou, Gilles Barthe, and Mingsheng Ying. 2022. Quantum Weakest Preconditions for Reasoning about Expected Runtimes of Quantum Programs. In Proceedings of the 37th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS ’22). Christel Baier and Dana Fisman (Eds.), ACM, New York, NY, Article 4, 13 pages.
[50]
Annabelle McIver and Carroll Morgan. 2006. Abstraction, Refinement and Proof for Probabilistic Systems. Springer, Berlin.
[51]
Annabelle McIver, Carroll Morgan, Benjamin L. Kaminski, and Joost-Pieter Katoen. 2018. A New Proof Rule for Almost-Sure Termination. Proceedings of the ACM on Programming Languages 2, POPL (2018), Article 33, 28 pages.
[52]
Marcel Moosbrugger, Ezio Bartocci, Joost-Pieter Katoen, and Laura Kovács. 2021. Automated Termination Analysis of Polynomial Probabilistic Programs. In Proceedings of the 30th European Symposium on Programming (ESOP ’21). Nobuko Yoshida (Ed.), LNCS, Vol. 12648, Springer, Berlin, 491–518.
[53]
Carroll Morgan, Annabelle McIver, and Karen Seidel. 1996. Probabilistic Predicate Transformers. ACM Transactions on Programming Languages and Systems 18, 3 (1996), 325–353.
[54]
Markus Müller-Olm and Helmut Seidl. 2004. Computing Polynomial Program Invariants. Information Processing Letters 91, 5 (2004), 233–244.
[55]
Juan M. Murillo, José García-Alonso, Enrique Moguel, Johanna Barzen, Frank Leymann, Shaukat Ali, Tao Yue, Paolo Arcaini, Ricardo Pérez, Ignacio G. R. de Guzmán, Mario Piattini, Antonio Ruiz-Cortés, Antonio Brogi, Jianjun Zhao, Andriy V. Miranskyy, and Manuel Wimmer. 2024. Challenges of quantum software engineering for the next decade: The road ahead. arXiv:2404.06825. Retrieved from https://arxiv.org/abs/2404.06825
[56]
Michael A. Nielsen and Isaac L. Chuang. 2000. Quantum Computation and Quantum Information. Cambridge University Press, London.
[57]
Bernhard Ömer. 1998. A Procedural Formalism for Quantum Computing. Technical Report. Technical University of Vienna.
[58]
Jeff W. Sanders and Paolo Zuliani. 2000. Quantum Programming. In Mathematics of Program Construction. R. Backhouse and J. N. Oliveira (Eds.), Springer, Berlin, 80–99.
[59]
Peter Selinger. 2004. Towards a Quantum Programming Language. Mathematical Structures in Computer Science 14, 4 (2004), 527–586.
[60]
Krysta Svore, Alan Geller, Matthias Troyer, John Azariah, Christopher Granade, Bettina Heim, Vadym Kliuchnikov, Mariia Mykhailova, Andres Paz, and Martin Roetteler. 2018. Q#: Enabling Scalable Quantum Computing and Development with a High-level DSL. In Proceedings of the Real World Domain Specific Languages Workshop (RWDSL@CGO ’18). ACM, New York, NY, Article 7, 10 pages.
[61]
Ming Xu, Jianling Fu, Jingyi Mei, and Yuxin Deng. 2022. An Algebraic Method to Fidelity-Oriented Model Checking over Quantum Markov Chains. Theoretical Computer Science 935 (2022), 61–81.
[62]
Ming Xu, Jianling Fu, Jingyi Mei, and Yuxin Deng. 2022. Model Checking QCTL Plus on Quantum Markov Chains. Theoretical Computer Science 913 (2022), 43–72.
[63]
Ming Xu, Cheng-Chao Huang, and Yuan Feng. 2021. Measuring the Constrained Reachability in Quantum Markov Chains. Acta Informatica 58, 6 (2021), 653–674.
[64]
Mingsheng Ying. 2011. Floyd–Hoare Logic for Quantum Programs. ACM Transactions on Programming Languages and Systems 33, 6 (2011), Article 19, 49 pages.
[65]
Mingsheng Ying. 2016. Foundations of Quantum Programming. Morgan Kaufmann, Amsterdam.
[66]
Mingsheng Ying. 2019. Toward Automatic Verification of Quantum Programs. Formal Aspects of Computing 31, 1 (2019), 3–25.
[67]
Mingsheng Ying, Runyao Duan, Yuan Feng, and Zhengfeng Ji. 2010. Predicate Transformer Semantics of Quantum Programs. Semantic Techniques in Quantum Computation 8 (2010), 311–360.
[68]
Mingsheng Ying and Yuan Feng. 2010. Quantum Loop Programs. Acta Informatica 47, 4 (2010), 221–250.
[69]
Mingsheng Ying, Shenggang Ying, and Xiaodi Wu. 2017. Invariants of Quantum Programs: Characterisations and Generation. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL ’17).Giuseppe Castagna and Andrew D. Gordon (Eds.), ACM, New York, NY, 818–832.
[70]
Mingsheng Ying, Nengkun Yu, Yuan Feng, and Runyao Duan. 2013. Verification of Quantum Programs. Science of Computer Programming 78, 9 (2013), 1679–1700.
[71]
Shenggang Ying and Mingsheng Ying. 2018. Reachability Analysis of Quantum Markov Decision Processes. Information and Computation 263 (2018), 31–51.
[72]
Nengkun Yu and Jens Palsberg. 2021. Quantum Abstract Interpretation. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI ’21). Stephen N. Freund and Eran Yahav (Eds.), ACM, New York, NY, 542–558.
[73]
Nengkun Yu and Mingsheng Ying. 2012. Reachability and Termination Analysis of Concurrent Quantum Programs. In Proceedings of the 23rd International Conference on Concurrency Theory (CONCUR ’12). Maciej Koutny and Irek Ulidowski (Eds.), LNCS, Vol. 7454, Springer, Berlin, 69–83.
[74]
Han-Sen Zhong, Hui Wang, Yu-Hao Deng, Ming-Cheng Chen, Li-Chao Peng, Yi-Han Luo, Jian Qin, Dian Wu, Xing Ding, Yi Hu, Peng Hu, Xiao-Yan Yang, Wei-Jun Zhang, Hao Li, Yuxuan Li, Xiao Jiang, Lin Gan, Guangwen Yang, Lixing You, Zhen Wang, Li Li, Nai-Le Liu, Chao-Yang Lu, and Jian-Wei Pan. 2020. Quantum Computational Advantage Using Photons. Science 370, 6523 (2020), 1460–1463.
[75]
Paolo Zuliani. 2004. Non-Deterministic Quantum Programming. In Proceedings of the 2nd International Workshop on Quantum Programming Languages. Turku Centre for Computer Science, Turku, 179–195.

Cited By

View all
  • (2024)Using Category Partition to Detect Metamorphic RelationsProceedings of the 9th ACM International Workshop on Metamorphic Testing10.1145/3679006.3685068(10-17)Online publication date: 13-Sep-2024

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Software Engineering and Methodology
ACM Transactions on Software Engineering and Methodology  Volume 33, Issue 8
November 2024
975 pages
EISSN:1557-7392
DOI:10.1145/3613733
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 05 December 2024
Online AM: 02 September 2024
Accepted: 21 August 2024
Revised: 20 August 2024
Received: 08 April 2024
Published in TOSEM Volume 33, Issue 8

Check for updates

Author Tags

  1. quantum program
  2. Markov decision process
  3. termination
  4. controller synthesis
  5. fixedpoint

Qualifiers

  • Research-article

Funding Sources

  • National Natural Science Foundation of China
  • National Key R & D Program of China
  • Fundamental Research Funds for the Central Universities
  • “Digital Silk Road” Shanghai International Joint Lab of Trustworthy Intelligent Software

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)228
  • Downloads (Last 6 weeks)61
Reflects downloads up to 22 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Using Category Partition to Detect Metamorphic RelationsProceedings of the 9th ACM International Workshop on Metamorphic Testing10.1145/3679006.3685068(10-17)Online publication date: 13-Sep-2024

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Full Text

View this article in Full Text.

Full Text

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media