The ZX-calculus is a graphical language that goes beyond circuit diagrams. It ‘splits the atom’ of well-known quantum logic gates to reveal the compositional structure inside. The calculus works by generalising the ideas of Z and X operations, allowing us to break out of the circuit model while maintaining soundness of reasoning. In doing so we can show properties of circuits, entanglement states, and protocols, in a visually succinct but logically complete manner.
The ZX-calculus is forging the next generation of quantum software. Using the calculus gives optimisation strategies that performs state-of-the-art T-count reduction (an important metric for fault-tolerant computing) and gate compilation. The generators of the calculus correspond closely to the basic operations of lattice surgery in the surface code, giving a visual design and verification language for these codes; and ZX has also been used to discover novel error correction procedures. It comes with a scalable notation capable of representing repeated structures at arbitrary qubit scales. The calculus also acts in the crucial role of an intermediate representation in a new commercial quantum compiler.
Want to learn more or ask some questions? Join us on Discord!
Example derivationThis example starts with a circuit and ends with a circuit, but the intermediate steps are not always circuits:
To learn a bit more about the ZX-calculus, check out the tutorial page, or see the publications in the next section.
We show here a couple of resources that serve as good introductions to the ZX-calculus. Please see the publications page for a full list of papers using the ZX-calculus.
- Quantum in Pictures (2023). A fun introduction to quantum theory and ZX calculus with no mathematical pre-requisites.
- Picturing Quantum Processes: A First Course in Quantum Theory and Diagrammatic Reasoning (2017). A.k.a. "the dodo book", gives a complete introduction to quantum theory and diagrammatic reasoning (including ZX) from first principles. Assumes basic university-level mathematics.
- Basic ZX-calculus for students and professionals (2023). A set of lecture notes giving a taste of ZX calculus. Assumes basic familiarity with bra-ket notation.
- ZX-calculus for the working quantum computer scientist (2020). A comprehensive introduction to the ZX calculus, aimed at people with a background in quantum computing.
ZX-calculus has now been applied in many areas, such as classical simulation, quantum circuit optimisation, quantum error correction, measurement-based quantum computing, tensor networks, condensed matter, constraint satisfaction, variational circuits, and quantum natural language processing. For a survey, check out this paper.
There are a number of tools that allow you to handle ZX-diagrams.
- PyZX is a Python library for automatically simplifying ZX-diagrams and quantum circuits. On this page you can find an in-browser demonstration of the T-count optimising procedure from PyZX presented in this paper.
- TikZiT is a GUI for making Tikz diagrams. Many papers that use ZX-diagrams use TikZiT to make the diagrams.