Datasets:
features
int64 0
65.5k
| label
int64 0
1
|
---|---|
0 | 0 |
1 | 0 |
2 | 0 |
3 | 0 |
4 | 0 |
5 | 0 |
6 | 0 |
7 | 0 |
8 | 0 |
9 | 0 |
10 | 0 |
11 | 0 |
12 | 0 |
13 | 0 |
14 | 0 |
15 | 0 |
16 | 0 |
17 | 0 |
18 | 0 |
19 | 0 |
20 | 0 |
21 | 0 |
22 | 0 |
23 | 0 |
24 | 0 |
25 | 0 |
26 | 0 |
27 | 0 |
28 | 0 |
29 | 0 |
30 | 0 |
31 | 0 |
32 | 0 |
33 | 0 |
34 | 0 |
35 | 0 |
36 | 0 |
37 | 0 |
38 | 0 |
39 | 0 |
40 | 0 |
41 | 0 |
42 | 0 |
43 | 0 |
44 | 0 |
45 | 0 |
46 | 0 |
47 | 0 |
48 | 0 |
49 | 0 |
50 | 1 |
51 | 0 |
52 | 0 |
53 | 0 |
54 | 0 |
55 | 0 |
56 | 0 |
57 | 0 |
58 | 0 |
59 | 0 |
60 | 0 |
61 | 0 |
62 | 0 |
63 | 0 |
64 | 0 |
65 | 0 |
66 | 0 |
67 | 0 |
68 | 0 |
69 | 0 |
70 | 0 |
71 | 0 |
72 | 0 |
73 | 0 |
74 | 0 |
75 | 0 |
76 | 0 |
77 | 0 |
78 | 0 |
79 | 0 |
80 | 0 |
81 | 0 |
82 | 1 |
83 | 0 |
84 | 0 |
85 | 0 |
86 | 0 |
87 | 0 |
88 | 0 |
89 | 0 |
90 | 0 |
91 | 0 |
92 | 0 |
93 | 0 |
94 | 0 |
95 | 0 |
96 | 0 |
97 | 0 |
98 | 1 |
99 | 0 |
Quantum Perceptron
This project implements McCullogh-Pitts Perceptron as described in An Artificial Neuron Implemented on an Actual Quantum Processor on IBM's Qiskit quantum simulator.
The GitHub repository (https://github.com/ashutosh1919/quantum-perceptron) contains the extensive codebase to create quantum perceptron circuit based on specific weight and input data. Moreover, we created training data as shown in the paper (checkboard patterns for different numbers) and simulated the training using single perceptron to update the weight. We have used training details from this article on nature by the authors of the original paper.
Moreover, the authors of the paper evaluates single perceptron for different weight-input pairs and generate visualization. They prove that the probability (output of perceptron) is 1 when weight = input
.
Usage
We have created the codebase such that the perceptron circuit can be utilized directly for any other usage. The code is scalable and takes the most possibilities into account. Note that we are deliberately raising error in case the perceptron with more than 9 qubits is initialized.
To use the perceptron, you will need to clone this repository and add the repository directory to $PATH
:
git clone https://github.com/ashutosh1919/quantum-perceptron.git
export PATH=./quantum_perceptron:$PATH
Now, you can use the perceptron codebase in your own project. To get started with experimenting on quantum perceptron, you can use below starter code:
from quantum_perceptron import Perceptron
from quantum_perceptron.utils import (
calculate_succ_probability,
plot_img_from_data
)
# Define perceptron initial parameter
num_qubits = 4
input_data = 12
weight_data = 626
# You can visualize input/weight data in checkboard pattern
plot_img_from_data(
data=weight,
num_qubits=num_qubits
)
# Intialize perceptron object
perceptron = Perceptron(
num_qubits=num_qubits,
weight=weight_data,
input=input
)
# Generate measurement outcomes for 3000 number of iterations
counts = perceptron.measure_circuit(
num_iters=3000
)
# Find the success probability (Number of 1s)/(Total iterations)
prob = calculate_succ_probability(counts)
# Draw circuit
perceptron.save_circuit_image(
file_path='qubit_4_circ.png',
output_format="mpl"
)
The checkboard pattern image generated by the above code will look something like this:
The saved image for the perceptron circuit of 4 qubits looks something like this:
In the above circuit, we can see two components U_i
and U_w
. These components are specifically to process input and weight data values respectively. The circuit is different for different values of input and weight. For more information, please take a look at the descriptions in the paper.
Reference Usage
Implementing An Artificial Quantum Perceptron -- https://arxiv.org/abs/2412.02083
@article{2025,
title={Implementing an Artificial Quantum Perceptron},
volume={2},
ISSN={2997-2795},
url={http://dx.doi.org/10.33140/ACPMS.02.01.01},
DOI={10.33140/acpms.02.01.01},
number={1},
journal={Annals of Computational Physics and Material Science},
publisher={Opast Group LLC},
author={Hathidara, Ashutosh and Pandey, Lalit},
year={2025},
month=jan, pages={01–05}
}
License
See the LICENSE file.
- Downloads last month
- 79