Qirella – The ZX-Calculus

In addition to my work on quantum circuit simulation, Qirella lets you create, view, and edit ZX-diagrams, as well as apply the rewrite rules of the ZX-Calculus in real-time. You can test it here:

The ZX-Calculus is a graphical notation for representing linear maps. It also provides a set of rewrite rules to transform these diagrams while preserving their underlying meaning. As quantum circuits are essentially unitary maps, ZX-diagrams represent a superset of them.

Thus, every quantum circuit can be transformed into a ZX-diagram representing the same map, and some ZX-diagrams can be converted back to quantum circuits.

The ZX-Calculus can therefore be used to optimize quantum circuits and reduce their gate count by first converting them to their ZX representation, then using the rewrite rules to optimize them, and afterwards extracting a circuit from the diagram.

Proving the diagram shown above actually just swaps the two qubits
Proving the Hopf law itself using the other rules of the calculus
Proving that the Hadamard gate is self inverse using the ZX-Calculus