A Deductive Verification Framework for Circuit-building Quantum Programs

While recent progress in quantum hardware open the door for significant speedup in certain key areas, quantum algorithms are still hard to implement right, and the validation of such quantum programs is a challenge. Early attempts either suffer from the lack of automation or parametrized reasoning, or target high-level abstract algorithm description languages far from the current de facto consensus of circuit-building quantum programming languages. As a consequence, no significant quantum algorithm implementation has been currently verified in a scale-invariant manner. We propose Qbricks, the first formal verification environment for circuit-building quantum programs, featuring clear separation between code and proof, parametric specifications and proofs, high degree of proof automation and allowing to encode quantum programs in a natural way, i.e. close to textbook style. Qbricks builds on best practice of formal verification for the classical case and tailor them to the quantum case: we bring a new domain-specific circuit-building language for quantum programs, namely Qbricks-DSL, together with a new logical specification language Qbricks-Spec and a dedicated Hoare-style deductive verification rule named Hybrid Quantum Hoare Logic. Especially, we introduce and intensively build upon HOPS, a higher-order extension of the recent path-sum symbolic representation, used for both specification and automation. To illustrate the opportunity of Qbricks, we implement the first verified parametric implementations of several famous and non-trivial quantum algorithms, including the quantum part of Shor integer factoring (Order Finding - Shor-OF), quantum phase estimation (QPE) - a basic building block of many quantum algorithms, and Grover search. These breakthroughs were amply facilitated by the specification and automated deduction principles introduced within Qbricks.

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

[2]  Alexei Y. Kitaev,et al.  Quantum measurements and the Abelian Stabilizer Problem , 1995, Electron. Colloquium Comput. Complex..

[3]  Jonathan M. Smith,et al.  Programming the quantum future , 2015, Commun. ACM.

[4]  R. Cleve,et al.  Quantum algorithms revisited , 1997, Proceedings of the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences.

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

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

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

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

[9]  Ross Duncan,et al.  Optimising Clifford Circuits with Quantomatic , 2019, QPL.

[10]  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).

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

[12]  Claude Marché,et al.  The Why/Krakatoa/Caduceus Platform for Deductive Program Verification , 2007, CAV.

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

[14]  Martin Rötteler,et al.  Verified Compilation of Space-Efficient Reversible Circuits , 2016, CAV.

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

[16]  François Bobot,et al.  Why3: Shepherd Your Herd of Provers , 2011 .

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

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

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

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

[21]  Anne Broadbent,et al.  How to Verify a Quantum Computation , 2015, Theory Comput..

[22]  John Preskill,et al.  Quantum Computing in the NISQ era and beyond , 2018, Quantum.

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

[24]  Gilles Brassard,et al.  Tight bounds on quantum searching , 1996, quant-ph/9605034.

[25]  Ugo Dal Lago,et al.  Quantum implicit computational complexity , 2010, Theor. Comput. Sci..

[26]  Michael Norrish,et al.  seL4: formal verification of an operating-system kernel , 2010, Commun. ACM.

[27]  Mingsheng Ying,et al.  Toward automatic verification of quantum programs , 2018, Formal Aspects of Computing.

[28]  Nikolai Kosmatov,et al.  Frama-C - A Software Analysis Perspective , 2012, SEFM.

[29]  Martin Rötteler,et al.  REVS: A Tool for Space-Optimized Reversible Circuit Synthesis , 2017, RC.

[30]  Mathias Soeken,et al.  SAT-Based Exact Synthesis: Encodings, Topology Families, and Parallelism , 2020, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems.

[31]  Urmila Mahadev,et al.  Classical Verification of Quantum Computations , 2018, 2018 IEEE 59th Annual Symposium on Foundations of Computer Science (FOCS).

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

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

[34]  Giovanni De Micheli,et al.  Reversible Pebble Games for Reducing Qubits in Hierarchical Quantum Circuit Synthesis , 2019, 2019 IEEE 49th International Symposium on Multiple-Valued Logic (ISMVL).

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

[36]  Stéphane Beauregard Circuit for Shor's algorithm using 2n+3 qubits , 2003, Quantum Inf. Comput..

[37]  N. Gershenfeld,et al.  Experimental Implementation of Fast Quantum Searching , 1998 .

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

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

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

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

[42]  Luca Paolini,et al.  QPCF: Higher-Order Languages and Quantum Circuits , 2018, Journal of Automated Reasoning.

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

[44]  Shih-Han Hung,et al.  Verified Optimization in a Quantum Intermediate Representation , 2019, ArXiv.

[45]  Robert Rand,et al.  Formally Verified Quantum Programming , 2018 .

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

[47]  C. A. R. Hoare,et al.  An axiomatic basis for computer programming , 1969, CACM.

[48]  Elham Kashefi,et al.  Verification of Quantum Computation: An Overview of Existing Approaches , 2017, Theory of Computing Systems.

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

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

[51]  Dong-Ho Lee,et al.  ReQWIRE: Reasoning about Reversible Quantum Circuits , 2019, QPL.

[52]  Moinuddin K. Qureshi,et al.  Not All Qubits Are Created Equal: A Case for Variability-Aware Policies for NISQ-Era Quantum Computers , 2018, ASPLOS.

[53]  Matthias Troyer,et al.  The Quantum Future of Computation , 2016, Computer.

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

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

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

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

[58]  Alexandru Paler On the Influence of Initial Qubit Placement During NISQ Circuit Compilation , 2017, QTOP@NetSys.

[59]  K. Rustan M. Leino,et al.  Specification and verification , 2011, Commun. ACM.

[60]  Benoît Valiron,et al.  A lambda calculus for quantum computation with classical control , 2006, Math. Struct. Comput. Sci..

[61]  Martin Rötteler,et al.  Q#: Enabling Scalable Quantum Computing and Development with a High-level DSL , 2018, RWDSL2018.

[62]  I. Chuang,et al.  Quantum Computation and Quantum Information: Bibliography , 2010 .

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

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

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

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