Table of Contents
Fetching ...

Exhaustive Search for Quantum Circuit Optimization using ZX Calculus

Tobias Fischbach, Pierre Talbot, Pascal Bouvry

TL;DR

This work addresses architecture-independent quantum circuit optimization by framing library-free ZX-diagram rewriting as an exhaustive search problem. It introduces a semantic-preserving optimization pipeline using ZX calculus and two state-space search strategies, DFS and iterative deepening DFS (IDDFS), complemented by pruning rules to ensure termination. The key contributions include a formal ZX-diagram optimization framework, a proof-of-concept implementation benchmarked on 100 circuits, and integration as a PyZX/Qiskit transpilation pass, with IDDFS achieving state-of-the-art-like performance for $T$-gate reduction and transferable improvements for edge-based metrics. The results demonstrate the practical potential of ZX-based exhaustive search for improving quantum circuit viability on near-term hardware and guide future work on scalability and architecture-aware optimization.

Abstract

Quantum computers allow a near-exponential speed-up for specific applications when compared to classical computers. Despite recent advances in the hardware of quantum computers, their practical usage is still severely limited due to a restricted number of available physical qubits and quantum gates, short coherence time, and high error rates. This paper lays the foundation towards a metric independent approach to quantum circuit optimization based on exhaustive search algorithms. This work uses depth-first search and iterative deepening depth-first search. We rely on ZX calculus to represent and optimize quantum circuits through the minimization of a given metric (e.g. the T-gate and edge count). ZX calculus formally guarantees that the semantics of the original circuit is preserved. As ZX calculus is a non-terminating rewriting system, we utilise a novel set of pruning rules to ensure termination while still obtaining high-quality solutions. We provide the first formalization of quantum circuit optimization using ZX calculus and exhaustive search. We extensively benchmark our approach on 100 standard quantum circuits. Finally, our implementation is integrated in the well-known libraries PyZX and Qiskit as a compiler pass to ensure applicability of our results.

Exhaustive Search for Quantum Circuit Optimization using ZX Calculus

TL;DR

This work addresses architecture-independent quantum circuit optimization by framing library-free ZX-diagram rewriting as an exhaustive search problem. It introduces a semantic-preserving optimization pipeline using ZX calculus and two state-space search strategies, DFS and iterative deepening DFS (IDDFS), complemented by pruning rules to ensure termination. The key contributions include a formal ZX-diagram optimization framework, a proof-of-concept implementation benchmarked on 100 circuits, and integration as a PyZX/Qiskit transpilation pass, with IDDFS achieving state-of-the-art-like performance for -gate reduction and transferable improvements for edge-based metrics. The results demonstrate the practical potential of ZX-based exhaustive search for improving quantum circuit viability on near-term hardware and guide future work on scalability and architecture-aware optimization.

Abstract

Quantum computers allow a near-exponential speed-up for specific applications when compared to classical computers. Despite recent advances in the hardware of quantum computers, their practical usage is still severely limited due to a restricted number of available physical qubits and quantum gates, short coherence time, and high error rates. This paper lays the foundation towards a metric independent approach to quantum circuit optimization based on exhaustive search algorithms. This work uses depth-first search and iterative deepening depth-first search. We rely on ZX calculus to represent and optimize quantum circuits through the minimization of a given metric (e.g. the T-gate and edge count). ZX calculus formally guarantees that the semantics of the original circuit is preserved. As ZX calculus is a non-terminating rewriting system, we utilise a novel set of pruning rules to ensure termination while still obtaining high-quality solutions. We provide the first formalization of quantum circuit optimization using ZX calculus and exhaustive search. We extensively benchmark our approach on 100 standard quantum circuits. Finally, our implementation is integrated in the well-known libraries PyZX and Qiskit as a compiler pass to ensure applicability of our results.

Paper Structure

This paper contains 11 sections, 6 figures.

Figures (6)

  • Figure 1: The basic rewriting rules of ZX calculus.
  • Figure 2: Successive applications of rewriting rules to a simple ZX diagram (to be read from left to right and top to bottom).
  • Figure 3: Performance comparison of the best solution found.
  • Figure 4: Performance comparison of the best solution found.
  • Figure 5: Performance comparison of the best solution found.
  • ...and 1 more figures

Theorems & Definitions (1)

  • definition thmcounterdefinition