Formal Methods for Quantum Programs: A Survey

While recent progress in quantum hardware open the door for significant speedup in certain key areas (cryptography, biology, chemistry, optimization, machine learning, etc), quantum algorithms are still hard to implement right, and the validation of such quantum programs is a challenge. Moreover, importing the testing and debugging practices at use in classical programming is extremely difficult in the quantum case, due to the destructive aspect of quantum measurement. As an alternative strategy, formal methods are prone to play a decisive role in the emerging field of quantum software. Recent works initiate solutions for problems occurring at every stage of the development process: high-level program design, implementation, compilation, etc. We review the induced challenges for an efficient use of formal methods in quantum computing and the current most promising research directions. 1 ar X iv :2 10 9. 06 49 3v 1 [ cs .P L ] 1 4 Se p 20 21 Formal methods for quantum algorithms Page 2

[1]  Neil J. Ross,et al.  ALGEBRAIC AND LOGICAL METHODS IN QUANTUM COMPUTATION , 2015, 1510.02198.

[2]  François Bobot,et al.  An Automated Deductive Verification Framework for Circuit-building Quantum Programs , 2021, ESOP.

[3]  Lawrence Charles Paulson,et al.  Isabelle/HOL: A Proof Assistant for Higher-Order Logic , 2002 .

[4]  Georges Gonthier,et al.  Formal Proof—The Four- Color Theorem , 2008 .

[5]  Daniel Gottesman,et al.  Stabilizer Codes and Quantum Error Correction , 1997, quant-ph/9705052.

[6]  Shih-Han Hung,et al.  A verified optimizer for Quantum circuits , 2019, Proc. ACM Program. Lang..

[7]  Thomas A. Henzinger,et al.  Software Verification with BLAST , 2003, SPIN.

[8]  Maria Schuld,et al.  Supervised Learning with Quantum Computers , 2018 .

[9]  Simon Perdrix,et al.  Pauli Fusion: a computational model to realise quantum transformations from ZX terms , 2019 .

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

[11]  Scott Aaronson,et al.  The computational complexity of linear optics , 2010, STOC '11.

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

[13]  Luca Paolini,et al.  qPCF: A Language for Quantum Circuit Computations , 2017, TAMC.

[14]  E. Kashefi,et al.  Generalized flow and determinism in measurement-based quantum computation , 2007, quant-ph/0702212.

[15]  Adam D. Bookatz QMA-complete problems , 2012, Quantum Inf. Comput..

[16]  E. Kashefi,et al.  Determinism in the one-way model , 2005, quant-ph/0506062.

[17]  Dominic Horsman,et al.  The ZX calculus is a language for surface code lattice surgery , 2017, Quantum.

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

[19]  Miriam Backens,et al.  The ZX-calculus is complete for stabilizer quantum mechanics , 2013, 1307.7025.

[20]  Robert B. Griffiths,et al.  Quantum Error Correction , 2011 .

[21]  Patrice Godefroid,et al.  Billions and billions of constraints: Whitebox fuzz testing in production , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[22]  Benoît Valiron,et al.  A Lambda Calculus for Quantum Computation with Classical Control , 2005, TLCA.

[23]  Xavier Leroy,et al.  Formal verification of a realistic compiler , 2009, CACM.

[24]  Jianxin Chen,et al.  A finite presentation of CNOT-dihedral operators , 2016, QPL.

[25]  Dmitri Maslov,et al.  Polynomial-Time T-Depth Optimization of Clifford+T Circuits Via Matroid Partitioning , 2013, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems.

[26]  Nikolai Kosmatov,et al.  Frama-C: A software analysis perspective , 2015, Formal Aspects of Computing.

[27]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[28]  Mnacho Echenim Quantum projective measurements and the CHSH inequality , 2021, Arch. Formal Proofs.

[29]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

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

[31]  Anna Philippou,et al.  Tools and Algorithms for the Construction and Analysis of Systems , 2018, Lecture Notes in Computer Science.

[32]  Volume and quantizations , 1996, gr-qc/9602035.

[33]  Peter W. Shor,et al.  Algorithms for Quantum Computation: Discrete Log and Factoring (Extended Abstract) , 1994, FOCS 1994.

[34]  Simon Perdrix,et al.  Completeness of the ZX-Calculus , 2019, Log. Methods Comput. Sci..

[35]  J. S. BELLt Einstein-Podolsky-Rosen Paradox , 2018 .

[36]  Sriram K. Rajamani,et al.  SLAM and Static Driver Verifier: Technology Transfer of Formal Methods inside Microsoft , 2004, IFM.

[37]  Renaud Vilmart,et al.  A Near-Minimal Axiomatisation of ZX-Calculus for Pure Qubit Quantum Mechanics , 2018, 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

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

[39]  Ievgeniia Oshurko Quantum Machine Learning , 2020, Quantum Computing.

[40]  Edmund M. Clarke,et al.  Formal Methods: State of the Art and Future Directions Working Group Members , 1996 .

[41]  Michele Pagani,et al.  Applying quantitative semantics to higher-order quantum computing , 2013, POPL.

[42]  Quanlong Wang,et al.  Fast and Effective Techniques for T-Count Reduction via Spider Nest Identities , 2020, TQC.

[43]  Alán Aspuru-Guzik,et al.  The theory of variational hybrid quantum-classical algorithms , 2015, 1509.04279.

[44]  Luis Hernández Encinas,et al.  Formal Verification of the Security of a Free-Space Quantum Key Distribution System , 2011 .

[45]  R. Hindley The Principal Type-Scheme of an Object in Combinatory Logic , 1969 .

[46]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[47]  Dmitri Maslov,et al.  Automated optimization of large quantum circuits with continuous parameters , 2017, npj Quantum Information.

[48]  Margaret Martonosi,et al.  Statistical Assertions for Validating Patterns and Finding Bugs in Quantum Programs , 2019, 2019 ACM/IEEE 46th Annual International Symposium on Computer Architecture (ISCA).

[49]  Peter Selinger,et al.  A categorical model for a quantum circuit description language , 2017, QPL.

[50]  Paul Benoit,et al.  Météor: A Successful Application of B in a Large Project , 1999, World Congress on Formal Methods.

[51]  Shih-Han Hung,et al.  Proving Quantum Programs Correct , 2020, ITP.

[52]  Rajagopal Nagarajan,et al.  Formal Verification of Quantum Protocols , 2002 .

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

[54]  Matthew Amy,et al.  Towards Large-scale Functional Verification of Universal Quantum Circuits , 2018, QPL.

[55]  Emmanuel Jeandel The rational fragment of the ZX-calculus , 2018, ArXiv.

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

[57]  Christian Schaffner,et al.  Using Simon's algorithm to attack symmetric-key cryptographic primitives , 2016, Quantum Inf. Comput..

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

[59]  Renaud Vilmart,et al.  The Structure of Sum-Over-Paths, its Consequences, and Completeness for Clifford , 2020, FoSSaCS.

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

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

[62]  Matthew Amy,et al.  Formal Methods in Quantum Circuit Design , 2019 .

[63]  Martin Rötteler,et al.  Q#: Enabling scalable quantum computing and development with a high-level domain-specific language , 2018, ArXiv.

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

[65]  E. Farhi,et al.  A Quantum Approximate Optimization Algorithm , 2014, 1411.4028.

[66]  Benoît Valiron,et al.  An Introduction to Quantum Programming in Quipper , 2013, RC.

[67]  Alejandro Díaz-Caro,et al.  A Lambda Calculus for Density Matrices with Classical and Probabilistic Controls , 2017, APLAS.

[68]  Andrew W. Cross,et al.  Open Quantum Assembly Language , 2017, 1707.03429.

[69]  Christine Paulin-Mohring Introduction to the Calculus of Inductive Constructions , 2015 .

[70]  Aleks Kissinger,et al.  Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus , 2019, Quantum.

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

[72]  Michael Hicks,et al.  Formal Verification vs. Quantum Uncertainty , 2019, SNAPL.

[73]  Bob Coecke,et al.  Interacting quantum observables: categorical algebra and diagrammatics , 2009, ArXiv.

[74]  Sellami Ali,et al.  DECOY STATE QUANTUM KEY DISTRIBUTION , 2010 .

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

[76]  John Preskill,et al.  Topological Quantum Computation , 1998, QCQC.

[77]  Simon Perdrix,et al.  A Generic Normal Form for ZX-Diagrams and Application to the Rational Angle Completeness , 2018, 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[78]  Samson Abramsky,et al.  Categorical quantum mechanics , 2008, 0808.1023.

[79]  Margaret Martonosi,et al.  ScaffCC: Scalable compilation and analysis of quantum programs , 2015, Parallel Comput..

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

[81]  Jean-Christophe Filliâtre,et al.  Why3 - Where Programs Meet Provers , 2013, ESOP.

[82]  E. Knill,et al.  Realization of quantum error correction , 2004, Nature.

[83]  Fuguo Deng,et al.  Quantum secure direct communication with high-dimension quantum superdense coding , 2005 .

[84]  Kartik Singhal,et al.  Quantum Hoare Type Theory , 2020, ArXiv.

[85]  H. Briegel,et al.  Measurement-based quantum computation on cluster states , 2003, quant-ph/0301052.

[86]  Benoît Valiron,et al.  A linear-non-linear model for a computational call-by-value lambda calculus (extended abstract) , 2008, FoSSaCS.

[87]  Anne Hillebrand,et al.  Quantum Protocols involving Multiparticle Entanglement and their Representations in the zx-calculus. , 2011 .

[88]  Benoît Valiron,et al.  Concrete resource analysis of the quantum linear-system algorithm used to compute the electromagnetic scattering cross section of a 2D target , 2015, Quantum Inf. Process..

[89]  The Quingo Development Team Quingo: A Programming Framework for Heterogeneous Quantum-Classical Computing with NISQ Features , 2020, ACM Transactions on Quantum Computing.

[90]  E. Knill,et al.  Conventions for quantum pseudocode , 1996, 2211.02559.

[91]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[92]  A. Harrow,et al.  Quantum algorithm for linear systems of equations. , 2008, Physical review letters.

[93]  Aleks Kissinger,et al.  Quantomatic: A proof assistant for diagrammatic reasoning , 2015, CADE.

[94]  Sarfraz Khurshid,et al.  Test input generation with java PathFinder , 2004, ISSTA '04.

[95]  Simon Perdrix,et al.  Diagrammatic Reasoning beyond Clifford+T Quantum Mechanics , 2018, LICS.

[96]  S. Lloyd,et al.  Quantum algorithms for supervised and unsupervised machine learning , 2013, 1307.0411.

[97]  Yongmei Huang,et al.  Satellite-to-ground quantum key distribution , 2017, Nature.

[98]  Alejandro Díaz-Caro,et al.  A concrete categorical semantics of Lambda-S , 2018, LSFA.

[99]  Thorsten Altenkirch,et al.  The Quantum IO Monad , 2006 .

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

[101]  Pawel Wocjan,et al.  "NON-IDENTITY-CHECK" IS QMA-COMPLETE , 2005 .

[102]  Jean-Christophe Filliâtre,et al.  Deductive software verification , 2011, International Journal on Software Tools for Technology Transfer.

[103]  Albert Einstein,et al.  Can Quantum-Mechanical Description of Physical Reality Be Considered Complete? , 1935 .

[104]  Daniel Smith-Tone,et al.  Report on Post-Quantum Cryptography , 2016 .

[105]  Ernst-Rüdiger Olderog,et al.  Fifty years of Hoare’s logic , 2019, Formal Aspects of Computing.

[106]  Gushu Li,et al.  Projection-based runtime assertions for testing and debugging Quantum programs , 2020, Proc. ACM Program. Lang..

[107]  Patrick Cousot,et al.  The ASTREÉ Analyzer , 2005, ESOP.

[108]  Peter Selinger,et al.  Generators and relations for n-qubit Clifford operators , 2013, Log. Methods Comput. Sci..

[109]  Hideki Sakurada,et al.  Semi-automated verification of security proofs of quantum cryptographic protocols , 2016, J. Symb. Comput..

[110]  Michael W. Mislove,et al.  Enriching a Linear/Non-linear Lambda Calculus: A Programming Language for String Diagrams , 2018, LICS.

[111]  Matthias Troyer,et al.  ProjectQ: An Open Source Software Framework for Quantum Computing , 2016, ArXiv.

[112]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[113]  Simon Perdrix,et al.  Environment and Classical Channels in Categorical Quantum Mechanics , 2010, CSL.

[114]  Gilles Brassard,et al.  Quantum cryptography: Public key distribution and coin tossing , 2014, Theor. Comput. Sci..

[115]  Maximilian Baader,et al.  Silq: a high-level quantum language with safe uncomputation and intuitive semantics , 2020, PLDI.

[116]  André van Tonder,et al.  A Lambda Calculus for Quantum Computation , 2003, SIAM J. Comput..

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

[118]  Travis S. Humble,et al.  Quantum supremacy using a programmable superconducting processor , 2019, Nature.

[119]  Thomas A. Henzinger,et al.  Handbook of Model Checking , 2018, Springer International Publishing.

[120]  R. Feynman Simulating physics with computers , 1999 .

[121]  Simon Perdrix,et al.  A Complete Axiomatisation of the ZX-Calculus for Clifford+T Quantum Mechanics , 2017, LICS.

[122]  Rajagopal Nagarajan,et al.  Formalization of Quantum Protocols using Coq , 2015, QPL.

[123]  Aleks Kissinger,et al.  PyZX: Large Scale Automated Diagrammatic Reasoning , 2019, Electronic Proceedings in Theoretical Computer Science.

[124]  Hidenori Kuwakado,et al.  Quantum distinguisher between the 3-round Feistel cipher and the random permutation , 2010, 2010 IEEE International Symposium on Information Theory.

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

[126]  M. Mariantoni,et al.  Surface codes: Towards practical large-scale quantum computation , 2012, 1208.0928.

[127]  Hidenori Kuwakado,et al.  Security on the quantum-type Even-Mansour cipher , 2012, 2012 International Symposium on Information Theory and its Applications.

[128]  Jennifer Paykin,et al.  QWIRE Practice: Formal Verification of Quantum Circuits in Coq , 2018, QPL.

[129]  Yijun He,et al.  Certified Quantum Computation in Isabelle/HOL , 2020, Journal of Automated Reasoning.

[130]  E. Farhi,et al.  A Quantum Adiabatic Evolution Algorithm Applied to Random Instances of an NP-Complete Problem , 2001, Science.

[131]  Koushik Sen,et al.  Symbolic execution for software testing: three decades later , 2013, CACM.

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

[133]  Ross Duncan,et al.  t|ket⟩: a retargetable compiler for NISQ devices , 2020, Quantum Science and Technology.

[134]  Aleks Kissinger,et al.  Hypergraph Simplification: Linking the Path-sum Approach to the ZH-calculus , 2020, Electronic Proceedings in Theoretical Computer Science.

[135]  Simon Perdrix,et al.  Completeness of Graphical Languages for Mixed States Quantum Mechanics , 2019, ICALP.

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

[137]  A. Shimony,et al.  Proposed Experiment to Test Local Hidden Variable Theories. , 1969 .

[138]  Miriam Backens,et al.  There and back again: A circuit extraction tale , 2021, Quantum.

[139]  Shor,et al.  Scheme for reducing decoherence in quantum computer memory. , 1995, Physical review. A, Atomic, molecular, and optical physics.

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

[141]  Aleks Kissinger,et al.  Reducing the number of non-Clifford gates in quantum circuits , 2020, Physical Review A.

[142]  Ugo Dal Lago,et al.  The geometry of parallelism: classical, probabilistic, and quantum effects , 2016, POPL.

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

[144]  Shengyu Zhang,et al.  BQP-Complete Problems , 2012, Handbook of Natural Computing.

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

[146]  Sean Hallgren,et al.  Quantum algorithms for some hidden shift problems , 2003, SODA '03.

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

[148]  Austin G. Fowler,et al.  Surface code quantum computing by lattice surgery , 2011, 1111.4022.

[149]  Tao Liu,et al.  A Theorem Prover for Quantum Hoare Logic and Its Applications , 2016, ArXiv.

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

[151]  Aleks Kissinger,et al.  Picturing Quantum Processes , 2017 .

[152]  N. Killoran,et al.  Strawberry Fields: A Software Platform for Photonic Quantum Computing , 2018, Quantum.

[153]  Ichiro Hasuo,et al.  Semantics of Higher-Order Quantum Computation via Geometry of Interaction , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[154]  V. Scarani,et al.  The security of practical quantum key distribution , 2008, 0802.4155.

[155]  Edmund M. Clarke,et al.  Design and Synthesis of Synchronization Skeletons Using Branching Time Temporal Logic , 2008, 25 Years of Model Checking.

[156]  Quanlong Wang,et al.  Two complete axiomatisations of pure-state qubit quantum computing , 2018, LICS.