Implementing An Artificial Quantum Perceptron
Ashutosh Hathidara, Lalit Pandey · 2024
Read Implementing An Artificial Quantum Perceptron by Ashutosh Hathidara, Lalit Pandey (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-02083.txt.
Introduction
Ashutosh Hathidara and Lalit Pandey build a quantum version of a perceptron in a paper from two thousand twenty-four. A perceptron is the basic unit of a neural network, making simple decisions from inputs. The authors compare two classic perceptron designs and turn one of them into a quantum circuit.
They generate a data set, simulate training, and test versions with different numbers of qubits. Their results suggest a growth advantage for the quantum model, which worked as a pattern classifier. For the second design, they explain how to build a spiking quantum perceptron. Code for the project is shared in public.
Catalog record
| CREATOR | Ashutosh Hathidara, Lalit Pandey |
|---|---|
| YEAR | 2024 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 13 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2412-02083
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Implementing An Artificial Quantum Perceptron Ashutosh Hathidara, Lalit Pandey Abstract A Perceptron is a fundamental building block of a neural network. The flexibility and scalability of perceptron make it ubiquitous in building intelligent systems. Studies have shown the efficacy of a single neuron in making intelligent decisions. Here, we examined and compared two perceptrons with distinct mechanisms, and developed a quantum version of one of those perceptrons. As a part of this modeling, we implemented the quantum circuit for an artificial perception, generated a dataset, and simulated the training. Through these experiments, we show that there is an exponential growth advantage and test different qubit versions. Our findings show that this quantum model of an individual perceptron can be used as a pattern classifier. For the second type of model, we provide an understanding to design and simulate a spike-dependent quantum perceptron. Our code is available at https://github.com/ashutosh1919/quantum-perceptron K eywords Quantum Perceptron \cdot Quantum Computing \cdot Quantum Machine Learning 1 Introduction A perceptron is an artificial unit of an intelligent system capable of making decisions. This artificial unit is inspired by the biological neurons found in the human brain. The human brain has a network of billions of neurons connected to each other. This connectivity leads to the formation of a deep network. Thus, a perceptron is used as a fundamental building block in deep learning systems. In classical computing, these perceptrons have two states, 0 and 1. When the input of the perceptron is sufficient enough to generate an output over the threshold limit, the perceptron is said to be in ‘ON’ or 1 state. On the other hand, if the output of the perceptron is less than its threshold value, then it is in ‘OFF’ or 0 state [ 1 ] . Decades of research in the field of classical deep learning have given rise to state-of-the-art systems [ 2 ] [ 3 ] that mimic human-level intelligence. Drawing from recent research that suggests the role of quantum entanglement in consciousness, there has been growing interest in exploring the potential of quantum computing to advance artificial intelligence. However, despite this progress, there remains a gap when implementing quantum algorithms in AI. In this study, we aim to bridge this gap by implementing a quantum model of a perceptron. Here, we review the available literature [ 4 ] and implement the quantum circuit using Qiskit quantum simulator [ 5 ] to simulate the training of a single perception. Almost every advanced deep learning system has artificial neurons as the fundamental building block. Inspired by the success in the classical machine learning field, we attempt to implement a quantum version of a perceptron that mimics the properties of a classical perceptron but has the benefits of a quantum system and obeys the rules of quantum mechanics. Previous works like [ 4 ] introduce a novel architecture and quantum algorithm to design a quantum version of a perceptron. We examine the algorithm and simulate it to test the efficacy of the quantum algorithm. For the implementation, we use QisKit quantum simulation tool and construct quantum gates as specified in the algorithm. We then develop an end-to-end pipeline to generate datasets, initialize weights, train the perceptron, and simulate the probability behavior as discussed in [ 4 ] . Following the training process, we conduct a comprehensive analysis to confirm the trained perceptron’s ability to accurately classify patterns. Figure 1: A classical perceptron used in deep learning systems. The perceptron takes multiple input values \{i_{0},i_{1},\ldots,i_{n-1}\} . Internally, it initializes random weight values \{w_{0},w_{1},\ldots,w_{n-1}\} corresponding to each of the input values. The perceptron computes the dot product of the input and weight vector i.e. \vec{i}\cdot\vec{w}=\sum_{j=0}^{n-1}i_{j}w_{j} . This dot product result is passed through a non-linear sigmoid [ 6 ] function which computes the probability. This probability can be used to compute the loss using the supervised label. The computed loss can then be used to train the perceptron by backpropagating gradients [ 7 ] and updating the weights. 2 Related Work The concept of a perceptron was first introduced in [ 8 ] , which presented the classical mathematical framework for utilizing a perceptron as a supervised data classifier. Numerous successful examples have demonstrated the effective application of this mathematical principle in real-world scenarios. In 2013, Lloyed et. al. [ 9 ] introduced a theoretical notion of quantum perceptron for supervised and unsupervised learning. Such perceptrons require generalized values and use qRAM [ 10 ] to store values. This study contributes to the theoretical literature of quantum computing. In 2014, Schuld et. al. [ 11 ] introduced the concept of simulating perceptrons using tools. They used the same simulation tools used in [ 4 ] to implement the quantum circuit of a perceptron. The terminology and the approach are similar too. However, [ 11 ] utilizes QFT to create intermediate oracle circuits to prepare the input and weight states which operates on an exponential number of gates. On the other hand, [ 4 ] make use of hypergraph states to construct these oracles. This allows them to operate with a polynomial number of quantum gates. The most recent classical deep learning models, as described in [ 12 ] , utilize bias vectors in addition to weight vectors for their perceptrons. As implementing perceptron algorithms in the quantum field is a relatively new concept, we omit the bias vector and exclusively focus on training the weight vector. 3 Methods 3.1 Architecture Unlike a classical perceptron, a quantum perceptron has quantum gates that prepare the inputs and weights for the system to process. Unitary transformation functions are used to pre-process the input and weight vectors. A Unitary transformation function, also known as an Oracle, houses quantum gates which act upon the input vectors to perform operations such as phase shift, imposing superposition, entanglement, etc. Akin to classical neurons, a quantum perceptron takes an input vector and a weight vector and outputs a probability of the outcome. Figure 2: A Quantum Version of Perceptron. \ket{\psi_i}=\frac{1}{\sqrt{m}}\sum_{j=0}^{m-1}i_{j}\ket{j} (1) \ket{\psi_w}=\frac{1}{\sqrt{m}}\sum_{j=0}^{m-1}w_{j}\ket{j} (2) Figure 2 illustrates the internal structure of a perceptron architecture. Two Unitary transformation functions namely, U_{i} and U_{f} , are used to perform quantum operations. The input vector is transformed into an input state by applying the U_{i} function as shown in equation 1 , while the U_{f} function transforms the weight vector into a weighted state as shown in equation 2 . After applying the transformation functions, the dot product is calculated between the input and the weight state ( \innerproduct{\psi_w}{\psi_i} ). This entire series of operations are carried out until the model converges and we obtain the optimal weight. 3.2 Dataset Generation We used the same quantum perceptron to generate the dataset consisting of value-label pairs. Following Mcculloch et. al. [ 1 ] , we replaced all the classical bits containing 1 with -1 and 0 bits with 1. For instance, if the input value is 12, then the transition from classical to quantum vector will look as 12\rightarrow[1,1,0,0]\rightarrow[-1,-1,1,1] . Figure 3: Generating dataset using single perceptron The overall implementation of dataset generation is described in algorithm 1 . The algorithm was tested using varying numbers of qubits, resulting in 16 possible input values when using 2