arXiv:2308.04741
Local Reasoning about Probabilistic Behaviour for Classical-Quantum Programs
Huiling Wu, Yuxin Deng, Ming Xu
Abstract
Verifying the functional correctness of programs with both classical and quantum constructs is a challenging task. The presence of probabilistic behaviour entailed by quantum measurements, together with the exponential size of quantum state spaces, complicates the verification task greatly. In this paper, we propose a quantum Hoare logic that supports separation-style local reasoning and introduces distribution formulas for specifying probabilistic properties, thereby enabling local reasoning about the probabilistic behaviour of classical-quantum programs. We show that the proof rules in the logic are sound with respect to a denotational semantics. To demonstrate the expressiveness of the logic, we formally verify several non-trivial examples, with a Bell-pair purification protocol serving as the main case study. Moreover, we embed our logic into the Rocq Prover (formerly Coq). The resulting logical framework, called CoqQLR, can facilitate semi-automated reasoning about classical--quantum programs.