Measuring Analytic Gradients of General Quantum Evolution with the Stochastic Parameter Shift Rule

Leonardo Banchi1,2 and Gavin E. Crooks3,4

1Department of Physics and Astronomy, University of Florence, via G. Sansone 1, I-50019 Sesto Fiorentino (FI), Italy
2INFN Sezione di Firenze, via G. Sansone 1, I-50019 Sesto Fiorentino (FI), Italy
3X, the moonshot factory (, Mountain View, CA, USA
4Berkeley Institute for Theoretical Science, Berkeley, CA, USA

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


Hybrid quantum-classical optimization algorithms represent one of the most promising application for near-term quantum computers. In these algorithms the goal is to optimize an observable quantity with respect to some classical parameters, using feedback from measurements performed on the quantum device. Here we study the problem of estimating the gradient of the function to be optimized directly from quantum measurements, generalizing and simplifying some approaches present in the literature, such as the so-called parameter-shift rule. We derive a mathematically exact formula that provides a stochastic algorithm for estimating the gradient of any multi-qubit parametric quantum evolution, without the introduction of ancillary qubits or the use of Hamiltonian simulation techniques. The gradient measurement is possible when the underlying device can realize all Pauli rotations in the expansion of the Hamiltonian whose coefficients depend on the parameter. Our algorithm continues to work, although with some approximations, even when all the available quantum gates are noisy, for instance due to the coupling between the quantum device and an unknown environment.

► BibTeX data

► References

[1] Cirq: A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits, 2019. https:/​/​​quantumlib/​Cirq.

[2] Leonardo Banchi, Nicola Pancotti, and Sougato Bose. Quantum gate learning in qubit networks: Toffoli gate without time-dependent control. npj Quantum Inf., 2: 16019, 2016. 10.1038/​npjqi.2016.19.

[3] Marcello Benedetti, Erika Lloyd, Stefan Sack, and Mattia Fiorentini. Parameterized quantum circuits as machine learning models. Quantum Sci. Technol., 2019. 10.1088/​2058-9565/​ab4eb5.

[4] Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, Carsten Blank, Keri McKiernan, and Nathan Killoran. Pennylane: Automatic differentiation of hybrid quantum-classical computations. arXiv:1811.04968, 2018.

[5] Heinz-Peter Breuer and Francesco Petruccione. The theory of open quantum systems. Oxford University Press on Demand, 2002. 10.1093/​acprof:oso/​9780199213900.001.0001.

[6] Michael Broughton, Guillaume Verdon, Trevor McCourt, Antonio J Martinez, Jae Hyeon Yoo, Sergei V Isakov, Philip Massey, Murphy Yuezhen Niu, Ramin Halavati, Evan Peters, Martin Leib, Andrea Skolik, Michael Streif, David Von Dollen, Jarrod R. McClean, Sergio Boixo, Dave Bacon, Alan K. Ho, Hartmut Neven, and Masoud Mohseni. Tensorflow quantum: A software framework for quantum machine learning. arXiv:2003.02989, 2020.

[7] Sébastien Bubeck. Convex optimization: Algorithms and complexity. Found. Trends Mach. Learn., 8 (3-4): 231–357, 2015. 10.1561/​2200000050.

[8] Tommaso Caneva, Tommaso Calarco, and Simone Montangero. Chopped random-basis quantum optimization. Phys. Rev. A, 84 (2): 022326, 2011. 10.1103/​physreva.84.022326.

[9] Andrew M Childs and Nathan Wiebe. Hamiltonian simulation using linear combinations of unitary operations. Quantum Information & Computation, 12 (11-12): 901–924, 2012. 10.26421/​QIC12.11-12.

[10] Jerry M Chow, AD Córcoles, Jay M Gambetta, Chad Rigetti, BR Johnson, John A Smolin, JR Rozen, George A Keefe, Mary B Rothwell, Mark B Ketchen, et al. Simple all-microwave entangling gate for fixed-frequency superconducting qubits. Phys. Rev. Lett., 107 (8): 080502, 2011. 10.1103/​PhysRevLett.107.080502.

[11] Gavin E Crooks. Gradients of parameterized quantum gates using the parameter-shift rule and gate decomposition. arXiv:1905.13311, 2019.

[12] Héctor Abraham et al. Qiskit: An open-source framework for quantum computing. 2019. 10.5281/​zenodo.2562110.

[13] Edward Farhi and Hartmut Neven. Classification with quantum neural networks on near term processors. arXiv preprint arXiv:1802.06002, 2018.

[14] Edward Farhi, Jeffrey Goldstone, and Sam Gutmann. A quantum approximate optimization algorithm. arXiv:1411.4028, 2014.

[15] Laura Gentini, Alessandro Cuccoli, Stefano Pirandola, Paola Verrucchi, and Leonardo Banchi. Noise-resilient variational hybrid quantum-classical optimization. Physical Review A, 102 (5): 052414, 2020. 10.1103/​PhysRevA.102.052414.

[16] Aram Harrow and John Napp. Low-depth gradient measurements can improve convergence in variational hybrid quantum-classical algorithms. arXiv:1901.05374, 2019.

[17] Luca Innocenti, Leonardo Banchi, Alessandro Ferraro, Sougato Bose, and Mauro Paternostro. Supervised learning of time-independent hamiltonians for gate design. New Journal of Physics, 2020. 10.1088/​1367-2630/​ab8aaf.

[18] Tyson Jones, Suguru Endo, Sam McArdle, Xiao Yuan, and Simon C Benjamin. Variational quantum algorithms for discovering hamiltonian spectra. Phys. Rev. A, 99 (6): 062304, 2019. 10.1103/​PhysRevA.99.062304.

[19] Navin Khaneja, Timo Reiss, Cindie Kehlet, Thomas Schulte-Herbrüggen, and Steffen J Glaser. Optimal control of coupled spin dynamics: design of nmr pulse sequences by gradient ascent algorithms. J. Magn. Reson, 172 (2): 296–305, 2005. 10.1016/​j.jmr.2004.11.004.

[20] Hyungwon Kim and David A Huse. Ballistic spreading of entanglement in a diffusive nonintegrable system. Phys. Rev. Lett., 111 (12): 127205, 2013. 10.1103/​PhysRevLett.111.127205.

[21] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv:1412.6980, 2014.

[22] Bálint Koczor and Simon C Benjamin. Quantum natural gradient generalised to non-unitary circuits. arXiv:1912.08660, 2019.

[23] Jun Li, Xiaodong Yang, Xinhua Peng, and Chang-Pu Sun. Hybrid quantum-classical approach to quantum optimal control. Physical review letters, 118 (15): 150503, 2017. 10.1103/​PhysRevLett.118.150503.

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

[25] Seth Lloyd. Universal quantum simulators. Science, 273 (5278): 1073–1078, 1996. 10.1126/​science.273.5278.1073.

[26] Jarrod R McClean, Sergio Boixo, Vadim N Smelyanskiy, Ryan Babbush, and Hartmut Neven. Barren plateaus in quantum neural network training landscapes. Nat. Commun., 9 (1): 4812, 2018. 10.1038/​s41467-018-07090-4.

[27] Willard Miller. Symmetry groups and their applications. Academic Press, 1973.

[28] Kosuke Mitarai and Keisuke Fujii. Methodology for replacing indirect measurements with direct measurements. Phys. Rev. Res., 1 (1): 013006, 2019. 10.1103/​PhysRevResearch.1.013006.

[29] Kosuke Mitarai, Makoto Negoro, Masahiro Kitagawa, and Keisuke Fujii. Quantum circuit learning. Phys. Rev. A, 98 (3): 032309, 2018. 10.1103/​PhysRevA.98.032309.

[30] Ashley Montanaro. Quantum algorithms: an overview. npj Quantum Inf., 2 (1): 1–8, 2016. 10.1038/​npjqi.2015.23.

[31] Michael A Nielsen, Mark R Dowling, Mile Gu, and Andrew C Doherty. Quantum computation as geometry. Science, 311 (5764): 1133–1135, 2006. 10.1126/​science.1121541.

[32] Alberto Peruzzo, Jarrod McClean, Peter Shadbolt, Man-Hong Yung, Xiao-Qi Zhou, Peter J Love, Alán Aspuru-Guzik, and Jeremy L O’Brien. A variational eigenvalue solver on a photonic quantum processor. Nat. Commun., 5: 4213, 2014. 10.1038/​ncomms5213.

[33] John Preskill. Quantum computing in the nisq era and beyond. Quantum, 2: 79, 2018. 10.22331/​q-2018-08-06-79.

[34] Angel Rivas and Susana F Huelga. Open quantum systems. Springer, 2012. 10.1007/​978-3-642-23354-8.

[35] Jonathan Romero, Jonathan P Olson, and Alán Aspuru-Guzik. Quantum autoencoders for efficient compression of quantum data. Quant. Sci. Tech., 2 (4): 045001, 2017. 10.1088/​2058-9565/​aa8072.

[36] Jonathan Romero, Ryan Babbush, Jarrod R McClean, Cornelius Hempel, Peter J Love, and Alán Aspuru-Guzik. Strategies for quantum computing molecular energies using the unitary coupled cluster ansatz. Quantum Science and Technology, 4 (1): 014008, 2018. 10.1088/​2058-9565/​aad3e4.

[37] Maria Schuld and Francesco Petruccione. Supervised learning with quantum computers. Springer, 2018. 10.1007/​978-3-319-96424-9.

[38] Maria Schuld, Ville Bergholm, Christian Gogolin, Josh Izaac, and Nathan Killoran. Evaluating analytic gradients on quantum hardware. Phys. Rev. A, 99 (3): 032331, 2019. 10.1103/​physreva.99.032331.

[39] Maria Schuld, Alex Bocharov, Krysta M. Svore, and Nathan Wiebe. Circuit-centric quantum classifiers. Phys. Rev. A, 101: 032308, 2020. 10.1103/​PhysRevA.101.032308. arXiv:1804.00633.

[40] Robert S Smith, Michael J Curtis, and William J Zeng. A practical quantum instruction set architecture. arXiv:1608.03355, 2016.

[41] James C. Spall. Multivariate stochastic approximation using a simultaneous perturbation gradient approximation. IEEE Trans. Automat. Contr., 37 (3): 332–341, 1992. 10.1109/​9.119632.

[42] James Stokes, Josh Izaac, Nathan Killoran, and Giuseppe Carleo. Quantum natural gradient. Quantum, 4: 269, 2020. 10.22331/​q-2020-05-25-269.

[43] Ryan Sweke, Frederik Wilde, Johannes Jakob Meyer, Maria Schuld, Paul K. Fährmann, Barthélémy Meynard-Piganeau, and Jens Eisert. Stochastic gradient descent for hybrid quantum-classical optimization. Quantum, 4: 314, August 2020. 10.22331/​q-2020-08-31-314.

[44] Barnaby van Straaten and Bálint Koczor. Measurement cost of metric-aware variational quantum algorithms. arXiv preprint arXiv:2005.05172, 2020.

[45] Ralph M Wilcox. Exponential operators and parameter differentiation in quantum physics. J. Math. Phys., 8 (4): 962–982, 1967. 10.1063/​1.1705306.

[46] Xiao Yuan, Suguru Endo, Qi Zhao, Ying Li, and Simon C Benjamin. Theory of variational quantum simulation. Quantum, 3: 191, 2019. 10.22331/​q-2019-10-07-191.

Cited by

[1] Johannes Jakob Meyer, Johannes Borregaard, and Jens Eisert, "A variational toolbox for quantum multi-parameter estimation", npj Quantum Information 7 1, 89 (2021).

[2] Maria Schuld and Francesco Petruccione, Quantum Science and Technology 177 (2021) ISBN:978-3-030-83097-7.

[3] S. Mangini, F. Tacchino, D. Gerace, D. Bajoni, and C. Macchiavello, "Quantum computing models for artificial neural networks", EPL (Europhysics Letters) 134 1, 10002 (2021).

[4] Stefano Barison, Filippo Vicentini, and Giuseppe Carleo, "An efficient quantum algorithm for the time evolution of parameterized circuits", Quantum 5, 512 (2021).

[5] Johannes Jakob Meyer, "Gradients just got more flexible", Quantum Views 5, 50 (2021).

[6] Sanjib Ghosh, Tanjung Krisnanda, Tomasz Paterek, and Timothy C. H. Liew, "Realising and compressing quantum circuits with quantum reservoir computing", Communications Physics 4 1, 105 (2021).

[7] 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, Sukin Sim, Leong-Chuan Kwek, and Alán Aspuru-Guzik, "Noisy intermediate-scale quantum (NISQ) algorithms", arXiv:2101.08448.

[8] Andrea Mari, Thomas R. Bromley, and Nathan Killoran, "Estimating the gradient and higher-order derivatives on quantum hardware", Physical Review A 103 1, 012405 (2021).

[9] Jakob S. Kottmann, Abhinav Anand, and Alán Aspuru-Guzik, "A Feasible Approach for Automatically Differentiable Unitary Coupled-Cluster on Quantum Computers", arXiv:2011.05938.

[10] Paolo Braccia, Filippo Caruso, and Leonardo Banchi, "How to enhance quantum generative adversarial learning of noisy information", New Journal of Physics 23 5, 053024 (2021).

[11] Saad Yalouz, Emiel Koridon, Bruno Senjean, Benjamin Lasorne, Francesco Buda, and Lucas Visscher, "Analytical nonadiabatic couplings and gradients within the state-averaged orbital-optimized variational quantum eigensolver", arXiv:2109.04576.

[12] Ieva Čepaitė, Brian Coyle, and Elham Kashefi, "A Continuous Variable Born Machine", arXiv:2011.00904.

[13] Maiyuren Srikumar, Charles D. Hill, and Lloyd C. L. Hollenberg, "Clustering and enhanced classification using a hybrid quantum autoencoder", arXiv:2107.11988.

[14] Tomislav Piskor, Florian G. Eich, Jan-Michael Reiner, Sebastian Zanker, Nicolas Vogt, Michael Marthaler, and Frank Wilhelm-Mauch, "Using gradient-based algorithms to determine ground state energies on a quantum computer", arXiv:2109.08420.

The above citations are from Crossref's cited-by service (last updated successfully 2021-10-22 11:27:33) and SAO/NASA ADS (last updated successfully 2021-10-22 11:27:34). The list may be incomplete as not all publishers provide suitable and complete citation data.

1 thought on “Measuring Analytic Gradients of General Quantum Evolution with the Stochastic Parameter Shift Rule

  1. Pingback: Perspective in Quantum Views by Johannes Jakob Meyer "Gradients just got more flexibl"