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

CoqQ: Foundational Verification of Quantum Programs

Published: 11 January 2023 Publication History

Abstract

CoqQ is a framework for reasoning about quantum programs in the Coq proof assistant. Its main components are: a deeply embedded quantum programming language, in which classic quantum algorithms are easily expressed, and an expressive program logic for proving properties of programs. CoqQ is foundational: the program logic is formally proved sound with respect to a denotational semantics based on state-of-art mathematical libraries (MathComp and MathComp Analysis). CoqQ is also practical: assertions can use Dirac expressions, which eases concise specifications, and proofs can exploit local and parallel reasoning, which minimizes verification effort. We illustrate the applicability of CoqQ with many examples from the literature.

References

[1]
Samson Abramsky and Bob Coecke. 2009. Categorical quantum mechanics. Handbook of quantum logic and quantum structures, 2 (2009), 261–325.
[2]
Dmitri Akatov. 2005. The Logic of Quantum Program Verification. Master’s thesis. Oxford University Computing Laboratory.
[3]
Gadi Aleksandrowicz, Thomas Alexander, Panagiotis Barkoutsos, Luciano Bello, Yael Ben-Haim, David Bucher, Francisco Jose Cabrera-Hernádez, Jorge Carballo-Franquis, Adrian Chen, Chun-Fu Chen, Jerry M. Chow, Antonio D. Córcoles-Gonzales, Abigail J. Cross, Andrew Cross, Juan Cruz-Benito, Chris Culver, Salvador De La Puente González, Enrique De La Torre, Delton Ding, Eugene Dumitrescu, Ivan Duran, Pieter Eendebak, Mark Everitt, Ismael Faro Sertage, Albert Frisch, Andreas Fuhrer, Jay Gambetta, Borja Godoy Gago, Juan Gomez-Mosquera, Donny Greenberg, Ikko Hamamura, Vojtech Havlicek, Joe Hellmers, Ł ukasz Herok, Hiroshi Horii, Shaohan Hu, Takashi Imamichi, Toshinari Itoko, Ali Javadi-Abhari, Naoki Kanazawa, Anton Karazeev, Kevin Krsulich, Peng Liu, Yang Luh, Yunho Maeng, Manoel Marques, Francisco Jose Martín-Fernández, Douglas T. McClure, David McKay, Srujan Meesala, Antonio Mezzacapo, Nikolaj Moll, Diego Moreda Rodríguez, Giacomo Nannicini, Paul Nation, Pauline Ollitrault, Lee James O’Riordan, Hanhee Paik, Jesús Pérez, Anna Phan, Marco Pistoia, Viktor Prutyanov, Max Reuter, Julia Rice, Abdón Rodríguez Davila, Raymond Harry Putra Rudy, Mingi Ryu, Ninad Sathaye, Chris Schnabel, Eddie Schoute, Kanav Setia, Yunong Shi, Adenilton Silva, Yukio Siraichi, Seyon Sivarajah, John A. Smolin, Mathias Soeken, Hitomi Takahashi, Ivano Tavernelli, Charles Taylor, Pete Taylour, Kenso Trabing, Matthew Treinish, Wes Turner, Desiree Vogt-Lee, Christophe Vuillot, Jonathan A. Wildstrom, Jessica Wilson, Erick Winston, Christopher Wood, Stephen Wood, Stefan Wörner, Ismail Yunus Akhalwaya, and Christa Zoufal. 2019. Qiskit: An Open-source Framework for Quantum Computing. https://doi.org/10.5281/zenodo.2562110
[4]
Matthew Amy. 2018. Towards Large-scale Functional Verification of Universal Quantum Circuits. In Proceedings 15th International Conference on Quantum Physics and Logic, QPL 2018, Halifax, Canada, 3-7th June 2018, Peter Selinger and Giulio Chiribella (Eds.) (EPTCS, Vol. 287). 1–21. https://doi.org/10.4204/EPTCS.287.1
[5]
Andrew W Appel. 2011. Verified software toolchain. In European Symposium on Programming. 1–17.
[6]
Alexandru Baltag and Sonja Smets. 2006. LQP: the dynamic logic of quantum information. Mathematical structures in computer science, 16, 3 (2006), 491–525.
[7]
Manuel Barbosa, Gilles Barthe, Xiong Fan, Benjamin Grégoire, Shih-Han Hung, Jonathan Katz, Pierre-Yves Strub, Xiaodi Wu, and Li Zhou. 2021. EasyPQC: Verifying Post-Quantum Cryptography. In Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security (CCS ’21). Association for Computing Machinery, New York, NY, USA. 2564–2586. isbn:9781450384544 https://doi.org/10.1145/3460120.3484567
[8]
Gilles Barthe, Justin Hsu, Mingsheng Ying, Nengkun Yu, and Li Zhou. 2019. Relational Proofs for Quantum Programs. Proc. ACM Program. Lang., 4, POPL (2019), Article 21, December, 29 pages. https://doi.org/10.1145/3371089
[9]
Alexander Bentkamp, Jasmin Christian Blanchette, and Dietrich Klakow. 2019. A formal proof of the expressiveness of deep learning. Journal of Automated Reasoning, 63, 2 (2019), 347–368.
[10]
Benjamin Bichsel, Maximilian Baader, Timon RGehr, and Martin Vechev. 2020. Silq: A high-level quantum language with safe uncomputation and intuitive semantics. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation. 286–300.
[11]
Anthony Bordg, Hanna Lachnitt, and Yijun He. 2021. Certified quantum computation in Isabelle/HOL. Journal of Automated Reasoning, 65, 5 (2021), 691–709.
[12]
Sergey Bravyi, David Gosset, and Robert König. 2018. Quantum advantage with shallow circuits. Science, 362, 6412 (2018), 308–311. https://doi.org/10.1126/science.aar3106
[13]
Olivier Brunet and Philippe Jorrand. 2004. Dynamic quantum logic for quantum programs. International Journal of Quantum Information, 2, 01 (2004), 45–54. https://doi.org/10.1142/S0219749904000067
[14]
Jose Manuel Rodriguez Caballero and Dominique Unruh. 2021. Complex Bounded Operators. Archive of Formal Proofs (Sept. 2021)., https://isa-afp.org/entries/Complex_Bounded_Operators.html
[15]
Christophe Chareton, Sébastien Bardin, François Bobot, Valentin Perrelle, and Benoît Valiron. 2021. An Automated Deductive Verification Framework for Circuit-building Quantum Programs. In Programming Languages and Systems, Nobuko Yoshida (Ed.). Springer International Publishing, Cham. 148–177. isbn:978-3-030-72019-3 https://doi.org/10.1007/978-3-030-72019-3_6
[16]
Bob Coecke. 2006. Kindergarten quantum mechanics: Lecture notes. In AIP Conference Proceedings. 810, 81–98.
[17]
Bob Coecke and Ross Duncan. 2011. Interacting quantum observables: categorical algebra and diagrammatics. New Journal of Physics, 13, 4 (2011), 043016.
[18]
Ellie D’Hondt and Prakash Panangaden. 2006. Quantum weakest preconditions. Mathematical Structures in Computer Science, 16, 3 (2006), 429–451. https://doi.org/10.1017/S0960129506005251
[19]
Ross Duncan, Aleks Kissinger, Simon Perdrix, and John Van De Wetering. 2020. Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus. Quantum, 4 (2020), 279.
[20]
Yuan Feng, Runyao Duan, Zhengfeng Ji, and Mingsheng Ying. 2007. Proof rules for the correctness of quantum programs. Theoretical Computer Science, 386, 1-2 (2007), 151–166.
[21]
Yuan Feng and Mingsheng Ying. 2021. Quantum Hoare Logic with Classical Variables. ACM Transactions on Quantum Computing, 2, 4 (2021), Article 16, December, 43 pages. issn:2643-6809 https://doi.org/10.1145/3456877
[22]
Georges Gonthier, Beta Ziliani, Aleksandar Nanevski, and Derek Dreyer. 2013. How to make ad hoc proof automation less ad hoc. Journal of Functional Programming, 23, 4 (2013), 357–401. https://doi.org/10.1017/S0956796813000051
[23]
Alexander S Green, Peter LeFanu Lumsdaine, Neil J Ross, Peter Selinger, and Benoît Valiron. 2013. Quipper: a scalable quantum programming language. In Proceedings of the 34th ACM SIGPLAN conference on Programming language design and implementation. 333–342.
[24]
Lov K Grover. 1996. A fast quantum mechanical algorithm for database search. In Proceedings of the twenty-eighth annual ACM symposium on Theory of computing. 212–219.
[25]
Amar Hadzihasanovic, Kang Feng Ng, and Quanlong Wang. 2018. Two complete axiomatisations of pure-state qubit quantum computing. In Proceedings of the 33rd annual ACM/IEEE symposium on logic in computer science. 502–511.
[26]
Aram W. Harrow, Avinatan Hassidim, and Seth Lloyd. 2009. Quantum Algorithm for Linear Systems of Equations. Phys. Rev. Lett., 103 (2009), October, 150502. https://doi.org/10.1103/PhysRevLett.103.150502
[27]
Kesha Hietala, Robert Rand, Shih-Han Hung, Liyi Li, and Michael Hicks. 2021. Proving Quantum Programs Correct. In 12th International Conference on Interactive Theorem Proving (ITP 2021), Liron Cohen and Cezary Kaliszyk (Eds.) (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 193). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany. 21:1–21:19. isbn:978-3-95977-188-7 issn:1868-8969 https://doi.org/10.4230/LIPIcs.ITP.2021.21
[28]
Kesha Hietala, Robert Rand, Shih-Han Hung, Xiaodi Wu, and Michael Hicks. 2021. A Verified Optimizer for Quantum Circuits. Proc. ACM Program. Lang., 5, POPL (2021), Article 37, jan, 29 pages. https://doi.org/10.1145/3434318
[29]
Emmanuel Jeandel, Simon Perdrix, and Renaud Vilmart. 2018. Diagrammatic reasoning beyond Clifford+ T quantum mechanics. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science. 569–578.
[30]
Jacques-Henri Jourdan, Vincent Laporte, Sandrine Blazy, Xavier Leroy, and David Pichardie. 2015. A Formally-Verified C Static Analyzer. In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2015, Mumbai, India, January 15-17, 2015, Sriram K. Rajamani and David Walker (Eds.). ACM, 247–259.
[31]
Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, and Derek Dreyer. 2018. RustBelt: securing the foundations of the rust programming language. Proc. ACM Program. Lang., 2, POPL (2018), 66:1–66:34. https://doi.org/10.1145/3158154
[32]
Ralf Jung, Robbert Krebbers, Jacques-Henri Jourdan, Ales Bizjak, Lars Birkedal, and Derek Dreyer. 2018. Iris from the ground up: A modular foundation for higher-order concurrent separation logic. J. Funct. Program., 28 (2018), e20. https://doi.org/10.1017/S0956796818000151
[33]
Yoshihiko Kakutani. 2009. A logic for formal verification of quantum programs. In Annual Asian Computing Science Conference. 79–93.
[34]
Aleks Kissinger and John van de Wetering. 2020. PyZX: Large Scale Automated Diagrammatic Reasoning. In Proceedings 17th International Conference on Quantum Physics and Logic, QPL 2020, Paris, France, June 2-6th, 2020, Benoît Valiron, Shane Mansfield, Pablo Arrighi, and Prakash Panangaden (Eds.) (EPTCS, Vol. 318). 229–241. https://doi.org/10.4204/eptcs.318.14
[35]
Aleks Kissinger and Vladimir Zamdzhiev. 2015. Quantomatic: A Proof Assistant for Diagrammatic Reasoning. In Automated Deduction - CADE-25, Amy P. Felty and Aart Middeldorp (Eds.). Springer International Publishing, Cham. 326–336. isbn:978-3-319-21401-6 https://doi.org/10.1007/978-3-319-21401-6_22
[36]
Alexei Y. Kitaev. 1996. Quantum measurements and the Abelian Stabilizer Problem. Electron. Colloquium Comput. Complex., TR96-003 (1996), ECCC:. arxiv:quant-ph/9511026
[37]
Xuan-Bach Le, Shang-Wei Lin, Jun Sun, and David Sanan. 2022. A Quantum Interpretation of Separating Conjunction for Local Reasoning of Quantum Programs Based on Separation Logic. Proc. ACM Program. Lang., 6, POPL (2022), Article 36, jan, 27 pages. https://doi.org/10.1145/3498697
[38]
Adrian Lehmann, Ben Caldwell, and Robert Rand. 2022. VyZX : A Vision for Verifying the ZX Calculus. In Proceedings 19th International Conference on Quantum Physics and Logic, QPL 2022, Oxford, England, 27 June – 1 July 2012, to be published, Bob Coecke and Matthew Leifer (Eds.). arxiv:arXiv preprint arXiv:1908.08963. arxiv:2205.05781
[39]
Xavier Leroy. 2009. Formal verification of a realistic compiler. Commun. ACM, 52, 7 (2009), 107–115.
[40]
Yangjia Li and Dominique Unruh. 2021. Quantum Relational Hoare Logic with Expectations. In 48th International Colloquium on Automata, Languages, and Programming (ICALP 2021), Nikhil Bansal, Emanuela Merelli, and James Worrell (Eds.) (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 198). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany. 136:1–136:20. isbn:978-3-95977-195-5 issn:1868-8969 https://doi.org/10.4230/LIPIcs.ICALP.2021.136
[41]
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 International conference on computer aided verification. 187–207.
[42]
Chris Lomont. 2004. The Hidden Subgroup Problem - Review and Open Problems. https://doi.org/10.48550/arxiv.quant-ph/0411037
[43]
Assia Mahboubi and Enrico Tassi. 2021. Mathematical Components. Zenodo. https://doi.org/10.5281/zenodo.4457887
[44]
Michael A Nielsen and Isaac Chuang. 2002. Quantum computation and quantum information.
[45]
Jennifer Paykin, Robert Rand, and Steve Zdancewic. 2017. QWIRE: a core language for quantum circuits. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017, Giuseppe Castagna and Andrew D. Gordon (Eds.). ACM, 846–858. http://dl.acm.org/citation.cfm?id=3009894
[46]
Tom Peham, Lukas Burgholzer, and Robert Wille. 2022. Equivalence Checking of Quantum Circuits with the ZX-Calculus. IEEE Journal on Emerging and Selected Topics in Circuits and Systems, 1–1. https://doi.org/10.1109/JETCAS.2022.3202204
[47]
Yuxiang Peng, Mingsheng Ying, and Xiaodi Wu. 2022. Algebraic reasoning of Quantum programs via non-idempotent Kleene algebra. In Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation. 657–670.
[48]
Robert Rand, Jennifer Paykin, Dong-Ho Lee, and Steve Zdancewic. 2018. ReQWIRE: Reasoning about Reversible Quantum Circuits. In Proceedings 15th International Conference on Quantum Physics and Logic, QPL 2018, Halifax, Canada, 3-7th June 2018, Peter Selinger and Giulio Chiribella (Eds.) (EPTCS, Vol. 287). 299–312. https://doi.org/10.4204/EPTCS.287.17
[49]
Robert Rand, Jennifer Paykin, and Steve Zdancewic. 2017. QWIRE Practice: Formal Verification of Quantum Circuits in Coq. In Proceedings 14th International Conference on Quantum Physics and Logic, QPL 2017, Nijmegen, The Netherlands, 3-7 July 2017., Bob Coecke and Aleks Kissinger (Eds.) (EPTCS, Vol. 266). 119–132. https://doi.org/10.4204/EPTCS.266.8
[50]
Robert Rand, Jennifer Paykin, and Steve Zdancewic. 2018. Phantom types for quantum programs. In The Fourth International Workshop on Coq for Programming Languages.
[51]
Jean-Pierre Serre. 1977. Linear representations of finite groups. 42, Springer.
[52]
Kartik Singhal. 2020. Quantum Hoare Type Theory. Master’s thesis. University of Chicago. Chicago, IL. arxiv:2012.02154. https://ks.cs.uchicago.edu/publication/qhtt-masters/ See also: https://ks.cs.uchicago.edu/publication/qhtt/
[53]
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 2018 (RWDSL 2018). ACM, New York, NY, USA. Article 7, 10 pages. https://doi.org/10.1145/3183895.3183901
[54]
The Cirq Developers. 2018. quantumlib/Cirq: A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits. https://github.com/quantumlib/Cirq
[55]
The Coq Development Team. 2022. The Coq Proof Assistant. https://doi.org/10.5281/zenodo.5846982
[56]
The MathComp Analysis Development Team. 2022. MathComp-Analysis: Mathematical Components compliant Analysis Library. https://github.com/math-comp/analysis Since 2017. Version 0.5.1
[57]
René Thiemann and Akihisa Yamada. 2016. Formalizing Jordan normal forms in Isabelle/HOL. In Proceedings of the 5th ACM SIGPLAN Conference on Certified Programs and Proofs. 88–99.
[58]
Dominique Unruh. 2019. Quantum Hoare Logic with Ghost Variables. In 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). ACM, New York, NY, USA. 1–13. https://doi.org/10.1109/LICS.2019.8785779
[59]
Dominique Unruh. 2019. Quantum Relational Hoare Logic. Proc. ACM Program. Lang., 3, POPL (2019), Article 33, jan, 31 pages. https://doi.org/10.1145/3290346
[60]
Dominique Unruh. 2020. Post-Quantum Verification of Fujisaki-Okamoto. In Advances in Cryptology – ASIACRYPT 2020, Shiho Moriai and Huaxiong Wang (Eds.). Springer International Publishing, Cham. 321–352. isbn:978-3-030-64837-4
[61]
Dominique Unruh. 2021. Quantum and classical registers. In The Second International Workshop on Programming Languages for Quantum Computing (PLanQC 2021). arxiv:2105.10914
[62]
Renaud Vilmart. 2019. A near-minimal axiomatisation of zx-calculus for pure qubit quantum mechanics. In 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). 1–10.
[63]
Mingsheng Ying. 2011. Floyd-Hoare logic for quantum programs. ACM Trans. Program. Lang. Syst., 33, 6 (2011), 19:1–19:49. https://doi.org/10.1145/2049706.2049708
[64]
Mingsheng Ying. 2016. Foundations of Quantum Programming. Morgan-Kaufmann.
[65]
Mingsheng Ying. 2019. Toward automatic verification of quantum programs. Formal Aspects of Computing, 31, 1 (2019), 01 Feb, 3–25. https://doi.org/10.1007/s00165-018-0465-3
[66]
Mingsheng Ying, Li Zhou, and Yangjia Li. 2018. Reasoning about Parallel Quantum Programs. https://doi.org/10.48550/arxiv.1810.11334
[67]
Mingsheng Ying, Li Zhou, Yangjia Li, and Yuan Feng. 2022. A proof system for disjoint parallel quantum programs. Theoretical Computer Science, 897 (2022), 164–184. issn:0304-3975 https://doi.org/10.1016/j.tcs.2021.10.025
[68]
Nengkun Yu. 2019. Quantum Temporal Logic. https://doi.org/10.48550/arxiv.1908.00158
[69]
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 2021). Association for Computing Machinery, New York, NY, USA. 542–558. isbn:9781450383912 https://doi.org/10.1145/3453483.3454061
[70]
Charles Yuan and Michael Carbin. 2022. Tower: Data Structures in Quantum Superposition. Proc. ACM Program. Lang., 6, OOPSLA2 (2022), Article 134, October, 41 pages. https://doi.org/10.1145/3563297
[71]
Charles Yuan, Christopher McNally, and Michael Carbin. 2022. Twist: Sound Reasoning for Purity and Entanglement in Quantum Programs. Proc. ACM Program. Lang., 6, POPL (2022), Article 30, jan, 32 pages. https://doi.org/10.1145/3498691
[72]
Li Zhou, Gilles Barthe, Justin Hsu, Mingsheng Ying, and Nengkun Yu. 2021. A Quantum Interpretation of Bunched Logic amp; Quantum Separation Logic. In 2021 36th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). 1–14. https://doi.org/10.1109/LICS52264.2021.9470673
[73]
Li Zhou, Gilles Barthe, Pierre-Yves Strub, Junyi Liu, and Mingsheng Ying. 2023. CoqQ: Foundational Verification of Quantum Programs. https://doi.org/10.1145/3554343
[74]
Li Zhou, Nengkun Yu, and Mingsheng Ying. 2019. An Applied Quantum Hoare Logic. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2019). Association for Computing Machinery, New York, NY, USA. 1149–1162. isbn:9781450367127 https://doi.org/10.1145/3314221.3314584

Cited By

View all
  • (2024)Statistical Testing of Quantum Programs via Fixed-Point Amplitude AmplificationProceedings of the ACM on Programming Languages10.1145/36897168:OOPSLA2(140-164)Online publication date: 8-Oct-2024
  • (2024)Quff: A Dynamically Typed Hybrid Quantum-Classical Programming LanguageProceedings of the 21st ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3679007.3685063(65-81)Online publication date: 13-Sep-2024
  • (2024)Dynamic Transitive Closure-based Static Analysis through the Lens of Quantum SearchACM Transactions on Software Engineering and Methodology10.1145/364438933:5(1-29)Online publication date: 4-Jun-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 7, Issue POPL
January 2023
2196 pages
EISSN:2475-1421
DOI:10.1145/3554308
  • Editor:
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution 4.0 International License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 January 2023
Published in PACMPL Volume 7, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Mathematical Libraries
  2. Program Logics
  3. Proof Assistants
  4. Quantum Programs

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)669
  • Downloads (Last 6 weeks)92
Reflects downloads up to 10 Nov 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media