Reduction of finite sampling noise in quantum neural networks

Reduction of finite sampling noise in quantum neural networks

David A. Kreplin and Marco Roth

Fraunhofer Institute for Manufacturing Engineering and Automation (IPA), Nobelstraße 12, D-70569 Stuttgart, Germany

Find this paper interesting or want to discuss? Scite or leave a comment on SciRate.

Abstract

Quantum neural networks (QNNs) use parameterized quantum circuits with data-dependent inputs and generate outputs through the evaluation of expectation values. Calculating these expectation values necessitates repeated circuit evaluations, thus introducing fundamental finite-sampling noise even on error-free quantum computers. We reduce this noise by introducing the variance regularization, a technique for reducing the variance of the expectation value during the quantum model training. This technique requires no additional circuit evaluations if the QNN is properly constructed. Our empirical findings demonstrate the reduced variance speeds up the training and lowers the output noise as well as decreases the number of necessary evaluations of gradient circuits. This regularization method is benchmarked on the regression of multiple functions and the potential energy surface of water. We show that in our examples, it lowers the variance by an order of magnitude on average and leads to a significantly reduced noise level of the QNN. We finally demonstrate QNN training on a real quantum device and evaluate the impact of error mitigation. Here, the optimization is feasible only due to the reduced number of necessary shots in the gradient evaluation resulting from the reduced variance.

Quantum neural networks (QNNs) are quantum computing methods that use parameterized quantum circuits with data-dependent inputs, producing outputs through the evaluation of expectation values. In a supervised learning framework, QNNs are trained to minimize a loss function based on labeled data.

Determining the model output by evaluating expectation values necessitates multiple circuit evaluations, known as shots, which introduces intrinsic finite-sampling noise, even in ideal quantum computers. While increasing the number of measurements can reduce finite-sampling noise, practical constraints limit this approach. Therefore, we propose reducing the variance of expectation values as an alternative method to lower the noise. This can be accomplished by adding variance as a regularization term in the loss function. If the QNN follows specific design principles, the variance can be calculated without additional circuit evaluations. This approach also applies to minimizing the number of shots required for evaluating the QNN gradient during training.

The efficacy of this technique is empirically validated through various benchmarks, including function regression and modeling the potential energy surface of water. Our results demonstrate that variance regularization can reduce the variance by an order of magnitude on average, significantly decreasing noise in QNN outputs. Furthermore, the practical feasibility of this method is confirmed on real quantum hardware, highlighting its importance in reducing the number of shots needed for gradient evaluation and enabling more efficient optimization on quantum computers.

► BibTeX data

► References

[1] John Preskill. “Quantum computing in the nisq era and beyond”. Quantum 2, 79 (2018).
https:/​/​doi.org/​10.22331/​q-2018-08-06-79

[2] M. Cerezo, Andrew Arrasmith, Ryan Babbush, Simon C. Benjamin, Suguru Endo, Keisuke Fujii, Jarrod R. McClean, Kosuke Mitarai, Xiao Yuan, Lukasz Cincio, and Patrick J. Coles. “Variational quantum algorithms”. Nature Reviews Physics 3, 625–644 (2021).
https:/​/​doi.org/​10.1038/​s42254-021-00348-9

[3] Kishor Bharti, Alba Cervera-Lierta, Thi Ha Kyaw, Tobias Haug, Sumner Alperin-Lea, Abhinav Anand, Matthias Degroote, Hermanni Heimonen, Jakob S. Kottmann, Tim Menke, Wai-Keong Mok, Sim Sukin, Leong-Chuan Kwek, and Alán Aspuru-Guzik. “Noisy intermediate-scale quantum algorithms”. Rev. Mod. Phys. 94, 015004 (2022).
https:/​/​doi.org/​10.1103/​RevModPhys.94.015004

[4] Bernhard Schölkopf. “The kernel trick for distances”. In Advances in Neural Information Processing Systems. Volume 13, pages 301–307. MIT Press (2000). url: https:/​/​proceedings.neurips.cc/​paper_files/​paper/​2000/​file/​4e87337f366f72daa424dae11df0538c-Paper.pdf.
https:/​/​proceedings.neurips.cc/​paper_files/​paper/​2000/​file/​4e87337f366f72daa424dae11df0538c-Paper.pdf

[5] Sergios Theodoridis and Konstantinos Koutroumbas. “Pattern recognition”. Academic Press. (2008).
https:/​/​doi.org/​10.1016/​B978-1-59749-272-0.X0001-2

[6] Maria Schuld and Nathan Killoran. “Quantum machine learning in feature hilbert spaces”. Phys. Rev. Lett. 122, 040504 (2019).
https:/​/​doi.org/​10.1103/​PhysRevLett.122.040504

[7] Seth Lloyd, Maria Schuld, Aroosa Ijaz, Josh Izaac, and Nathan Killoran. “Quantum embeddings for machine learning” (2020). arXiv:2001.03622.
https:/​/​doi.org/​10.48550/​arXiv.2001.03622
arXiv:2001.03622

[8] Vojtěch Havlíček, Antonio D. Córcoles, Kristan Temme, Aram W. Harrow, Abhinav Kandala, Jerry M. Chow, and Jay M. Gambetta. “Supervised learning with quantum-enhanced feature spaces”. Nature 567, 209–212 (2019).
https:/​/​doi.org/​10.1038/​s41586-019-0980-2

[9] Thomas Hubregtsen, David Wierichs, Elies Gil-Fuster, Peter-Jan H. S. Derks, Paul K. Faehrmann, and Johannes Jakob Meyer. “Training quantum embedding kernels on near-term quantum computers”. Phys. Rev. A 106, 042431 (2022).
https:/​/​doi.org/​10.1103/​PhysRevA.106.042431

[10] Jonas Kübler, Simon Buchholz, and Bernhard Schölkopf. “The inductive bias of quantum kernels”. In Advances in Neural Information Processing Systems. Volume 34, pages 12661–12673. Curran Associates, Inc. (2021). url: https:/​/​proceedings.neurips.cc/​paper_files/​paper/​2021/​file/​69adc1e107f7f7d035d7baf04342e1ca-Paper.pdf.
https:/​/​proceedings.neurips.cc/​paper_files/​paper/​2021/​file/​69adc1e107f7f7d035d7baf04342e1ca-Paper.pdf

[11] Frederic Rapp and Marco Roth. “Quantum gaussian process regression for bayesian optimization”. Quantum Mach. Intell. 6, 5 (2024).
https:/​/​doi.org/​10.1007/​s42484-023-00138-9

[12] K. Mitarai, M. Negoro, M. Kitagawa, and K. Fujii. “Quantum circuit learning”. Phys. Rev. A 98, 032309 (2018).
https:/​/​doi.org/​10.1103/​PhysRevA.98.032309

[13] Marcello Benedetti, Erika Lloyd, Stefan Sack, and Mattia Fiorentini. “Parameterized quantum circuits as machine learning models”. Quantum Sci. Technol. 4, 043001 (2019).
https:/​/​doi.org/​10.1088/​2058-9565/​ab4eb5

[14] Edward Farhi and Hartmut Neven. “Classification with quantum neural networks on near term processors” (2018). arXiv:1802.06002.
https:/​/​doi.org/​10.48550/​arXiv.1802.06002
arXiv:1802.06002

[15] Iris Cong, Soonwon Choi, and Mikhail D. Lukin. “Quantum convolutional neural networks”. Nature Physics 15, 1273–1278 (2019).
https:/​/​doi.org/​10.1038/​s41567-019-0648-8

[16] Kerstin Beer, Dmytro Bondarenko, Terry Farrelly, Tobias J. Osborne, Robert Salzmann, Daniel Scheiermann, and Ramona Wolf. “Training deep quantum neural networks”. Nature communications 11, 808 (2020).
https:/​/​doi.org/​10.1038/​s41467-020-14454-2

[17] Kaining Zhang, Min-Hsiu Hsieh, Liu Liu, and Dacheng Tao. “Toward trainability of quantum neural networks” (2020). arXiv:2011.06258.
https:/​/​doi.org/​10.48550/​arXiv.2011.06258
arXiv:2011.06258

[18] M. Cerezo, Guillaume Verdon, Hsin-Yuan Huang, Lukasz Cincio, and Patrick J. Coles. “Challenges and opportunities in quantum machine learning”. Nature Computational Science 2, 567–576 (2022).
https:/​/​doi.org/​10.1038/​s43588-022-00311-3

[19] David Wierichs, Christian Gogolin, and Michael Kastoryano. “Avoiding local minima in variational quantum eigensolvers with the natural gradient optimizer”. Phys. Rev. Research 2, 043246 (2020).
https:/​/​doi.org/​10.1103/​PhysRevResearch.2.043246

[20] Aram W. Harrow and John C. Napp. “Low-depth gradient measurements can improve convergence in variational hybrid quantum-classical algorithms”. Phys. Rev. Lett. 126, 140502 (2021).
https:/​/​doi.org/​10.1103/​PhysRevLett.126.140502

[21] Maria Schuld, Ville Bergholm, Christian Gogolin, Josh Izaac, and Nathan Killoran. “Evaluating analytic gradients on quantum hardware”. Phys. Rev. A 99, 032331 (2019).
https:/​/​doi.org/​10.1103/​PhysRevA.99.032331

[22] David Wierichs, Josh Izaac, Cody Wang, and Cedric Yen-Yu Lin. “General parameter-shift rules for quantum gradients”. Quantum 6, 677 (2022).
https:/​/​doi.org/​10.22331/​q-2022-03-30-677

[23] Takahiro Goto, Quoc Hoan Tran, and Kohei Nakajima. “Universal approximation property of quantum machine learning models in quantum-enhanced feature spaces”. Phys. Rev. Lett. 127, 090506 (2021).
https:/​/​doi.org/​10.1103/​PhysRevLett.127.090506

[24] Maria Schuld, Ryan Sweke, and Johannes Jakob Meyer. “Effect of data encoding on the expressive power of variational quantum-machine-learning models”. Phys. Rev. A 103, 032430 (2021).
https:/​/​doi.org/​10.1103/​PhysRevA.103.032430

[25] Adrián Pérez-Salinas, David López-Núñez, Artur García-Sáez, P. Forn-Díaz, and José I. Latorre. “One qubit as a universal approximant”. Phys. Rev. A 104, 012405 (2021).
https:/​/​doi.org/​10.1103/​PhysRevA.104.012405

[26] Francisco Javier Gil Vidal and Dirk Oliver Theis. “Input redundancy for parameterized quantum circuits”. Front. Phys. 8, 297 (2020).
https:/​/​doi.org/​10.3389/​fphy.2020.00297

[27] Adrián Pérez-Salinas, Alba Cervera-Lierta, Elies Gil-Fuster, and José I. Latorre. “Data re-uploading for a universal quantum classifier”. Quantum 4, 226 (2020).
https:/​/​doi.org/​10.22331/​q-2020-02-06-226

[28] Matthias C. Caro, Hsin-Yuan Huang, M. Cerezo, Sharma Kunal, Andrew Sornborger, Lukasz Cincio, and Patrick J. Coles. “Generalization in quantum machine learning from few training data”. Nature communications 13, 4919 (2022).
https:/​/​doi.org/​10.1038/​s41467-022-32550-3

[29] Jarrod R. McClean, Sergio Boixo, Vadim N. Smelyanskiy, Ryan Babbush, and Hartmut Neven. “Barren plateaus in quantum neural network training landscapes”. Nature communications 9, 4812 (2018).
https:/​/​doi.org/​10.1038/​s41467-018-07090-4

[30] Andrew Arrasmith, M. Cerezo, Piotr Czarnik, Lukasz Cincio, and Patrick J. Coles. “Effect of barren plateaus on gradient-free optimization”. Quantum 5, 558 (2021).
https:/​/​doi.org/​10.22331/​q-2021-10-05-558

[31] Zoë Holmes, Sharma Kunal, M. Cerezo, and Patrick J. Coles. “Connecting ansatz expressibility to gradient magnitudes and barren plateaus”. PRX Quantum 3, 010313 (2022).
https:/​/​doi.org/​10.1103/​PRXQuantum.3.010313

[32] Carlos Ortiz Marrero, Mária Kieferová, and Nathan Wiebe. “Entanglement-induced barren plateaus”. PRX Quantum 2, 040316 (2021).
https:/​/​doi.org/​10.1103/​PRXQuantum.2.040316

[33] M. Cerezo, Akira Sone, Tyler Volkoff, Lukasz Cincio, and Patrick J. Coles. “Cost function dependent barren plateaus in shallow parametrized quantum circuits”. Nature communications 12, 1791 (2021).
https:/​/​doi.org/​10.1038/​s41467-021-21728-w

[34] A. V. Uvarov and J. D. Biamonte. “On barren plateaus and cost function locality in variational quantum algorithms”. J. Phys. A: Math. Theor. 54, 245301 (2021).
https:/​/​doi.org/​10.1088/​1751-8121/​abfac7

[35] Arthur Pesah, M. Cerezo, Samson Wang, Tyler Volkoff, Andrew T. Sornborger, and Patrick J. Coles. “Absence of barren plateaus in quantum convolutional neural networks”. Phys. Rev. X 11, 041011 (2021).
https:/​/​doi.org/​10.1103/​PhysRevX.11.041011

[36] Martín Larocca, Nathan Ju, Diego García-Martín, Patrick J. Coles, and Marco Cerezo. “Theory of overparametrization in quantum neural networks”. Nature Computational Science 3, 542–551 (2023).
https:/​/​doi.org/​10.1038/​s43588-023-00467-6

[37] Samson Wang, Enrico Fontana, M. Cerezo, Kunal Sharma, Akira Sone, Lukasz Cincio, and Patrick J. Coles. “Noise-induced barren plateaus in variational quantum algorithms”. Nature communications 12, 6961 (2021).
https:/​/​doi.org/​10.1038/​s41467-021-27045-6

[38] Samson Wang, Piotr Czarnik, Andrew Arrasmith, M. Cerezo, Lukasz Cincio, and Patrick J. Coles. “Can error mitigation improve trainability of noisy variational quantum algorithms?”. Quantum 8, 1287 (2024).
https:/​/​doi.org/​10.22331/​q-2024-03-14-1287

[39] Amazon Web Services. “Quantum computer and simulator – amazon braket pricing – aws”. https:/​/​aws.amazon.com/​de/​braket/​pricing/​. Accessed: 2023-04-11.
https:/​/​aws.amazon.com/​de/​braket/​pricing/​

[40] Andrea Skolik, Jarrod R. McClean, Masoud Mohseni, Patrick van der Smagt, and Martin Leib. “Layerwise learning for quantum neural networks”. Quantum Mach. Intell. 3, 5 (2021).
https:/​/​doi.org/​10.1007/​s42484-020-00036-4

[41] Oleksandr Kyriienko, Annie E. Paine, and Vincent E. Elfving. “Solving nonlinear differential equations with differentiable quantum circuits”. Phys. Rev. A 103, 052416 (2021).
https:/​/​doi.org/​10.1103/​PhysRevA.103.052416

[42] R. Somma, G. Ortiz, J. E. Gubernatis, E. Knill, and R. Laflamme. “Simulating physical phenomena by quantum networks”. Phys. Rev. A 65, 042323 (2002).
https:/​/​doi.org/​10.1103/​PhysRevA.65.042323

[43] Gian Giacomo Guerreschi and Mikhail Smelyanskiy. “Practical optimization for hybrid quantum-classical algorithms” (2017). arXiv:1701.01450.
https:/​/​doi.org/​10.48550/​arXiv.1701.01450
arXiv:1701.01450

[44] Milton Abramowitz, Irene A. Stegun, and Robert H. Romer. “Handbook of mathematical functions with formulas, graphs, and mathematical tables”. American Journal of Physics 56, 958 (1988).
https:/​/​doi.org/​10.1119/​1.15378

[45] Ali Javadi-Abhari, Matthew Treinish, Kevin Krsulich, Christopher J. Wood, Jake Lishman, Julien Gacon, Simon Martiel, Paul D. Nation, Lev S. Bishop, Andrew W. Cross, Blake R. Johnson, and Jay M. Gambetta. “Quantum computing with qiskit” (2024). arXiv:2405.08810.
https:/​/​doi.org/​10.48550/​arXiv.2405.08810
arXiv:2405.08810

[46] David A. Kreplin, Moritz Willmann, Jan Schnabel, Frederic Rapp, Manuel Hagelüken, and Marco Roth. “squlearn – a python library for quantum machine learning” (2024). arXiv:2311.08990.
https:/​/​doi.org/​10.48550/​arXiv.2311.08990
arXiv:2311.08990

[47] Haym Benaroya, Seon Mi Han, and Mark Nagurka. “Probability models in engineering and science”. CRC press. (2005).
https:/​/​doi.org/​10.1201/​9781420056341

[48] Diederik P. Kingma and Jimmy Ba. “Adam: A method for stochastic optimization” (2017). arXiv:1412.6980.
https:/​/​doi.org/​10.48550/​arXiv.1412.6980
arXiv:1412.6980

[49] Oriel Kiss, Francesco Tacchino, Sofia Vallecorsa, and Ivano Tavernelli. “Quantum neural networks force fields generation”. Mach. Learn.: Sci. Technol. 3, 035004 (2022).
https:/​/​doi.org/​10.1088/​2632-2153/​ac7d3c

[50] Gunnar Alexander Schmitz. “water-dz-f12-static-g32n-1m_pes-dzero.xyz”. In Machine Learning for Potential Energy Surface Construction: A Benchmark Set. Harvard Dataverse (2019).
https:/​/​doi.org/​10.7910/​DVN/​C9ISSX/​T3ROI5

[51] Gunnar Schmitz, Ian Heide Godtliebsen, and Ove Christiansen. “Machine learning for potential energy surfaces: An extensive database and assessment of methods”. J. Chem. Phys. 150, 244113 (2019).
https:/​/​doi.org/​10.1063/​1.5100141

[52] IBM Quantum. https:/​/​quantum-computing.ibm.com/​ (2023).
https:/​/​quantum-computing.ibm.com/​

[53] Kristan Temme, Sergey Bravyi, and Jay M. Gambetta. “Error mitigation for short-depth quantum circuits”. Phys. Rev. Lett. 119, 180509 (2017).
https:/​/​doi.org/​10.1103/​PhysRevLett.119.180509

[54] Ying Li and Simon C. Benjamin. “Efficient variational quantum simulator incorporating active error minimization”. Phys. Rev. X 7, 021050 (2017).
https:/​/​doi.org/​10.1103/​PhysRevX.7.021050

Cited by

[1] Yaswitha Gujju, Atsushi Matsuo, and Rudy Raymond, “Quantum machine learning on near-term quantum devices: Current state of supervised and unsupervised techniques for real-world applications”, Physical Review Applied 21 6, 067001 (2024).

[2] David A. Kreplin, Moritz Willmann, Jan Schnabel, Frederic Rapp, Manuel Hagelüken, and Marco Roth, “sQUlearn — A Python Library for Quantum Machine Learning”, arXiv:2311.08990, (2023).

[3] I. J. David, I. Sinayskiy, and F. Petruccione, “Benchmarking regularisation methods for quantum process tomography on NISQ devices”, European Physical Journal Special Topics 232 20-22, 3237 (2024).

[4] Erik Recio-Armengol, Jens Eisert, and Johannes Jakob Meyer, “Single-shot quantum machine learning”, arXiv:2406.13812, (2024).

The above citations are from SAO/NASA ADS (last updated successfully 2024-06-25 11:42:31). The list may be incomplete as not all publishers provide suitable and complete citation data.

Could not fetch Crossref cited-by data during last attempt 2024-06-25 11:42:30: Could not fetch cited-by data for 10.22331/q-2024-06-25-1385 from Crossref. This is normal if the DOI was registered recently.

Time Stamp:

More from Quantum Journal