The ability of artificial neural networks (ANNs) to adapt to input data and perform generalizations is intimately connected to the use of nonlinear activation and propagation functions. Quantum versions of ANN have been proposed to take advantage of the possible supremacy of quantum over classical computing. To date, all proposals faced the difficulty of implementing nonlinear activation functions since quantum operators are linear. This brief presents an architecture to simulate the computation of an arbitrary nonlinear function as a quantum circuit. This computation is performed on the phase of an adequately designed quantum state, and quantum phase estimation recovers the result, given a fixed precision, in a circuit with linear complexity in function of ANN input size.
Quantum computing has been revolutionizing the development of algorithms. However, only noisy intermediate-scale quantum devices are available currently, which imposes several restrictions on the circuit implementation of quantum algorithms. In this article, we propose a framework that builds quantum neurons based on kernel machines, where the quantum neurons differ from each other by their feature space mappings. Besides contemplating previous quantum neurons, our generalized framework has the capacity to instantiate other feature mappings that allow us to solve real problems better. Under that framework, we present a neuron that applies a tensor-product feature mapping to an exponentially larger space. The proposed neuron is implemented by a circuit of constant depth with a linear number of elementary single-qubit gates. The previous quantum neuron applies a phase-based feature mapping with an exponentially expensive circuit implementation, even using multiqubit gates. Additionally, the proposed neuron has parameters that can change its activation function shape. Here, we show the activation function shape of each quantum neuron. It turns out that parametrization allows the proposed neuron to optimally fit underlying patterns that the existing neuron cannot fit, as demonstrated in the nonlinear toy classification problems addressed here. The feasibility of those quantum neuron solutions is also contemplated in the demonstration through executions on a quantum simulator. Finally, we compare those kernel-based quantum neurons in the problem of handwritten digit recognition, where the performances of quantum neurons that implement classical activation functions are also contrasted here. The repeated evidence of the parametrization potential achieved in real-life problems allows concluding that this work provides a quantum neuron with improved discriminative abilities. As a consequence, the generalized framework of quantum neurons can contribute toward practical quantum advantage.