Quantum Hopfield neural network

Patrick Rebentrost, Thomas R. Bromley, Christian Weedbrook, Seth Lloyd · DOI

Abstract

Neural networks, ubiquitous in machine learning, are generalized to the quantum realm. The method results in a network that can be exploited to offer exponential speedup on many applications, such as image processing and optimization, thus with a wider interest in neuroscience and medicine.

Introduction

The Hopfield network serves as a foundational model for associative memory, capable of pattern recognition and data reconstruction. However, classical implementations face a significant scaling bottleneck: the time required for network updates and memory retrieval scales linearly with the number of neurons ($d$). As modern datasets in fields like genomics or high-resolution imaging grow in dimensionality, this linear scaling becomes a computational barrier. This paper introduces qHop, a quantum Hopfield network designed to overcome these limitations by leveraging quantum amplitudes for storage and reformulating retrieval as a matrix inversion problem.

Methodology

The core innovation lies in bridging classical neural network dynamics with quantum mechanical operations. The authors propose three primary advancements:

  1. Amplitude Encoding: Instead of a one-to-one mapping of neurons to qubits, the state of $d$ neurons is encoded into the amplitudes of a quantum state. This allows $N$ qubits to represent $2^N$ neurons, achieving exponential storage density.
  2. Quantum Hebbian Learning (qHeb): Training is performed by imprinting patterns into a quantum density matrix. By utilizing density matrix exponentiation, the weight matrix is treated as a quantum Hamiltonian.
  3. Matrix Inversion (qHop): Rather than the classical iterative flipping of neurons to reach a local minimum, the retrieval process is framed as solving a linear system $Av = w$. The HHL algorithm is then employed to solve this inversion in $O(\text{poly}(\log d))$ time.
Comparison of classical, matrix inversion, and quantum approaches to Hopfield networks across training, read-in, operation, and read-out phases.

The transition from classical iterative updates to a quantum circuit implementation is visualized in the figure above. The quantum approach effectively "sees" the entire state space globally, solving for the nearest memory through matrix inversion rather than local, step-by-step updates.

Experimental Evaluation

To validate the quantum-inspired matrix inversion approach, the researchers utilized a real-world biological dataset consisting of Influenza A RNA sequences (H1N1 strain). The RNA bases (A, C, G, U) were converted into binary strings.

The benchmark involved storing the first 50 RNA bases of 8 segments ($d=100$ neurons, $M=8$ patterns). Results indicated that the matrix-inversion-based recovery performance, measured by Hamming distance, was nearly identical to the standard classical Hopfield network. Crucially, the theoretical complexity of the quantum algorithm is $O(\text{poly}(M, \log d, 1/\epsilon))$, demonstrating an exponential speedup relative to the dimension $d$ for a fixed number of patterns $M$.

Discussion and Future Work

While qHop offers a path to exponential speedup, several challenges remain. The "Input/Output" bottleneck—the efficiency of loading classical data into quantum states (e.g., via qRAM) and extracting results—is a critical factor that could impact real-world performance. Additionally, the current algorithm's performance depends linearly on the number of stored patterns $M$, which must remain small relative to the total capacity to maintain the logarithmic advantage.

Future research will focus on implementing these subroutines on Noisy Intermediate-Scale Quantum (NISQ) devices to evaluate their robustness against physical noise. Furthermore, the techniques developed for qHop, such as quantum Hebbian learning, may serve as foundational components for more sophisticated quantum neural architectures beyond the Hopfield model.

Summary updated

BibTeX
@inproceedings{rebentrost2018quantum,
  author = {Patrick Rebentrost and Thomas R. Bromley and Christian Weedbrook and Seth Lloyd},
  title = {{Quantum Hopfield neural network}},
  booktitle = {Physical},
  year = {2018},
  doi = {10.1103/physreva.98.042308},
}
Figure