Quantum ZX Corpus2. ZX graphs in brief
Contents

Chapter 2 of 10 · ZX graphs in brief

What a ZX graph is, and why it is used to measure quantum optimisers

The ZX-calculus draws a quantum circuit as a graph. Rewriting that graph is how many optimisers make circuits cheaper to run.

Circuits become graphs

The ZX-calculus draws a quantum circuit as a graph. The nodes are called spiders: green Z spiders and red X spiders. Some carry a phase. A CNOT gate becomes a green spider on one wire joined to a red spider on the other.

Rules simplify the graph

Simple rules change the graph without changing what the circuit does. Two connected spiders of the same colour merge into one. A spider with no phase and two connections can be removed.

Benchmarks count what's left

A benchmark measures how far a tool gets: how many spiders and T gates remain, and how long it took. T gates matter most because they are the most expensive operation on fault-tolerant hardware.

Z spider X spider Highlighted link: click to merge Dashed ring: click to remove
0Spiders
0Links
0T-count

    Try it. A demonstration written for this page. It applies spider merging, spider removal and one cleanup rule (the Hopf law), and ignores overall scaling factors. The library will record the same counts for every graph.