Diagrammatic Differentiation for Quantum Machine Learning
arXiv:2103.07960 · doi:10.4204/EPTCS.343.7
Abstract
We introduce diagrammatic differentiation for tensor calculus by generalising the dual number construction from rigs to monoidal categories. Applying this to ZX diagrams, we show how to calculate diagrammatically the gradient of a linear map with respect to a phase parameter. For diagrams of parametrised quantum circuits, we get the well-known parameter-shift rule at the basis of many variational quantum algorithms. We then extend our method to the automatic differentation of hybrid classical-quantum circuits, using diagrams with bubbles to encode arbitrary non-linear operators. Moreover, diagrammatic differentiation comes with an open-source implementation in DisCoPy, the Python library for monoidal categories. Diagrammatic gradients of classical-quantum circuits can then be simplified using the PyZX library and executed on quantum hardware via the tket compiler. This opens the door to many practical applications harnessing both the structure of string diagrams and the computational power of quantum machine learning.
arXiv commentIn Proceedings QPL 2021, arXiv:2109.04886
References in corpus (9)
- The NumPy array: a structure for efficient numerical computation
- Supervised learning with quantum enhanced feature spaces
- Evaluating analytic gradients on quantum hardware
- Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus
- Reducing T-count with the ZX-calculus
- Phase Gadget Synthesis for Shallow Circuits
- DisCoPy: Monoidal Categories in Python
- A Hitchhiker's Guide to Automatic Differentiation
- Architecture-Aware Synthesis of Phase Polynomials for NISQ Devices
Cited by in corpus (5)
- Light-Matter Interaction in the ZXW Calculus
- Deconstructing the Calculus of Relations with Tape Diagrams
- Diagrammatic Analysis for Parameterized Quantum Circuits
- Differentiating and Integrating ZX Diagrams with Applications to Quantum Machine Learning
- ZX Graphical Calculus for Continuous-Variable Quantum Processes