# PyZX: Large Scale Automated Diagrammatic Reasoning

@article{Kissinger2019PyZXLS, title={PyZX: Large Scale Automated Diagrammatic Reasoning}, author={Aleks Kissinger and John van de Wetering}, journal={Electronic Proceedings in Theoretical Computer Science}, year={2019} }

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…

## 74 Citations

### VyZX : A Vision for Verifying the ZX Calculus

- Computer ScienceArXiv
- 2022

Vy ZX is developed, a veriﬁed ZX-calculus in the Coq proof assistant that provides two distinct representations of ZX diagrams for ease of programming and proof.

### Spin-networks in the ZX-calculus

- Computer Science
- 2021

It has long been thought that quantum gravity should be closely aligned to quantum information theory, and the results demonstrate a way in which this connection can be made exact, by writing the spin-networks of loop quantum gravity in the ZX-diagrammatic language of quantum computation.

### Diagrammatic Diﬀerentiation for Quantum Machine Learning

- Computer Science
- 2021

This work introduces diagrammatic diﬀerentiation for tensor calculus by generalising the dual number construction from rigs to monoidal categories and extends the method to the automatic di-erentation of hybrid classical-quantum circuits, using diagrams with bubbles to encode arbitrary non-linear operators.

### Fast Automated Reasoning over String Diagrams using Multiway Causal Structure

- Computer ScienceArXiv
- 2021

We introduce an intuitive algorithmic methodology for enacting automated rewriting of string diagrams within a general double-pushout (DPO) framework, in which the sequence of rewrites is chosen in…

### AKLT-States as ZX-Diagrams: Diagrammatic Reasoning for Quantum States

- Computer SciencePRX Quantum
- 2022

The results show that the ZXH-calculus is a powerful language for representing and computing with physical states entirely graphically, paving the way to develop more efficient many-body algorithms.

### ZX-calculus for the working quantum computer scientist

- Computer Science
- 2020

This review discusses Clifford computation and graphically prove the Gottesman-Knill theorem, a recently introduced extension of the ZX-calculus that allows for convenient reasoning about Toffoli gates, and the recent completeness theorems that show that, in principle, all reasoning about quantum computation can be done using Zx-diagrams.

### Diagrammatic Differentiation for Quantum Machine Learning

- Computer ScienceElectronic Proceedings in Theoretical Computer Science
- 2021

This work introduces diagrammatic differentiation for tensor calculus by generalising the dual number construction from rigs to monoidal categories and extending the method to the automatic differentation of hybrid classical-quantum circuits.

### Diagrammatic Analysis for Parameterized Quantum Circuits

- Computer Science
- 2022

Extensions of the ZX-calculus especially suitable for parameterized quantum circuits, in particular for computing observable expectation values as functions of or for parameters, which are important algorithmic quantities in a variety of applications ranging from combinatorial optimization to quantum chemistry are described.

### Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus

- Computer ScienceQuantum
- 2020

A simplification strategy for ZX-diagrams is given based on the two graph transformations of local complementation and pivoting and it is shown that the resulting reduced diagram can be transformed back into a quantum circuit.

### DisCoPy for the quantum computer scientist

- Computer Science
- 2022

This work reviews the recent developments of the library in this direction, making DisCoPy a toolbox for the quantum computer scientist.

## References

SHOWING 1-10 OF 33 REFERENCES

### Quantomatic: A proof assistant for diagrammatic reasoning

- Computer ScienceCADE
- 2015

This work briefly outlines the theoretical basis of Quantomatic's rewriting engine, then gives an overview of the core features and architecture and gives a simple example project that computes normal forms for commutative bialgebras.

### A Near-Minimal Axiomatisation of ZX-Calculus for Pure Qubit Quantum Mechanics

- Mathematics2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)
- 2019

This paper introduces the singular-value decomposition of a ZX-diagram, and uses it to show that all the rules of the former axiomatisation are provable with the new one.

### Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus

- Computer ScienceQuantum
- 2020

A simplification strategy for ZX-diagrams is given based on the two graph transformations of local complementation and pivoting and it is shown that the resulting reduced diagram can be transformed back into a quantum circuit.

### Pattern Graph Rewrite Systems

- Computer ScienceDCM
- 2012

This extended abstract shows how the power of graph rewrite systems can be greatly extended by introducing pattern graphs, which provide a means of expressing infinite families of rewrite rules where certain marked subgraphs on both sides of a rule can be copied any number of times or removed.

### Making the stabilizer ZX-calculus complete for scalars

- Computer Science
- 2015

This work replaces those scalar-free rewrite rules with correctly scaled ones and shows that, by adding one new diagram element and a new rewrite rule, the calculus can be made complete for pure qubit stabilizer quantum mechanics with scalars.

### A Complete Axiomatisation of the ZX-Calculus for Clifford+T Quantum Mechanics

- MathematicsLICS
- 2018

The ZX-Calculus is made complete for the so-called Clifford+T quantum mechanics by adding two new axioms to the language, and it is proved that the π/4-fragment of the ZX -Calculus represents exactly all the matrices over some finite dimensional extension of the ring of dyadic rationals.

### Interacting quantum observables: categorical algebra and diagrammatics

- MathematicsArXiv
- 2009

The ZX-calculus is introduced, an intuitive and universal graphical calculus for multi-qubit systems, which greatly simplifies derivations in the area of quantum computation and information and axiomatize phase shifts within this framework.

### A diagrammatic axiomatisation of fermionic quantum circuits

- PhysicsFSCD
- 2018

It is proved that the axioms provide a complete equational axiomatisation of the monoidal category whose objects are quantum systems of finitely many local fermionic modes, with operations that preserve or reverse the parity of states, and the tensor product, corresponding to the composition of two systems, as monoidal product.

### J ul 2 01 9 A DIAGRAMMATIC CALCULUS OF FERMIONIC QUANTUM CIRCUITS

- Physics
- 2019

We introduce the fermionic ZW calculus, a string-diagrammatic language for fermionic quantum computing (FQC). After defining a fermionic circuit model, we present the basic components of the…

### Reducing T-count with the ZX-calculus

- Computer Science
- 2019

A new method for reducing the number of T-gates in a quantum circuit based on the ZX-calculus is presented, which matches or beats previous approaches to T-count reduction on the majority of benchmark circuits in the ancilla-free case, in some cases yielding up to 50% improvement.