The ZX-calculus

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 derivation

This example starts with a circuit and ends with a circuit, but the intermediate steps are not always circuits:
The example derivation requires javascript in order to be displayed.

For a longer introduction to the ZX-calculus see the tutorial page.

Selected publications

We show here a couple of papers that might serve as good introductions to the ZX-calculus. Please see the publications page for a full list of papers using the ZX-calculus.


There are a number of tools that allow you to handle ZX-diagrams.

Other parts of the site:

These are also accessible from the banner at the top of the page.

Website by Hector Miller-Bakewell and John van de Wetering, with thanks to Dom Horsman and Richard East

Home Tutorial Publications Accessibility Map PyZX Demo