## Abstract

Estimating nonlinear functions of quantum states, such as the moment \({{{\rm{tr}}}}({\rho }^{m})\), is of fundamental and practical interest in quantum science and technology. Here we show a quantum-classical hybrid framework to measure them, where the quantum part is constituted by the generalized swap test, and the classical part is realized by postprocessing the result from randomized measurements. This hybrid framework utilizes the partial coherent power of the intermediate-scale quantum processor and, at the same time, dramatically reduces the number of quantum measurements and the cost of classical postprocessing. We demonstrate the advantage of our framework in the tasks of state-moment estimation and quantum error mitigation.

### Similar content being viewed by others

## Introduction

Quantum measurement is one of the fundamental building blocks of quantum physics, connecting the quantum world to its classical counterpart. The linear expectation value of the quantum state *ρ* in the form \({{{\rm{tr}}}}(O\rho )\) can be measured directly in the basis of the observable *O* by Born’s rule. However, the measurement of nonlinear functions, such as the Rényi entropy and the moment \({P}_{m}={{{\rm{tr}}}}({\rho }^{m})\), generally involves quantum circuits interfering among *m* copies of the state *ρ* by the generalized swap test^{1,2,3,4}, which transform nonlinear functions to linear ones on all that copies. Although there are significant experimental advances for the *m* = 2 case^{5,6,7,8}, it is still challenging to extend to a larger degree *m* with a moderate system size on current quantum platforms^{9}.

Recently, alternative approaches based on the randomized measurement (RM)^{10}, such as the shadow estimation^{11,12}, are proposed. By postprocessing the results from random basis measurements of sequentially prepared states, the shadow estimation is efficient for measuring local observables and the fidelity to some entangled states. However, when measuring nonlinear functions, such as the purity *P*_{2}, RM protocol inevitably needs an exponential number of measurements and postprocessings^{12,13,14}, which hinders its further applications for large systems.

By trading off the swap test and the RM protocol, here we propose a hybrid framework for estimating nonlinear functions of quantum states to fill the gap between them, which inherits their advantages and reduces weaknesses. Specifically, one can conduct RM on a few jointly prepared copies of the state by utilizing the partial coherent power of the quantum processor, and then estimate many nonlinear functions in a more efficient way, i.e., less demanding on both the quantum hardware and classical post-processing.

The nonlinear function of quantum states \({\{{\rho }_{i}\}}_{i = 1}^{m}\) with some observables \({\{{O}_{i}\}}_{i = 1}^{m}\) of interest reads

which is general and includes, such as the state overlap and fidelity^{15,16,17}, the purity and higher-order moments^{18,19}, quantum Fisher information^{20}, out-of-time-ordered correlators^{21,22}, and topological invariants^{23,24}. For simplicity, hereafter we mainly adopt the moment function *P*_{m} to illustrate the framework, where \({O}_{i}={{\mathbb{I}}}_{d}\) and *ρ*_{i} = *ρ* in Eq. (1), and assume *ρ* is an *n*-qubit state, i.e., \(\rho \in {{{{\mathcal{H}}}}}_{d}={{{{\mathcal{H}}}}}_{2}^{\otimes n}\) with *d* = 2^{n}.

Before moving to the following Results, let us first take a quick review of the swap test and the RM protocol for measuring *P*_{m}, respectively. The moment can be written as \({P}_{m}={{{\rm{tr}}}}({S}_{m}{\rho }^{\otimes m})\), with *S*_{m} the shift operation on \({{{{\mathcal{H}}}}}_{d}^{\otimes m}\) satisfying \({S}_{m}\left\vert {{{{\bf{b}}}}}_{1},{{{{\bf{b}}}}}_{2}\cdots \,,{{{{\bf{b}}}}}_{m}\right\rangle =\left\vert {{{{\bf{b}}}}}_{2},\cdots {{{{\bf{b}}}}}_{m},{{{{\bf{b}}}}}_{1}\right\rangle\), with each \(\{\left\vert {{{\bf{b}}}}\right\rangle \}\) the basis of each copy. Using the swap test, one can measure *P*_{m} efficiently with complete coherent control over multiple copies of the state, as illustrated in Fig. 1a. In particular, one initializes a control qubit and prepares the *m*-copy state *ρ*^{⊗m}, and then conducts the Controlled-shift operation

Finally one measures the control qubit to get the value of *P*_{m}^{1,2}. The corresponding quantum circuit requires a quantum processor with a total of *N* = *n**m* + 1 qubits. Although the shift operation on *m*-copy can be expressed as a product of 2-copy swap operations, this approach would significantly increase the quantum circuit depth. Furthermore, preparing *m* copies of the state in parallel imposes stringent demands on quantum memories. Therefore, the generalized swap test presents significant challenges for cases where *m* ≥ 3.

The RM toolbox^{10} was recently developed to ease the experimental challenge mentioned above^{25,26,27}. Compared with swap test, one only needs to control a single-copy state to realize the estimation. For shadow estimation^{12}, independent snapshots of the state \(\{{\widehat{\rho }}_{(i)}\}\) can be constructed using data conllected in RMs, as shown in Fig. 1b. This is referred to as the shadow set and has the property that the expectation \({\mathbb{E}}({\widehat{\rho }}_{(i)})=\rho\). Denote the random unitary evolution sampled from some ensemble as \(U\in {{{\mathcal{E}}}}\), and the *Z*-basis measurement result as **b** = {*b*_{1}*b*_{2} ⋯ *b*_{n}} ∈ {0, 1}^{n},

where \(\widehat{{{{\bf{b}}}}}\) is a random variable with probability \(\left\langle {{{\bf{b}}}}\right\vert U\rho {U}^{{\dagger} }\left\vert {{{\bf{b}}}}\right\rangle\), and the inverse (classical) postprocessing channel \({{{{\mathcal{M}}}}}^{-1}\) is determined by the chosen \({{{\mathcal{E}}}}\)^{12,28,29,30,31}. For instance, \({{{\mathcal{E}}}}\) can be the global or local Clifford ensemble, denoted as Clifford and Pauli measurements hereafter, respectively. After constructing the shadow set, the unbiased estimator of *P*_{m} can be constructed as

In principle, any nonlinear function can be obtained with only an *n*-qubit quantum processor using sequential RMs. However, the number of measurements needed generally scales exponentially with the qubit number, and the scaling becomes worse for larger *m* values, such as *m*≥3^{12,13}.

## Results

### Hybrid framework for nonlinear functions

By trading off the quantum and classical resources, here we develop a hybrid framework for nonlinear functions. All proofs and more detailed discussions are left in Supplementary Notes 1-4.

For a nonlinear function of degree *m* such as *P*_{m}, where \(m=\sum\nolimits_{i = 1}^{L}{m}_{i}\), we demonstrate that it can be estimated using a quantum processor with only \(N=n(\mathop{\max }_{i}{m}_{i})+1\) qubits. The core idea is to conduct RM on *ρ*^{t}, where *t* = *m*_{i}, by leveraging the coherent operation on *t* copies of *ρ*. Note that as *t* = 2 one needs the 3-qubit Controlled-swap operation also known as quantum Fredkin gate^{32,33}, by observing that the swap operation can be decomposed to qubit-wise ones. Quantum Fredkin gate has been realized, say, in the photonic system^{34}.

Instead of directly reading the control qubit outcome to obtain *P*_{t}, as in the swap test, we perform RM on one of the prepared *t* copies of *ρ*. As the permutation symmetry holds, the RM can be performed on any copy, like the final one shown in Fig. 1c. By measuring the expectation value of the Pauli-*X* operator on the control qubit and performing the projective measurement on the final copy, we obtain

Here the identity operators \({{\mathbb{I}}}_{d}^{\otimes (t-1)}\) are on the first *t* − 1 copies, and the projective measurement \(\left\vert {{{\bf{b}}}}\right\rangle \left\langle {{{\bf{b}}}}\right\vert\) and random unitary *U* is on the final *t*-th copy, as shown in Fig. 2. The result in the last line indicates that one can effectively conduct RM on *ρ*^{t}.

The full measurement procedure is listed in Algorithm 1, which aims to construct the shadow set \({\{{\widehat{{\rho }^{t}}}_{(i)}\}}_{i = 1}^{M}\) of *ρ*^{t} from the RM results collected in Fig. 1c, and these shadow snapshots can be used to estimate more complex nonlinear functions. We show the general form of the hybrid framework in Supplementary Note 2 for the *m*-degree function in Eq. (1). We also remark that other postprocessing strategies on these RM data could also be adopted for some specific functions of the state^{18,19,35}, like state overlap.

### Algorithm 1

**Hybrid shadow estimation**

**Input:** *M* × *K* sequentially prepared *ρ*^{⊗t} and control qubit initially set as \({\left\vert 0\right\rangle }_{c}\).

**Output:** The shadow set \({\{{\widehat{{\rho }^{t}}}_{(i)}\}}_{i = 1}^{M}\).

1: **for** *i* = 1 **to** *M* **do**

2: Randomly choose \(U\in {{{\mathcal{E}}}}\) and record it.

3: **for** *j* = 1 **to** *K* **do**

4: Conduct the quantum circuit shown in Fig. 1c.

5: Measure the control qubit and the final copy of *ρ*^{⊗t} in the computational basis \(\{\left\vert {b}_{c}\right\rangle \}\) and \(\{\left\vert {{{\bf{b}}}}\right\rangle \}\).

6: Construct the unbiased estimator \({\widehat{{\rho }^{t}}}_{(i)}^{(j)}\) using the results \({b}_{c}^{(i,j)}\) and **b**^{(i, j)} by Eq. (6), where *i* and *j* denoting the *j*th measurement under the *i*-th unitary.

7: **end for**

8: Average *K* results under the same unitary to get \({\widehat{{\rho }^{t}}}_{(i)}=\frac{1}{K}{\sum }_{j}{\widehat{{\rho }^{t}}}_{(i)}^{(j)}\).

9: **end for**

10: Get the shadow set \(\left\{{\widehat{{\rho }^{t}}}_{(1)},{\widehat{{\rho }^{t}}}_{(2)},\cdots {\widehat{{\rho }^{t}}}_{(M)}\right\}\), which contains *M* independent estimators of *ρ*^{t}.

### Theorem 1

Suppose one conducts the circuit shown in Fig. 1c for once (*M* = *K* = 1), the unbiased estimator of *ρ*^{t} shows

such that \({{\mathbb{E}}}_{\{U,{b}_{c},{{{\bf{b}}}}\}}\left(\widehat{{\rho }^{t}}\right)={\rho }^{t}\). Here *b*_{c} and **b** are the measurement results of the control qubit and the final copy from *ρ*^{⊗t}, respectively; the inverse classical postprocessing \({{{{\mathcal{M}}}}}^{-1}\) depends on the random unitary ensemble applied.

Furthermore, to evaluate \({o}_{t}={{{\rm{tr}}}}(O{\rho }^{t})\) with *O* being some observable, the variance shows

where \({{{\rm{Var}}}}\left[{{{\rm{tr}}}}(O\widehat{\rho })\right]\) is the variance of measuring *O* on the original single-copy shadow snapshot \(\widehat{\rho }\), which can be upper bounded by the square of shadow norm ∥*O*_{0}∥_{shadow}^{12} for the traceless operator \({O}_{0}=O-{{{\rm{tr}}}}(O){{\mathbb{I}}}_{d}/d\).

Theorem 1 is the central result of this work, which gives the unbiased estimator of *ρ*^{t} and also relates the statistical variance to the previous single-copy one, i.e., *t* = 1^{12}. The proof and related discussions are left in Supplementary Note I. Note that the shadow norm is also related to the chosen random unitary ensemble^{12}. According to Eq. (7), the hybrid shadow can dramatically reduce the variance of estimating nonlinear functions compared with the original shadow protocol. Take the Pauli measurement as an example, for a *k*-local observable *O*, the shadow norm \(\parallel {O}_{0}{\parallel }_{{{{\rm{shadow}}}}}^{2}\le {4}^{k}\parallel O{\parallel }_{\infty }^{2}\)^{12} and thus the variance of evaluating \({{{\rm{tr}}}}(O{\rho }^{t})\) is *independent* of the total qubit number *n* by Eq. ((7)). However, the variance of the original shadow protocol shows an exponential scaling with *n*^{12,13}. This point is also clarified by the numerical result in Fig. 3a. We will discuss this advantage in detail in the application of quantum error mitigation later.

Furthermore, one can repeat the above procedure for all \(\widehat{{\rho }^{{m}_{i}}}\) and patch them together to evaluate more complex functions. For *P*_{m} the unbiased estimator now shows

With the hybrid framework, one can equivalently transform an *m*-degree function in the original shadow protocol in Eq. (4) to a lower *L*-degree one here. This not only reduces the sampling and postprocessing cost, but also makes other postprocessing strategies^{19,35} available for higher-degree functions. In particular, the postprocessing cost is reduced from \({{{\mathcal{O}}}}({M}^{m})\) to \({{{\mathcal{O}}}}({M}^{L})\). We take the moment estimation of *P*_{3} as an example to show these advantages.

Besides the functions like *o*_{m} and *P*_{m} here, we give the hybrid shadow estimation for more general functions of Eq. (1) in Supplementary Note II, by directly extending Theorem 1.

### Application for the moment estimation

In this section, we explicitly show how to construct the unbiased estimator for the moments, by taking the third moment *P*_{3} as an example. We also analyse the statistical variance under finite measurement times here.

We divide *m* = 3 to 2 + 1 to estimate \({P}_{3}={{{\rm{tr}}}}({S}_{2}{\rho }^{2}\otimes \rho )\). For \(\widehat{{\rho }^{2}}\), by following Algorithm 1 (*K* = 1, *t* = 2) one collects the shadow set

one also collects the shadow set of *ρ* using the original shadow estimation,

and then combines two sets to get the estimator of *P*_{3}.

### Proposition 1

By combing the shadow sets \(\{{\widehat{{\rho }^{2}}}_{(i)}\}\) and \(\{{\widehat{\rho }}_{({i}^{{\prime} })}\}\), one gets the unbiased estimator of *P*_{3} as

Suppose one applies the random Pauli measurements, the variance of \(\widehat{{P}_{3}}\) can be upper bounded by

with \(M={M}^{{\prime} }\) for simplicity.

The result of Eq. (12) is almost the same as that of *P*_{2} using the original shadow estimation (Eq. (D16) in Ref. ^{13}). This indicates that the hybrid framework reduces the statistical error from a 3-degree problem to a 2-degree one, with coherent access to a limited (*t* = 2) quantum hardware. We leave the analysis of the estimator and the statistical variance for random Clifford measurements and higher-order moments in Supplementary Note III.

Moreover, one can adopt another postprocessing protocol^{35} with the same measurement data collected in Algorithm 1, and the estimator \({\widehat{{P}_{3}}}^{{\prime} }\) is given in Proposition 2. This protocol with Pauli measurements mainly works for 2-degree functions and is proved infeasible for higher-degree ones^{14}. With the hybrid framework here, one can make it feasible for the 3-degree function *P*_{3} and also reproduce the same variance scaling of *P*_{2} in the original protocol^{16,35}, indicating the advantage again.

### Proposition 2

Using the RM results, \(\{{\widehat{{b}_{c}}}^{(i,j)},{\widehat{{{{\bf{b}}}}}}^{(i,j)}\}\), collected in Algorithm 1 for *t* = 2, one can construct an alternative unbiased estimator of *P*_{3} as

Here the choice of the postprocessing function, \({X}_{c}({{{\bf{b}}}},{{{{\bf{b}}}}}^{{\prime} })=-{(-d)}^{{\delta }_{{{{\bf{b}}}},{{{{\bf{b}}}}}^{{\prime} }}}\) or \({X}_{p}({{{\bf{b}}}},{{{{\bf{b}}}}}^{{\prime} })=\mathop{\prod }\nolimits_{k = 1}^{n}-{(-2)}^{{\delta }_{{b}_{k},{{b}_{k}}^{{\prime} }}}\), depends on the RM primitives, random Clifford or Pauli measurements.

For Pauli measurements, the variance is about

To complement the above analytical results, in Fig. 3c, we numerically study the scaling of the statistical errors for estimating *P*_{3}, using the estimators \(\widehat{{P}_{3}}\) in Eq. (11) and \({\widehat{{P}_{3}}}^{{\prime} }\) in Eq. (13), and also the one from the original shadow protocol^{13}, in the regime *d* ≫ *M*(*K*). They are denoted for short as Hybrid Shadow (HS), Hybrid Random (HR) and Original Shadow (OS), respectively. The numerical results, which correspond to the standard variance, are consistent with the analytical ones, and we summarize them together in Table 1.

The numerical errors correspond to the standard variance, and are consistent with the theoretical predictions. As shown in Fig. 3a for the noisy GHZ state, *α* = 1.05 < 1.5 for HS as predicted by Eq. (12); *α* = 0.75 is quite close \(({\log }_{2}3)/2=0.80\) in Eq. (14) for HR; *α* = 1.91 < 3 for OS^{13}.

Consequently, in practise one needs \(M={{{\mathcal{O}}}}({d}^{1.27})\) for OS, \(M={{{\mathcal{O}}}}({d}^{1.05})\) for HS, and \(K={{{\mathcal{O}}}}({d}^{0.73})\) for HR to make the error less than some constant. It is clear that HS and HR from the hybrid framework both show an advantage compared to OS, and HR is the most efficient one for *P*_{3}. In Fig. 3d, we further find the total number of measurements is about *M**K* = 200*d*^{0.75} to make Error(*P*_{3})≤0.1, showing great enhancement than OS protocol^{13,20}. And the advantage of the hybrid framework is more significant for measuring higher-order moments like *P*_{4}, and we leave more discussions in Supplementary Note III and IV.

### Application in quantum error mitigation

Recently purified-based methods are proposed^{36,37} for quantum error mitigation^{38,39,40,41} by virtually purifying multiple copies of the prepared states. Suppose the perfect target state is Ψ and the noisy prepared state is *ρ*. The central task there is to estimate \({o}_{m}:= {{{\rm{tr}}}}(O{\rho }^{m})\), and use the normalized value \({o}_{m}/{P}_{m}\to {{{\rm{tr}}}}(O\Psi )\) to approach the target value \({{{\rm{tr}}}}(O\Psi )\) with Ψ the noiseless state, which can suppress the error exponentially with the copy-number *m*. The original protocol is based on the swap test to measure *o*_{m}, and very recently there have been ones by shadow estimation^{42,43}. There is also an experimental advance for that of *m* = 2^{44}, however, similarly it is still challenging to extend both approaches to *m*≥3. Here we show that the hybrid framework gives various advantages on estimating *o*_{m}.

Suppose one has access to the coherent operation on *m*-copy quantum states. By only adopting the classical postprocessing, the shadow set collected in Algorithm 1 for *t* = *m* can be reused for many different observables {*O*_{i}}, say totally *T* ones, and the estimation error scales like \({{{\mathcal{O}}}}(\log (T))\) using the median-of-mean technique^{12}. However, in principle the swap test approach should adopt different quantum circuits for different observables^{37}, and also the error would scale linearly \({{{\mathcal{O}}}}(T)\). This advantage is significant for quantum chemistry simulation with the polynomial number of terms in Hamiltonian^{44,45,46}.On the other hand, compared to OS protocol^{42}, HS significantly reduces the statistical variance and thus the sampling cost. For instance, suppose one applies Pauli measurements with OS protocol to estimate *o*_{m} for a local observable *O*. Since \({o}_{m}={{{\rm{tr}}}}({O}_{m}{\rho }^{\otimes m})\) and \({O}_{m}:= \frac{1}{2}(O{S}_{m}+{S}_{m}^{{\dagger} }O)\) the symmetrized observable is actually a global one with locality about *m**n*^{12,13}, and thus the shadow norm scales exponentially with *n*. While in HS protocol, the variance is independent of the qubit number *n* by Eq. (7). See Fig. 3a for this exponential advantage as *t* = 2, and similar advantage also appears in the fidelity estimation using the Clifford measurements as shown in Fig. 3b, with more discussions left in Supplementary Note IV.

In reality, one generally can not implement Algorithm 1 directly for *t* = *m* when *m* ≥ 3 due to the hardware limitation. Like the moment estimation, one can alternatively patch low-degree snapshots to measure higher-degree *o*_{m}. For instance, when *m* = 3 and *t* = 2, similar as Eq. (11), one can construct the estimator \(\widehat{{o}_{3}}={(M{M}^{{\prime} })}^{-1}{\sum }_{i,{i}^{{\prime} }}{{{\rm{tr}}}}({O}_{2}{\widehat{{\rho }^{2}}}_{(i)}\otimes {\widehat{\rho }}_{({i}^{{\prime} })})\), and the error also scales logarithmically with the total number of observebles. In addition, one can construct an alternative estimator \({\widehat{{o}_{3}}}^{{\prime} }\) by the following Eq. (13). Similar as in the moment-estimation of *P*_{3}, both estimators show statistical error advantages compared to the original shadow. The details of the unbiased estimator for general observable *O* and numerical results are left in Supplementary Note IV.

## Discussion

The hybrid framework proposed here utilizes the partial coherent power of quantum devices and can act as a subroutine for many quantum information tasks, for instance, measuring entanglement^{47,48,49,50}, characterizing quantum chaos^{51,52}, and constructing quantum algorithms^{53,54,55}. Note that the framework reduces to previous RM protocols as *t* = 1 in Algorithm 1, and the advantage essentially comes from the coherent processing the few-copy state. So it is intriguing to build the ultimate result of this replica advantage^{8,56} considering the limited quantum memory. Moreover, it is also appealing to extend the current framework to quantum channel^{57,58,59,60} and boson or fermion systems^{61,62}.

## Data availability

Data sharing is not applicable to this article as no data sets were generated or analyzed during the current study.

## Code availability

The code used in this study is available from the corresponding authors on reasonable request.

## References

Ekert, A. K. et al. Direct estimations of linear and nonlinear functionals of a quantum state.

*Phys. Rev. Lett.***88**, 217901 (2002).Horodecki, P. & Ekert, A. Method for direct detection of quantum entanglement.

*Phys. Rev. Lett.***89**, 127902 (2002).Bruni, T. A. Measurimg polynomial functions of states.

*Quantum Info. Comput.***4**, 401–408 (2004).Garcia-Escartin, J. C. & Chamorro-Posada, P. swap test and Hong-Ou-Mandel effect are equivalent.

*Phys. Rev. A***87**, 052330 (2013).Rajibul, I. et al. Measuring entanglement entropy in a quantum many-body system.

*Nature***528**, 77 (2015).Kaufman, A. M. et al. Quantum thermalization through entanglement in an isolated many-body system.

*Science***353**, 794 (2016).Coltler, J. et al. Quantum virtual cooling.

*Phys. Rev. X***9**, 031013 (2019).Huang, H.-Y. et al. Quantum advantage in learning from experiments.

*Science***376**, 1182 (2022).Preskill, J. Quantum computing in the NISQ era and beyond.

*Quantum***2**, 79 (2018).Elben, A. et al. The randomized measurement toolbox.

*Nat. Rev. Phys.***5**, 9 (2023).Aaronson, S. Shadow tomography of quantum states.

*SIAM J. Comput.***49**, STOC18 (2019).Huang, H.-Y., Kueng, R. & Preskill, J. Predicting many properties of a quantum system from very few measurements.

*Nat. Phys.***16**, 1050 (2020).Elben, A. et al. Mixed-state entanglement from local randomized measurements.

*Phys. Rev. Lett.***125**, 200501 (2020).Zhou, Y., Zeng, P. & Liu, Z. Single-copies estimation of entanglement negativity.

*Phys. Rev. Lett.***125**, 200502 (2020).Elben, A. et al. Cross-platform verification of intermediate scale quantum devices.

*Phys. Rev. Lett.***124**, 010504 (2020).Liu, Z., Zeng, P., Zhou, Y. & Gu, M. Characterizing correlation within multipartite quantum systems via local randomized measurements.

*Phys. Rev. A***105**, 022407 (2022).Guerini, L., Wiersema, R., Carrasquilla, J. F. & Aolita, L. Quasiprobabilistic state-overlap estimator for nisq devices, preprint at https://arxiv.org/abs/2112.11618 (2021).

van Enk, S. J. & Beenakker, C. W. J. Measuring \({{{\rm{Tr}}}}{\rho }^{n}\) on single copies of

*ρ*using random measurements.*Phys. Rev. Lett.***108**, 110503 (2012).Brydges, T. et al. Probing rényi entanglement entropy via randomized measurements.

*Science***364**, 260 (2019).Rath, A., Branciard, C., Minguzzi, A. & Vermersch, B. Quantum fisher information from randomized measurements.

*Phys. Rev. Lett.***127**, 260501 (2021).Vermersch, B., Elben, A., Sieberer, L. M., Yao, N. Y. & Zoller, P. Probing scrambling using statistical correlations between randomized measurements.

*Phys. Rev. X***9**, 021061 (2019).Garcia, R. J., Zhou, Y. & Jaffe, A. Quantum scrambling with classical shadows.

*Phys. Rev. Res.***3**, 033155 (2021).Elben, A. et al. Many-body topological invariants from randomized measurements in synthetic quantum matter.

*Sci. Adv.***6**, eaaz3666 (2020).Cian, Z.-P. et al. Many-body chern number from statistical correlations of randomized measurements.

*Phys. Rev. Lett.***126**, 050501 (2021).Struchalin, G., Zagorovskii, Y. A., Kovlakov, E., Straupe, S. & Kulik, S. Experimental estimation of quantum state properties from classical shadows.

*PRX Quantum***2**, 010307 (2021).Zhang, T. et al. Experimental quantum state measurement with classical shadows.

*Phys. Rev. Lett.***127**, 200501 (2021).Yu, M. et al. Experimental estimation of the quantum fisher information from randomized measurements.

*Phys. Rev. Res.***3**, 043122 (2021).Hu, H.-Y. & You, Y.-Z. Hamiltonian-driven shadow tomography of quantum states.

*Phys. Rev. Res.***4**, 013054 (2022).Hu, H.-Y., Choi, S. & You, Y.-Z. Classical shadow tomography with locally scrambled quantum dynamics.

*Phys. Rev. Res.***5**, 023027 (2023).Ohliger, M., Nesme, V. & Eisert, J. Efficient and feasible state tomography of quantum many-body systems.

*New J. Phys.***15**, 015024 (2013).Bu, K., Koh, D. E., Garcia, R. J. & Jaffe, A. Classical shadows with pauli-invariant unitary ensembles.

*npj Quantum Inf.***10**, 6 (2024).Fredkin, E. & Toffoli, T. Conservative logic.

*Int. J. Theor. Phys.***21**, 219 (1982).Smolin, J. A. & DiVincenzo, D. P. Five two-bit quantum gates are sufficient to implement the quantum Fredkin gate.

*Phys. Rev. A***53**, 2855 (1996).Patel, R. B., Ho, J., Ferreyrol, F., Ralph, T. C. & Pryde, G. J. A quantum fredkin gate.

*Sci. Adv.***2**, e1501531 (2016).Elben, A., Vermersch, B., Roos, C. F. & Zoller, P. Statistical correlations between locally randomized measurements: a toolbox for probing entanglement in many-body quantum states.

*Phys. Rev. A***99**, 052323 (2019).Huggins, W. J. et al. Virtual distillation for quantum error mitigation.

*Phys. Rev. X***11**, 041036 (2021).Koczor, B. Exponential error suppression for near-term quantum devices.

*Phys. Rev. X***11**, 031057 (2021).Temme, K., Bravyi, S. & Gambetta, J. M. Error mitigation for short-depth quantum circuits.

*Phys. Rev. Lett.***119**, 180509 (2017).Endo, S., Benjamin, S. C. & Li, Y. Practical quantum error mitigation for near-future applications.

*Phys. Rev. X***8**, 031027 (2018).Kandala, A. et al. Error mitigation extends the computational reach of a noisy quantum processor.

*Nature***567**, 491 (2019).Endo, S., Cai, Z., Benjamin, S. C. & Yuan, X. Hybrid quantum-classical algorithms and quantum error mitigation.

*J. Phys. Soc. Jpn.***90**, 032001 (2021).Seif, A., Cian, Z.-P., Zhou, S., Chen, S. & Jiang, L. Shadow distillation: Quantum error mitigation with classical shadows for near-term quantum processors.

*PRX Quantum***4**, 010303 (2023).Hu, H.-Y., LaRose, R., You, Y.-Z., Rieffel, E. & Wang, Z. Logical shadow tomography: Efficient estimation of error-mitigated observables, Preprint at https://arxiv.org/abs/2203.07263 (2022).

O’Brien, T. E. et al. Purification-based quantum error mitigation of pair-correlated electron simulations.

*Nat. Phys.***19**, 1787 (2023).McArdle, S., Endo, S., Aspuru-Guzik, A., Benjamin, S. C. & Yuan, X. Quantum computational chemistry.

*Rev. Mod. Phys.***92**, 015003 (2020).Arute, F. et al. Hartree-fock on a superconducting qubit quantum computer.

*Science***369**, 1084 (2020).Ketterer, A., Wyderka, N. & Gühne, O. Characterizing multipartite entanglement with moments of random correlations.

*Phys. Rev. Lett.***122**, 120505 (2019).Neven, A. et al. Symmetry-resolved entanglement detection using partial transpose moments.

*npj Quantum Info.***7**, 1 (2021).Yu, X.-D., Imai, S. & Gühne, O. Optimal entanglement certification from moments of the partial transpose.

*Phys. Rev. Lett.***127**, 060504 (2021).Liu, Z. et al. Detecting entanglement in quantum many-body systems via permutation moments.

*Phys. Rev. Lett.***129**, 260501 (2022).Joshi, L. K. et al. Probing many-body quantum chaos with quantum simulators.

*Phys. Rev. X***12**, 011018 (2022).McGinley, M., Leontica, S., Garratt, S. J., Jovanovic, J. & Simon, S. H. Quantifying information scrambling via classical shadow tomography on programmable quantum simulators.

*Phys. Rev. A***106**, 012441 (2022).Yuan, X., Sun, J., Liu, J., Zhao, Q. & Zhou, Y. Quantum simulation with hybrid tensor networks.

*Phys. Rev. Lett.***127**, 040501 (2021).Lubasch, M., Joo, J., Moinier, P., Kiffner, M. & Jaksch, D. Variational quantum algorithms for nonlinear problems.

*Phys. Rev. A***101**, 010301 (2020).Yamamoto, K., Endo, S., Hakoshima, H., Matsuzaki, Y. & Tokunaga, Y. Error-mitigated quantum metrology via virtual purification.

*Phys. Rev. Lett.***129**, 250503 (2022).Chen, S., Cotler, J., Huang, H.-Y. & Li, J. Exponential separations between learning with and without quantum memory. In: 2

*021 62nd Annu. IEEE Symp. Found. Comput. Sci. FOCS)*574–585 (IEEE, 2022). https://ieeexplore.ieee.org/abstract/document/9719827/.Chen, S., Yu, W., Zeng, P. & Flammia, S. T. Robust shadow estimation.

*PRX Quantum***2**, 030348 (2021).Helsen, J. et al. Shadow estimation of gate-set properties from random sequences.

*Nat. Commun.***14**, 5039 (2023).Kunjummen, J., Tran, M. C., Carney, D. & Taylor, J. M. Shadow process tomography of quantum channels.

*Phys. Rev. A***107**, 042403 (2023).Levy, R., Luo, D. & Clark, B. K. Classical shadows for quantum process tomography on near-term quantum computers.

*Phys. Rev. Res.***6**, 013029 (2024).Elben, A., Vermersch, B., Dalmonte, M., Cirac, J. I. & Zoller, P. Rényi entropies from random quenches in atomic hubbard and spin models.

*Phys. Rev. Lett.***120**, 050406 (2018).Zhao, A., Rubin, N. C. & Miyake, A. Fermionic partial tomography via classical shadows.

*Phys. Rev. Lett.***127**, 110504 (2021).

## Acknowledgements

Y.Z. is supported by the National Natural Science Foundation of China(NSFC) Grant No.12205048, the start-up funding of Fudan University, Innovation Program for Quantum Science and Technology 2021ZD0302000, and the CPS-Huawei MindSpore Fellowship. Z.L. acknowledges support from the National Natural Science Foundation of China Grant No. 12174216 and the Innovation Program for Quantum Science and Technology Grant No. 2021ZD0300804.

## Author information

### Authors and Affiliations

### Contributions

Y.Z. initialized project and developed the theory with Z.L., and Z.L. completed the numerical simulation. Both authors contributed to polishing the results and writing the paper.

### Corresponding authors

## Ethics declarations

### Competing interests

The authors declare no competing interests.

## Additional information

**Publisher’s note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Supplementary information

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Zhou, Y., Liu, Z. A hybrid framework for estimating nonlinear functions of quantum states.
*npj Quantum Inf* **10**, 62 (2024). https://doi.org/10.1038/s41534-024-00846-5

Received:

Accepted:

Published:

DOI: https://doi.org/10.1038/s41534-024-00846-5