[Paper Review] CertiQ: A Mostly-automated Verification of a Realistic Quantum Compiler
CertiQ is a mostly-automated verification framework for real-world quantum compiler passes in Qiskit, using a quantum circuit calculus to encode circuit equivalence checking as SMT problems. It enables formal verification of 26 out of 30 Qiskit compiler passes with minimal manual annotations, detecting three bugs and ensuring correctness while maintaining performance.
We present CertiQ, a verification framework for writing and verifying compiler passes of Qiskit, the most widely-used quantum compiler. To our knowledge, CertiQ is the first effort enabling the verification of real-world quantum compiler passes in a mostly-automated manner. Compiler passes written in the CertiQ interface with annotations can be used to generate verification conditions, as well as the executable code that can be integrated into Qiskit. CertiQ introduces the quantum circuit calculus to enable the efficient checking of equivalence of quantum circuits by encoding such a checking procedure into an SMT problem. CertiQ also provides a verified library of widely-used data structures, transformation functions for circuits, and conversion functions for different quantum data representations. This verified library not only enables modular verification but also sheds light on future quantum compiler design. We have re-implemented and verified 26 (out of 30) Qiskit compiler passes in CertiQ, during which three bugs are detected in the Qiskit implementation. Our verified compiler pass implementations passed all of Qiskit's regression tests without showing noticeable performance loss.
Motivation & Objective
- To address the critical need for reliable quantum compiler verification in near-term quantum computing, where bugs can corrupt results across millions of runs.
- To overcome the limitations of existing formal verification tools, which are manual, complex, and unsuitable for rapidly evolving quantum compilers like Qiskit.
- To enable scalable, automated verification of real-world quantum compiler optimizations without requiring deep expertise in proof assistants.
- To provide a verified, modular library of quantum circuit transformations that preserve semantics and support compositional verification.
- To integrate verified compiler passes directly into Qiskit with no performance loss, ensuring correctness across regression tests.
Proposed method
- Introduces a quantum circuit calculus that enables symbolic representation and execution of quantum circuits, supporting efficient equivalence checking via SMT encoding.
- Encodes verification conditions for compiler passes into SMT formulas using symbolic execution results and extracted rewriting rules from verified transformations.
- Employs a verified library of high-level, semantics-preserving quantum circuit transformations to modularize proofs and reduce verification burden.
- Uses annotations only for loop invariants and external function contracts, minimizing manual specification effort—enabling 'mostly-automated' verification.
- Leverages state-of-the-art SMT solvers (e.g., Z3) to check circuit equivalence without full matrix representation, avoiding exponential overhead.
- Generates both executable, optimized Qiskit passes and machine-checkable proofs from the same CertiQ-verified source code.
Experimental results
Research questions
- RQ1Can formal verification of real-world quantum compiler passes be achieved with minimal manual effort, enabling scalability in practice?
- RQ2Can SMT-based equivalence checking of quantum circuits be made efficient and practical for compiler verification without relying on full denotational semantics?
- RQ3Can a verified library of quantum circuit transformations enable modular, composable verification of complex compiler passes?
- RQ4Can the integration of verified passes into a production compiler like Qiskit be achieved without performance degradation?
- RQ5Can formal verification detect real, previously undetected bugs in existing quantum compiler implementations?
Key findings
- CertiQ successfully verified 26 out of 30 Qiskit compiler passes, demonstrating feasibility for real-world quantum compiler verification.
- Three previously undetected bugs were discovered in the original Qiskit implementations during the verification process.
- All verified compiler passes passed Qiskit’s full regression test suite, confirming functional correctness in practice.
- Verification of passes using high-level transformation functions completed in seconds, while low-level rule-based passes took under one minute.
- The verified passes showed no noticeable performance loss compared to the original Qiskit implementations in execution benchmarks.
- The framework enables mostly-automated verification with minimal annotations, significantly reducing the proof burden for quantum compiler developers.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.