TensorFlow Quantum: A Software Framework for Quantum Machine Learning
Michael Broughton, Guillaume Verdon, Trevor McCourt, Antonio J. Martinez, Jae Hyeon Yoo, Sergei V. Isakov, Philip Massey, Ramin Halavati, Murphy Yuezhen Niu, Alexander Zlokapa, Evan Peters, Owen Lockwood, Andrea Skolik, Sofiene Jerbi, Vedran Dunjko, Martin Leib, Michael Streif, David Von Dollen, Hongxiang Chen, Shuxiang Cao, Roeland Wiersema, Hsin-Yuan Huang, Jarrod R. McClean, Ryan Babbush, Sergio Boixo, Dave Bacon, Alan K. Ho, Hartmut Neven, Masoud Mohseni
TL;DR
TensorFlow Quantum (TFQ) presents an integrated software stack that unites Cirq with TensorFlow to enable rapid prototyping and training of hybrid quantum-classical models on quantum data. It provides differentiable quantum circuit execution, batched processing, and a high-performance qsim backend to scale simulations, along with a rich set of building blocks (tensors, sampling, differentiation layers, and datasets) for end-to-end quantum ML pipelines. The paper details both the software architecture and a broad spectrum of applications, from basic quantum classifiers and QAOA to advanced topics like meta-learning, Hamiltonian learning, quantum generative models, and quantum RL, illustrating TFQ’s potential to drive practical QML on near-term devices. The work emphasizes methodology for backpropagation through quantum circuits, toolchains for hybrid graphs, and robust training under noise, positioning TFQ as a versatile framework for exploring quantum algorithms and discovering quantum advantages. Overall, TFQ aims to accelerate quantum ML research by providing accessible, differentiable, and scalable tooling that can operate across simulators and real quantum hardware.
Abstract
We introduce TensorFlow Quantum (TFQ), an open source library for the rapid prototyping of hybrid quantum-classical models for classical or quantum data. This framework offers high-level abstractions for the design and training of both discriminative and generative quantum models under TensorFlow and supports high-performance quantum circuit simulators. We provide an overview of the software architecture and building blocks through several examples and review the theory of hybrid quantum-classical neural networks. We illustrate TFQ functionalities via several basic applications including supervised learning for quantum classification, quantum control, simulating noisy quantum circuits, and quantum approximate optimization. Moreover, we demonstrate how one can apply TFQ to tackle advanced quantum learning tasks including meta-learning, layerwise learning, Hamiltonian learning, sampling thermal states, variational quantum eigensolvers, classification of quantum phase transitions, generative adversarial networks, and reinforcement learning. We hope this framework provides the necessary tools for the quantum computing and machine learning research communities to explore models of both natural and artificial quantum systems, and ultimately discover new quantum algorithms which could potentially yield a quantum advantage.
