[Paper Review] VyZX : A Vision for Verifying the ZX Calculus
VyZX presents a formally verified implementation of the ZX calculus in the Coq proof assistant, using two complementary representations—block-based for inductive reasoning and graph-based for intuitive programming. It enables machine-checked proofs of ZX diagram equivalences and paves the way for a fully verified quantum circuit optimizer by integrating with the Voqc compiler pipeline.
Optimizing quantum circuits is a key challenge for quantum computing. The PyZX compiler broke new ground by optimizing circuits via the ZX calculus, a powerful graphical alternative to the quantum circuit model. Still, it carries no guarantee of its correctness. To address this, we developed VyZX, a verified ZX-calculus in the Coq proof assistant. VyZX provides two distinct representations of ZX diagrams for ease of programming and proof: A graph-based representation for writing high-level functions on diagrams and a block-based representation for proving ZX diagrams equivalent. Through these two different views, VyZX provides the tools necessary to verify properties and transformations of ZX diagrams. This paper explores the proofs and design choices underlying VyZX and its application and the challenges of verifying a graphical programming language.
Motivation & Objective
- To address the lack of correctness guarantees in existing quantum circuit optimizers, particularly those based on the ZX calculus like PyZX.
- To formalize the ZX calculus in Coq to enable machine-checked proofs of diagram equivalences and transformations.
- To overcome the challenges of verifying graphical languages by designing two complementary representations: block-based for inductive proofs and graph-based for intuitive manipulation.
- To enable integration with the Voqc compiler for a fully verified quantum optimization pipeline.
- To extend the framework to support other graphical calculi like ZH and ZW for broader verification applications.
Proposed method
- Formalizing the ZX calculus using a block representation that supports inductive reasoning and structural induction for proving diagram equivalences.
- Implementing a graph representation that mirrors standard ZX diagram notation for intuitive programming and visualization.
- Defining semantics via linear map extraction using NumPy for equivalence checking, with formal proofs in Coq.
- Developing bidirectional conversion between block and graph representations to enable reasoning and implementation.
- Designing a circuit extraction pipeline from graph representations to sqir circuits, leveraging gflow for correctness.
- Planning integration with Voqc to create a fully verified optimization pipeline from circuit ingestion to extraction.
Experimental results
Research questions
- RQ1How can a graphical quantum calculus like the ZX calculus be formally verified in a proof assistant like Coq?
- RQ2What dual representations are necessary to balance inductive reasoning with intuitive diagram manipulation in a formal system?
- RQ3Can a verified ZX calculus framework enable the construction of a fully verified quantum circuit optimizer?
- RQ4How can formal equivalence checking of ZX diagrams be achieved without relying on SMT solvers or numerical validation alone?
- RQ5To what extent can the VyZX framework be extended to other graphical calculi such as ZH and ZW?
Key findings
- VyZX successfully formalizes the ZX calculus in Coq using two complementary representations: block-based for inductive proofs and graph-based for intuitive programming.
- The framework enables machine-checked proofs of core ZX diagram equivalences, such as the Euler decomposition and the ZH spider fusion rules.
- VyZX supports circuit ingestion from sqir and provides a foundation for extracting verified ZX diagrams back into sqir circuits.
- The design allows for formal verification of circuit extractability via gflow, ensuring that optimized diagrams can be reliably converted back to circuits.
- VyZX is designed for extensibility and can be adapted to verify optimizations in related calculi such as the ZH and ZW calculi.
- The framework lays the groundwork for a fully verified quantum optimizer by enabling integration with the Voqc compiler, ensuring end-to-end correctness.
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.