Quantum Neuron: an elementary building block for machine learning on quantum computers

Yudong Cao, Gian Giacomo Guerreschi, Alán Aspuru-GuzikarXiv 2017

Abstract

The integration of non-linear activation functions into the inherently linear framework of quantum mechanics has been a significant hurdle for quantum machine learning. This work presents a novel "quantum neuron" based on "repeat-until-success" (RUS) circuits. This approach enables non-linear thresholding while preserving quantum coherence, allowing for the processing of data in superposition. We demonstrate that these neurons can learn non-linearly separable functions like XOR and act as associative memory in quantum Hopfield networks.

Introduction

Classical artificial neural networks rely on non-linear activation functions, such as sigmoid or ReLU, to model complex patterns. In contrast, quantum mechanics is governed by linear, unitary transformations. Previous attempts to reconcile these paradigms often resulted in either a loss of computational power (by removing non-linearity) or a loss of quantum advantage (by destroying coherence). This paper introduces a coherent quantum framework that implements a non-linear threshold activation function without sacrificing the properties of superposition and entanglement.

Methods: The Quantum Neuron

The core innovation is the Quantum Neuron, which utilizes Repeat-Until-Success (RUS) circuits. Unlike standard fixed gates, an RUS circuit involves an ancilla qubit that is measured to determine the success of a non-linear operation. If the measurement yields a specific result, the operation is successful; otherwise, a correction is applied, and the process is repeated.

Comparison of classical and quantum neuron architectures, including the RUS circuit and the resulting non-linear activation function.

This stochastic process implements a non-linear mapping $q(\phi) = \arctan(\tan^2 \phi)$. By repeating this process ($k$ iterations), the function $q^{\circ k}(\phi)$ increasingly approximates a step function, effectively mimicking a classical threshold activation. These neurons are modular and can be organized into feedforward or recurrent (Hopfield) architectures. Training is performed using the Nelder-Mead algorithm, a gradient-free optimization method suited for the noisy objective functions generated by the probabilistic RUS process.

Key Insights and Results

A primary breakthrough of this model is the use of quantum measurement as a source of non-linearity. By performing measurements on ancilla qubits, the main data qubits remain coherent while undergoing non-linear transformations.

Learning from Superposition

In classical machine learning, data is typically processed in batches. In this quantum model, the entire training set can be prepared as a single quantum superposition. Numerical evidence suggests that training on this "super-state" allows the network to learn the underlying function for all individual inputs simultaneously.

Quantum circuit designed for training the network on a superposition of input states.

Performance Benchmarks

The model was evaluated on several tasks:

  • XOR and 8-bit Parity: The quantum feedforward network achieved near-perfect accuracy on these non-linearly separable logic tasks.
  • Associative Memory: A quantum Hopfield network successfully recognized and "cleaned" corrupted 3x3 binary pixel patterns (e.g., the letters 'C' and 'Y'), demonstrating stable attractor dynamics even with blurry quantum inputs.

The authors also proved that this quantum model can simulate classical deep feedforward networks with polynomial time overhead and logarithmic memory overhead. Furthermore, the runtime for a single neuron to reach precision $\epsilon$ was bounded by $O((n/\delta)^{2.075} (1/\epsilon)^{3.15})$.

Discussion and Limitations

While the quantum neuron provides a robust path toward non-linear QNNs, challenges remain. The "Repeat-Until-Success" nature introduces stochastic depth, which may lead to latency in large-scale networks. Additionally, while Nelder-Mead is effective for small benchmarks, scaling to millions of parameters will likely require the development of "quantum-aware" backpropagation. Finally, the requirement for fast, mid-circuit measurement and real-time feed-forward control poses a significant challenge for current NISQ-era hardware.

Summary updated

BibTeX
@misc{cao2017quantum,
  author = {Yudong Cao and Gian Giacomo Guerreschi and Alán Aspuru-Guzik},
  title = {{Quantum Neuron: an elementary building block for machine learning on quantum computers}},
  year = {2017},
  eprint = {1711.11240},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1711.11240},
}
Figure