Skip to main content

Advertisement

Log in

A quantum model of feed-forward neural networks with unitary learning algorithms

  • Published:
Quantum Information Processing Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Explore related subjects

Discover the latest articles, news and stories from top researchers in related subjects.

References

  1. Alpaydin, E.: Introduction to Machine Learning, 3rd edn. MIT Press, Cambridge (2015)

    MATH  Google Scholar 

  2. Goodfellow, I., Bengio, Y., Courville, A.: Deep Learning. MIT Press, Cambridge (2016)

    MATH  Google Scholar 

  3. Haykin, S.: Neural Networks and Learning Machines, 3rd edn. Pearson, London (2009)

    Google Scholar 

  4. Rosenblatt, F.: The perceptron: a probabilistic model for information storage and organization in the brain. Psychol. Rev. 65, 386–408 (1958)

    Article  Google Scholar 

  5. Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge University Press, Cambridge (2000)

    MATH  Google Scholar 

  6. Schuld, M., Sinayskiy, I., Petruccione, F.: The quest for a quantum neural network. Quantum Inf. Process. 13, 2567–2586 (2014)

    Article  ADS  MathSciNet  Google Scholar 

  7. Altaisky, M.V.: Quantum neural network. arXiv:quant-ph/0107012v2 (2001)

  8. 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)

  9. 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)

    Article  Google Scholar 

  10. Daskin, A.: A Quantum Implementation Model for Artificial Neural Networks. arXiv:1609.05884v2 (2016)

  11. Farhi, E., Neven, H.: Classification with Quantum Neural Networks on Near Term Processors. arXiv:1802.06002v2 (2018)

  12. Kouda, N., Matsui, N., Nishimura, H., Peper, F.: Qubit neural network and its learning efficiency. Neural Comput. Appl. 14, 114–121 (2005)

    Article  Google Scholar 

  13. Rebentrost, P., Bromley, T.R., Weedbrook, C., Lloyd, S.: Quantum hopfield neural network. Phys. Rev. A 98, 042308 (2018)

    Article  ADS  Google Scholar 

  14. Schuld, M., Bocharov, A., Svore, K., Wiebe, N.: Circuit-centric quantum classifiers. arXiv:1804.00633 (2018)

  15. Shao, C.: A Quantum Model for Multilayer Perceptron. arXiv:1808.10561 (2018)

  16. Tacchino, F., Macchiavello, C., Gerace, D., Bajoni, D.: An artificial neuron implemented on an actual quantum processor. npj Quantum Inf. 5, 26 (2019)

    Article  ADS  Google Scholar 

  17. Schuld, M., Sinayskiy, I., Petruccione, F.: Simulating a perceptron on a quantum computer. Phys. Lett. A 379, 660–663 (2015)

    Article  Google Scholar 

  18. 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)

    Article  ADS  Google Scholar 

  19. Yamamoto, A.Y., Sundqvist, K.M., Li, P., Harris, R.H.: Simulation of a multidimensional input quantum perceptron. Quantum Inf. Process. 17, 128 (2018)

    Article  ADS  MathSciNet  Google Scholar 

  20. Buhrman, H., Cleve, R., Watrous, J., de Wolf, R.: Quantum fingerprinting. Phys. Rev. Lett. 87, 167902 (2001)

    Article  ADS  Google Scholar 

  21. 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)

    Chapter  Google Scholar 

  22. Kitaev, A.Y.: Quantum measurements and the Abelian Stabilizer Problem. arXiv:quant-ph/9511026 (1995)

  23. 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)

  24. Schuld, M., Sinayskiy, I., Petruccione, F.: An introduction to quantum machine learning. Contemp. Phys. 56, 172–185 (2015)

    Article  ADS  Google Scholar 

  25. Grover, L., Rudolph, T.: Creating superpositions that correspond to efficiently integrable probability distributions. arXiv:quant-ph/0208112 (2002)

  26. Giovannetti, V., Lloyd, S., Maccone, L.: Quantum random access memory. Phys. Rev. Lett. 100, 160501 (2008)

    Article  ADS  MathSciNet  Google Scholar 

  27. Soklakov, A., Schack, R.: Efficient state preparation for a register of quantum bits. Phys. Rev. A 73, 012307 (2006)

    Article  ADS  Google Scholar 

  28. McClean, J.R., Romero, J., Babbush, R., Aspuru-Guzik, A.: The theory of variational hybrid quantum-classical algorithms. New J. Phys. 18, 023023 (2016)

    Article  ADS  Google Scholar 

  29. 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)

    Article  ADS  Google Scholar 

  30. Preskill, J.: Quantum computing in the NISQ era and beyond. Quantum 2, 79 (2018)

    Article  Google Scholar 

  31. Childs, A.M., Wiebe, N.: Hamiltonian simulation using linear combinations of unitary operations. Quantum Inf. Comput. 12, 901–924 (2012)

    MathSciNet  MATH  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Changpeng Shao.

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

$$\begin{aligned} |\phi \rangle =U|0\rangle ^{\otimes k}=\sin \theta |0\rangle |u\rangle +\cos \theta |1\rangle |v\rangle \end{aligned}$$
(18)

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

$$\begin{aligned} G=(I-2|\phi \rangle \langle \phi |)(Z\otimes I)=U(I-2|0\rangle ^{\otimes k}\langle 0|^{\otimes k})U^\dag (Z\otimes I). \end{aligned}$$

Then,

$$\begin{aligned} G=\left[ \begin{array}{cc} \cos 2\theta &{}\quad \sin 2\theta \\ -\sin 2\theta &{}\quad \cos 2\theta \\ \end{array} \right] \end{aligned}$$

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

$$\begin{aligned} |w_1\rangle =\frac{1}{\sqrt{2}}\Big (|0\rangle |u\rangle +\i |1\rangle |v\rangle \Big ),~~ |w_2\rangle =\frac{1}{\sqrt{2}}\Big (|0\rangle |u\rangle -\i |1\rangle |v\rangle \Big ) \end{aligned}$$

, 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

$$\begin{aligned} -\frac{\i }{\sqrt{2}}\Big (e^{\i \theta }|y\rangle |w_1\rangle -e^{-\i \theta }| -y\rangle |w_2\rangle \Big ), \end{aligned}$$
(19)

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

$$\begin{aligned} |\phi \rangle |f(\tilde{\theta })\rangle , \end{aligned}$$
(20)

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.

Fig. 6
figure 6

Quantum circuit of Hadamard test

The final quantum state is

$$\begin{aligned} |\phi \rangle =\frac{1}{2}(|0\rangle (|x\rangle +|y\rangle )+|1\rangle (|x\rangle -|y\rangle )). \end{aligned}$$

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

$$\begin{aligned} |\psi \rangle =\frac{1}{2}(|0\rangle (|x\rangle +\i |y\rangle )+|1\rangle (|x\rangle -\i |y\rangle )), \end{aligned}$$

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

$$\begin{aligned} \frac{1}{\sqrt{2}}(|+\rangle |x\rangle +|-\rangle |y\rangle )\otimes |g(s)\rangle , \end{aligned}$$
(21)

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

$$\begin{aligned} \frac{1}{\sqrt{2}}(|0\rangle |x\rangle +|1\rangle |y\rangle ) |0\rangle \mapsto \frac{1}{\sqrt{2}}(|0\rangle |x\rangle +|1\rangle |y\rangle )|g(s)\rangle \end{aligned}$$
(22)

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.

Fig. 7
figure 7

Quantum circuit of swap test

The final state of Fig. 7 has the following form

$$\begin{aligned} \frac{1}{2}|0\rangle (|x\rangle |y\rangle + |y\rangle |x\rangle ) +\frac{1}{2}|1\rangle (|x\rangle |y\rangle - |y\rangle |x\rangle ). \end{aligned}$$
(23)

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 xy. 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

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11128-020-2592-z

Keywords

Navigation

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy