Abstract
Quantum metrology plays a fundamental role in many scientific areas. However, the complexity of engineering entangled probes and the external noise raise technological barriers for realizing the expected precision of the tobeestimated parameter with given resources. Here, we address this problem by introducing adjustable controls into the encoding process and then utilizing a hybrid quantumclassical approach to automatically optimize the controls online. Our scheme does not require any complex or intractable offline design, and it can inherently correct certain unitary errors during the learning procedure. We also report the first experimental demonstration of this promising scheme for the task of finding optimal probes for frequency estimation on a nuclear magnetic resonance (NMR) processor. The proposed scheme paves the way to experimentally autosearch optimal protocol for improving the metrology precision.
Introduction
Measuring physical parameters of interest with highest precision remains the everlasting pursuit in science and technology^{1}. The general measurement procedure reads: prepare a probe, interact it with the system, and measure the probe. During this process, errors will result in a statistical uncertainty on the interested parameter \(\phi \). These errors mainly come from intrinsic fluctuations, insufficient controls and external perturbations^{2,3,4}. The central limit theorem tells us that repeated applications of this process N times can improve the estimation precision, inducing a bound of \(\Delta \phi \sim 1/\sqrt{N}\), which is called Standard Quantum Limit. Quantum metrology^{1,5,6,7} exploits available quantum resources to beat this limit and can approach a scaling called Heisenberg Limit, namely \(\Delta \phi \sim 1/N\). However, in practical applications, realizing the expected precision under many cases, including inevitable external noise^{8,9,10}, complex probe states^{11,12,13,14,15,16} and complicated encoding dynamics^{17,18,19,20}, are often very challenging.
Fortunately, additional controls were found to be useful and necessary for quantum metrology to address these issues^{21}. Dynamical decoupling methods^{22,23,24} and quantum error corrections^{25,26} were used specifically to defend against certain external noise for maintaining the precision. For extended types of encoding dynamics, including timedependent^{21}, noncommuting^{27}, or general form^{28}, carefully designed controls were applied to alter the dynamics and enhance the estimation precision. The above mentioned control methods are for specific purposes and are often very complex to design. Recently, Yuan and Liu^{29} proposed a systematic controlled sequential scheme to search the required controls in noisy system for enhancing the quantum metrology abilities. It is based on an optimal control algorithm called Gradient Ascent Pulse Engineering (GRAPE), where the added controls could be iteratively refreshed until the performance function (e.g., quantum Fisher information^{1,7}) reaches the optimum. This algorithm is very efficient and easilyimplemented for smallscale systems. However, in actual applications, it often happens that an exact model of the noise is lacking so that it is difficult to evaluate the gradient of the performance function to a good precision, even for the singlequbit case. These problems are further harmed by the exponentially increased complexity of the system dynamics.
To tackle these issues, we utilize a hybrid quantumclassical approach^{30,31} assisted GRAPE (hqcGRAPE for short) to practically learn the optimal controls experimentally. Under a completely different motivation, the previous works concern how to speedup quantum optimal control problems, while here we seek for its extension to quantum metrology area. Hybrid quantumclassical (HQC) algorithms, which combine the presentday accessible quantum resources with sophisticated classical computation routines, have witnessed tremendous successful applications, ranging from simulating quantum chemistry^{32,33,34,35} to solving optimization problems^{30,31,36,37}. By applying this approach, we do not require any priorknowledge of how the optimal controls are related to the encoding dynamics, as they are automatically learned in the experiments without any design. These searched controls and the encoding dynamics are then coupled together to deliver an optimal metrology procedure. The computationally resourceconsuming and experimentally intractable parts of the GRAPE algorithm, namely the gradient of the performance function, are efficiently and conveniently measured by applying some singlequbit rotations to the system. Furthermore, as this HQC approach is combined with GRAPE to deliver a closedloop learning^{38} procedure, it has inherent features of defending against certain kinds of unitary noise for improving the metrology precision.
We also presented a demonstrative experiment of finding optimal probes for estimating the frequency by hqcGRAPE on a twoqubit NMR processor. The experimental results verify the success of hqcGRAPE in learning optimal controls for improving the metrology precision. The outline of this study is described as follows. Firstly, we introduce the details of hqcGRAPE for quantum metrology in “Framework” section. The experimental procedure is presented in “Experiment” section. Finally, we provide some conclusions and discussions in “Discussion” section.
Results
Framework
Consider a typical quantum metrology task of estimating an interested parameter \(\Omega \) which is encoded in a general form of Hamiltonian \({\mathcal {H}}_0(\Omega )\) (with couplings between system qubits). Conventional quantum metrology schemes then proceed to design optimal probe state and the corresponding optimal measurements to gain the best metrology precision. In particular, the metrology can be thought of as two distinct tasks: (1) Find a classical procedure that enables us to engineer the probe state whose quantum Fisher information is sufficiently optimal. (2) Application of the encoding process to an optimal probe (synthesized using the above procedure), then estimate the interested parameter with suitable measurements. Here, we mainly focus on the first task. In practice, inevitable noise and the complexity of synthesizing the probes will prevent us from realizing the best precision. As stated in the introduction part, additional controls can be applied to address these problems and improve the precision that can be reached.
Here, we implement adjustable controls to alter the encoding dynamics, thus the total Hamiltonian can be expressed as
where \(u_k(t) (t\in (0,T))\) represents the amplitude of the kth control field. Note that \({\mathcal {H}}_0(\Omega )\) contains the interactions between qubits, thus the above total Hamiltonian captures a general form for the metrology application. Without loss of generality, we assume the kth control Hamiltonian can be formulated as \({\mathcal {H}}_k=\sigma _{\alpha }^k\) with \(\sigma _{\alpha }^k~(\alpha =x,y,z)\) being the Pauli matrix, i.e., the controls are at most three directions for each qubit, which is a standard form in many quantum systems^{39,40,41}. To optimize these controls by hqcGRAPE, we divide the total evolution time T into M equal segments, and the controls in each segment of duration \(\Delta t=T/M\) are approximately treated as constants. Thus, in the mth segment, the sliced evolution operator can be depicted by
this will lead to the total evolution operator \(\varepsilon _{\Omega }(T)=\prod _{m=1}^M \varepsilon _{\Omega }^m\).
The metrology process using hqcGRAPE begins with some easily prepared pure probe state \(\rho _0\), which does not need to be optimal. This avoids the complex design and synthesis of the optimal probes, thus greatly easing the analytical efforts. The probe \(\rho _0\) is then engineered by the system evolution with some trial control fields \(\mathbf {{u}}=(u_k[m]),k=1,2,...,K;m=1,2,...,M\), leading to the final system state \(\rho _{\Omega }(T) =\varepsilon _{\Omega }(T) \rho _0 \varepsilon _{\Omega }(T)^{\dag }\). Performing the corresponding optimal measurements will induce the best metrology precision that can be reached in this situation. Here, to quantify the performance of estimating the interested parameter x, we can use the quantum Fisher information (\(F_Q\) for short) as a performance function^{42,43}, namely
In order to achieve the possibly best precision with the given resources, we need to iteratively refresh the control fields to maximize the performance function \(F_Q\). In hqcGRAPE, the control fields are updated by moving towards the gradient direction of the performance function with some appropriate distance. The explicit form of the gradient of \(F_Q\), i.e., \(\nabla F_Q=\mathbf {g} =(g_k[m])\) with \(g_k[m]={\partial F_Q}/{\partial {u_k[m]}}\), can be easily calculated as follows
For brevity, we denote \(U_{m_1}^{m_2}=\varepsilon _{\Omega }^{m_2} \cdots \varepsilon _{\Omega }^{m_1+1} \varepsilon _{\Omega }^{m_1}\), then we get \({\partial \rho _{\Omega }(T)}/{\partial {u_k[m]}}=i \Delta t U_{m+1}^M [\sigma _{\alpha }^k,U_1^m \rho _0 {U_1^{m}}\dag ] {U_{m+1}^{M}}^{\dag }\). The key idea of hqcGRAPE is that we can compute this commutator by some local rotations^{30}. It is achieved by using the relation which holds for any operator \(\rho \)
where \(R_{\alpha }^k(\pm \pi /2)\) represents the \(\pm \pi /2\) rotations along \(\alpha \) axis. Thus, we can get
In this way, by inserting local rotations, we can obtain the mth gradient information similarly as presented in Eq. 3, i.e., directly measuring the \(F_Q\) of the final system state involving the inserted local rotations. Note that this transformation does not depend on how we measure the \(F_Q\). Thus, 2KM operations are needed to compute the gradient \(\mathbf {g}\) in each iteration.
Overall, one needs \(2KM+1\) measurements of the performance function in each iteration. In general, K scales polynomially with the increasing of qubits, as the control Hamiltonians \({\mathcal {H}}_k\) are single Pauli matrixes along at most three directions for each qubit. Typically, M increases polynomially with the growing of system size. Indeed, for most randomly selected Hamiltonian \({\mathcal {H}}\), the minimal number of the controls required to synthesize it will scale exponentially. However, nearterm quantum metrology applications are likely concerned with what can be done with a polynomial number of gate operations. This corresponds to optimizing over the best possible probes that can be synthesized with a polynomial number of control slices – which is precisely the problem our protocol is ideally suited for. Thus, for the practicality of our protocol, the key issue becomes how to efficiently measure the performance function, i.e., \(F_Q\). Fortunately, there have emerged several scalable methods to estimate \(F_Q\) in experiment, where they have replaced \(F_Q\) with some easily accessible quantities, such as (1) purity loss^{44,45}. \(F_Q\) is bounded by purity loss, which captures how fragile the purity of the resultant state with respect to stochastic noise on the encoding parameter and can be obtained by simulating a finite stochastic noise regardless of the system size. (2) multiplequantum coherence (MQC)^{46}. By appending reversion of the system dynamics, MQC can be efficiently accessed and used to calculate \(F_Q\) in an experiment. This procedure takes finite runs of experiments for Fourier transformation of the measured signal, thus does not need exponential resource. (3) Loschmidt echo^{47}. This method is similar as method (2) but needs added controlled operations and an ancillary qubit. However, it carries a great advantage of readout from a single ancillary qubit. In real experiment, it is advisable to choose the suitable method in consideration of the experimental resource needed.
We proceed by briefly summarizing the algorithmic procedure of hqcGRAPE (see schematic diagram in Fig. 1) for solving this metrology task:
Step 1: Randomly generate initial control field \(\mathbf {u}^0\), then apply it to some easily prepared probe state \(\rho _0\). The system state will evolve under this control together with the encoding dynamics governed by \({\mathcal {H}}_0\). Measure the performance function \(F_Q^0(\mathbf {u}^0)\) and the corresponding gradient \(\mathbf {g}^0=\nabla F_Q^0(\mathbf {u}^0)=(g_k^0[m]),k =1,2,...,K; m=1,2,...,M\).
Step 2: Set the iteration number as \(l=l+1\), calculate the updated controls by \(\mathbf {u}^{l+1}=\mathbf {u}^{l} +\lambda ^l \mathbf {g}^l\),where \(\lambda ^l\) is some appropriate stepsize along the gradient direction and \(\mathbf {g}^l=\nabla F_Q^l(\mathbf {u}^l)=(g_k^l[m])\). Measure the performance function \(F_Q^{l+1}\) and the gradient \(\mathbf {g}^{l+1}\) again.
Step 3: Check whether the measured performance function satisfies the stopping criterion, if not, go to Step 2.
In this closedloop learning procedure, the resourceconsuming parts, i.e., the computing of \(F_Q\) and its gradient \(\nabla F_Q\), are efficiently accomplished by the quantum system. The classical computer is used to determine the suitable stepsize for updating controls fields, to generate the pulses for singlequbit rotations, and to store the data in each iteration. The resources needed for the classical computer are then very moderate, even for very large quantum systems. Therefore, the cooperated scheme of quantum sensor and classical computer is very applicable for the nearterm quantum metrology tasks with accessible resources.
Experiment
Setup and techniques
The proofofprinciple experiments were conducted using the \(^{13}\text {C}\)labeled sample Chloroform on a Bruker Avance III 400 MHz spectrometer at room temperature. We mark the spins \(^{13}\text {C}\), \(^{1}\text {H}\) as 1 and 2, respectively. The internal Hamiltonian can be described as \({{\mathcal {H}}_{{\mathrm{int}} }} = \sum _{i = 1}^2 {\Omega ^i \sigma _z^i}/2 + \pi J\sigma _z^1 \sigma _z^2/2\), where \(\Omega ^i\) represents the offset of the ith spin in the rotating frame and \(J=214.5~\)Hz is the scalar coupling strength between the two spins.
For brevity, we set \(\Omega ^1=\Omega ^2=\Omega \) and consider estimating the single parameter \(\Omega \) encoded in the following Hamiltonian \({\mathcal {H}}_0 (\Omega )=\Omega (\sigma _z^1 +\sigma _z^2)/2 + \pi J\sigma _z^1 \sigma _z^2/2\). Additional control fields are introduced along x and y directions of each spin, thus leading to \({\mathcal {H}}={\mathcal {H}}_0(\Omega ) +\sum ^{2}_{k=1}\left( u_{k,x}[m]\sigma _x^k+u_{k,y}[m] \sigma _y^k\right) \). For an encoding time T, the tobeoptimized control fields are sliced into M segments with \(\mathbf {u}=(u_{k,x}[m],u_{k,y}[m])\), where \(k=1,2;m=1,2,...,M\). In this simple case, we do not need to seek for advanced methods as mentioned above to estimate \(F_Q\). Specifically, the quantum Fisher information of the resultant state \(\rho _{\Omega }(T)\) corresponding to the controls \(\mathbf {u}\) can be explicitly written as \(F_Q(\mathbf {u})=T^2 \{\text {Tr}[\rho _{\Omega }(T)(\sigma _z^1 +\sigma _z^2)^2]  \text {Tr}[\rho _{\Omega }(T)(\sigma _z^1 +\sigma _z^2)]^2 \} \). Note that the trace operations only concern the diagonal elements, and the Pauli matrix \(\sigma _z^k\) is diagonal, thus only the diagonal elements of \(\rho _{\Omega }(T)\) matter. Direct derivation indicates that only two diagonal elements of \(\rho _{\Omega }(T)\) are needed to compute \(F_Q(\mathbf {u})\), which greatly reduces the experimental cost. Similarly, the gradient of \(F_Q(\mathbf {u})\) reduces to \(g_{k,\alpha }[m]=T^2 \{\text {Tr}[\rho ' (T)(\sigma _z^1+\sigma _z^2)^2] 2\text {Tr}[\rho '(T)(\sigma _z^1 +\sigma _z^2)] \text {Tr}[\rho _{\Omega }(T)(\sigma _z^1+\sigma _z^2)]\}\) with \(\rho '(T)={\partial \rho _{\Omega }(T)}/{\partial {u_{k, \alpha }[m]}}\) and \(\alpha =x,y\), where \(\rho '(T)\) is obtained by applying local rotations on the kth spin during the mth sliced controls.
Experimental procedures and results
The detailed experimental procedure of hqcGRAPE can be divided into the following five steps:

(i)
Preparation of initial state \(\rho _0\). We initialized the system at pseudopure (PPS) state by lineselective method^{48}, i.e., \({\rho _{\mathrm{pps}}} =\frac{{1  \varepsilon }}{{4}}{\mathbf {I}_{4}} + \varepsilon 00\rangle \langle 00\), where \(\mathbf {I}_{4}\) represents the \(4 \times 4\) identity matrix and \(\varepsilon \approx {10^{  5}}\) is the thermal polarization of the twoqubit system. Notice that the identity matrix doesn’t produce observable effects, thus the initial PPS state effectively behaves like \(\rho _0^{th}=00\rangle \langle 00\). Full tomography^{49} verified that the prepared initial state \(\rho _0\) has a fidelity of 0.9986 compared with \(\rho _0^{th}\) by defining \(F(\rho _0^{th},\rho _0)=\text {Tr} (\rho _0^{th}\rho _0)/\sqrt{\text {Tr}[(\rho _0^{th})^2] \text {Tr}[(\rho _0)^2]}\).

(ii)
Generation of initial controls \(\mathbf {u^{0}}\). The initial control fields \(\mathbf {u}^0=(u_{k,x}^0[m],u_{k,y}^0[m])\) with \(k=1,2; m=1,2,...,M\) were randomly generated on classical computer and applied to the quantum simulator. During the optimization procedure, we set \(\Omega =2\pi \times 50~\)Hz, \(M=6\) and the encoding time \(T=9~\)ms.

(iii)
Measurement of \(F_Q^l(\mathbf {u}^l)\) and \(\mathbf {g}^l\). In the lth iteration, we first measured the performance of the resultant state \(\rho _{\Omega }(T)\) corresponding to \(\mathbf {u}^l\), namely \(F_Q^l(\mathbf {u}^l)\). As stated above, only two diagonal elements of \(\rho _{\Omega }(T)\) are needed to compute its quantum Fisher information. In our NMR simulator, this was accomplished by applying two local \(\pi /2\) rotations along y axis on spin 1 and 2, respectively, and observing the corresponding spectra^{49}. To obtain \(\mathbf {g}^l=(g_{k,x}^l[m],g_{k,y}^l[m])\), after the mth sliced evolution operator, we inserted two groups of local rotations \(R_x^k(\pm \pi /2)\) and \(R_y^k(\pm \pi /2)\) sequentially and measured the resultant state \(\rho '(T)={\partial \rho _{\Omega }(T)}/{\partial {u_{k,\alpha }[m]}}, \alpha =x,y\) according to Eq. 4 and Eq. 6. Similarly, only diagonal elements of \(\rho '(T)\) are necessary to compute \(\mathbf {g}^l\).

(iv)
Generation of new controls \(\mathbf {u}^{l+1}\). The measured \(F_Q^l(\mathbf {u}^l)\) and \(\mathbf {g}^l\) were then fed back to the classical computer. A suitable stepsize \(\lambda ^l\) was decided to generate new controls by \(\mathbf {u}^{l+1}=\mathbf {u}^{l} +\lambda ^l \mathbf {g}^l\). Here, \(\lambda ^l\) was initially set as 5000 and gradually decreased by \(50\%\) if \(F_Q^l(\mathbf {u}^{l+1})\) was worse than \(F_Q^l(\mathbf {u}^{l})\).

(v)
Loop of the optimization procedure. The iteration number was set as \(l=l+1\) and the refreshed controls \(\mathbf {u}^{l+1}\) were applied to the NMR simulator again. We then jumped to step (iii) to loop the rest steps. This iterative procedure was stopped until the settled maximum iteration number 10 was hit.
Furthermore, in order to demonstrate the advantages of hqcGRAPE in searching optimal protocol for quantum metrology in realistic experiments, we compared it with the conventional openloop designs entirely running on classical computer, which we marked as GRAPE. This pure classical simulation iteratively calculates \(F_Q^l(\mathbf {u}^l)\) and \(\mathbf {g}^l\) according to the ideal Hamiltonian, which does not include the effects of the inevitable noises in real situation, thus deserves the above mentioned closedloop optimization. We also directly applied the classically searched controls by GRAPE to the NMR quantum simulator to measure the corresponding \(F_Q\) in each iteration, which was denoted as GRAPEexp. Specifically, we first prepare the system at its initial state \(\rho _0\) as described in the step (i). Next for each iteration l, we directly import the corresponding optimal controls searched by the openloop GRAPE into the quantum simulator. Finally we measure its performance function as introduced in the step (iii).
The experimental results are shown in Fig. 2. Green dashed line in Fig. 2a shows the optimization process entirely running on classical computer by the GRAPE method. The searched optimal controls induce a final \(F_Q\) of 4.00, which saturates the theoretical bound^{7}. Blue dashdotted line demonstrates the measured \(F_Q\) through directly applying the controls searched by the openloop GRAPE to the NMR simulator. The final optimal controls are tested 5 times to estimate the statistical error resulting in \(F_Q=3.8798 \pm 0.0006\) for GRAPEexp. The deviation from the theoretical optimum attributes to various noise and errors existing in the control process. Red solid line then presents the optimization process of hqcGRAPE, the final \(F_Q\) corresponding to the learned optimal controls is \(3.9102 \pm 0.0007\) over 5 tests. This indicates that in the metrology process, hqcGRAPE method automatically corrected some forms of errors, thus reaching a higher \(F_Q\) than that of the openloop designs. We also reconstructed the final optimal resultant state \(\rho _{\Omega }(T)\), as shown in Fig. 2b for GRAPEexp, and Fig. 2c for hqcGRAPE. Compared them with the theoretical optimal NOON state \(\rho _t=\psi _t\rangle \langle \psi _t\), \(\psi _t \rangle =(00\rangle +e^{i\phi }11\rangle )/\sqrt{2}\)^{7}, we obtained a fidelity of \(0.9954 \pm 0.0002\) for GRAPEexp and \(0.9962 \pm 0.0001\) for hqcGRAPE by defining \(F(\rho _t,\rho _{\Omega }(T)) =\text {Tr}(\rho _t\rho _{\Omega }(T))/\sqrt{\text {Tr}[(\rho _t)^2] \text {Tr}[(\rho _{\Omega }(T)^2]}\). This reveals that hqcGRAPE can reach a state closer to the theoretical optimum than GRAPEexp does. Moreover, we plot the initial controls (0th iteration) and the final optimal controls (10th iteration) searched by GRAPE and hqcGRAPE in Fig. 2d,e, respectively. These two approaches started from the same initial controls, but terminated with slightly different control amplitudes, which leads to their distinct performances.
Analysis of the benefits of hqcGRAPE
As demonstrated above, the final optimal controls searched by hqcGRAPE induce a higher quantum Fisher information \(F_Q\) than GRAEPexp did. The benefits come from the inherent features of closedloop learning, which can automatically correct some specific unitary errors^{38}. To explicitly understand how hqcGRAPE improve the estimation precision, we now proceed to carefully analyze the existing errors in our experiments. In general, they can be divided into the following four types:
Initial state imperfection. It refers to the deviation of experimentally prepared initial state and the desired one. From the experimentally reconstructed initial state \(\rho _0\), we applied optimal controls searched by GRAPE, leading to the resultant state shown in Fig. 3b (the ideal resultant state is depicted in Fig. 3a). We then performed ideal measurements and got \(F_Q=3.9573\). This indicates that initial state imperfection yields an error of 0.0427 from the theoretical optimal value. Actually, as the prepared \(\rho _0\) is not a perfect pure state, the nonunitary parts under the controls and the encoding process will finally induce the errors on estimating \(F_Q\). In addition, the spectrum of the prepared initial state is directly treated as the reference signal for characterizing \(F_Q\). Thus, this kind of error will eventually cause nonunitary effects that can not be corrected in the closedloop learning process.
Decoherence. Normally, the effects of decoherence in NMR simulator can be described by phase damping channel \(\varepsilon _{\mathrm{PD}}\) and generalized amplitude damping channel \(\varepsilon _{\mathrm{GAD}}\)^{50}. In each sliced evolution process, phase damping error was involved by \(\rho \rightarrow \varepsilon _{\mathrm{PD}} ^2 \circ \varepsilon _{\mathrm{PD}}^1(\rho ) \), where \(\varepsilon _{\mathrm{PD}} ^i(\rho )=(1p_i)\rho +p_i\sigma _z^i \rho \sigma _z^i\) with \(p_i=(1e^{\Delta t/T_2^i})/2, i=1,2\) being the qubit number, and \(T_2^1=0.3~\text {s}, T_2^2=3.3~\text {s}\). Similarly, generalized amplitude damping error was expressed as \(\rho \rightarrow \varepsilon _{\mathrm{GAD}} ^2 \circ \varepsilon _{\mathrm{GAD}}^1(\rho ) \) and calculated by \(\varepsilon _{\mathrm{GAD}}^i(\rho )=\sum _s E_s^i\rho E_s^{i\dag }\), where
with \(\eta ^i=1e^{\Delta t/T_1^i}, p \approx 1/2\) and \(T_1^1=18.5~\text {s},T_1^2=9.9~\text {s}\). With perfect initial state, optimal pulses searched by GRAPE and ideal measurements, the decoherence then induces an error of 0.0370, as shown in Fig. 3c. It’s worth noting that the coherent controls may partially ease the decoherence^{24}. However, the analysis above has taken the effects of the coherent controls into consideration, thus the remaining error can not be corrected.
Pulse error. To estimate the influence of pulse errors on \(F_Q\), we assume that the amplitude of the controls undergoes uniformly distributed stochastic fluctuation with at most 5% distortions. With perfect initial state and ideal measurements, we repeated the optimal controls with fluctuations 1000 times and got an error around 0.0038.
Measurement error. Measurement errors can be estimated from the stochastic fluctuations of NMR spectra. In our experiments, measurements are accomplished by observing the NMR spectra and fitting them with Lorentzian functions. A direct estimation of the measurement error of resultant state was at the level of \(10^{4}\), which becomes \(10^{6}\) when considering its \(F_Q\) using error propagation. Reasonably, this type of error can be ignored.
To conclude, initial state imperfection, decoherence and pulse error are three major errors in our experiments. However, as analyzed above, the initial state imperfection here will cause nonunitary effects and the error of decoherence here is the part that controls can not handle. That is to say, the employed coherent controls are not able to further deal with these two errors. Thus when we compensate the loss of these two errors on \(F_Q\), the performance of hqcGRAPE is remarkably improved to 3.9899, which is near the optimal value, as shown in Fig. 3d. For the results of GRAPEexp after error compensation, there is still a visible gap with respect to the optimal value, see Fig. 3d. These results indicate that hqcGRAPE can intelligently correct pulse error and some other unknown unitary errors to improve the metrology precision.
Conclusion
For quantum metrology, additional controls are helpful for dealing with the challenges of external noise, complicated designs and manipulation of probes and encoding dynamics. Though this area has attracted much attention recently, practical schemes are still urgently in demand^{45}. In this study, we proposed a hybrid quantumclassical approach assisted GRAPE to automatically engineer the encoding dynamics for searching optimal probes to improve the metrology precision. The quantum simulator, which can efficiently simulate the timeconsuming part of the GRAPE algorithm, is combined with the classical computer to iteratively optimize the controls. In our scheme, there is no need to start from optimal probes, the controls can transform arbitrary pure initial probe to the best resultant state during the learning process without any prior designs. Furthermore, many specific unitary errors can be inherently corrected by this closedloop learning procedure, which indeed improve the metrology precision. The accompanied experiments successfully verified the effectiveness and advantages of hqcGRAPE.
The demonstrative experiments were implemented on a smallscale NMR quantum simulator, however, the proposed scheme is scalable and feasible for current NISQ^{51} systems. Cooperated with many efficient methods of estimating quantum Fisher information in experiments^{44,46,47}, the proposed scheme is promising in realizing optimal quantum metrology with autodesign techniques for more complicated and largesized applications.
Data availability
The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.
References
Giovannetti, V., Lloyd, S. & Maccone, L. Advances in quantum metrology. Nat. Photon. 5, 222–229 (2011).
Escher, B., de Matos Filho, R. & Davidovich, L. General framework for estimating the ultimate precision limit in noisy quantumenhanced metrology. Nat. Phys. 7, 406 (2011).
Escher, B., de Matos Filho, R. & Davidovich, L. Quantum metrology for noisy systems. Braz. J. Phys. 41, 229–247 (2011).
Yuan, H. & Fung, C.H.F. Quantum parameter estimation with general dynamics. NPJ Quantum Inf. 3, 14 (2017).
Giovannetti, V., Lloyd, S. & Maccone, L. Quantum metrology. Phys. Rev. Lett. 96, 010401 (2006).
Tóth, G. & Apellaniz, I. Quantum metrology from a quantum information science perspective. J. Phys. A Math. Theor. 47, 424006 (2014).
Pezzè, L., Smerzi, A., Oberthaler, M. K., Schmied, R. & Treutlein, P. Quantum metrology with nonclassical states of atomic ensembles. Rev. Mod. Phys. 90, 035005 (2018).
Chin, A. W., Huelga, S. F. & Plenio, M. B. Quantum metrology in nonmarkovian environments. Phys. Rev. Lett. 109, 233601 (2012).
DemkowiczDobrzański, R., Kołodyński, J. & Guţă, M. The elusive heisenberg limit in quantumenhanced metrology. Nat. Commun. 3, 1063 (2012).
DemkowiczDobrzański, R. & Maccone, L. Using entanglement against noise in quantum metrology. Phys. Rev. Lett. 113, 250801 (2014).
Pan, J.W. et al. Multiphoton entanglement and interferometry. Rev. Mod. Phys. 84, 777 (2012).
Jones, J. A. et al. Magnetic field sensing beyond the standard quantum limit using 10spin noon states. Science 324, 1166–1168 (2009).
Simmons, S., Jones, J. A., Karlen, S. D., Ardavan, A. & Morton, J. J. L. Magnetic field sensors using 13spin cat states. Phys. Rev. A 82, 022330 (2010).
Mitchell, M. W., Lundeen, J. S. & Steinberg, A. M. Superresolving phase measurements with a multiphoton entangled state. Nature 429, 161 (2004).
Resch, K. J. et al. Timereversal and superresolving phase measurements. Phys. Rev. Lett. 98, 223601 (2007).
Joo, J., Munro, W. J. & Spiller, T. P. Quantum metrology with entangled coherent states. Phys. Rev. Lett. 107, 083601 (2011).
Boixo, S., Flammia, S. T., Caves, C. M. & Geremia, J. Generalized limits for singleparameter quantum estimation. Phys. Rev. Lett. 98, 090401 (2007).
Roy, S. M. & Braunstein, S. L. Exponentially enhanced quantum metrology. Phys. Rev. Lett. 100, 220501 (2008).
Napolitano, M. et al. Interactionbased quantum metrology showing scaling beyond the heisenberg limit. Nature 471, 486 (2011).
Hall, M. J. W. & Wiseman, H. M. Does nonlinear metrology offer improved resolution? answers from quantum information theory. Phys. Rev. X 2, 041006 (2012).
Pang, S. & Jordan, A. N. Optimal adaptive control for quantum metrology with timedependent hamiltonians. Nat. Commun. 8, 14695 (2017).
Tan, Q.S., Huang, Y., Yin, X., Kuang, L.M. & Wang, X. Enhancement of parameterestimation precision in noisy systems by dynamical decoupling pulses. Phys. Rev. A 87, 032102 (2013).
Lang, J. E., Liu, R. B. & Monteiro, T. S. Dynamicaldecouplingbased quantum sensing: floquet spectroscopy. Phys. Rev. X 5, 041016 (2015).
Sekatski, P., Skotiniotis, M. & Dür, W. Dynamical decoupling leads to improved scaling in noisy quantum metrology. New J. Phys. 18, 073034 (2016).
Dür, W., Skotiniotis, M., Fröwis, F. & Kraus, B. Improved quantum metrology using quantum error correction. Phys. Rev. Lett. 112, 080801 (2014).
Kessler, E. M., Lovchinsky, I., Sushkov, A. O. & Lukin, M. D. Quantum error correction for metrology. Phys. Rev. Lett. 112, 150802 (2014).
Hou, Z. et al. Controlenhanced sequential scheme for general quantum parameter estimation at the heisenberg limit. Phys. Rev. Lett. 123, 040501 (2019).
Yuan, H. & Fung, C.H.F. Optimal feedback scheme and universal time scaling for hamiltonian parameter estimation. Phys. Rev. Lett. 115, 110401 (2015).
Liu, J. & Yuan, H. Quantum parameter estimation with optimal control. Phys. Rev. A 96, 012117 (2017).
Li, J., Yang, X., Peng, X. & Sun, C.P. Hybrid quantumclassical approach to quantum optimal control. Phys. Rev. Lett. 118, 150503 (2017).
Lu, D. et al. Enhancing quantum control by bootstrapping a quantum processor of 12 qubits. NPJ Quantum Inf. 3, 45 (2017).
Peruzzo, A. et al. A variational eigenvalue solver on a photonic quantum processor. Nat. Commun. 5, 4213 (2014).
Grimsley, H. R., Economou, S. E., Barnes, E. & Mayhall, N. J. An adaptive variational algorithm for exact molecular simulations on a quantum computer. Nat. Commun. 10, 1–9 (2019).
Wecker, D., Hastings, M. B. & Troyer, M. Progress towards practical quantum variational algorithms. Phys. Rev. A 92, 042303 (2015).
O’Malley, P. J. J. et al. Scalable quantum simulation of molecular energies. Phys. Rev. X 6, 031007 (2016).
Bauer, B., Wecker, D., Millis, A. J., Hastings, M. B. & Troyer, M. Hybrid quantumclassical approach to correlated materials. Phys. Rev. X 6, 031045 (2016).
Shao, C. Fast variational quantum algorithms for training neural networks and solving convex optimizations. Phys. Rev. A 99, 042325 (2019).
Brif, C., Chakrabarti, R. & Rabitz, H. Control of quantum phenomena: past, present and future. New J. Phys. 12, 075008 (2010).
Vandersypen, L. M. K. & Chuang, I. L. Nmr techniques for quantum control and computation. Rev. Mod. Phys. 76, 1037–1069 (2005).
Makhlin, Y., Schön, G. & Shnirman, A. Quantumstate engineering with josephsonjunction devices. Rev. Mod. Phys. 73, 357–400 (2001).
Leibfried, D., Blatt, R., Monroe, C. & Wineland, D. Quantum dynamics of single trapped ions. Rev. Mod. Phys. 75, 281–324 (2003).
Tóth, G. & Petz, D. Extremal properties of the variance and the quantum fisher information. Phys. Rev. A 87, 032324 (2013).
Altenburg, S., Oszmaniec, M., Wölk, S. & Gühne, O. Estimation of gradients in quantum metrology. Phys. Rev. A 96, 042319 (2017).
Modi, K., Céleri, L. C., Thompson, J. & Gu, M. Fragile states are better for quantum metrology. arXiv:1608.01443 (2016).
Yang, X. et al. Probe optimization for quantum metrology via closedloop learning control. NPJ Quantum Inf. 6, 1–7 (2020).
Gärttner, M., Hauke, P. & Rey, A. M. Relating outoftimeorder correlations to entanglement via multiplequantum coherences. Phys. Rev. Lett. 120, 040402 (2018).
Macrì, T., Smerzi, A. & Pezzè, L. Loschmidt echo for quantum metrology. Phys. Rev. A 94, 010102 (2016).
Peng, X. et al. Preparation of pseudopure states by lineselective pulses in nuclear magnetic resonance. Chem. Phys. Lett. 340, 509–516 (2001).
Lee, J.S. The quantum state tomography on an nmr system. Phys. Lett. A 305, 349–353 (2002).
Vandersypen, L. M. et al. Experimental realization of shor’s quantum factoring algorithm using nuclear magnetic resonance. Nature 414, 883–887 (2001).
Preskill, J. Quantum computing in the nisq era and beyond. Quantum 2, 79 (2018).
Acknowledgements
J.L. is supported by the National Natural Science Foundation of China (Grant No. 11975117), and Guangdong Provincial Key Laboratory (Grant No. 2019B121203002). X.P. is supported by National Key Research and Development Program of China (Grant No. 2018YFA0306600), the National Science Fund for Distinguished Young Scholars (Grant No. 11425523), Projects of International Cooperation and Exchanges NSFC (Grant No. 11661161018), and Anhui Initiative in Quantum Information Technologies (Grant No. AHY050000).
Author information
Authors and Affiliations
Contributions
X.Y. proposed this project and wrote the manuscript; X.C. and X.Y. performed the experiments and analyzed the data; J.L. and R.L. helped with discussions and revised the manuscript; X.P. supervised the whole project.
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.
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
Yang, X., Chen, X., Li, J. et al. Hybrid quantumclassical approach to enhanced quantum metrology. Sci Rep 11, 672 (2021). https://doi.org/10.1038/s41598020800701
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598020800701
This article is cited by

Online optimization for optical readout of a single electron spin in diamond
Frontiers of Physics (2023)
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.