Abstract
Quantum neural networks (QNNs) are promised to be powerful computing devices that integrate the advantages of artificial neural networks (ANNs) and quantum computing. Due to the different dynamics between ANN and quantum computing, constructing a reasonable QNN model with efficient learning algorithms is still an open challenge. In this paper, we propose a new quantum model for feed-forward neural networks whose learning algorithm applies quantum superposition and parallelism features. This model contains classical feed-forward neural network and the amplitude encoding QNN model as special cases. Moreover, it inherits the advantages and avoids the disadvantages of the amplitude encoding model. We give a quantum-classical hybrid procedure to implement the learning algorithm. The result shows that we can train this QNN by a series of unitary operators efficiently.





Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Alpaydin, E.: Introduction to Machine Learning, 3rd edn. MIT Press, Cambridge (2015)
Goodfellow, I., Bengio, Y., Courville, A.: Deep Learning. MIT Press, Cambridge (2016)
Haykin, S.: Neural Networks and Learning Machines, 3rd edn. Pearson, London (2009)
Rosenblatt, F.: The perceptron: a probabilistic model for information storage and organization in the brain. Psychol. Rev. 65, 386–408 (1958)
Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge University Press, Cambridge (2000)
Schuld, M., Sinayskiy, I., Petruccione, F.: The quest for a quantum neural network. Quantum Inf. Process. 13, 2567–2586 (2014)
Altaisky, M.V.: Quantum neural network. arXiv:quant-ph/0107012v2 (2001)
Cao, Y.D., Guerreschi, G.G., Aspuru-Guzik, A.: Quantum neuron: an elementary building block for machine learning on quantum computers. arXiv:1711.11240v1 (2017)
da Silva, A.J., Ludermir, T.B., de Oliveira, W.R.: Quantum perceptron over a field and neural network architecture selection in a quantum computer. Neural Netw. 76, 55–64 (2016)
Daskin, A.: A Quantum Implementation Model for Artificial Neural Networks. arXiv:1609.05884v2 (2016)
Farhi, E., Neven, H.: Classification with Quantum Neural Networks on Near Term Processors. arXiv:1802.06002v2 (2018)
Kouda, N., Matsui, N., Nishimura, H., Peper, F.: Qubit neural network and its learning efficiency. Neural Comput. Appl. 14, 114–121 (2005)
Rebentrost, P., Bromley, T.R., Weedbrook, C., Lloyd, S.: Quantum hopfield neural network. Phys. Rev. A 98, 042308 (2018)
Schuld, M., Bocharov, A., Svore, K., Wiebe, N.: Circuit-centric quantum classifiers. arXiv:1804.00633 (2018)
Shao, C.: A Quantum Model for Multilayer Perceptron. arXiv:1808.10561 (2018)
Tacchino, F., Macchiavello, C., Gerace, D., Bajoni, D.: An artificial neuron implemented on an actual quantum processor. npj Quantum Inf. 5, 26 (2019)
Schuld, M., Sinayskiy, I., Petruccione, F.: Simulating a perceptron on a quantum computer. Phys. Lett. A 379, 660–663 (2015)
Wan, K.H., Dahlsten, O., Kristjánsson, H., Gardner, R., Kim, M.S.: Quantum generalisation of feedforward neural networks. npj Quantum Inf. 3, 36 (2017)
Yamamoto, A.Y., Sundqvist, K.M., Li, P., Harris, R.H.: Simulation of a multidimensional input quantum perceptron. Quantum Inf. Process. 17, 128 (2018)
Buhrman, H., Cleve, R., Watrous, J., de Wolf, R.: Quantum fingerprinting. Phys. Rev. Lett. 87, 167902 (2001)
Brassard, G., Høyer, P., Mosca, M.: Quantum amplitude amplification and estimation. In: Lomonaco, S.J. (ed.) Quantum Computation and Quantum Information, AMS Contemporary Mathematics, vol. 305, pp. 53–74. AMS, Providence (2002)
Kitaev, A.Y.: Quantum measurements and the Abelian Stabilizer Problem. arXiv:quant-ph/9511026 (1995)
Grover, L.: A fast quantum mechanical algorithm for database search. In: Proceedings of the 28th Annual ACM Symposium on the Theory of Computing (STOC), pp. 212–219 (1996)
Schuld, M., Sinayskiy, I., Petruccione, F.: An introduction to quantum machine learning. Contemp. Phys. 56, 172–185 (2015)
Grover, L., Rudolph, T.: Creating superpositions that correspond to efficiently integrable probability distributions. arXiv:quant-ph/0208112 (2002)
Giovannetti, V., Lloyd, S., Maccone, L.: Quantum random access memory. Phys. Rev. Lett. 100, 160501 (2008)
Soklakov, A., Schack, R.: Efficient state preparation for a register of quantum bits. Phys. Rev. A 73, 012307 (2006)
McClean, J.R., Romero, J., Babbush, R., Aspuru-Guzik, A.: The theory of variational hybrid quantum-classical algorithms. New J. Phys. 18, 023023 (2016)
Peruzzo, A., McClean, J., Shadbolt, P., Yung, M.H., Zhou, X.Q., Love, P.J., Aspuru-Guzik, A., O’Brien, J.L.: A variational eigenvalue solver on a photonic quantum processor. Nat. Commun. 5, 4213 (2014)
Preskill, J.: Quantum computing in the NISQ era and beyond. Quantum 2, 79 (2018)
Childs, A.M., Wiebe, N.: Hamiltonian simulation using linear combinations of unitary operations. Quantum Inf. Comput. 12, 901–924 (2012)
Acknowledgements
This work was supported by the QuantERA ERA-NET Cofund in Quantum Technologies implemented within the European Union’s Horizon 2020 Programme (QuantAlgo project), and EPSRC Grants EP/L021005/1 and EP/R043957/1.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Brief review of Hadamard test and swap test
Brief review of Hadamard test and swap test
In this appendix, we briefly review two quantum algorithms (Hadamard test and swap test) to extract inner product of quantum states. Each method has its own advantages and disadvantages. First, we consider the following amplitude estimation problem [21]. Let
be a quantum state that can be prepared by a unitary operator U in time \(O(T_{\text {in}})\). The problem we plan to solve is to estimate \(|\sin \theta |\) and \(|\cos \theta |\) (i.e., \(\pm \theta \)) in quantum computer to accuracy \(\epsilon \) with high success probability at least \(1-\delta \).
The quantum algorithm to solve this problem is a direct application of quantum phase estimation. Let Z be the two-dimensional Pauli-Z matrix that maps \(|0\rangle \) to \(|0\rangle \) and \(|1\rangle \) to \(-|1\rangle \). Denote
Then,
in the space spanned by \(\{|0\rangle |u\rangle ,|1\rangle |v\rangle \}\). The eigenvalues of G are \(e^{\pm \i 2\theta }\), and the corresponding eigenvectors are
, respectively. Note that \( |\phi \rangle =-\frac{\i }{\sqrt{2}} (e^{\i \theta }|w_1\rangle -e^{-\i \theta }|w_2\rangle ). \) Performing quantum phase estimation to G with initial state \(|0\rangle ^n|\phi \rangle \) for some \(n=O(\log 1/\delta \epsilon )\) [5]. Then, with probability at least \(1-\delta \), we will obtain an approximate of the following state
where \(y\in {\mathbb {Z}}_{2^n}\) satisfies \(|\theta -y\pi /2^n|\le \epsilon \). The time complexity of the above procedure is \(O(T_{\text {in}}/\epsilon \delta )\). Performing a measurement on (19), we will get an \(\epsilon \) approximate of \(\theta \) or \(-\theta \) with a high probability at least \(1-\delta \).
Furthermore, let f be an even function such that there is an efficient oracle \(U_f\) to implement f, that is \(U_f|j,k\rangle = |j,k\oplus f(j)\rangle \). Then, by Eq. (19), we can get an approximation of
by adding a register to store \(f(\tilde{\theta })\) and undoing the quantum phase estimation, where \(|\theta -\tilde{\theta }|\le \epsilon \).
Now let \(|x\rangle ,|y\rangle \) be two quantum states that can be prepared in time \(O(T_{\text {in}})\). Then, the above method provides us two quantum algorithms to estimate \(\langle x|y\rangle \) to accuracy \(\epsilon \) in time \(O(T_{\text {in}}/\epsilon )\).
First, we discuss the Hadamard test. Assume that there are two unitaries \(U_0,U_1\) such that \(U_0|0..0\rangle = |x\rangle , U_1|0..0\rangle = |y\rangle \). The Hadamard test can be described by the quantum circuit in Fig. 6.
The final quantum state is
The probability of \(|0\rangle \) is \((1+\mathrm{Re}\langle x|y\rangle )/2\), and the probability of \(|1\rangle \) is \((1-\mathrm{Re}\langle x|y\rangle )/2\). So we can set \(\sin \theta =\sqrt{(1+\mathrm{Re}\langle x|y\rangle )/2}\) and \(\cos \theta =\sqrt{(1-\mathrm{Re}\langle x|y\rangle )/2}\). The quantum state \(|\phi \rangle \) can be rewritten in the form of (18) with \(|u\rangle ,|v\rangle \) corresponding to the normalization of \(|x\rangle +|y\rangle ,|x\rangle -|y\rangle \). Therefore, \(\mathrm{Re}\langle x|y\rangle \) can be evaluated in time \(O(T_{\text {in}}/\epsilon )\) with accuracy \(\epsilon \). However, if considering
then we can estimate \(\mathrm{Im}\langle x|y\rangle \) in time \(O(T_{\text {in}}/\epsilon )\) with accuracy \(\epsilon \). Moreover, we actually can obtain the following quantum state
for any function g with an efficient circuit to implement \(U_g:|j,k\rangle = |j,k\oplus g(j)\rangle \), where \(|s-\langle x|y\rangle | \le \epsilon \). More precisely, we can first generate \(|\phi \rangle |\mathrm{Re}(\langle x|w\rangle )\rangle \) by taking \(f(\theta ) = 1- 2 \cos ^2\theta \) in Eq. (20). Since \(|\psi \rangle \) can be obtained from \(|\phi \rangle \), we can further generate \(|\psi \rangle |\mathrm{Re}(\langle x|w\rangle )\rangle |\mathrm{Im}(\langle x|w\rangle )\rangle \). Now based on the oracle \(U_g\) and the unitary to perform \(|j,k,0\rangle \rightarrow |j,k,j+\i k\rangle \), we can get \(|\psi \rangle |\mathrm{Re}(\langle x|w\rangle )\rangle |\mathrm{Im}(\langle x|w\rangle )\rangle |g(\langle x|w\rangle )\rangle \). Finally, undo the first two steps to yield state (21). Concluding the above analysis, we have the following proposition.
Proposition 1
Let \(|x\rangle ,|y\rangle \) be two quantum states that can be prepared by two unitaries in time \(O(T_{in })\). Let g be a univariate function over \({\mathbb {C}}\) with an efficient circuit to implement \(U_g:|x,y\rangle = |x,y\oplus g(x)\rangle \). Then, the following transformation
can be achieved in time \(O(T_{in }/\epsilon )\), where \(|\langle x|y\rangle -s|\le \epsilon \).
To apply Hadamard test, we need to know the unitaries \(U_0,U_1\) to prepare \(|x\rangle ,|y\rangle \) in advance. Otherwise, we cannot use it to extract \(\mathrm{Re}\langle x|y\rangle \) and \(\mathrm{Im}\langle x|y\rangle \). On the other hand, swap test does not need such an assumption [24]. However, swap test can only estimate the norm of \(\langle x|y\rangle \). The quantum circuit to implement swap test is shown in Fig. 7.
The final state of Fig. 7 has the following form
The probability of \(|0\rangle \) is \(\frac{1}{2} ( 1+ |\langle x|y\rangle |^2)\). Consequently, we can get an approximation of \(|\langle x|y\rangle |\). The complexity to prepare state (23) is \(O(T_\mathrm{in})\); thus, the complexity to get an \(\epsilon \)-approximation of \(|\langle x|y\rangle |\) still equals \(O(T_\mathrm{in}/\epsilon )\) by the method discussed in the beginning of this appendix. We can also obtain a similar result as Proposition 1 by swap test; that is, s in Proposition 1 becomes an approximation of \(|\langle x|y\rangle |\).
However, there is a simple technique to extract \(\langle x|y\rangle \) from swap test if we are given two unit real vectors x, y. More precisely, denote \({\tilde{x}}=(1,x)\) and \({\tilde{y}}=(1,y)\); then, it is easy to verify that \(|\langle {\tilde{x}}|{\tilde{y}}\rangle |=(1+\langle x|y\rangle )/2\). Thus, to compute \(\langle x|y\rangle \), we can apply swap test to \(|{\tilde{x}}\rangle , |{\tilde{y}}\rangle \). With this simple technique, Proposition 1 can also be obtained.
Rights and permissions
About this article
Cite this article
Shao, C. A quantum model of feed-forward neural networks with unitary learning algorithms. Quantum Inf Process 19, 102 (2020). https://doi.org/10.1007/s11128-020-2592-z
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11128-020-2592-z