arXiv:1312.4149v1 [] 15 Dec 2013

Autonomous Quantum Perceptron Neural Network
Alaa Sagheer 1 and Mohammed Zidan
Department of Mathematics
Center for Artificial Intelligence and RObotics (CAIRO)
Faculty of Science, Aswan University, Aswan, Egypt
Email: alaa@cairo-aswu.edu.eg
Abstract:Recently, with the rapid development of technology, there are a lot
of applications require to achieve low-cost learning. However the computational
power of classical artificial neural networks, they are not capable to provide
low-cost learning. In contrast, quantum neural networks may be representing a
good computational alternate to classical neural network approaches, based on
the computational power of quantum bit (qubit) over the classical bit. In this
paper we present a new computational approach to the quantum perceptron
neural network can achieve learning in low-cost computation. The proposed
approach has only one neuron can construct self-adaptive activation operators
capable to accomplish the learning process in a limited number of iterations
and, thereby, reduce the overall computational cost. The proposed approach
is capable to construct its own set of activation operators to be applied widely
in both quantum and classical applications to overcome the linearity limitation
of classical perceptron. The computational power of the proposed approach
is illustrated via solving variety of problems where promising and comparable
results are given.

1

Introduction

Classical Artificial Neural Networks (CANN) derives its computing power through
its massively parallel-distributed structure and the ability to learn and, therefore, generalize. However, CANN may face many difficulties such as the absence
of concrete algorithms and rules for specifying optimal design architectures,
limited memory capacity, time-consuming training, etc.[1]. One of the known
classical approaches is the classical Perceptron Neural Network (CPNN), which
is applied only for linearly separable learning problems [2]. In other words,
CPNN cannot be applied for problems which have inseparable classes, such as
XOR problem [1]. These limitations, and others, have been motivated many researchers to investigate new trends in neural computation domain [3, 4]. One of
the novel trends in this domain is to evoke properties and techniques of quantum
computing into classical neural computation approaches.
Several researchers expect that quantum computing is capable to enhance
the performance, and overcoming the above limitations, of classical neural computation [5, 6, 7, 8]. The beginning was in 1995 with Kak [9] who was the
first researcher introduced the concept of quantum neural computation. Then,
1 Corresponding

author

1

Menneer [10] defines a class of quantum neural network (QNN) as a superposition of single component networks where each is trained using only one pattern.
Ventura et al. in [6] introduced a new associative memory technique based
on Grover’s quantum search algorithm can solve the completion problem. The
technique restores the full pattern when a part of it is initially presented with
just a part of the pattern. Also, an exponential increase in the capacity of the
memory is performed when it compared with the CANN capacity.
As long as classical perceptron is concerned, some researchers have been tried
to increase the efficiency of perceptron using the power of quantum computation.
In 2001, Altaisky [11] developed a simple quantum perceptron that depends on
selecting the activation operator. However its simplicity, Altaisky approach
consumed much time in order to select an activation operator, especially, when
the size of training data is large. Next, Fei et al. [12] introduced a new model of
quantum neuron and its learning algorithm based on Altaisky perceptron. Fei
model used the delta rule as the learning rule which yields considerable results
such as computing XOR-Function using only one neuron and nonlinear mapping
property. Unfortunately, Fei model did not provide us a new way for deriving the
activation operator. Nevertheless, Fei model is sensitive for the selection of the
appropriate activation operator, which was the problem of Altaisky perceptron.
Recently, Zhou et al. [13] developed a quantum perceptron approach based
on the quantum phase adequately and could to compute the XOR function
using only one neuron.The drawback of Zhou perceptron is that it requires many
computation iterations to give a response. Finally, Siomau [14] introduced an
autonomous quantum perceptron based on calculating a set of positive valued
operators and valued measurements (POVM). However, Simomau perceptron
cannot be applied for problems such as quantum-Not gate and Hadamard gate.
In this paper, we propose a novel autonomous quantum perceptron neural
network (AQPNN) approach can be used to solve both classical applications
and quantum applications. The proposed AQPNN improves the computational
cost of Altaisky quantum perceptron as well as the computational cost of Zhou
quantum perceptron and its ability to learn the problems that Siomau quantum
perceptron can not learn. The proposed perceptron is capable to adapt its activation operator very fast which reduces the overall learning time. In addition,
it is capable to overcome the linearity restriction of classical perceptron where
AQPNN can be viewed as a non-linear perceptron. To evaluate AQPNN, we
solve various problems and the results are compared favorably with Zhou [13].
The paper is organized as follows: Section 2 describes the operation of
AQPNN and its learning algorithm. Section 3 shows the computational power
of AQPNN via solving various problems. Section 4 discusses the performanceof
AQPNN. Section 5 shows the conclusion and our future work.

2

2
2.1

Autonomous Quantum Perceptron Neural Network (AQPNN)
Description of the AQPNN

The proposed (AQPNN)approach is a quantum neural network approach includes only one neuron with n qubit inputs x1 , x2 , ....., xn ,(for qubit definition, see Appendix A). A set of weight operators w1 ,w2 , .....,wn is assumed
such that one weight operator is associated with each input, and ynet is the
final network response; see Figure 1. The operators Fj refers to a set of unique
activation operators of the proposed perceptron.

Figure 1: The proposed AQPNN model
The proposed AQPNN approach is based on a supervised learning procedure,
that is, it is provided with a set of learning patterns (inputs/targets) in qubit
form.
For each input pattern presented to the network, the weighted sum qubit
yj is calculated using the form:


n
X
αj
.
(1)
wi xi =
yj =
βj
i=1

where αj and βj are the probability amplitudes of the weighted sum qubit for
j th pattern in the training set. The weight operators is updated at time t using
the following rule:
(2)
wi (t + 1) = wi (t) + γ e xi .
where γ is the learning rate, e = ( d − y ) is the perceptron error and e xi
denotes the outer product of vectors e and xi . Once the weighted sum is
calculated for all the available patterns, then the set of activation operators can
be calculated using the form:


cos θj − sin θj
.
(3)
Fj =
sin φj cos φj
where j = 1, 2, 3, ..., m, and m is the set of unique activation operators (repeated
activation operators are discarded) where m ≤ N is the number of training data
set. The parameters θj and ϕj are two real valued angles calculated using the
form:
 



αdj
αj
cos θj − sin θj
=
.
(4)
βd j
βj
sin φj cos φj
3

where [αj ,βj ]T is the weighted sum qubit and (αdj ,βdj )T is the target qubit.
The aim of each activation operator is to transform the weighted sum qubit to
be mapped into the given target and make it a normalized qubit Eq.(A2). After
calculating the set of all activation operators, the output of the autonomous
quantum perceptron is given using the superposition of all activation operators
in the following form:
n
m
X
X
xi .
(5)
Fj
youtput =
j=1

i=1

where youtput is the network output as a superposition of the set of output
qubits. This output represents the effect of the activation operators (interference) on the weighted sum qubit resulted when any pattern presented to the
network. One qubit only from these qubits will be the response of the network
and can be specified by the following form:
ynet = L( ( youtput ◦ youtput − C) ) ◦ D ) .

(6)

T

where C = [1, 1, ..., 1] is a good vector and D is the vector of the target qubits.
The operation ◦ achieves the Hadamard product operation [15] (for more details,
see Appendix A), where the function L retain the smallest absolute value and
makes it equal one and the rest of values to be equal zeros. Hence, the result
of Eq.(6) is only one qubit represents the net response of the AQPNN for the
current input.

2.2

The learning algorithm of AQPNN

According to the description given above, the AQPNN learning algorithm is
divided into two main stages: The First stage is imbedded in both Eq.(4) and
Eq.(5), where the AQPNN algorithm collects information about the problem
in hand by constructing a set of activation operators. In the second stage the
AQPNN takes the decision about the networks response according to Eq.(6)
based on the gathered information. In the following, we can summarize the
AQPNN learning algorithm in the following steps:
Step 1: Set all Fi = I (identity matrix). Then choose the initial weight operators wi randomly, set the learning rate 0 < γ < 1 and set iteration number k = 1,
Step 2: Calculate the weighted sum qubit for each given pattern using Eq.(1),
Step 3: Compare each weighted sum qubit for the patterns of each class with
all other weighted sum qubits for other classes. We have two cases here:
1. If each weighted sum qubit for any class does not equal the same value for
any weighted sum in any other classes then go to step 5, else, go to step
4.
2. If the value of any weighted sum qubit is zero then go to step 4, else, go
to step 5.
4

Step 4: Update the weight operators using Eq.(2), set k = k + 1, go to step 2.
Step 5: Calculate the activation operator for each weighted sum qubit using
Eq.(4).
The superposition of output qubits of the network is given by Eq.(5) whereas
the net response of the AQPNN is given by Eq.(6).

3

The Computational Power of AQPNN

We proceed now to evaluate practically the computational power of the proposed
AQPNN algorithm. In this section, we show the results of using AQPNN in
solving four different problems. In the first two problems, we solve the problems
of quantum Not-gate and the Hadamard-gate. In the third problem we compute
the XOR-function, whereas in the fourth problem we achieve a classification task
application.

3.1

The Quantum Not-gate







0
Class A: The first pattern is P1 = { x1 =
, d1 =
}
1
 

0
1
Class B: The second pattern is P2 = { x2 =
, d2 =
}
1
 0 
1 0
The initial weight operators is chosen arbitrary as w =
. Once, we
0 1
introduced the two patterns to the AQPNN network we obtain the weighted
sum, according to Eq.(1), as follows:

 

1
0
y1 =
, y2 =
0
1
1
0


Since y1 has a different value than y2 , then we can calculate the set of
activation operators as follows:


cos θ1
sin φ1

− sin θ1
cos φ1



1
0



0
1



0
1

i.e. θ1 = −90, ϕ1 = 90 and, thereby, F1 =



=



1
0



=



0
1



1
0



.

Similarly, we can get F2 as follows:


cos θ2
sin φ2

− sin θ2
cos φ2

5



i.e. θ2 = −90, ϕ2 = 90 and, thereby, F2 = F1 =





0 1
1 0
= F

Therefore, the superposition output is youtput

.

n
P

wi xi . This means

i=1

that, the quantum Not gate is trained after only one iteration.

3.2

The Hadamard-gate

 
1
}
, d1 = √12
1




0
1
1
√
Class B: The second pattern is P2 = { x2 = 2
, d2 =
}
1
−1


1 0
The initial weight operators is chosen arbitrary as w =
Once, we
0 1
introduced the two patterns to the AQPNN network we obtain the weighted
sum, according to Eq.(1), as follows:


 
1
0
y1 =
, y2 =
0
1
Class A: The first pattern is P1 = { x1 =



1
0



By the same way, as y1 has a different value than y2 then we can calculate the set of activation operators,we can get F1 as follows:


cos θ1
sin φ1



− sin θ1
cos φ1

1
0

i.e. θ1 = −45, ϕ1 = 135 and, thereby, F1 =



√1
2

=

√1
2



1
1





1
1

1
−1



.

Similarly, we can get F2 as follows:


cos θ2
sin θ2

− sin θ2
cos θ2



0
1

i.e. θ2 = −45, ϕ2 = 135 and, thereby, F2 =



=

√1
2



√1
2

1
1



1
−1

1
−1

Therefore, the superposition output is youtput = F




.

n
P

wi xi . This means

i=1

that, the Hadamard-gate is trained after only one iteration.

3.3

The XOR-Function

It is known that, there are two classes in XOR-function:






1
1
1
Class A: The first pattern is P1 = { x1 =
, x2 =
d1 =
}
0
0
0
6







0
1
, x2 =
d2 =
}
1
0






1
0
0
Class B: The third pattern is P3 = { x1 =
, x =
d =
}
0  2 
1  3 
1
 
0
1
0
The fourth pattern is P4 = { x1 =
, x2 =
d4 =
}
1
0
1


1.1 1.2
Assume a random initial weight operator takes the value w1 = w2 =
.
0
0
If we introduced the four patterns into the AQPNN network we obtain,after only
one iteration, the weighted sum of each pattern as follows:
The second pattern is P2 = { x1 =

y1 =



2.2
0



, y2 =



2.4
0



0
1



, y3 =



2.3
0



, y4 =



2.3
0



It is easy to observe that the first couple of weighted sum qubits has different
values than the other couple of weighted sum qubits (i.e. either of y1 or y2 )
has a different value than y3 and y4 . Also, we may observe that y3 = y4
. As these two patterns are in the same class B, this implies that there only
three activation operators will take the following forms:






0.4545 −0.8907
0.4167 −0.9091
0
−1
F1 =
, F2 =
, F3 = F4 =
0
1
0
1
0.4348 0.9005
Then, the superposition output can be calculated as:
youtput =

m=3
P
j=1

Fj

n=2
P

wi xi

i=1

Table 1 shows a comparison between the proposed perceptron AQPNN,
Zhouh perceptron [13] and the classical perceptron, the classical pereptron is not
applicable in case of using one neuron. The proposed perceptron gives the final
output after only one iteration whereas Zhouh perceptron gives the final result
after 16 iterations [13]. Then it is clear that AQPNN reduces the computation
steps to get the final results.
Table 1: A comparison between the proposed AQPNN perceptron, Zhouh perceptron and the classical perceptron to solve the XOR-function
Algorithm name AQPNN Zhouh Perceptron Classical Perceptron(One neuron)
No.of iterations
1
16
Not applicable by one neuron

3.4

Two-overlapped classification problem

We proceed now to use the proposed AQPNN approach in a classification application. The application we use here is atypical two-overlapped classes classification problem, which can be regarded as a complex generalization of the
7

XOR problem [16]; see Figure

2. It has two classes: the first is a oval-shape
1
class has the target 0 =
with arbitrary input patterns given in Table 2.
0


0
The second class is square-shape class which has the target 1 =
with
1
arbitrary input patterns given in Table 3.

Figure 2: Two overlapped classes classification problem

P1
(0.1,0)

Table 2: Training input patterns of the oval-shape class
P2
P3
P4
P5
P6
P7
(0.1,0.2) (0,0.1) (-0.1,0.2) (-0.1,0) (0,-0.1) (0.1,-0.2)

P8
(-0.1,-0.2)

Table 3: Training input patterns of the square-shape class
P9
P10
P11
P12
P13
P14
P15
(0.1,0.1) (0,0) (0,0.2) (-0.1,0.1) (0.1,-0.1) (-0.1,-0.1) (0,-0.2)
It’s clear that the values of input patterns are classical data, i.e. real values, so it must be transformed into qubits using qubit normalization equation
Eq.(A2). For example, for the pattern P1= (0.1,0),
and,
 where a=0.1

 then,

p
0.1
1
b = 1 − (0.1)2 . Thus, we may have P1 = { x1 =
, d1 =
}.
0.9950
0
In this experiment, we chose only 15 patterns as training data whereas the
testing data is generalized over 176 patterns. If the learning rate is chosen,
randomly, to be 0.1, we will find the classification rate approaches 97.73% after
only one iteration for the learning process.
8

4

Discussion

It is worth now to discuss the performance of the proposed algorithm. It is clear
from the above examples that the computational power of the proposed AQPNN
is high, however, many observations may be one will record. First observation
is that under equal weight operators, the AQPNN model, in some applications,
does not utilize all the training data like other perceptron algorithms [2, 13, 14].
For example, in the first two situations, i.e. Not-gate and Hadamard-gate,
we need only one training input (because we use only the unique activation
operator), where as in the XOR function situation, it is required three training
inputs in order to accomplish the learning process. In the three situations, the
AQPNN is capable to reduce both the computation time and the number of
activation operators.
Second observation is concerned with the relation between the initial weight
operators and the activation operators. In the situations of the quantum Notgate and the quantum Hadamard-gate, the initial weight operator was the unitary operator, whereas in case of the XOR-function it was not the unitary
operator. The reason for this is due to the nature of the unitary operatorU
where U U † = I. Then, using Eq.(3), that includes the formula of the activation
operators, we have:


cos θj
sin φj

− sin θj
cos φj



cos θj
− sin θj

sin φj
cos φj



=



1

sin (θj − φj )
sin (θj − φj )
1



Obviously, the value of activation operator depends on the values of θj and φj ,
which in turn depend on the initial weight operators and the training data.

5

Conclusion and Future Work

This paper presented a novel algorithm achieves autonomous quantum perceptron neural network (AQPNN) to enable real time computations. The developed
algorithm represents a good computational alternate to the classical perceptron
neural network approach. AQPNN constructs self-adaptive activation operators
capable to accomplish the learning process in limited number of iterations and
reduces the overall computational cost. These activation operators can be applied in both quantum and classical applications. The efficiency of the proposed
algorithm is evaluated via solving four different problems where promising and
comparable results are given. In addition, to train the AQPNN algorithm, it
uses a limited number of training data samples, and in testing, it accomplishes
a well generalization. Using the proposed perceptron in real world applications
is one of our future aims.

9

References
[1] M. Hagan, H. Demuth and M. Beale (1996), Neural Network Design, PWS
publishing Company (USA) .
[2] F. Rosenblatt (1957), The Perceptron - a perceiving and recognizing automaton, Tech. report 85-460-1, Aeronautical Lab., Cornell Univ..
[3] F. Shafee (2007), Neural networks with quantum gated nodes, Engineering
Applications of Artificial Intelligence , 20,4, pp. 429-437.
[4] R.Zhou (2010), Quantum Competitive Neural Network,International Journal
of Theoretical Physics, 49, pp. 110-119.
[5] A. Sagheer and N. Metwally (2010), Communication via Quantum Neural
Networks,the 2nd world congress on nature and biologically inspired computing, NaBIC, IEEE, pp. 418-422.
[6] D. Ventura and T. Martinez (2000),
ory,InformationSciences, 5124, pp.273-296.

Quantum Associative Mem-

[7] C. Li and S. Li (2008), Learning algorithm and application of quantum BP
neural networks based on universal quantum gates,19,1, pp. 167-174.
[8] M. Nielsen and I. Chuang (2000.), Quantum Computation and Quantum
Information,Cambridge University Press (Cambridge).
[9] S. C. Kak (1995), Quantum Neural Computing, Advances in Imaging and
Electron Physics, 94, pp. 259-314.
[10] T. Menneer (1998), Quantum Artificial Neural Networks, Ph. D. thesis of
The Univ. of Exeter, UK,.
[11] M. V. Altaisky (2001), Quantum neural network,qunat-ph/0l07012.
[12] L. Fei and Z. Baoyu (2008), A study of quantum neural networks, Neural
Networks and Signal Processing, IEEE, 1, pp.539-542.
[13] R. Zhou, L .Qin and N. Jiang (2006), Quantum Perceptron Network,
The 16th International Conference on Artificial Neural Networks, ICANN
, LNCS,4131, pp. 651-657.
[14] M. Siomau (2013), A Quantum Model for Autonomous Learning Automata,
qunat-ph/1210.6626 v3.
[15] R. Horn and C. Johnson (1999), Topics in matrix analysis, Cambridge
University Press (Cambridge).
[16] H. Xiao and M. Cao (2009), Hybrid Quantum Neural Networks Model Algorithm and Simulation, The 5th International Conference on Natural Computation, 1, pp. 164-168.

10

Appendix A
Qubit: The smallest element store information in quantum computer is called
quantum-bit (qubit). The qubit takes either value of 0 or 1 or a superposition
of these states in the form :
ψ =a 0 +b 1 .

(A1)

Where a,b are complex numbers called the probability amplitudes. The qubit
2
2
state ψ is collapse into either basis state 0 or 1 with probability |a| or |b|
respectively where
|a|2 + |b|2 = 1.
(A2)
Hadamard product (matrices) In mathematics, the Hadamard product is a
binary operation that takes two matrices of the same dimensions, and produces
another matrix where each element i,j is the product of elements i,j of the
original two matrices. For two matrices, A, B of the same dimension, m x n the
Hadamard product, A ◦ B, is a matrix, of the same dimension as the operands,
with elements given by
˙ i,j .
(A ◦ B)i,j = (A)i,j (B)

(A3)

Example : Suppose two matrices




1 2
5 6
A=
, and B =
3 4
7 8
then the hadamrd product is
A◦B =



1(5) 2(6)
3(7) 4(8)

11



=



5 12
21 32



