Source-linked AI summary
Quantum Neuron: an elementary building block for machine learning on quantum computers
Yudong Cao, Gian Giacomo Guerreschi, Alán Aspuru-Guzik
TL;DR
The paper addresses the difficulty of implementing nonlinear activation functions in quantum neural networks. It proposes a quantum-neuron circuit based on RUS iterations and analyzes its use in feedforward networks, including error accumulation and runtime. The construction preserves the intended threshold behavior while providing bounds for state fidelity, propagation cost, and agreement with corresponding classical layers.
Problem
Quantum neural-network proposals face the challenge of implementing nonlinear activation functions within quantum mechanics.
Method
The paper constructs quantum neurons from weighted input rotations and RUS circuits, then analyzes feedforward propagation across layers.
Results
The analysis gives propagation cost O(nMℓ), output fidelity at least 1−nϵ^2, and classical-layer agreement probability (1−η)^ℓ.
Takeaways & Limitations
The construction provides a quantum-neuron framework whose feedforward behavior can be compared with classical network dynamics while retaining quantum state processing.
Abstract
from arXiv · showhide
Even the most sophisticated artificial neural networks are built by aggregating substantially identical units called neurons. A neuron receives multiple signals, internally combines them, and applies a non-linear function to the resulting weighted sum. Several attempts to generalize neurons to the quantum regime have been proposed, but all proposals collided with the difficulty of implementing non-linear activation functions, which is essential for classical neurons, due to the linear nature of quantum mechanics. Here we propose a solution to this roadblock in the form of a small quantum circuit that naturally simulates neurons with threshold activation. Our quantum circuit defines a building block, the "quantum neuron", that can reproduce a variety of classical neural network constructions while maintaining the ability to process superpositions of inputs and preserve quantum coherence and entanglement. In the construction of feedforward networks of quantum neurons, we provide numerical evidence that the network not only can learn a function when trained with superposition of inputs and the corresponding output, but that this training suffices to learn the function on all individual inputs separately. When arranged to mimic Hopfield networks, quantum neural networks exhibit properties of associative memory. Patterns are encoded using the simple Hebbian rule for the weights and we demonstrate attractor dynamics from corrupted inputs. Finally, the fact that our quantum model closely captures (traditional) neural network dynamics implies that the vast body of literature and results on neural networks becomes directly relevant in the context of quantum machine learning.
A. Convergence analysis of the nonlinear map q
The nonlinear map q iteratively drives inputs toward attractors at π/2 or its symmetric counterpart. The required iterations depend on the initial distance from the threshold and the target accuracy.
- A. Convergence analysis of the nonlinear map q: q(ϕ)=arctan(tan^2ϕ) is analyzed to determine the RUS iterations required for convergence to an attractor.The analysis considers ϕ0>π/4 and tracks the distance from π/4 and π/2.
- A. Convergence analysis of the nonlinear map q: The attractor for ϕ0>π/4 is π/2, and reaching an ϵ-close value requires at least log1/β(1/ϵ) iterations.The parameter satisfies β≈0.4327.
- A. Convergence analysis of the nonlinear map q: The total iteration count can ensure |ϕk−π/2|≤ϵ, with the same expression applying by symmetry to the opposite basin.The convergence guarantee combines the intermediate and final stages.
B. Runtime analysis of RUS circuits
The RUS runtime analysis characterizes success probabilities, expected trials, and recursive behavior across iterations. Each RUS iteration has bounded expected cost, while total runtime grows with recursion depth and the number of iterations.
- B. Runtime analysis of RUS circuits: For k-iteration circuits, the expected trial count is obtained by combining the expected costs of the recursive subcircuits.The same probability analysis is applied to successive RUS rounds.
- B. Runtime analysis of RUS circuits: The probability of measuring |0⟩ in the RUS circuit is p(θ)=sin^4θ+cos^4θ, while measuring |1⟩ has probability 1−p(θ).The success probability satisfies 1/2≤p(ϕ)≤1.
- B. Runtime analysis of RUS circuits: The expected runtime of one RUS circuit is 1/p(θ)≤2.This bounds the expected number of trials needed for a successful subroutine.
- B. Runtime analysis of RUS circuits: Each RUS recursion level has expected trials bounded from above by 7, giving an upper bound on bottom-recursion trials across k iterations.The recursive construction records successes and failures at each level.
- B. Runtime analysis of RUS circuits: The analysis represents failure histories using vectors of trial counts and defines functions that depend on measurement outcomes across RUS levels.The vectors record successes and failures at each recursion level.
C. Weights and bias setting
The weight-and-bias construction maps classical weighted sums into rotation angles around the threshold π/4. Scaling and discrete parameter restrictions keep these angles separated from the threshold and within the circuit’s operating range.
- C. Weights and bias setting: If the initial distance from π/4 becomes arbitrarily small, the number of RUS iterations is unbounded.The construction therefore restricts representable weights and biases to avoid this case.
- C. Weights and bias setting: An added δ/2 bias term ensures |w1x1+⋯+wnxn+b|≥δ/2 for xi∈{−1,1}.The restriction separates weighted sums from the threshold.
- C. Weights and bias setting: The scaling parameter keeps each next-layer input angle within [0,π/2).This restriction is required when propagating activation values between layers.
- C. Weights and bias setting: The quantum neuron applies ϕ=γ(w1x1+⋯+wnxn+b)+π/4 after converting qubit values si∈{0,1} to classical variables xi=2si−1.This circuit implements the weighted and biased input process of a classical neuron.
- C. Weights and bias setting: ϕ>π/4 exactly when the classical activation θ is positive, while ϕ<π/4 when θ is negative.The construction therefore encodes the threshold decision around π/4.
D. General property of quantum neuron
The general quantum-neuron construction uses a rotation angle determined by a weighted input and analyzes the RUS iterations needed to produce the desired output state. Its guarantees assume restricted weight and bias representations.
- D. General property of quantum neuron: The rotation angle is ϕ=γθ+π/4, where θ is the weighted input plus bias.The theorem assumes the weights and bias have the form specified in the weight-setting construction.
- D. General property of quantum neuron: The RUS iteration count is chosen to ensure the output state is sufficiently close to the desired state for every weighted input θ.The proof substitutes the angle-separation bound into the convergence estimate.
- D. General property of quantum neuron: The resulting runtime bound follows by substituting the required iteration count into the expected-runtime bound.This connects convergence accuracy to the cost of producing the quantum-neuron output.
E. Feedforward networks of quantum neurons
The feedforward construction propagates approximate computational-basis neuron states through quantum layers, using measurement and repetition to control errors. Its resource estimates show near-linear qubit overhead and linear computational overhead for constant-depth networks.
- Each classical neuron state is represented by a corresponding qubit, with |0⟩ and |1⟩ encoding the neuron’s binary states.
- A single-layer propagation has failure probability at most nϵ^2, where n is the layer size and ϵ bounds each qubit’s rotation-angle error.
- Propagation errors can spread across layers because amplitudes may cease to remain concentrated on states corresponding to the classical network.
- Measuring after each layer restores a computational-basis state, so correct input states yield amplitude concentrated on the corresponding correct output state.
- M ≥ 8 ln(1/η) repetitions suffice for tolerance η, requiring at least 166 repetitions when η = 10^-9.
F. Hopfield networks of quantum neurons
The quantum-neuron construction can simulate Hopfield-network updates by repeatedly measuring output qubits and using the majority state as the next neuron state. Output-qubit recycling avoids a linear qubit overhead, while repetition controls cumulative error.
- Each Hopfield update is simulated with the same RUS-circuit construction used for quantum-neuron propagation.
- Repeated output-qubit measurements determine a majority state, which becomes the neuron’s new binary state.
- The output qubit can be recycled for the next update, eliminating the need for linear qubit overhead.
- O(log(1/η)) repetitions control the error for one update, while t updates have total error probability O(ηt).