tensorflow/quantum

An open-source Python framework for hybrid quantum-classical machine learning.

TensorFlow Quantum (TFQ)

What it is – TFQ is a Python library that lets you build hybrid quantum‑classical machine‑learning models. It plugs quantum circuits written with Cirq into the TensorFlow/Keras ecosystem, so you can train models with the same tools you use for ordinary deep learning.

Key capabilities

  • Write quantum circuits with Cirq and simulate them with Google’s high‑performance qsim engine.
  • Use Keras layers that wrap quantum operations, making quantum circuits first‑class TensorFlow ops.
  • Automatic differentiation of quantum circuits via several gradient methods (parameter‑shift, adjoint, etc.).
  • Leverages TensorFlow’s graph execution and GPU/TPU acceleration for large‑scale experiments.

Typical workflow

  1. Define a parameterised quantum circuit in Cirq.
  2. Wrap the circuit in a tfq.layers Keras layer.
  3. Build a Keras model that mixes classical and quantum layers.
  4. Train the model with model.fit, letting TensorFlow handle back‑propagation through the quantum part.

Installation – Follow the official guide (linked from the README). The package is published on PyPI as tensorflow-quantum and requires Python 3.10‑3.12, TensorFlow 2.19+, NumPy 2.0, and Cirq 1.5.

Learning resources

  • Quick‑start tutorials and notebooks are in the repo under docs/tutorials.
  • Full documentation, guides, and API reference are hosted at https://tensorflow.org/quantum.

Getting help

  • Open issues on the GitHub tracker.
  • Ask questions on Stack Overflow with the tensorflow-quantum tag.

Cite the project When you publish work that uses TFQ, cite the arXiv paper TensorFlow Quantum: A Software Framework for Quantum Machine Learning (2020) – the README provides a ready‑to‑copy BibTeX entry.

Contact – For non‑public queries, email quantum-oss-maintainers@google.com.

Why it matters – TFQ enables researchers to prototype quantum‑enhanced ML algorithms at scale, using the same tooling and hardware acceleration that power mainstream deep learning. This bridges the gap between quantum algorithm research and practical machine‑learning pipelines.

Related

  • Project
  • Project
  • Project
  • Project
  • Project