Reasoning about Parameterized Recursive Quantum Programs with Ancilla Data and Probabilistic Control: a unified assertion logic for verifying both classical and quantum programs (Transactions on Computational Logic, 2022)
Zhaowei Xu, Mingsheng Ying, Benoît Valiron, Dominique Unruh
Most modern (classical) programming languages support recursion. Recursion has also been successfully applied to the design of several quantum algorithms and introduced in a couple of quantum programming languages. So, it can be expected that recursion will become one of the fundamental paradigms of quantum programming. Several program logics have been developed for verification of quantum while-programs. However, there are as yet no general methods for reasoning about (mutual) recursive procedures and ancilla quantum data structure in quantum computing (with measurement). We fill the gap in this paper by proposing a parameterized quantum assertion logic and, based on which, designing a quantum Hoare logic for verifying parameterized recursive quantum programs with ancilla data and probabilistic control. The quantum Hoare logic can be used to prove partial, total, and even probabilistic correctness (by reducing to total correctness) of those quantum programs. In particular, two counterexamples for illustrating incompleteness of non-parameterized assertions in verifying recursive procedures, and, one counterexample for showing the failure of reasoning with exact probabilities based on partial correctness, are constructed. The effectiveness of our logic is shown by three main examples – recursive quantum Markov chain (with probabilistic control), fixed-point Grover’s search, and recursive quantum Fourier sampling.