Diagrammatic Differentiation for Quantum Machine Learning

Alexis Toumi
(University of Oxford)
Richie Yeung
(Cambridge Quantum Computing Ltd.)
Giovanni de Felice
(University of Oxford)

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.

In Chris Heunen and Miriam Backens: Proceedings 18th International Conference on Quantum Physics and Logic (QPL 2021), Gdansk, Poland, and online, 7-11 June 2021, Electronic Proceedings in Theoretical Computer Science 343, pp. 132–144.
Published: 18th September 2021.

ArXived at: http://dx.doi.org/10.4204/EPTCS.343.7 bibtex PDF
References in reconstructed bibtex, XML and HTML format (approximated).
Comments and questions to: eptcs@eptcs.org
For website issues: webmaster@eptcs.org