Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:2608.13099 · Lecture notes in computer science

Formal Verification of Quantum Ancilla Safety

Jiqi Li, Jingyi Mei, Wang Fang, Ji Guan

quant-phSubmitted Aug 13, 2026• Announced Aug 14, 2026• 0 citations
arXivHTMLPDF

Abstract

Ensuring ancilla safety is a critical correctness requirement for quantum compilation, since ancilla qubits are routinely introduced to implement complex operations with fewer gates and reduced depth. However, formally verifying this property is computationally hard due to state-space explosion in the number of qubits, particularly for dirty ancillae, which carry unknown initial states and must be restored after use. We propose an end-to-end verification-and-repair framework that rigorously addresses both clean and dirty ancilla safety. Our core contribution is a two-step reduction strategy: we first prove that verifying an $m$-qubit dirty ancilla register decomposes into $2m$ independent clean ancilla safety checks; subsequently, we reduce each clean ancilla safety instance to an algebraic commutativity check against Pauli-$Z$ and Pauli-$X$ operators. This approach yields an efficient and naturally parallel verifier and enables actionable diagnosis by classifying violations into logic errors and phase errors. Leveraging this diagnosis, we further design lightweight repair routines that append local single-qubit rotations to eliminate a broad class of local ancilla faults. We implement the full pipeline in a prototype tool using a dual-backend architecture combining decision diagrams and weighted model counting, and validate it on diverse circuits ranging from arithmetic benchmarks to Grover's algorithm. Our experiments demonstrate scalability to thousands of qubits and show that the proposed repairs effectively improve ancilla safety while preserving circuit functionality.

DOI
10.1007/978-3-032-32537-2_16

Related papers

Quantum Uncomputation of Clean and Dirty Ancilla Qubits

Chenke Liu, Li Zhou, Boning Meng

Automatic uncomputation aims to provide programming-language-level support to facilitate the correct and safe use of ancilla qubits in quantum computing, but efforts have only been made for clean ancillas, leaving dirty ancillas unexplored. We present a unified formalization of the uncomputation of both clean and dirty ancillas. For the first time, we prove that checking the existence of uncomputation is coNP-hard. We introduce two complementary synthesis-oriented existence checking methods: a syntax-directed static reasoning system and a rewrite-based normalization procedure (\RwUnx), together forming a top-down pipeline. We implement \RwUnx in Qiskit. Compared with the state-of-the-art \Reqompx, \RwUnx handles practical benchmarks with complex dependencies where \Reqompx does not, and achieves higher success rates in random-circuit experiments.

cs.PLCross-listedarXiv:2608.09578•Proceedings of the ACM on Programming Languages•Aug 11, 2026•0 citations

Formal Verification of Quantum Circuit Optimization Algorithms

Jincheng Zhang

Quantum circuit optimization is crucial for realizing the full potential of quantum computing. However, the inherent complexity of quantum circuits and the potential for errors introduce significant challenges in ensuring the correctness and efficiency of optimization algorithms. This paper proposes a novel approach to formally verify quantum circuit optimization algorithms. We translate these algorithms into formal specification languages and leverage model checking and theorem proving techniques to rigorously demonstrate that the algorithms meet their intended objectives – primarily minimizing circuit complexity – without introducing unintended side effects. The core contribution lies in applying formal verification methodologies to this largely unexplored area, offering a path towards building trust and confidence in quantum optimization strategies. The presented framework provides a systematic method for ensuring the reliability of quantum circuits, a critical step towards practical quantum computation. The verification process relies on defining the desired behavior as a set of logical properties and then employing automated tools to check whether the optimized circuit satisfies these properties. This approach addresses the fundamental need for rigorous assurance in quantum systems, moving beyond empirical validation and towards mathematically proven correctness.

•Sep 5, 2026•0 citations

Bona: Automatic Management of Dirty Ancilla Borrowing in Quantum Circuits

Xiaoquan Xu, Chenke Liu, Boning Meng +2 more

The management of ancilla qubits has become a critical technique for reducing quantum circuit width. Dirty ancillas, which may be borrowed from any temporarily idle qubit regardless of their initial states, offer substantial flexibility for width optimization, but their use has so far required manual and error-prone handling. We formalize the dirty-qubit borrowing problem and establish a fundamental computational limit by proving its NP-hardness. To support practical optimization, we present \bona, the first scheduler for dirty-qubit borrowing, built on a novel depth-aware heuristic algorithm. We evaluate \bona~ across a variety of benchmarks, including practical quantum circuits and randomly arranged compositions of real circuit modules, and find that it reduces nearly 99\% of dirty ancillas on average with controlled depth overhead. In particular, for parallel quantum walk---an essential component of parallel Hamiltonian simulation---\bona~ matches the circuit width achieved by the clean-qubit schemes of \citeauthor{jiang2024recycling}~(\citeyear{jiang2024recycling}) and \citeauthor{quantinuum}~(\citeyear{quantinuum}), but attains significantly smaller circuit depth, providing concrete evidence that dirty ancillas offer unique optimization advantages in circuits with certain parallelism.

cs.PLCross-listedarXiv:2608.08765•Aug 11, 2026•0 citations

Rise of conditionally clean ancillae for efficient quantum circuit constructions

Tanuj Khattar, Craig Gidney

We introduce conditionally clean ancilla qubits, a new quantum resource, recently explored by \cite{nie2024quantum}, that bridges the gap between traditional clean and dirty ancillae. Like dirty ancillae, they begin and end in an unknown state and can be borrowed from existing system qubits, avoiding the space overhead of explicit qubit allocation. Like clean ancillae, they can be treated as initialized in a known state within specific computations, thus avoiding the overhead of toggle detection required for dirty ancillae. We present new circuit constructions leveraging conditionally clean ancillae to achieve lower gate counts and depths, particularly with limited ancilla availability. Specifically, we provide constructions for:(a) n -controlled NOT using 2 n Toffolis and O ( log ⁡ n ) depth given 2 clean ancillae.(b) n -qubit incrementer using 3 n Toffolis given log 2 ∗ ⁡ n clean ancillae.(c) n -qubit quantum-classical comparator using 3 n Toffolis given log 2 ∗ ⁡ n clean ancillae.(d) unary iteration over [ 0 , N ) using 2.5 N Toffolis given log 2 ∗ ⁡ n clean ancillae.(e) unary iteration via skew tree over [ 0 , N ) using 1.25 N Toffolis given n dirty ancillae.We also introduce laddered toggle detection , a technique to replace clean ancillae with dirty ancillae in all our constructions, incurring a 2x Toffoli gate overhead. Our results demonstrate that conditionally clean ancillae are a valuable tool for quantum circuit design, especially in the resource-constrained early fault-tolerant era.

arXiv:2407.17966•Quantum•May 21, 2025•16 citations

Formal Verification of Quantum Circuit Compilation

Jincheng Zhang

Quantum circuit compilation is a crucial step in the realization of quantum computation, transforming high-level quantum algorithms into gate-level operations executable on specific quantum hardware. However, this process is inherently complex and susceptible to errors, including gate decomposition errors, qubit mapping errors, and resource allocation errors. These errors can significantly degrade the fidelity of the final computation. This paper proposes and investigates the application of formal verification techniques to guarantee the correctness of quantum circuit compilation. We demonstrate how model checking and formal methods can be applied to rigorously verify that the compilation algorithm adheres to predefined constraints, such as preserving quantum properties like unitary evolution and qubit orthogonality. The core claim is that formal verification offers a robust solution to the challenges of detecting and preventing errors in quantum compilation. The proposed approach significantly advances the reliability and trustworthiness of quantum computing by providing a rigorous method for ensuring compilation accuracy. We outline a framework for applying these techniques, focusing on key constraints and illustrating their application through a simplified compilation scenario.

•Aug 29, 2026•0 citations

Formal Verification of Quantum Circuit Compilation using Symbolic Execution

Jincheng Zhang

Quantum circuit compilation is a crucial step in translating high-level quantum algorithms into executable quantum circuits on specific hardware. The complexity and potential for errors within this process necessitate rigorous verification methods. This paper proposes a novel approach leveraging symbolic execution to formally verify quantum circuit compilation. We represent quantum circuits and compilation steps as a symbolic program, enabling the exploration of all possible compilation paths. By incorporating quantum gate fidelities and noise models into the symbolic execution engine, we can identify potential errors in the compilation logic, providing a robust and systematic way to ensure the correctness of the compilation process. The core claim is that symbolic execution can be extended to formally verify the correctness of quantum circuit compilation processes. This work addresses a critical need in quantum computing, offering a new technique for building trust and reliability into quantum software.

•Aug 28, 2026•0 citations
Ensuring ancilla safety is a critical correctness requirement for quantum compilation, since ancilla qubits are routinely introduced to implement complex operations with fewer gates and reduced depth. However, formally verifying this property is computationally hard due to state-space explosion in the number of qubits, particularly for dirty ancillae, which carry unknown initial states and must be restored after use. We propose an end-to-end verification-and-repair framework that rigorously addresses both clean and dirty ancilla safety. Our core contribution is a two-step reduction strategy: we first prove that verifying an mmm-qubit dirty ancilla register decomposes into 2m2m2m independent clean ancilla safety checks; subsequently, we reduce each clean ancilla safety instance to an algebraic commutativity check against Pauli-ZZZ and Pauli-XXX operators. This approach yields an efficient and naturally parallel verifier and enables actionable diagnosis by classifying violations into logic errors and phase errors. Leveraging this diagnosis, we further design lightweight repair routines that append local single-qubit rotations to eliminate a broad class of local ancilla faults. We implement the full pipeline in a prototype tool using a dual-backend architecture combining decision diagrams and weighted model counting, and validate it on diverse circuits ranging from arithmetic benchmarks to Grover's algorithm. Our experiments demonstrate scalability to thousands of qubits and show that the proposed repairs effectively improve ancilla safety while preserving circuit functionality.
Automatic uncomputation aims to provide programming-language-level support to facilitate the correct and safe use of ancilla qubits in quantum computing, but efforts have only been made for clean ancillas, leaving dirty ancillas unexplored. We present a unified formalization of the uncomputation of both clean and dirty ancillas. For the first time, we prove that checking the existence of uncomputation is coNP-hard. We introduce two complementary synthesis-oriented existence checking methods: a syntax-directed static reasoning system and a rewrite-based normalization procedure (\RwUnx), together forming a top-down pipeline. We implement \RwUnx in Qiskit. Compared with the state-of-the-art \Reqompx, \RwUnx handles practical benchmarks with complex dependencies where \Reqompx does not, and achieves higher success rates in random-circuit experiments.
Quantum circuit optimization is crucial for realizing the full potential of quantum computing. However, the inherent complexity of quantum circuits and the potential for errors introduce significant challenges in ensuring the correctness and efficiency of optimization algorithms. This paper proposes a novel approach to formally verify quantum circuit optimization algorithms. We translate these algorithms into formal specification languages and leverage model checking and theorem proving techniques to rigorously demonstrate that the algorithms meet their intended objectives – primarily minimizing circuit complexity – without introducing unintended side effects. The core contribution lies in applying formal verification methodologies to this largely unexplored area, offering a path towards building trust and confidence in quantum optimization strategies. The presented framework provides a systematic method for ensuring the reliability of quantum circuits, a critical step towards practical quantum computation. The verification process relies on defining the desired behavior as a set of logical properties and then employing automated tools to check whether the optimized circuit satisfies these properties. This approach addresses the fundamental need for rigorous assurance in quantum systems, moving beyond empirical validation and towards mathematically proven correctness.
The management of ancilla qubits has become a critical technique for reducing quantum circuit width. Dirty ancillas, which may be borrowed from any temporarily idle qubit regardless of their initial states, offer substantial flexibility for width optimization, but their use has so far required manual and error-prone handling. We formalize the dirty-qubit borrowing problem and establish a fundamental computational limit by proving its NP-hardness. To support practical optimization, we present \bona, the first scheduler for dirty-qubit borrowing, built on a novel depth-aware heuristic algorithm. We evaluate \bona~ across a variety of benchmarks, including practical quantum circuits and randomly arranged compositions of real circuit modules, and find that it reduces nearly 99\% of dirty ancillas on average with controlled depth overhead. In particular, for parallel quantum walk---an essential component of parallel Hamiltonian simulation---\bona~ matches the circuit width achieved by the clean-qubit schemes of \citeauthor{jiang2024recycling}~(\citeyear{jiang2024recycling}) and \citeauthor{quantinuum}~(\citeyear{quantinuum}), but attains significantly smaller circuit depth, providing concrete evidence that dirty ancillas offer unique optimization advantages in circuits with certain parallelism.
We introduce conditionally clean ancilla qubits, a new quantum resource, recently explored by \cite{nie2024quantum}, that bridges the gap between traditional clean and dirty ancillae. Like dirty ancillae, they begin and end in an unknown state and can be borrowed from existing system qubits, avoiding the space overhead of explicit qubit allocation. Like clean ancillae, they can be treated as initialized in a known state within specific computations, thus avoiding the overhead of toggle detection required for dirty ancillae. We present new circuit constructions leveraging conditionally clean ancillae to achieve lower gate counts and depths, particularly with limited ancilla availability. Specifically, we provide constructions for:(a) n -controlled NOT using 2 n Toffolis and O ( log ⁡ n ) depth given 2 clean ancillae.(b) n -qubit incrementer using 3 n Toffolis given log 2 ∗ ⁡ n clean ancillae.(c) n -qubit quantum-classical comparator using 3 n Toffolis given log 2 ∗ ⁡ n clean ancillae.(d) unary iteration over [ 0 , N ) using 2.5 N Toffolis given log 2 ∗ ⁡ n clean ancillae.(e) unary iteration via skew tree over [ 0 , N ) using 1.25 N Toffolis given n dirty ancillae.We also introduce laddered toggle detection , a technique to replace clean ancillae with dirty ancillae in all our constructions, incurring a 2x Toffoli gate overhead. Our results demonstrate that conditionally clean ancillae are a valuable tool for quantum circuit design, especially in the resource-constrained early fault-tolerant era.
Quantum circuit compilation is a crucial step in the realization of quantum computation, transforming high-level quantum algorithms into gate-level operations executable on specific quantum hardware. However, this process is inherently complex and susceptible to errors, including gate decomposition errors, qubit mapping errors, and resource allocation errors. These errors can significantly degrade the fidelity of the final computation. This paper proposes and investigates the application of formal verification techniques to guarantee the correctness of quantum circuit compilation. We demonstrate how model checking and formal methods can be applied to rigorously verify that the compilation algorithm adheres to predefined constraints, such as preserving quantum properties like unitary evolution and qubit orthogonality. The core claim is that formal verification offers a robust solution to the challenges of detecting and preventing errors in quantum compilation. The proposed approach significantly advances the reliability and trustworthiness of quantum computing by providing a rigorous method for ensuring compilation accuracy. We outline a framework for applying these techniques, focusing on key constraints and illustrating their application through a simplified compilation scenario.
Quantum circuit compilation is a crucial step in translating high-level quantum algorithms into executable quantum circuits on specific hardware. The complexity and potential for errors within this process necessitate rigorous verification methods. This paper proposes a novel approach leveraging symbolic execution to formally verify quantum circuit compilation. We represent quantum circuits and compilation steps as a symbolic program, enabling the exploration of all possible compilation paths. By incorporating quantum gate fidelities and noise models into the symbolic execution engine, we can identify potential errors in the compilation logic, providing a robust and systematic way to ensure the correctness of the compilation process. The core claim is that symbolic execution can be extended to formally verify the correctness of quantum circuit compilation processes. This work addresses a critical need in quantum computing, offering a new technique for building trust and reliability into quantum software.