NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Quantum Circuit Optimization Based on Dynamic Grouping and ZX-Calculus for Reducing 2-Qubit Gate Count

Kai Chen, Wenyu Liu, Guofu Xu, Yangzhi Li, Maoduo Li, Suirong HearXiv 2025

Abstract

In the noisy intermediate-scale quantum (NISQ) era, two-qubit gates in quantum circuits are more susceptible to noise than single-qubit gates. Therefore, reducing the number of two-qubit gates is crucial for improving circuit efficiency and reliability. As quantum circuits scale up, the optimization search space becomes increasingly complex, leading to challenges such as low efficiency and suboptimal solutions. To address these issues, this paper proposes a quantum circuit optimization approach based on dynamic grouping and ZX-calculus. First, a random strategy-based dynamic grouping method partitions the circuit into multiple subcircuits. Second, a ZX-calculus guided k-step lookahead search performs equivalent subcircuit filtering to minimize two-qubit gate counts. Third, a delay-aware placement method optimizes the recombined circuit to reduce the overall gate count. Finally, simulated annealing iteratively updates the grouping strategy to achieve an optimized two-qubit gate count. Experimental results on benchmark datasets demonstrate the effectiveness and superiority of the proposed method in reducing two-qubit gates. Compared to the original circuits, the approach achieves an average reduction of 18% in two-qubit gates. It outperforms classical methods with up to 25% reduction, especially on gf circuits, and shows a 4% average improvement over heuristic ZX-calculus-based methods, validating its efficiency.

Introduction

In the Noisy Intermediate-Scale Quantum (NISQ) era, quantum computers are highly susceptible to errors. Two-qubit gates, such as CNOTs, are particularly problematic due to their lower fidelity and higher implementation costs compared to single-qubit gates. Minimizing the 2-qubit gate count is therefore essential for improving the reliability of quantum computations.

Optimizing these circuits is a complex task. Traditional rule-based methods rely on predefined templates and often miss non-local optimization opportunities. Intermediate Representation (IR) methods using ZX-calculus—a graphical language for quantum circuits—offer a way to find global structural simplifications. However, they face two main hurdles: a massive search space for transformation rules and the potential for "circuit extraction" to introduce redundant single-qubit gates. This paper introduces a hybrid pipeline to overcome these issues.

Methodology

The proposed framework combines dynamic circuit partitioning, ZX-calculus, and a lookahead search strategy.

1. Dynamic Grouping and ZX-Mapping

Instead of optimizing the entire circuit globally, the algorithm randomly slices the circuit into smaller subcircuits based on gate execution layers. Each subcircuit is then converted into a ZX-diagram. The mapping between standard quantum gates and their ZX-calculus counterparts (spiders) is fundamental to this process.

Mapping standard quantum gates to ZX-calculus spiders.

By converting the circuit into this graphical form, the optimizer can perform topological simplifications that are difficult to identify in standard gate notation. Below is an example of a circuit and its equivalent ZX-diagram.

Example of a quantum circuit converted into its equivalent ZX-diagram representation.

To avoid suboptimal greedy choices, the algorithm employs a k-step lookahead search. It explores multiple transformation paths $k$ steps into the future, evaluating which graphical changes will actually result in the fewest 2-qubit gates after the diagram is converted back into a circuit.

3. Delayed Gate Placement and Simulated Annealing

After optimizing subcircuits, they are recombined. To clean up artifacts from the ZX-extraction process—such as redundant Hadamard gates—the algorithm uses a delayed gate placement strategy. This allows adjacent gates to meet and cancel out. The entire optimization is wrapped in a simulated annealing loop, which iteratively tests different grouping strategies to find a global optimum.

Key Results

The method was evaluated on a benchmark of 25 quantum circuits ranging from 5 to 36 qubits.

  • Significant Reduction: The approach achieved an average 18% reduction in 2-qubit gates compared to unoptimized circuits.
  • Outperforming Classical Baselines: It surpassed rule-based optimizers (like Qiskit and Quartz) by up to 25%, particularly on complex multiplier circuits.
  • Improvement over Heuristic ZX Methods: It beat existing ZX-based tools (PyZX, R2Q) by an average of 4%, with improvements reaching 15% for specific adder circuits.
  • Total Efficiency: Total gate counts were reduced by up to 25%, ensuring that 2-qubit gate savings did not lead to single-qubit gate bloat.

Conclusion and Future Work

This hybrid approach effectively mitigates the noise sensitivity of NISQ devices by minimizing 2-qubit gates through a combination of graphical calculus and heuristic search. While the lookahead search adds computational complexity, the resulting fidelity gains are substantial. Future research will focus on integrating hardware-specific topology constraints and exploring reinforcement learning to automate the selection of transformation rules.

Summary updated

BibTeX
@misc{chen2025quantum,
  author = {Kai Chen and Wenyu Liu and Guofu Xu and Yangzhi Li and Maoduo Li and Suirong He},
  title = {{Quantum Circuit Optimization Based on Dynamic Grouping and ZX-Calculus for Reducing 2-Qubit Gate Count}},
  year = {2025},
  eprint = {2507.14434},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.14434},
  howpublished = {arXiv},
}
Figure