arXiv:2610.34723cs.LOOct 2026

Manuscript Offprint

arXiv:2610.34723

Connecting Quantum Proof Systems and Hoare Logic

Liyi Li, Zoukarneini Difaizi Tagba, Alex Potanin

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

LIYI LI, Iowa State University, USA

ZOUKARNEINI DIFAIZI TAGBA, Iowa State University, USA

ALEX POTANIN, Australian National University, Australia

Verifying quantum programs today requires specialized proof systems built on interactive theorem provers such as Rocq, Lean, Isabelle, or Why3, and even modest quantum algorithms cost substantial human effort to verify. Because quantum programs cannot be effectively checked by runtime testing, formal verification is the only viable path to correctness, making the cost of these bespoke systems the chief barrier to scalable quantum software assurance. We show that verifying a quantum program should be no harder than verifying a classical array program, a paradigm commonly used in parallel programming: the Qafny quantum proof system translates into Hoare logic with array theory completely (every Qafny proof becomes a valid Hoare triple) and soundly (a valid translated triple certifies only true quantum specifications), and we mechanize the completeness direction in Rocq. The embedding determinizes quantum proof obligations and exposes the full machinery of classical automated verifiers (e.g. Dafny and SMT-based separation logic) to quantum code, removing the need for dedicated quantum proof system infrastructure. In particular, the embedding supplies the correctness argument that the existing compilation of Qafny into Dafny lacks.

1 Introduction

Quantum computers aim to solve highly complex problems by leveraging quantum superposition, which enables substantially faster algorithms, such as Shor's algorithm, than classical algorithms. Because of the exponential state space of quantum superpositions and the inherently probabilistic, nondeterministic nature of quantum systems, traditional validation techniques based on runtime testing are virtually impossible to develop for large quantum programs. Many frameworks have been proposed to verify quantum programs [Chareton et al. 2021; Hietala et al. 2021] using interactive theorem provers, such as Isabelle, Rocq, and Why3, while others have proposed some proof automation by creating proof systems [Cheng et al. 2025; Le et al. 2022; Li et al. 2024; Liu et al. 2019; Unruh 2019; Ying 2012; Zhou et al. 2021], but quantum program verification is still time-consuming.

While quantum computation might be more powerful than classical computation, an interesting question is whether verifying quantum programs is more difficult than verifying classical programs. The key is to establish an effective compilation from quantum program verification to a verification problem in a classical framework, thereby relating quantum and classical operations and providing a classical analogy for quantum programs.

In this paper, we propose a set of classical aggregate operations as the target for compiling quantum operations. Such operations are well-known in higher-order functional programming and are associated with a large and effective verification library. Based on these operations, we transform the Qafny quantum proof system to classical Hoare logic, and illustrate the same approach for Quantum Hoare Logic (QHL) [Feng and Ying 2021] to show its generality. While these classical operations might be computationally expensive, their verification might not be expensive, i.e., it suffices to verify correctness by examining a symbolic representative value of the quantum state after applying a quantum operation. When one applies a quantum operation to a quantum state that can be thought of as a set of classical state values, it cannot manipulate a singleton classical state value without affecting the others. In fact, the manipulation of the operation has a similar effect across different classical state values, which can be summarized by a symbolic state representing the quantum state.

Authors' Contact Information: Liyi Li, Iowa State University, USA, liyili2@iastate.edu; Zoukarneini Difaizi Tagba, Iowa State University, USA, difaizi@iastate.edu; Alex Potanin, Australian National University, Australia, alex.potanin@anu.edu.au.

Liyi Li, Zoukarneini Difaizi Tagba, and Alex Potanin

Figure

Fig. 1. Two different kinds of soundness and completeness theorems (ours on the left).

To connect quantum and classical proof systems, we develop a new methodology for relating them. In verifying the transformation from quantum proof systems to classical Hoare logic, we develop soundness and completeness theorems based on such theorems in the compilation sense (Figure 1), rather than relying on the proof system soundness and relative completeness, which relate proof systems and their underlying language semantics. The right demonstrates the flow of what would happen by using proof system soundness and relative completeness for our transformation, which fails in place of utilizing the Hoare logic relative completeness to transform a semantic system back to logical assertions, because relative completeness cannot suggest the existence of an effective program verification via the transformation.

Essentially, the main issue arises at predicate transformation. Consider a simple quantum operation (q‾←λx.∣x+3⟩)(\overline{q} \leftarrow \lambda x. |x + 3\rangle) to add 3 on each basis-vector of a quantum state φ\varphi for q‾\overline{q}, where φ\varphi is a superposition state ∑jαj∣j⟩\sum_j \alpha_j |j\rangle. When performing verification, users also need to support a logical post-condition q‾=∑jαj∣j+3⟩\overline{q} = \sum_j \alpha_j |j + 3\rangle, where ∑jαj∣j+3⟩\sum_j \alpha_j |j + 3\rangle is an expression for describing the quantum state φ\varphi after the application, resulting in a quantum state φ′\varphi'. The post-condition transformation based on the right side of Figure 1 is listed below.

q‾=∑jαj∣j+3⟩→{q‾:φ′}→{q‾:trans(φ′)}→q‾=list(trans(φ′))\overline{q}=\sum_{j}\alpha_{j}\left|j+3\right\rangle\rightarrow\left\{\overline{q}:\varphi^{\prime}\right\}\rightarrow\left\{\overline{q}:\mathrm{trans}(\varphi^{\prime})\right\}\rightarrow\overline{q}=\mathrm{list}(\mathrm{trans}(\varphi^{\prime}))

The first transformation above transforms the post-condition to a post-state, a map structure mapping from q‾\overline{q} to a quantum state φ′\varphi'. Writing down the state can potentially be exponential. The next step is to transform the state by using some classical state structure (trans), e.g., lists or arrays. The last step turns the classical state structure back into a predicate, yielding a possibly exponential listing of different singleton states in the quantum superposition state φ′\varphi'.

To connect quantum and classical proof systems properly, as in the left of Figure 1, we develop completeness and soundness theorems for the translation itself, in the style of compiler correctness, to relate the validity of the two systems; i.e., the translation completeness theorem states that everything derivable in the quantum proof system is also derivable in Hoare logic, while the translation soundness theorem states that if the translated program is derivable in Hoare logic, then the quantum proof system also derives it, up to semantic equivalence of the assertions.

References (27)