Abstract
We discuss a quantum non-demolition measurement (QNDM) protocol to estimate the derivatives of a cost function with a quantum computer. The cost function, which is supposed to be classically hard to evaluate, is associated with the average value of a quantum operator. Then a quantum computer is used to efficiently extract information about the function and its derivative by evolving the system with a so-called variational quantum circuit. To this aim, we propose to use a quantum detector that allows us to directly estimate the derivatives of an observable, i.e., the derivative of the cost function. With respect to the standard direct measurement approach, this leads to a reduction of the number of circuit iterations needed to run the variational quantum circuits. The advantage increases if we want to estimate the higher-order derivatives. We also show that the presented approach can lead to a further advantage in terms of the number of total logical gates needed to run the variational quantum circuits. These results make the QNDM a valuable alternative to implementing the variational quantum circuits.
Similar content being viewed by others
Data Availability Statement
This manuscript has no associated data or the data will not be deposited. [Authors’ comment: The authors confirm that the data supporting the findings of this study are available within the article.]
References
A. Peruzzo, J. McClean, P. Shadbolt, M.-H. Yung, X.-Q. Zhou, P.J. Love, A. Aspuru-Guzik, J.L. O’Brien, A variational eigenvalue solver on a photonic quantum processor. Nat. Commun. 5(1), 4213 (2014). https://doi.org/10.1038/ncomms5213
A. Kandala, A. Mezzacapo, K. Temme, M. Takita, M. Brink, J.M. Chow, J.M. Gambetta, Hardware-efficient variational quantum Eigensolver for small molecules and quantum magnets. Nature 549(7671), 242–246 (2017). https://doi.org/10.1038/nature23879
E. Farhi, J. Goldstone, S. Gutmann, A quantum approximate optimization algorithm. arXiv preprint (2014). arXiv:1411.4028
S. McArdle, S. Endo, A. Aspuru-Guzik, S.C. Benjamin, X. Yuan, Quantum computational chemistry. Rev. Mod. Phys. 92, 015003 (2020). https://doi.org/10.1103/RevModPhys.92.015003
M. Cerezo, A. Arrasmith, R. Babbush, S.C. Benjamin, S. Endo, K. Fujii, J.R. McClean, K. Mitarai, X. Yuan, L. Cincio, P.J. Coles, Variational quantum algorithms. Nat. Rev. Phys. 3(9), 625–644 (2021). https://doi.org/10.1038/s42254-021-00348-9
A. Mari, T.R. Bromley, N. Killoran, Estimating the gradient and higher-order derivatives on quantum hardware. Phys. Rev. A 103, 012405 (2021). https://doi.org/10.1103/PhysRevA.103.012405
A.A. Clerk, Full counting statistics of energy fluctuations in a driven quantum resonator. Phys. Rev. A 84, 043824 (2011). https://doi.org/10.1103/PhysRevA.84.043824
A. Bednorz, W. Belzig, A. Nitzan, Nonclassical time correlation functions in continuous quantum measurement. New J. Phys. 14(1), 013009 (2012)
Y. Aharonov, D.Z. Albert, L. Vaidman, How the result of a measurement of a component of the spin of a spin-1/2 particle can turn out to be 100. Phys. Rev. Lett. 60, 1351–1354 (1988). https://doi.org/10.1103/PhysRevLett.60.1351
P. Solinas, S. Gasparinetti, Full distribution of work done on a quantum system for arbitrary initial states. Phys. Rev. E 92, 042150 (2015). https://doi.org/10.1103/PhysRevE.92.042150
P. Solinas, S. Gasparinetti, Probing quantum interference effects in the work distribution. Phys. Rev. A 94, 052103 (2016). https://doi.org/10.1103/PhysRevA.94.052103
P. Solinas, M. Amico, N. Zanghì, Measurement of work and heat in the classical and quantum regimes. Phys. Rev. A 103, 060202 (2021). https://doi.org/10.1103/PhysRevA.103.L060202
P. Solinas, M. Amico, N. Zanghì, Quasiprobabilities of work and heat in an open quantum system. Phys. Rev. A 105, 032606 (2022). https://doi.org/10.1103/PhysRevA.105.032606
P. Talkner, E. Lutz, P. Hänggi, Fluctuation theorems: Work is not an observable. Phys. Rev. E 75, 050102 (2007). https://doi.org/10.1103/PhysRevE.75.050102
T.E. O’Brien, B. Senjean, R. Sagastizabal, X. Bonet-Monroig, A. Dutkiewicz, F. Buda, L. DiCarlo, L. Visscher, Calculating energy derivatives for quantum chemistry on a quantum computer. NPJ Quant. Inf. 5(1), 113 (2019). https://doi.org/10.1038/s41534-019-0213-4
L. Banchi, G.E. Crooks, Measuring analytic gradients of general quantum evolution with the stochastic parameter shift rule. Quantum 5, 386 (2021). https://doi.org/10.22331/q-2021-01-25-386
R. Cheng, Quantum geometric tensor (fubini-study metric) in simple quantum system: A pedagogical introduction. arXiv preprint (2010). arXiv:1012.1337
J. Liu, H. Yuan, X.-M. Lu, X. Wang, Quantum fisher information matrix and multiparameter estimation. J. Phys. A: Math. Theor. 53(2), 023001 (2019). https://doi.org/10.1088/1751-8121/ab5d4d
P. Solinas, H.J.D. Miller, J. Anders, Measurement-dependent corrections to work distributions arising from quantum coherences. Phys. Rev. A 96, 052115 (2017). https://doi.org/10.1103/PhysRevA.96.052115
D. Wecker, M.B. Hastings, M. Troyer, Progress towards practical quantum variational algorithms. Phys. Rev. A 92, 042303 (2015). https://doi.org/10.1103/PhysRevA.92.042303
V. Havlíček, A.D. Córcoles, K. Temme, A.W. Harrow, A. Kandala, J.M. Chow, J.M. Gambetta, Supervised learning with quantum-enhanced feature spaces. Nature 567(7747), 209–212 (2019). https://doi.org/10.1038/s41586-019-0980-2
D.S. Abrams, S. Lloyd, Quantum algorithm providing exponential speed increase for finding eigenvalues and eigenvectors. Phys. Rev. Lett. 83, 5162–5165 (1999). https://doi.org/10.1103/PhysRevLett.83.5162
V. Verteletskyi, T.-C. Yen, A.F. Izmaylov, Measurement optimization in the variational quantum eigensolver using a minimum clique cover. J. Chem. Phys. 152(12), 124114 (2020). https://doi.org/10.1063/1.5141458
T.-C. Yen, V. Verteletskyi, A.F. Izmaylov, Measuring all compatible operators in one series of single-qubit measurements using unitary transformations. J. Chem. Theory Comput. 16(4), 2400–2409 (2020). https://doi.org/10.1021/acs.jctc.0c00008
T.-C. Yen, A.F. Izmaylov, Cartan subalgebra approach to efficient measurements of quantum observables. PRX Quant. 2, 040320 (2021). https://doi.org/10.1103/PRXQuantum.2.040320
M. Ahookhosh, Y. Nesterov, High-order methods beyond the classical complexity bounds, i: inexact high-order proximal-point methods (2021). arXiv preprint arXiv:2107.05958
M. Ahookhosh, Y. Nesterov, High-order methods beyond the classical complexity bounds, ii: inexact high-order proximal-point methods with segment search. arXiv preprint (2021). arXiv:2109.12303
N. Stamatopoulos, G. Mazzola, S. Woerner, W.J. Zeng, Towards quantum advantage in financial market risk using quantum gradient algorithms. Quantum 6, 770 (2022). https://doi.org/10.22331/q-2022-07-20-770
J.R. McClean, S. Boixo, V.N. Smelyanskiy, R. Babbush, H. Neven, Barren plateaus in quantum neural network training landscapes. Nat. Commun. 9(1), 4812 (2018). https://doi.org/10.1038/s41467-018-07090-4
Acknowledgements
The authors acknowledge financial support from INFN. This work has been carried out while Giovanni Minuto was enrolled in the Italian National Doctorate on Artificial Intelligence run by Sapienza University of Rome in collaboration with Dept. of Informatics, Bioengineering, Robotics, and Systems Engineering, Polytechnic School of Genoa.
Author information
Authors and Affiliations
Contributions
Paolo Solinas proposed and developed the idea, perform the calculations and wrote the first draft of the manuscript. All authors commented on previous versions of the manuscript and were involved in the final writing of the final version. All authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Conflict of interest
The author declares that he has no known competing funding, employment, financial or nonfinancial interests that could have appeared to influence the work reported in this paper.
Appendices
Appendix A
Unitary evolution in the parameter space
In the main text, we have written the total unitary transformation to measure the gradient as \(U_{tot} = e^{ i \lambda {\hat{p}} \otimes {\hat{M}} } U_2 e^{-i \lambda {\hat{p}} \otimes {\hat{M}} } U_1\). The \(U_1\) and \(U_2\) operation can be thought of as a sequence of non-commuting logical quantum gates or, alternatively using a more physical language, generated by a time-dependent Hamiltonian \(H(\theta (t))\).
We consider the change in \({\vec \theta }\) along a single direction \(\textbf{e}_{j_1}\) so that the difference between the points \({\vec \theta } \pm s \textbf{e}_{j_1}\) is parametrized only by s. To build the operator \(U({\vec \theta })\), we divide the transformation into N steps as usually done for the evolution of a quantum system or the implementation in a quantum circuit. Similarly, we suppose that to implement the operators \(U({\vec \theta } - s \textbf{e}_{j_1})\) and \(U({\vec \theta } + s \textbf{e}_{j_1})\) we need \( N-N_1\) and \(N+N_2\) operations, respectively. Denoting the single unitary operation a \(u_k\), we can write
and \(U_2 = \Pi _{j=1}^{N+N_2} u_j = \Pi _{j=N-N_1}^{N+N_2} u_j U_1 \). Therefore, we can obtain \(U_2\) by implementing first \(U_1\) and then applying other \(N_2+N_1\) operators.
Using the mapping \(U_1= U({\vec \theta } - s \textbf{e}_{j_1})\) and \(U_2= U({\vec \theta } + s \textbf{e}_{j_1})\), we rewrite the above equation as
where we have implicitly denoted with \(U({\vec \theta } + s \textbf{e}_{j_1}, {\vec \theta } - s \textbf{e}_{j_1})\) the operator that allows us to pass from \({\vec \theta } - s \textbf{e}_{j_1}\) to \({\vec \theta } + s \textbf{e}_{j_1}\) with \(N_2+N_1\) operators.
In a similar way, we can implement the series of operators \({\mathcal {U}}_\lambda = e^{ i \lambda {\bar{p}} {\hat{M}} } U_4 e^{-i \lambda {\bar{p}} {\hat{M}} } U_3 e^{ i \lambda {\bar{p}} {\hat{M}} } U_2 e^{-i \lambda {\bar{p}} {\hat{M}} } U_1\) to measure the second derivative. The \(U_j\) operators (with \(j=1,..,4\)) correspond to the operators working in the \(\vec \theta \) space.
We define the quasi-characteristic function as in Eq. (9) and use the above expression for \({\mathcal {U}}_\lambda \). Taking the first derivative with respect to \(\lambda \), and using the mapping
we obtain
where in the last line we have used the definition of \(f(\vec \theta )\) in Eq. (3). A part from a \(2 \sin s\) factor, this is the second derivative as in Eq. (5). By denoting with \(U(\vec \theta _2, \vec \theta _1)\) the operator that allows us to pass from \(\vec \theta _1\) to \(\vec \theta _2\), we obtain the explicit form of the \(U_j\) operators as in Eq. (22) of the main text.
Appendix B
Detection with a qubit
We consider the case in which a qubit, i.e., a two-level system, is used as a detector. The initial state of the detector is fixed at \(|\eta _0\rangle = \cos \alpha /2 |0\rangle + \sin \alpha /2 |1\rangle \). The initial contribution to \({\mathcal {G}}_\lambda \) is \(\langle 0|\eta _0 \rangle \langle \eta _0|1 \rangle = 1/2~\sin \alpha \).
After the evolution the detector acquires a phase \(\phi (\lambda )\) so that its final state is \(|\eta _f\rangle = \cos \alpha /2 |0\rangle + \sin \alpha /2 e^{- i \phi (\lambda )} |1\rangle \). The numerator of the \({\mathcal {G}}_\lambda \) is \(\langle 0|\eta _f \rangle \langle \eta _f|1 \rangle = 1/2~\sin \alpha e^{ i \phi (\lambda )}\) and
is exactly the phase accumulated during the evolution.
We can verify that \({\mathcal {G}}_\lambda \) has the properties discussed in the previous section recalling that for \(\lambda =0\) there is no system–detector interaction and, thus, no phase is accumulated, i.e., \(\phi (0) = 0\).
In particular, \(-i \partial _\lambda {\mathcal {G}}_\lambda |_{\lambda =0 } = \partial _\lambda \phi (\lambda )|_{\lambda =0}\); therefore, the average value and the gradient are related to the derivative of the accumulated phase evaluated in the origin.
In the experiments, we need to calculate \(\partial _\lambda \phi (\lambda )|_{\lambda =0}\) numerically. We can approximate it as
We can calculate the desired quantity by evaluating the protocol and the phase at a small \(\Delta \lambda \ll 1\).
Appendix C
Measuring the Pauli string—QNDM and DM circuit implementation
Let us consider the implementation of the exponential operator \(\exp \{ i \lambda {{\hat{p}}} \otimes {\hat{P}}_j \}\) where the Pauli string \({\hat{P}}_j\) is a product of Pauli operators: \( {\hat{P}}_j = \prod _i \sigma _i^j\).
Having in mind the implementation in a quantum computer, we can substitute the detector \({\hat{p}}\) operator with a Pauli operator \(\sigma _z^D\). The exponential operator reads \(\exp \{ i \lambda \sigma _z^D \prod _i \sigma _i^j \}\); therefore, the presence of the detector simply increases the dimension of the Pauli string of one qubit.
To implement the exponential operator, we first rotate the Pauli operator to have a product of \(\sigma _z\) operators. This can be done by applying Hadamard operators \(H_{had, x}\) for the \(\sigma _x\) and the corresponding \(H_{had, y}\) for the \(\sigma _y\). That is \( \left( \prod H_{had, l} \right) \exp \{ i \lambda \sigma _z^D {\hat{P}}_j \} \left( \prod H_{had, l} \right) = \exp \{ i \lambda \sigma _z^D \prod _p \sigma _z^p \}\).
The diagonalized exponential operator generates a phase factor \(\exp \{\pm i \lambda \}\) depending on the logical string to whom it is applied. More specifically, taking \(\sigma _z |0\rangle = - |0\rangle \) and \(\sigma _z |1\rangle = |1\rangle \), the transformation is \(|x_1 x_2... x_n\rangle \rightarrow \exp \{ i \lambda \} |x_1 x_2... x_n\rangle \) if the number of \(x_i=0\) is even and \(|x_1 x_2... x_n\rangle \rightarrow \exp \{- i \lambda \} |x_1 x_2... x_n\rangle \) if the number of \(x_i=0\) is odd.
To count the parity of \(x_i=0\) in a string, we add an ancilla qubit in position \(n+2\) (the \(n+1\) qubit is the detector) and apply a sequence of n \(\textrm{C}_i \textrm{NOT}_{n+2}\) logical gate with \(i=1,2,..., n+1\). The \(\textrm{C}_i \textrm{NOT}_{n+2}\) is controlled on the i-th logical qubit and acts always in the ancilla qubit. As a consequence, if we have an even number of \(x_i=0\), the ancilla qubit will end up in the \(|0\rangle \) state, otherwise, i.e., for an odd number of \(x_i=0\), in the \(|1\rangle \) state. Then we apply a phase gate on the ancilla qubit \(\exp \{ i \lambda \sigma _z^a \}\) and reverse the \(\textrm{C}_i \textrm{NOT}_{n+2}\) operations to reset the ancilla qubit to its original state \(|0\rangle \). The full circuit is shown in Fig. 4.
To implement this operator, we need \(2(n+1)\) Hadamard gates, \(2(n+1)\) CNOT gates and a phase gate for a total of \(4(n+1)+1\approx 4n\) elementary gates for \(n \gg 1\). Notice that this is the worst case where we have to apply 2n Hadamard gates. In many cases, the Pauli string operators are the product of a limited number of Pauli operators so the number of Hadamard gates can be significantly reduced. For example, in physical problems where we need to find the energy of the ground state of a Hamiltonian, the Pauli strings are usually the product of only four Pauli operators [20, 29].
For the DM approach, we have an analogous situation. In quantum computers, the measurement is performed in a fixed basis (usually the one in which \(\sigma _z\) is diagonal). Since we cannot directly measure an alternative Pauli observable (\(\sigma _x\) or \(\sigma _y\)), we have to rotate the qubit state and perform the measurement in the predetermined basis. As above, this is done by applying an Hadarmard \(H_{had,l}\) operator. Therefore, to measure the average of a Pauli string, we need a maximum of n \(H_{had,l}\) logical gates.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Solinas, P., Caletti, S. & Minuto, G. Quantum gradient evaluation through quantum non-demolition measurements. Eur. Phys. J. D 77, 76 (2023). https://doi.org/10.1140/epjd/s10053-023-00648-y
Received:
Accepted:
Published:
DOI: https://doi.org/10.1140/epjd/s10053-023-00648-y