This book is a coding-driven introduction to ZX-Calculus, guiding readers to the advanced techniques of diagrammatic reasoning and circuit optimization.
Over recent years, ZX calculus has developed into a versatile formalism that extends well beyond quantum circuit optimization. While the previous chapters established its foundational rules, graphical language, and computational workflow, this chapter shifts attention to a new setting in which diagrammatic reasoning becomes especially valuable: fermionic systems. In particular, we examine how ZX-based methods can be adapted to represent and manipulate fermionic tensor networks in a structured and intuitive way.
Quantum computing promises significant speed-ups for certain algorithms but the practical use of current noisy intermediate-scale quantum (NISQ) era computers remains limited by resources constraints (e.g., noise, qubits, gates, and circuit depth). Quantum circuit optimization is a key mitigation strategy. In this context, ZX-calculus has emerged as an alternative framework that allows for semantics-preserving quantum circuit optimization. We review ZX-based optimization of quantum circuits, categorizing them by optimization techniques, target metrics and intended quantum computing architecture. In addition, we outline critical challenges and future research directions, such as multi-objective optimization, scalable algorithms, and enhanced circuit extraction methods. This survey is valuable for researchers in both combinatorial optimization and quantum computing. For researchers in combinatorial optimization, we provide the background to understand a new challenging combinatorial problem: ZX-based quantum circuit optimization. For researchers in quantum computing, we classify and explain existing circuit optimization techniques.
In the previous chapters, we developed the groundwork of ZX calculus, beginning with the basic structure of tensor networks such as edges, wires, and nodes, and the linear maps they represent. We also examined the rewrite and optimization procedures that make these diagrams useful for analyzing and transforming quantum circuits. Having seen that this graphical language also extends to applications such as fermionic ZX calculus, we now turn to another important application of ZX calculus in this chapter.
The ZX-calculus is a graphical language for reasoning about ZX-diagrams, a type of tensor networks that can represent arbitrary linear maps between qubits. Using the ZX-calculus, we can intuitively reason about quantum theory, and optimise and validate quantum circuits. In this paper we introduce PyZX, an open source library for automated reasoning with large ZX-diagrams. We give a brief introduction to the ZX-calculus, then show how PyZX implements methods for circuit optimisation, equality validation, and visualisation and how it can be used in tandem with other software. We end with a set of challenges that when solved would enhance the utility of automated diagrammatic reasoning.