This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Preparation of Metrological States in Dipolar-Interacting Spin Systems

Tian-Xing Zheng1,2    Anran Li1    Jude Rosen1    Sisi Zhou1,3    Martin Koppenhöfer1    Ziqi Ma4,5    Frederic T. Chong4    Aashish A. Clerk1    Liang Jiang1    Peter C. Maurer1 1Pritzker School of Molecular Engineering, University of Chicago, Chicago, Illinois 60637, USA 2Department of Physics, University of Chicago, Chicago, Illinois 60637, USA 3Institute for Quantum Information and Matter, California Institute of Technology, Pasadena, California 91125, USA 4Department of Computer Science, University of Chicago, Chicago, Illinois 60637, USA 5Microsoft, Redmond, Washington 98052, USA
Abstract

Spin systems are an attractive candidate for quantum-enhanced metrology. Here we develop a variational method to generate metrological states in small dipolar-interacting ensembles with limited qubit controls and unknown spin locations. The generated states enable sensing beyond the standard quantum limit (SQL) and approaching the Heisenberg limit (HL). Depending on the circuit depth and the level of readout noise, the resulting states resemble Greenberger-Horne-Zeilinger (GHZ) states or Spin Squeezed States (SSS). Sensing beyond the SQL holds in the presence of finite spin polarization and a non-Markovian noise environment.

preprint: APS/123-QED

Introduction.

Spin systems have emerged as a promising platform for quantum sensing [Degen et al., 2017; Barry et al., 2020; Schirhagl et al., 2014; Tetienne, 2021] with applications ranging from tests of fundamental physics [Hensen et al., 2015,Marti et al., 2018] to mapping fields and temperature profiles in condensed matter systems and life sciences [Schirhagl et al., 2014]. Improving the sensitivity of these qubit sensors has so far largely relied on increasing the number of sensing spins and extending spin coherence through material engineering and coherent control. However, with increasing spin density, dipolar interactions between individual sensor spins cause single-qubit dephasing [Yan et al., 2013,Childress et al., 2006] and, in the absence of advanced dynamical decoupling [Waugh et al., 1968; Mehring, 2012; Choi et al., 2020], set a limit to the sensitivity.

Although dipolar interactions in dense spin ensembles lead to complex evolution, they can provide a resource for the creation of metrological states that enable sensing beyond the SQL. Current approaches to create such states (i.e., GHZ states and SSS) either require all-to-all interactions [Pedrozo-Peñafiel et al., 2020; Kitagawa and Ueda, 1993; Bilitewski et al., 2021] or single-qubit addressability [Chen et al., 2020,Neumann et al., 2008], which are challenging to implement experimentally. An alternative approach that relies on adiabatic state preparation requires less control but results in preparation times that increase exponentially with system size [Cappellaro and Lukin, 2009,Choi et al., 2017a], leaving this method susceptible to dephasing.

Variational methods provide a powerful tool for controlling many-body quantum systems [Cerezo et al., 2021; Kokail et al., 2019; Li and Benjamin, 2017; Zhou et al., 2020a]. Such methods have been proposed for Rydberg-interacting atomic systems [Kaubruegger et al., 2019,Kaubruegger et al., 2021] and demonstrated in trapped ions [Marciniak et al., 2021]. However, these techniques rely on effective all-to-all interactions (e.g. almost constant interaction strength inside the Rydberg radius [Kaubruegger et al., 2019,Borish et al., 2020,Bernien et al., 2017]) which are generally absent in solid-state spin ensembles. In this work, we develop a variational algorithm that drives dipolar-interacting spin systems [Fig. 1(a)] into highly entangled states. The resulting states can be subsequently used for Ramsey-interferometry-based single parameter estimation [Degen et al., 2017]. The required system control relies solely on uniform single-qubit rotations and free evolution under dipolar interactions. The optimization can be directly performed on an experimental device using only its measurement outcomes without the need to know the spatial distribution of the spins (later referred as ‘spin configuration’). Potential experimental platforms include dipolar-interacting ensembles of NV centers, nitrogen defects in diamond (P1), rare-earth-doped crystals, and ultra-cold molecules.

Refer to caption
Figure 1: (a) Schematic of a dipolar-interacting spin ensemble in a 3D-random configuration. (b) The quantum circuit consists of three parts: a sequence for generating entanglement (entangler), phase accumulation (Ramsey) and single-qubit readout in the SzS_{z} basis. Dipolar interactions during Ramsey interference are eliminated by dynamical decoupling [Yan et al., 2013,Waugh et al., 1968,Zhou et al., 2020b]. The measurement outcome is processed on a classical computer and used to determine the next generation for 𝜽\bm{\theta}. (c) Gate sequence of each variational layer and the Wigner distributions for a 5-spin state after each gate. (d) Illustration of an optimization process on a 3-spin system with m=1m=1. The contour plots show the 2D projection of the multidimensional 𝜽\bm{\theta} space for fixed ϑ1\vartheta_{1}. The orange points mark the sampling positions in the parameter space. Convergence to the global maximum is reached in the 63th generation.

Variational Ansatz.

As shown in Fig. 1(b), the variational circuit 𝒮(𝜽)=𝒰m𝒰2𝒰1\mathcal{S}(\bm{\theta})=\mathcal{U}_{m}...\mathcal{U}_{2}\mathcal{U}_{1} is constructed by mm layers of unitary operations. Each 𝒰i\mathcal{U}_{i} consists of the parameterized control gates

𝒰i=Ry(π2)D(τi)Ry(π2)Rx(ϑi)D(τi),\mathcal{U}_{i}=R_{y}\left(\frac{\pi}{2}\right)D\left(\tau^{\prime}_{i}\right)R_{y}\left(-\frac{\pi}{2}\right)R_{x}\left(\vartheta_{i}\right)D\left(\tau_{i}\right), (1)

where Rμ(ϑ)=exp(iϑj=1NSjμ)R_{\mu}(\vartheta)=\exp(-i\vartheta\sum_{j=1}^{N}S_{j}^{\mu}) are single-qubit rotations and SjμS_{j}^{\mu} (μ{x,y,z})(\mu\in\{x,y,z\}) is the μ\mu component of the jj-th spin operator. D(τ)=exp(iτHdd/)D(\tau)=\exp(-i\tau H_{\text{dd}}/\hbar) is the time evolution operator of the spin ensemble under dipolar-interaction Hamiltonian Hdd=i<jVij(2SizSjzSixSjxSiySjy)H_{\text{dd}}=\sum_{i<j}V_{ij}(2S^{z}_{i}S^{z}_{j}-S^{x}_{i}S^{x}_{j}-S^{y}_{i}S^{y}_{j}). The coupling strength between two spins at positions 𝒓i\bm{r}_{i} and 𝒓j\bm{r}_{j} is

Vij=μ04πγiγj2|𝒓i𝒓j|3(13cosβij)2,V_{ij}=\frac{\mu_{0}}{4\pi}\frac{\gamma_{i}\gamma_{j}\hbar^{2}}{\left|\bm{r}_{i}-\bm{r}_{j}\right|^{3}}\frac{(1-3\cos\beta_{ij})}{2}, (2)

with μ0\mu_{0} the vacuum permeability, \hbar the reduced Planck constant, γ\gamma the spin’s gyromagnetic ratio, and βij\beta_{ij} the angle between the line segment connecting (𝒓i\bm{r}_{i}, 𝒓j\bm{r}_{j}) and the direction of bias magnetic field. An evolutionary algorithm [Hansen, 2016,SM, ] is applied on the mm-layer circuit which contains 3m3m free parameters constituting the vector 𝜽=(τ1,ϑ1,τ1,,τi,ϑi,τi,,τm,ϑm,τm)\bm{\theta}=(\tau_{1},\vartheta_{1},\tau^{\prime}_{1},...,\tau_{i},\vartheta_{i},\tau^{\prime}_{i},...,\tau_{m},\vartheta_{m},\tau^{\prime}_{m}). Each τi\tau_{i} is restricted to τi[0,1/f¯dd]\tau_{i}\in[0,1/\bar{f}_{\text{dd}}] where f¯dd\bar{f}_{\text{dd}} is the average nearest-neighbor interaction strength for the considered spin configuration. The Ansatz in Eq. (1) is the most general set of global single-qubit gates that preserves the initial collective spin direction i𝑺i/|i𝑺i|\langle\sum_{i}\bm{S}_{i}\rangle/|\langle\sum_{i}\bm{S}_{i}\rangle|, here chosen to be the xx-direction [Kaubruegger et al., 2019,SM, ]. Although this Ansatz does not enable universal system control [Schirmer et al., 2001; Albertini and D’Alessandro, 2002, 2021a; SM, ], we show that with increasing circuit depth, sensing near the HL can be achieved.

Metrological cost function.

The Ramsey protocol shown in Fig. 1(b) encodes the quantity of interest in the accumulated phase ϕ=ωtR\phi=\omega t_{\text{R}}, with ω\omega the detuning frequency and tRt_{\text{R}} the Ramsey sensing time. The Classical Fisher Information (CFI) [Degen et al., 2017,SM, ] quantifies how precisely one can estimate an unknown parameter ϕ\phi under a measurement basis. Our variational approach treats the spin systems as a black-box for which the algorithm finds a control sequence that maximizes the CFI associated with the parameter estimation problem

CFIϕ=zTr[Pzρϕ](logTr[Pzρϕ]ϕ)2.\mathrm{CFI}_{\phi}=\sum_{z}\Tr[P_{z}\rho_{\phi}]\left(\frac{\partial\log\Tr[P_{z}\rho_{\phi}]}{\partial\phi}\right)^{2}. (3)

The sum runs over the 2N2^{N} basis states |z=i=1N|siz\ket{z}=\otimes_{i=1}^{N}\ket{s_{i}^{z}}, where sizs_{i}^{z} are the eigenvalues of SizS_{i}^{z}. Pz|zz|P_{z}\equiv\ket{z}\bra{z} denotes the corresponding measurement operator and ρϕ\rho_{\phi} the density matrix. The CFI is chosen as cost function because it is a measure for the maximal achievable sensitivity for a given measurement basis [Degen et al., 2017,Kobayashi et al., 2011]. Likewise, PzP_{z} provides the maximal information that can be gained from single-qubit measurements. However, measurement operators such as parity or total spin polarization result in a smaller outcome space and are therefore more efficient in experimental implementations. While this study optimizes the measurement for PzP_{z}, the obtained results likewise hold for parity and total spin polarization [SM, ].

Refer to caption
Figure 2: (a) Top: CFI for m=1m=1 (circles) and m=7m=7 (squares) circuits. The colors correspond to the configurations shown on the left. Bottom: schematics of different spin configurations. The numbers in the 2D square lattice pattern label the order in which spins are added to form a lattice of size NN. (b) Average CFI for 50 configurations of 3D-randomly distributed spins. (c) Average number of layers required to achieve a CFI within a given percentage of the HL in the case of 3D-random configuration. The fit m=aNb+cm=aN^{b}+c with b=2.45b=2.45 (goodness of fit R2=0.996R^{2}=0.996) serve as a guide to the eye. The same data also fits to an exponential model with slightly lower R2=0.995R^{2}=0.995.
Refer to caption
Figure 3: (a) Wigner distributions versus spin number for m=2m=2 and m=7m=7 in the case of 2D square lattice and 3D-random configurations. (b) von-Neumann entanglement entropy for one specific 3D-random configuration of 9 spins for m=2m=2 and m=7m=7. Individual spins are colored according to their von-Neumann entropies. Entangled clusters are marked by solid black lines. (c) Histograms depicting the maximal size of entangled clusters for 50 3D-random configurations. (d) Average CFI (blue) and state preparation time (orange) versus mm. The state preparation time is given as a unitless quantity f¯ddT\bar{f}_{\text{dd}}T with T=i=1m(τi+τi)T=\sum^{m}_{i=1}(\tau_{i}+\tau^{\prime}_{i}).

Numerical results for regular and disordered spin configurations.

We start by testing our approach for three distinct regular spin configurations. Figure 2(a) shows the CFI after optimization for spins arranged on a linear chain (blue), a two-dimensional (2D) square lattice (orange), and a circle (green). All three configurations result in states with CFI above the SQL. When multiple circuit layers are added, the CFI further improves. Next, we simulate the case of disordered three-dimensional (3D) spin configurations (later referred as 3D-random). In our simulations the spins are randomly located in a box of length LN1/3L\propto N^{1/3} (constant spin density). Compared to the regular spin array, the disordered case shows a noticeable saturation of the CFI as a funciton of NN. With increased circuit depth, sensing precision beyond the SQL is maintained. The required circuit depth increases drastically with NN [Fig. 2(c)].

Characterization of entanglement.

We investigate the NN-qubit entangled states created by our variational method. Figure 3(a) shows the corresponding Wigner distributions [Hillery et al., 1984; Dowling et al., 1994; Koczor et al., 2020] for a regular 2D spin array (top) and the average Wigner distributions for 50 different 3D-random spin configurations (bottom). In both cases, the optimized states resemble GHZ states when NN is small and mm is large. For large NN and small mm, the states are close to SSS. Non-Gaussian states that provide sensitivity beyond the SSS but lower than GHZ states are also generated. Our algorithm tends to drive the systems into a GHZ state, as it has the unique property of attaining the HL in Ramsey spectroscopy [Giovannetti et al., 2006].

For quantitatively analysing the buildup of entanglement, the von-Neumann entanglement entropy (EvN=Tr(ρslog2ρs)E_{\text{vN}}=-\Tr(\rho_{\text{s}}\log_{2}\rho_{\text{s}})) [Nielsen and Chuang, 2010] is used as a measure for the degree of entanglement between a spin subsystem (ρs=Trsρtot\rho_{\text{s}}=\Tr_{\text{s}}{\rho_{\text{tot}}}) and the remaining system. As an example, we explore one case of a 3D-random configuration of 9 spins. Figure 3(b) shows the von-Neumann entropy of each spin after employing a 2-layer circuit (left) and a 7-layer circuit (right). In the case of m=2m=2, the achieved degree of entanglement is modest with spin No.6 for example showing no substantial entanglement with the remaining spins. When the circuit depth is increased to 7, all spins display substantial entanglement. While the single-particle entropy detects spins unentangled with the remaining system, it does not determine whether all spins are entangled with each other or entanglement is local. We distinguish these two scenarios by identifying the smallest clusters with EvN0.4E_{\text{vN}}\leq 0.4. For m=2m=2, the spin ensemble segments into 5 clusters [Fig. 3(b)], while for m=7m=7 only 2 clusters are found. The results verify that multiple layers are required to overcome the anisotropy of the dipolar interaction (Eq. (2)) when building up entanglement over the entire system. Finally, in Fig. 3(c) we analyze the size of the largest cluster for each of the 50 spin configurations and observe an overall increase of the largest cluster size and a decrease of the variance.

State preparation time.

Minimizing the preparation time is central in practical applications, as it increases bandwidth, reduces decoherence, and enables more measurement repetitions [Degen et al., 2017]. Figure 3(d) shows the average state preparation time for 8 spins in 50 different 3D-random configurations as a function of layer number. The preparation time increases with the layer number and is inversely proportional to the average dipole coupling strength of the nearest-neighbour spins f¯dd\bar{f}_{\text{dd}}. Compared to adiabatic methods [Cappellaro and Lukin, 2009], our approach results in an 11×11\times reduction of the preparation time to reach the same CFI for identical spin number and density [SM, ].

Refer to caption
Figure 4: (a) CFIϕ\text{CFI}_{\phi} under finite initialization fidelity (IF) and readout fidelity (RF). Circuit depth m=5m=5. IF=NNN\text{IF}=\frac{N_{\uparrow}-N_{\downarrow}}{N}, where NN_{\uparrow} (NN_{\downarrow}) denotes the number of spins in the |\ket{\uparrow} (|\ket{\downarrow}) state at the beginning of the sensing protocol in Fig. 1(b). RF=1p(|)=1p(|)\text{RF}=1-p(\downarrow|\uparrow)=1-p(\uparrow|\downarrow). (b) Optimized Wigner functions and CFIϕ\text{CFI}_{\phi} of a 10-spin state versus different readout fidelities (RF). For comparison, the row ‘CSS’ represents the CFIϕ\text{CFI}_{\phi} for a coherent spin state given the same RF. (c) CFIϕ\text{CFI}_{\phi} in the presence of decoherence in the entangler. (d) Ramsey protocol’s results of the generated states when considering non-Markovian noise during signal accumulation. Data correspond to the optimized states from 2D square lattice configuration.

State preparation under decoherence, initialization and readout errors

Until now our analysis assumed full coherence and perfect spin initialization and readout. However, dephasing, initializaiton, and readout errors will be limiting factors in experimental implementations. We next examine the impact of such imperfections on state preparation and sensing. Figure 4(a) shows the CFI in the presence of imperfect initialization and finite readout fidelity for spins on a 2D square lattice. For N10N\leq 10, beyond-SQL precision is reached with 90% initialization and 95% readout fidelity, respectively.

Next, we investigate the resulting states when readout errors are added into the optimizer. Figure 4(b) indicates that without readout errors, the Wigner distribution of the resulting state is close to a GHZ state. However, with a finite readout error rate, our algorithm drives the system into a state resembling a SSS. When the readout noise is further increased, the SSS transforms into a coherent spin state (CSS). The results agree with the fact that GHZ states are sensitive to single-spin readout errors while SSS are more robust [Davis et al., 2017].

Table 1: Experimental platforms’ relative parameters
Systems f¯dd\bar{f}_{\text{dd}} T2(DD)T_{2}^{\text{(DD)}} f¯ddT2(DD)\bar{f}_{\text{dd}}T_{2}^{\text{(DD)}} PiniP_{\text{ini}} FreadoutF_{\text{readout}} ν\nu
NV ensemble 3535kHz [Zhou et al., 2020b] 7.9(2)μ7.9(2)\mus [Zhou et al., 2020b] 0.28 97.5%97.5\% [Shields et al., 2015] 97.5%97.5\% [Shields et al., 2015] 242-4 [Childress et al., 2006]
P1 centers 0.920.92MHz [Zu et al., 2021] 4.4μ4.4\mus [Zu et al., 2021] 4.0 95%95\% [Degen et al., 2021] 95%95\% [Degen et al., 2021] ?
Rare-Earth crystals 1.961.96MHz [Merkel et al., 2021] 2.5μ2.5\mus [Merkel et al., 2021] 4.9 97%97\% [Chen et al., 2020] 94.6%94.6\% [Raha et al., 2020] 2.4±0.12.4\pm 0.1 [Le Dantec et al., 2021]
Cold Molecules 5252Hz [Yan et al., 2013] 8080ms [Yan et al., 2013] 4.16 97%97\% [Cheuk et al., 2020] 97%97\% [Cheuk et al., 2020] ?

During the state preparation, decoherence (T2T_{2}) reduces entanglement. We assume independent, Markovian dephasing of each spin as described by a Lindblad master equation [Nielsen and Chuang, 2010]. Figure 4(c) shows the CFI for various T2T_{2} times using the previously optimized gate parameters for 2D square lattice. While a finite T2T_{2} decreases the CFI, coherence times exceeding 5/fdd5/f_{\text{dd}} result in states with beyond-SQL sensitivity. Here, fddf_{\text{dd}} denotes the nearest-neighbor interaction strength for 2D square lattice. Since performing optimization with imperfections is numerically expensive, the results in Fig. 4(a), (c), (d) are obtained by optimizing the parameters in the absence of imperfections and using those parameters to compute the CFI under imperfect conditions. Thus, better results are expected if the optimization is directly run on experiments.

Sensitivity in a non-Markovian environment.

In addition to impacts on state preparation, dephasing affects performance in Ramsey interferometry. In the presence of spatially uncorrelated Markovian noise, entanglement does not lead to a beyond-SQL scaling [Demkowicz-Dobrzański et al., 2012,Escher et al., 2011]. In a non-Markovian environment, such as that of a solid-state spin system, this limitation does not hold [Chin et al., 2012,Smirne et al., 2016]. We examine the performance of our optimized states in a non-Markovian noise environment. We adopt a noise model [Chin et al., 2012] in which the amplitude of single-spin coherence reduces according to

ρ01(t)=ρ01(0)e(tT2)ν\rho_{01}(t)=\rho_{01}(0)e^{-\left(\frac{t}{T_{2}}\right)^{\nu}} (4)

where ν\nu is the stretch factor set by the noise properties. The time evolution under Ramsey propagation is simulated with a generalized Lindblad master equation [SM, ,Smirne et al., 2016]. The sensing performance of optimized states is characterized by the square of the signal-noise-ratio SNR2CFIω/tR{}^{2}\propto\text{CFI}_{\omega}/t_{\text{R}} [SM, ]. Figure 4(d) shows their performance compared to the CSS and the GHZ states for a ν=2\nu=2 and ν=4\nu=4 noise exponent [Childress et al., 2006]. The created entangled states provide an advantage over uncorrelated states. For small spin numbers, the SNR follows the HL scaling [Chin et al., 2012].

Proposed experimental platforms.

Candidate systems for realizing the proposed variational approach need to possess long T2T_{2} coherence time, strong dipolar-interacting strength, and high initialization and readout fidelity. Recent developments in solid-state spin systems and ultracold molecules have demonstrated coherence times that exceed dipolar coupling times (1/f¯dd1/\bar{f}_{\text{dd}}) as well as high-fidelity spin initialization and readout. Table S1 lists the experimentally observed parameters for different candidate systems, including Nitrogen Vacancy (NV) ensembles, P1 centers in diamond, rare-earth doped crystals, and ultracold molecule tweezer systems [SM, ].

Conclusion and Outlook.

This work introduces a variational circuit that generates entangled metrological states in a dipolar-interacting spin system without requiring knowledge of the actual spin configuration. The required system parameters are within the reach of several experimental platforms. While this study remains limited to small system sizes (N10N\leq 10, limited by computational resource), our results are of immediate interest to nanoscale quantum sensing where spatial resolution is paramount and the finite sensor size limits the number of spins that can be utilized. Extending our results to N>10N>10 can either be achieved by utilizing symmetries in regular arrays or directly testing our optimization algorithms on an actual experimental platform. The developed method is also potentially applicable for preparing other relevant highly entangled states in quantum computing and quantum communication.

We thank D. DeMille, D. Freedmann, A. Bleszynski Jayich, S. Kolkowitz, T. Li, Z. Li, R. Kaubruegger, Y. Huang, Q. Xuan, Z. Zhang, S. von Kugelgen, C-J. Yu, Y. Bao, and P. Gokhale for helpful discussions. T-X.Z., M.K., F.T.C., A.C., L.J. and P.M. acknowledge support by Q-NEXT Grant No. DOE 1F-60579. T-X.Z. and P.M. acknowledge support by National Science Foundation (NSF) Grant No. OMA-1936118 and OIA-2040520, and NSF QuBBE QLCI (NSF OMA- 2121044). S.Z. acknowledges funding provided by the Institute for Quantum Information and Matter, an NSF Physics Frontiers Center (NSF Grant PHY-1733907). Z.M. and F.T.C acknowledge support by EPiQC, an NSF Expedition in Computing, under grants CCF-1730082/1730449; in part by STAQ under grant NSF Phy-1818914; in part by the US DOE Office of Advanced Scientific Computing Research, Accelerated Research for Quantum Computing Program.; and in part by NSF OMA-2016136. The authors are also grateful for the support of the University of Chicago Research Computing Center for assistance with the numerical simulations carried out in this work.

Disclosure: F.T.C. is the Chief Scientist for Super.tech and an advisor to QCI.

References

  • Degen et al. (2017) C. L. Degen, F. Reinhard,  and P. Cappellaro, Reviews of modern physics 89, 035002 (2017).
  • Barry et al. (2020) J. F. Barry, J. M. Schloss, E. Bauch, M. J. Turner, C. A. Hart, L. M. Pham,  and R. L. Walsworth, Reviews of Modern Physics 92, 015004 (2020).
  • Schirhagl et al. (2014) R. Schirhagl, K. Chang, M. Loretz,  and C. L. Degen, Annual review of physical chemistry 65, 83 (2014).
  • Tetienne (2021) J.-P. Tetienne, Nature Physics 17, 1074 (2021).
  • Hensen et al. (2015) B. Hensen, H. Bernien, A. E. Dréau, A. Reiserer, N. Kalb, M. S. Blok, J. Ruitenberg, R. F. Vermeulen, R. N. Schouten, C. Abellán, et al., Nature 526, 682 (2015).
  • Marti et al. (2018) G. E. Marti, R. B. Hutson, A. Goban, S. L. Campbell, N. Poli,  and J. Ye, Physical review letters 120, 103201 (2018).
  • Yan et al. (2013) B. Yan, S. A. Moses, B. Gadway, J. P. Covey, K. R. Hazzard, A. M. Rey, D. S. Jin,  and J. Ye, Nature 501, 521 (2013).
  • Childress et al. (2006) L. Childress, M. G. Dutt, J. Taylor, A. Zibrov, F. Jelezko, J. Wrachtrup, P. Hemmer,  and M. Lukin, Science 314, 281 (2006).
  • Waugh et al. (1968) J. S. Waugh, L. M. Huber,  and U. Haeberlen, Physical Review Letters 20, 180 (1968).
  • Mehring (2012) M. Mehring, Principles of high resolution NMR in solids (Springer Science & Business Media, 2012).
  • Choi et al. (2020) J. Choi, H. Zhou, H. S. Knowles, R. Landig, S. Choi,  and M. D. Lukin, Physical Review X 10, 031002 (2020).
  • Pedrozo-Peñafiel et al. (2020) E. Pedrozo-Peñafiel, S. Colombo, C. Shu, A. F. Adiyatullin, Z. Li, E. Mendez, B. Braverman, A. Kawasaki, D. Akamatsu, Y. Xiao,  and V. Vuletić, Nature 588, 414 (2020).
  • Kitagawa and Ueda (1993) M. Kitagawa and M. Ueda, Physical Review A 47, 5138 (1993).
  • Bilitewski et al. (2021) T. Bilitewski, L. De Marco, J.-R. Li, K. Matsuda, W. G. Tobias, G. Valtolina, J. Ye,  and A. M. Rey, Physical Review Letters 126, 113401 (2021).
  • Chen et al. (2020) S. Chen, M. Raha, C. M. Phenicie, S. Ourari,  and J. D. Thompson, Science 370, 592 (2020).
  • Neumann et al. (2008) P. Neumann, N. Mizuochi, F. Rempp, P. Hemmer, H. Watanabe, S. Yamasaki, V. Jacques, T. Gaebel, F. Jelezko,  and J. Wrachtrup, science 320, 1326 (2008).
  • Cappellaro and Lukin (2009) P. Cappellaro and M. D. Lukin, Physical Review A 80, 032311 (2009).
  • Choi et al. (2017a) S. Choi, N. Y. Yao,  and M. D. Lukin, arXiv:1801.00042  (2017a).
  • Cerezo et al. (2021) M. Cerezo, A. Arrasmith, R. Babbush, S. C. Benjamin, S. Endo, K. Fujii, J. R. McClean, K. Mitarai, X. Yuan, L. Cincio, et al., Nature Reviews Physics , 1 (2021).
  • Kokail et al. (2019) C. Kokail, C. Maier, R. van Bijnen, T. Brydges, M. K. Joshi, P. Jurcevic, C. A. Muschik, P. Silvi, R. Blatt, C. F. Roos, et al., Nature 569, 355 (2019).
  • Li and Benjamin (2017) Y. Li and S. C. Benjamin, Physical Review X 7, 021050 (2017).
  • Zhou et al. (2020a) L. Zhou, S.-T. Wang, S. Choi, H. Pichler,  and M. D. Lukin, Physical Review X 10, 021067 (2020a).
  • Kaubruegger et al. (2019) R. Kaubruegger, P. Silvi, C. Kokail, R. van Bijnen, A. M. Rey, J. Ye, A. M. Kaufman,  and P. Zoller, Physical review letters 123, 260505 (2019).
  • Kaubruegger et al. (2021) R. Kaubruegger, D. V. Vasilyev, M. Schulte, K. Hammerer,  and P. Zoller, Physical review X 11, 2160 (2021).
  • Marciniak et al. (2021) C. D. Marciniak, T. Feldker, I. Pogorelov, R. Kaubruegger, D. V. Vasilyev, R. van Bijnen, P. Schindler, P. Zoller, R. Blatt,  and T. Monz, arXiv:2107.01860  (2021).
  • Borish et al. (2020) V. Borish, O. Marković, J. A. Hines, S. V. Rajagopal,  and M. Schleier-Smith, Physical review letters 124, 063601 (2020).
  • Bernien et al. (2017) H. Bernien, S. Schwartz, A. Keesling, H. Levine, A. Omran, H. Pichler, S. Choi, A. S. Zibrov, M. Endres, M. Greiner, et al., Nature 551, 579 (2017).
  • Zhou et al. (2020b) H. Zhou, J. Choi, S. Choi, R. Landig, A. M. Douglas, J. Isoya, F. Jelezko, S. Onoda, H. Sumiya, P. Cappellaro, H. S. Knowles, H. Park,  and M. D. Lukin, Physical review X 10, 031003 (2020b).
  • Hansen (2016) N. Hansen, arXiv:1604.00772  (2016).
  • (30) See Supplemental Material for additional details.
  • Schirmer et al. (2001) S. G. Schirmer, H. Fu,  and A. I. Solomon, Physical Review A 63, 063410 (2001).
  • Albertini and D’Alessandro (2002) F. Albertini and D. D’Alessandro, Linear algebra and its applications 350, 213 (2002).
  • Albertini and D’Alessandro (2021a) F. Albertini and D. D’Alessandro, ScienceDirect: Systems & Control Letters 151, 104913 (2021a).
  • Kobayashi et al. (2011) H. Kobayashi, B. L. Mark,  and W. Turin, Probability, random processes, and statistical analysis (Cambridge University Press, 2011).
  • Hillery et al. (1984) M. Hillery, R. F. O’Connell, M. O. Scully,  and E. P. Wigner, Physics reports 106, 121 (1984).
  • Dowling et al. (1994) J. P. Dowling, G. S. Agarwal,  and W. P. Schleich, Physical Review A 49, 4101 (1994).
  • Koczor et al. (2020) B. Koczor, R. Zeier,  and S. J. Glaser, Physical Review A 102, 062421 (2020).
  • Giovannetti et al. (2006) V. Giovannetti, S. Lloyd,  and L. Maccone, Physical review letters 96, 010401 (2006).
  • Nielsen and Chuang (2010) M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information (Cambridge University Press, 2010).
  • Davis et al. (2017) E. Davis, G. Bentsen, T. Li,  and M. Schleier-Smith, Advances in Photonics of Quantum Computing, Memory, and Communication X 10118, 101180Z (2017).
  • Shields et al. (2015) B. J. Shields, Q. P. Unterreithmeier, N. P. de Leon, H. Park,  and M. D. Lukin, Physical review letters 114, 136402 (2015).
  • Zu et al. (2021) C. Zu, F. Machado, B. Ye, S. Choi, B. Kobrin, T. Mittiga, S. Hsieh, P. Bhattacharyya, M. Markham, D. Twitchen, A. Jarmola, D. Budker, C. R. Laumann, J. E. Moore,  and N. Y. Yao, Nature 597, 45–50 (2021).
  • Degen et al. (2021) M. Degen, S. Loenen, H. Bartling, C. Bradley, A. Meinsma, M. Markham, D. Twitchen,  and T. Taminiau, Nature Communications 12, 3470 (2021).
  • Merkel et al. (2021) B. Merkel, P. C. Fariña,  and A. Reiserer, Physical Review Letters 127, 030501 (2021).
  • Raha et al. (2020) M. Raha, S. Chen, C. M. Phenicie, S. Ourari, A. M. Dibos,  and J. D. Thompson, Nature communications 11, 1605 (2020).
  • Le Dantec et al. (2021) M. Le Dantec, M. Rančić, S. Lin, E. Billaud, V. Ranjan, D. Flanigan, S. Bertaina, T. Chanelière, P. Goldner, A. Erb, et al., Science advances 7, eabj9786 (2021).
  • Cheuk et al. (2020) L. W. Cheuk, L. Anderegg, Y. Bao, S. Burchesky, S. S. Yu, W. Ketterle, K.-K. Ni,  and J. M. Doyle, Physical review letters 125, 043401 (2020).
  • Demkowicz-Dobrzański et al. (2012) R. Demkowicz-Dobrzański, J. Kołodyński,  and M. Guţă, Nature communications 3, 1063 (2012).
  • Escher et al. (2011) B. Escher, R. de Matos Filho,  and L. Davidovich, Nature Physics 7, 406 (2011).
  • Chin et al. (2012) A. W. Chin, S. F. Huelga,  and M. B. Plenio, Physical review letters 109, 233601 (2012).
  • Smirne et al. (2016) A. Smirne, J. Kołodyński, S. F. Huelga,  and R. Demkowicz-Dobrzański, Physical review letters 116, 120801 (2016).
  • Kucsko et al. (2018) G. Kucsko, S. Choi, J. Choi, P. C. Maurer, H. Zhou, R. Landig, H. Sumiya, S. Onoda, J. Isoya, F. Jelezko, et al., Physical review letters 121, 023601 (2018).
  • (53) D. Barskiy, “Dipole-dipole interactions in NMR: explained.” (unpublished).
  • Choi et al. (2017b) S. Choi, J. Choi, R. Landig, G. Kucsko, H. Zhou, J. Isoya, F. Jelezko, S. Onoda, H. Sumiya, V. Khemani, et al., Nature 543, 221 (2017b).
  • Sutton and Barto (2018) R. S. Sutton and A. G. Barto, Reinforcement learning: An introduction (MIT press, 2018).
  • Silver et al. (2017) D. Silver, J. Schrittwieser, K. Simonyan, I. Antonoglou, A. Huang, A. Guez, T. Hubert, L. Baker, M. Lai, A. Bolton, et al., nature 550, 354 (2017).
  • Peng et al. (2021) P. Peng, X. Huang, C. Yin, L. Joseph, C. Ramanathan,  and P. Cappellaro, arXiv:2102.13161  (2021).
  • Braunstein and Caves (1994) S. L. Braunstein and C. M. Caves, Physical Review Letters 72, 3439 (1994).
  • Strobel et al. (2014) H. Strobel, W. Muessel, D. Linnemann, T. Zibold, D. B. Hume, L. Pezzè, A. Smerzi,  and M. K. Oberthaler, Science 345, 424 (2014).
  • Meyer et al. (2021) J. J. Meyer, J. Borregaard,  and J. Eisert, NPJ Quantum Information 7, 1 (2021).
  • Schuld et al. (2019) M. Schuld, V. Bergholm, C. Gogolin, J. Izaac,  and N. Killoran, Physical Review A 99, 032331 (2019).
  • (62) D. Panchenko, “Properties of MLE: consistency, asymptotic normality. Fisher information.” (unpublished).
  • Holevo (1993) A. S. Holevo, Reports on mathematical physics 32, 211 (1993).
  • Johansson et al. (2012) J. R. Johansson, P. D. Nation,  and F. Nori, Computer Physics Communications 183, 1760 (2012).
  • Wineland et al. (1994) D. J. Wineland, J. J. Bollinger, W. M. Itano,  and D. Heinzen, Physical Review A 50, 67 (1994).
  • Pezzé and Smerzi (2009) L. Pezzé and A. Smerzi, Physical review letters 102, 100401 (2009).
  • Hyllus et al. (2010) P. Hyllus, O. Gühne,  and A. Smerzi, Physical Review A 82, 012337 (2010).
  • Pezze et al. (2018) L. Pezze, A. Smerzi, M. K. Oberthaler, R. Schmied,  and P. Treutlein, Reviews of Modern Physics 90, 035005 (2018).
  • d’Alessandro (2021) D. d’Alessandro, Introduction to quantum control and dynamics (Chapman and hall/CRC, 2021).
  • Wang et al. (2016) X. Wang, D. Burgarth,  and S. Schirmer, Physical Review A 94, 052319 (2016).
  • Ramakrishna and Rabitz (1996) V. Ramakrishna and H. Rabitz, Physical Review A 54, 1715 (1996).
  • Polack et al. (2009) T. Polack, H. Suchowski,  and D. J. Tannor, Physical Review A 79, 053403 (2009).
  • Chen et al. (2017) J. Chen, H. Zhou, C. Duan,  and X. Peng, Physical Review A 95, 032340 (2017).
  • Albertini and D’Alessandro (2018) F. Albertini and D. D’Alessandro, Journal of Mathematical Physics 59, 052102 (2018).
  • Albertini and D’Alessandro (2021b) F. Albertini and D. D’Alessandro, Systems & Control Letters 151, 104913 (2021b).
  • Gao et al. (2013) Y. Gao, H. Zhou, D. Zou, X. Peng,  and J. Du, Physical Review A 87, 032335 (2013).

Supplemental Material for: Preparation of Metrological States in Dipolar Interacting Spin Systems

Designing the variational circuit

In this section, we discuss how to choose the experimentally realizable elementary gates in the variational sequence in the entangler based on limited quantum resource [Kaubruegger et al., 2019, Kaubruegger et al., 2021].

Entanglement generation gates from two-body interaction Hamiltonian and global rotations

Consider a two-body interaction Hamiltonian:

Hint=i<jVij(JISziSzj+JS𝑺i𝑺j).\displaystyle H_{\text{int}}=\sum_{i<j}V_{ij}\left(J^{\text{I}}S_{zi}S_{zj}+J^{\text{S}}\bm{S}_{i}\cdot\bm{S}_{j}\right). (S1)

In this Hamiltonian, 𝑺=(Sx,Sy,Sz)\bm{S}=(S_{x},S_{y},S_{z}) is the vector of spin-1/2 operators, VijV_{ij} is the interaction strength between spin ii and jj which depends on their locations, and JI(0),JSJ^{\text{I}}(\neq 0),J^{\text{S}} are the Ising and symmetric coupling constant respectively.

The elementary gates in each layer of the variational circuit for preparing metrological states (Fig.1(c) main text) include two free evolutions under the interaction Hamiltonian D(τ),D(τ)D(\tau),D(\tau^{\prime}), one global rotation along the xx-axis Rx(ϑ)R_{x}(\vartheta) and two fixed π/2\pi/2 rotations Ry(π2),Ry(π2)R_{y}(-\frac{\pi}{2}),R_{y}(\frac{\pi}{2}) along the yy-axis. We define the interaction gate in the zz-direction as

Dz(τ)exp(iτHint/)=exp[iτi<jVij(JISziSzj+JS𝑺i𝑺j)/].\displaystyle D_{z}(\tau)\equiv\exp(-i\tau H_{\text{int}}/\hbar)=\exp[-i\tau\sum_{i<j}V_{ij}\left(J^{\text{I}}S_{zi}S_{zj}+J^{\text{S}}\bm{S}_{i}\cdot\bm{S}_{j}\right)/\hbar]. (S2)

The interaction gates in other directions can be obtained by π/2\pi/2 rotations:

Dx,y(τ)\displaystyle D_{x,y}(\tau) =Ry,x(π/2)Dz(τ)Ry,x(π/2)\displaystyle=R_{y,x}(\pi/2)D_{z}(\tau)R_{y,x}(-\pi/2)
=exp[iτi<jVij(JISx,yiSx,yj+JS𝑺i𝑺j)/].\displaystyle=\exp[-i\tau\sum_{i<j}V_{ij}\left(J^{\text{I}}S_{x,yi}S_{x,yj}+J^{\text{S}}\bm{S}_{i}\cdot\bm{S}_{j}\right)/\hbar]. (S3)

In Eqs. (S2) (Entanglement generation gates from two-body interaction Hamiltonian and global rotations), the symmetric interaction term stay unchanged because inner product is conserved under global rotation and the ‘direction of interaction’ is only determined by the Ising term. Using these definitions, we simplify the gate set in each layer as

𝒰i\displaystyle\mathcal{U}_{i} =Ry(π2)D(τi)Ry(π2)Rx(ϑi)D(τi)\displaystyle=R_{y}\left(\frac{\pi}{2}\right)D\left(\tau^{\prime}_{i}\right)R_{y}\left(-\frac{\pi}{2}\right)R_{x}\left(\vartheta_{i}\right)D\left(\tau_{i}\right)
=Dx(τi)Rx(ϑi)Dz(τi).\displaystyle=D_{x}\left(\tau^{\prime}_{i}\right)R_{x}\left(\vartheta_{i}\right)D_{z}\left(\tau_{i}\right). (S4)

In the next two subsections, it will be shown that the sequence in Eq. (Entanglement generation gates from two-body interaction Hamiltonian and global rotations) is the most general gate set that uses only global rotations and preserves the collective spin direction along xx-direction.

Preservation of the collective spin direction

Define the x-parity operator PxΠiNσxi=PxP_{x}\equiv\Pi_{i}^{N}\sigma_{xi}=P_{x}^{\dagger}, with Px2=IP_{x}^{2}=I. This operator describes the parity of a state in xx-direction and is related to the global π\pi rotation along xx-axis up to a phase constant, Rx(π)=exp(iπiSxi)=(i)NΠiNσxiR_{x}(\pi)=\exp(-i\pi\sum_{i}S_{xi})=(-i)^{N}\Pi_{i}^{N}\sigma_{xi}. Applying the x-parity operator onto individual spin’s angular momentum operator gives PxSμjPx=(σxSμσx)j=±SμjP_{x}S_{\mu j}P_{x}=(\sigma_{x}S_{\mu}\sigma_{x})_{j}=\pm S_{\mu j}. Thus the interaction gates along xx- and zz-direction conserve the x-parity, PxDx,zPx=Dx,zP_{x}D_{x,z}P_{x}=D_{x,z}. Similarly, the only global rotation that conserves x-parity for arbitrary angles is Rx(ϑ)R_{x}(\vartheta). Then, based on Eq.(1) in the main text, the unitary operator of the whole control sequence conserves the x-parity

Px𝒮(𝜽)Px\displaystyle P_{x}\mathcal{S}(\bm{\theta})P_{x} =Px𝒰m𝒰2𝒰1Px\displaystyle=P_{x}\mathcal{U}_{m}...\mathcal{U}_{2}\mathcal{U}_{1}P_{x}
=PxΠi[Dx(τi)Rx(ϑi)Dz(τi)]Px\displaystyle=P_{x}\Pi_{i}[D_{x}\left(\tau^{\prime}_{i}\right)R_{x}\left(\vartheta_{i}\right)D_{z}\left(\tau_{i}\right)]P_{x}
=𝒮(𝜽).\displaystyle=\mathcal{S}(\bm{\theta}). (S5)

The initial spin state pointing to the +x+x-direction is an eigenstate of PxP_{x}: Px|xN=|xNP_{x}\ket{\uparrow_{x}}^{\otimes N}=\ket{\uparrow_{x}}^{\otimes N}. Thus, any state produced by this variational circuit remains an eigenstate of PxP_{x}:

Px|Ψ(𝜽)\displaystyle P_{x}\ket{\Psi(\bm{\theta})} =Px𝒮(𝜽)|xN\displaystyle=P_{x}\mathcal{S}(\bm{\theta})\ket{\uparrow_{x}}^{\otimes N}
=Px𝒮(𝜽)PxPx|xN\displaystyle=P_{x}\mathcal{S}(\bm{\theta})P_{x}P_{x}\ket{\uparrow_{x}}^{\otimes N}
=|Ψ(𝜽).\displaystyle=\ket{\Psi(\bm{\theta})}. (S6)

Now consider the expectation value of the total spin angular momentum operator JμiSμiJ_{\mu}\equiv\sum_{i}S_{\mu i} (μ{x,y,z})(\mu\in\{x,y,z\}):

Jy,z\displaystyle\langle J_{y,z}\rangle =Ψ(𝜽)|Jy,z|Ψ(𝜽)\displaystyle=\bra{\Psi(\bm{\theta})}J_{y,z}\ket{\Psi(\bm{\theta})}
=Ψ(𝜽)|PxPxJy,zPxPx|Ψ(𝜽)\displaystyle=\bra{\Psi(\bm{\theta})}P_{x}P_{x}J_{y,z}P_{x}P_{x}\ket{\Psi(\bm{\theta})}
=Jy,z=0.\displaystyle=-\langle J_{y,z}\rangle=0. (S7)

Thus, the collective spin direction 𝑱/|𝑱|\langle\bm{J}\rangle/|\langle\bm{J}\rangle| always points along the xx-direction.

Choosing the most general gate set

To preserve the collective spin direction along xx-axis, the global rotation and interaction gates that can be chosen are RxR_{x}, DxD_{x}, DD_{\perp} where DD_{\perp} stands for the interaction gates along any direction perpendicular to the xx-direction. Combining RxR_{x} and DzD_{z} can generate any DD_{\perp}, thus the simplest gate set fulfilling all the requirements is DxRxDzD_{x}R_{x}D_{z}, as described by Eq.(1) in the main text.

The derivations and results in this section about selecting the variational sequence agree with ref.[Kaubruegger et al., 2019]. However, the interaction Hamiltonian we discuss here is more general. In Eq. (S1), when JI=1,JS=0J^{\text{I}}=1,J^{\text{S}}=0, the interaction becomes Ising type interaction which is equivalent to the Rydberg interaction in ref.[Kaubruegger et al., 2019,Kaubruegger et al., 2021]. The Ising interaction can also describe spin systems with large local disorder. The optimization results are shown in the next section. When JI=3,JS=1J^{\text{I}}=3,J^{\text{S}}=-1, Eq. (S1) becomes the dipolar interaction Hamiltonian between spin-1/2 particles. When JI=2,JS=1J^{\text{I}}=2,J^{\text{S}}=-1, it becomes the dipolar interaction Hamiltonian between spin-1 particles (such as NV centers). The simulation results for this case are shown in the next section. When JI=1,JS=1J^{\text{I}}=1,J^{\text{S}}=-1, the interaction can describe the dipolar interaction between cold molecules [Yan et al., 2013].

Optimization algorithm: Covariance Matrix Adaptation Evolution Strategy

The optimization in the 3m3m dimensional parameter space is highly non-convex (Fig.1(d) in main text) due to the large inhomogeneity of the interaction strength. In our setting, the previously used Dividing Rectangles algorithm [Kaubruegger et al., 2019,Kokail et al., 2019] cannot converge to a beyond-SQL result despite large number of iterations. We address this challenge by using the Covariance Matrix Adaptation Evolution Strategy (CMA-ES) as our optimization algorithm [Hansen, 2016]. CMA-ES balances the exploration and exploitation process when searching in the parameter space so that convergence is reached after less than approximately 2,000 generations for N,m10N,m\leq 10. This corresponds to about 10810^{8} repetitions of the Ramsey experiment, which can be further reduced if collective measurement observables are measured.

We reduce the complexity of the optimization by restricting τi\tau_{i} within [0,1/f¯dd][0,1/\bar{f}_{\text{dd}}] where f¯dd\bar{f}_{\text{dd}} is the average nearest-neighbor interaction strength for the considered spin configuration. Setting a large parameter searching range for the interaction gates’ time τi\tau_{i} would potentially ensure the global maximum CFI location is included in the parameter space. However, when the upper bound of τi\tau_{i} is much bigger than 1/f¯dd1/\bar{f}_{\text{dd}}, the evolution of neighboring spin pairs is fast when sweeping τi\tau_{i}. This would introduce a huge amount of local maximum points in the parameter searching so that it is impractical for the black-box optimization algorithm to converge to that global maximum point.

Optimization results of different types of dipole-dipole interaction Hamiltonian

The magnetic dipole-dipole interaction Hamiltonian under secular approximation has the general form [Kucsko et al., 2018, Barskiy, ]:

Hdd=i<jVij(2SziSzjSxiSxjSyiSyj)\displaystyle H_{\text{dd}}=\sum_{i<j}V_{ij}(2S_{zi}S_{zj}-S_{xi}S_{xj}-S_{yi}S_{yj}) (S8)

with

Vij=i<jμ04πγiγj2|𝒓i𝒓j|3(13cosβij)2\displaystyle V_{ij}=\sum_{i<j}\frac{\mu_{0}}{4\pi}\frac{\gamma_{i}\gamma_{j}\hbar^{2}}{\left|\bm{r}_{i}-\bm{r}_{j}\right|^{3}}\frac{(1-3\cos\beta_{ij})}{2} (S9)

where μ0\mu_{0} is the vacuum permeability, γ\gamma is the geomagnetic ratio of the spin, βij\beta_{ij} is the angle between the line segment connecting (𝒓𝒊\bm{r_{i}},𝒓𝒋\bm{r_{j}}) and the direction of the bias external magnetic field (along z-direction in this case). Eq. (S8) is able to describe the dipolar interaction for the spin systems with arbitrary spin number as long as the spin angular momentum operators SμS_{\mu} obey the commutation relation [Si,Sj]=iϵijkSk[S_{i},S_{j}]=i\epsilon_{ijk}S_{k}. It applies to the spin-1/2 systems we discussed in the main text and Nitrogen-Vacancy (NV) centers which are spin-1 systems.

NV ensemble

Here we consider NV ensemble and only |ms=1\ket{m_{s}=1} and |ms=0\ket{m_{s}=0} are used as a 2-level system. The spin-1 operators are

Sx(1)=12(010101010),Sy(1)=12(0i0i0i0i0),Sz(1)=(100000001).\displaystyle S_{x}^{(1)}=\frac{1}{\sqrt{2}}\begin{pmatrix}0&1&0\\ 1&0&1\\ 0&1&0\\ \end{pmatrix},S_{y}^{(1)}=\frac{1}{\sqrt{2}}\begin{pmatrix}0&-i&0\\ i&0&-i\\ 0&i&0\\ \end{pmatrix},S_{z}^{(1)}=\begin{pmatrix}1&0&0\\ 0&0&0\\ 0&0&-1\\ \end{pmatrix}. (S10)

If we only take the |ms=1\ket{m_{s}=1}, |ms=0\ket{m_{s}=0} subspace into consideration, the relations between the ‘truncated’ spin-1 operators and the spin-1/2 operators are:

Sy(1)=2Sy(12),Sy(1)=2Sy(12),Sz(1)=I2+Sx(12)\displaystyle S_{y}^{(1)}=\sqrt{2}S_{y}^{(\frac{1}{2})},S_{y}^{(1)}=\sqrt{2}S_{y}^{(\frac{1}{2})},S_{z}^{(1)}=\frac{I}{2}+S_{x}^{(\frac{1}{2})} (S11)

Plugging Eq. (S11) into Eq. (S8), we get the effective dipole-dipole interaction Hamiltonian for NV ensemble |ms=1\ket{m_{s}=1}, |ms=0\ket{m_{s}=0} subspace [Kucsko et al., 2018,Choi et al., 2017b]:

HDD,NV=i<jVij(Szi(12)Szj(12)Sxi(12)Sxj(12)Syi(12)Syj(12))\displaystyle H_{\text{DD,NV}}=\sum_{i<j}V_{ij}(S^{(\frac{1}{2})}_{zi}S^{(\frac{1}{2})}_{zj}-S^{(\frac{1}{2})}_{xi}S^{(\frac{1}{2})}_{xj}-S^{(\frac{1}{2})}_{yi}S^{(\frac{1}{2})}_{yj}) (S12)

Fig. S1(a) shows the Classical Fisher Information (CFI) optimization results for 2D square lattice spin configuration. They are similar to the results we get in Fig.(2) of the main text for spin-1/2 systems.

Refer to caption
Figure S1: (a) Optimization results for NV-ensemble. The CFI saturates the theoretical upper bound Heisenberg Limit (HL) when the variational circuit layer number goes up from 1 to 7, and the CFI results are ‘oscillating’ for even/odd number of spins from shallow circuit. (b) Optimization results for Ising type spin interaction when there is large local disorder in the system.

Ising type interaction (large local disorder)

When the system has large local disorder, the flip-flop terms in the dipolar interaction Hamiltonian Eq. (S8) are suppressed because of the large energy gap:

HDD,Ising\displaystyle H_{\text{DD,Ising}} =iδiSzi(12)+i<jVij(2Szi(12)Szj(12)Sxi(12)Sxj(12)Syi(12)Syj(12))\displaystyle=\sum_{i}\delta_{i}S^{(\frac{1}{2})}_{zi}+\sum_{i<j}V_{ij}(2S^{(\frac{1}{2})}_{zi}S^{(\frac{1}{2})}_{zj}-S^{(\frac{1}{2})}_{xi}S^{(\frac{1}{2})}_{xj}-S^{(\frac{1}{2})}_{yi}S^{(\frac{1}{2})}_{yj})
=iδiSzi(12)+i<j2Vij(Szi(12)Szj(12)S+i(12)Sj(12)Si(12)S+j(12))\displaystyle=\sum_{i}\delta_{i}S^{(\frac{1}{2})}_{zi}+\sum_{i<j}2V_{ij}(S^{(\frac{1}{2})}_{zi}S^{(\frac{1}{2})}_{zj}-S^{(\frac{1}{2})}_{+i}S^{(\frac{1}{2})}_{-j}-S^{(\frac{1}{2})}_{-i}S^{(\frac{1}{2})}_{+j})
iδiSzi(12)+i<j2VijSzi(12)Szj(12).\displaystyle\approx\sum_{i}\delta_{i}S^{(\frac{1}{2})}_{zi}+\sum_{i<j}2V_{ij}S^{(\frac{1}{2})}_{zi}S^{(\frac{1}{2})}_{zj}. (S13)

This location-dependent single-spin energy shift (δi\delta_{i}) can be canceled by spin-echo pulse sequence where the interaction gate D(τ)D(\tau) needs to be applied:

D(τ)\displaystyle D(\tau) =Rx(π)exp[iτHDD,Ising]Rx(π)exp[iτHDD,Ising]\displaystyle=R_{x}(\pi)\exp[-i\tau H_{\text{DD,Ising}}]R_{x}(\pi)\exp[-i\tau H_{\text{DD,Ising}}]
=exp[iτi<j2VijSzi(12)Szj(12)].\displaystyle=\exp[-i\tau\sum_{i<j}2V_{ij}S^{(\frac{1}{2})}_{zi}S^{(\frac{1}{2})}_{zj}]. (S14)

Eq. (Ising type interaction (large local disorder)) is also valid when the local disorder δi\delta_{i} is comparable with the interaction strength VijV_{ij}. If there is local disorder in the dipolar-interacting spin ensemble, applying spin-echo will generate the interaction gate D(τ)D(\tau) where the local disorder terms are canceled.

The CFI optimization results by using the effective Ising type interaction Hamiltonian HDD,Ising=i<j2VijSzi(12)Szj(12)H_{\text{DD,Ising}}=\sum_{i<j}2V_{ij}S^{(\frac{1}{2})}_{zi}S^{(\frac{1}{2})}_{zj} is shown in Fig. S1 (b).

From Fig. S1, the CFI results close to the Heisenberg Limit are observed, indicating that the variational method can be applied to different kinds of spins in solid state systems and generate highly entangled state for high-precision quantum metrology. We also observe that for shallow variational circuits, the CFI ‘oscillation’ between even and odd spin numbers only appears when there are flip-flop terms in the Hamiltonian. For Ising type interaction, the ‘oscillation’ disappears.

Optimization results by using PztotP_{z}^{\text{tot}}, PzπP_{z}^{\pi} as measurement bases

Refer to caption
Figure S2: CFI optimization data for (a) 2D square lattice using observable PztotP_{z}^{\text{tot}}, (b) 3D-random configuration using observable PztotP_{z}^{\text{tot}} (averaged over 5 cases), (c) 2D square lattice using observable PzπP_{z}^{\pi}, (d) 3D-random configuration using observable PzπP_{z}^{\pi} (averaged over 5 cases).

The optimization results shown in Fig.2 in the main text are obtain by using PzP_{z} as the measurement basis for the CFI (cost function) calculation. Although measuring all the diagonal elements in the density matrix of the resulting states provides the maximum information one can get from single-qubit measurement and a large Hilbert space for the optimizer, it leads to an exponentially large (2N2^{N}) experimental repetition number when the CFI needs to be estimated from experimental data. Thus, we test the variational method on two other measurement bases which require less repetitions for readout.

The measurement basis on total spin polarization along zz-direction is given by

Pztot|J=N/2,JzJ=N/2,Jz|\displaystyle P_{z}^{\text{tot}}\equiv\ket{J=N/2,J_{z}}\bra{J=N/2,J_{z}} (S15)

where JJ is the total spin angular momentum quantum number and JzJ_{z} is the total spin angular momentum projection quantum number that runs from N/2N/2 to N/2-N/2. PztotP_{z}^{\text{tot}} has N+1N+1 outcomes, so it scales linear with the system size.

The optimization results by using the CFI on PztotP_{z}^{\text{tot}} as cost function are shown in Fig. S2 (a)(b). Surprisingly, compared to the results by using PzP_{z}, the optimization results from using PztotP_{z}^{\text{tot}} are improved by about a factor of 1.521.5\sim 2 for the 3D-random spin configuration. Since all the information one can extract from PztotP_{z}^{\text{tot}} are contained in PzP_{z}, we attribute this improvement to the simpler parameter space structure that PztotP_{z}^{\text{tot}} provides to the optimizer. Less local maximum points in the parameter space will help the optimizer to converge to a high CFI point, especially when the dimension of the parameter space (3m3m) is large.

Parity of the spin ensemble,

PzπΠiNσzi,\displaystyle P_{z}^{\pi}\equiv\Pi_{i}^{N}\sigma_{zi}, (S16)

provides a constant (22) dimensional outcome space for experimental readout. Improvements are also observed in 2D square lattice and 3D-random spin configurations (Fig. S2(c)(d)).

Supplementary Data

Complete CFI data for Fig.2 in main text

The complete data for dipolar-interacting spin systems’ CFI optimization is shown in this section. Fig. S3(a) shows the 50-cases averaged optimization results for 3D-random spin configurations, the variational circuit layer number mm is chosen from 1 to 10. The optimized CFI results are approaching to the Heisenberg Limit (HL) when more layers (mm) are used. However, when m>7m>7, the CFI results stop increasing. This CFI ‘saturation’ effect might be caused by two reasons. First, when mm is larger, the number of the local maximum points in the high dimensional parameter space increases. This could potentially cause the optimizer to stuck in the local maximum point. Sometimes, take N=7,m=10N=7,m=10 data in Fig. S3(a) as an example, adding more variational layers even leads to a lower CFI optimization result. The ‘local maximum’ problem could be solved by more advanced and powerful optimization algorithms, such as reinforcement learning [Sutton and Barto, 2018; Silver et al., 2017; Peng et al., 2021], and more computational resources. Second, the ‘saturation’ effect reflects the global maximum CFI one can reach, no matter what kind of optimization algorithm is applied. It’s still an open question what is the highest CFI the spin ensemble could reach for a given configuration.

Fig. S3(b)-(d) show the CFI optimization result for 1D chain, 2D square lattice and 2D symmetric cycle spin configurations. The results of regular patterns are better than those of 3D-random pattern.

Refer to caption
Figure S3: The complete CFI data for (a) 3D random, (b) 1D chain, (c) 2D square lattice, and (d) 2D circle.

Required layers to reach given CFI for 2D square lattice

Refer to caption
Figure S4: Left: Schematic of a 2D square lattice pattern. The numbers label the order in which spins are added to form a lattice of size NN. Right: Number of layers required to achieve a CFI within a given percentage of the HL.

As shown by the schematic on the left, the distances between spin No.4 and spin No.5, 7, and 9 are the same, so the interaction strengths between each pair are the same. Similarly, the distance between spin No.4 and spin No.2, 3, 6, and 8 are the same (smaller). Therefore, the plateau features in Fig. S4 are likely due to this symmetry: adding one more spin to the lattice does not require an extra layer to reach a given percentage of the CFI.

Orders of interaction

Due to the decaying feature (1r3\frac{1}{r^{3}}) of dipolar interaction strength, the resulting states might be mainly generated by nearest-neighbor interaction. For studying ‘how much’ interaction is essential for generating the resulting entangled states, we calculate the overlap (state fidelity [Nielsen and Chuang, 2010]) between the original state and the new state, which is generated by using the cutoff Hamiltonian and optimized parameters. A cutoff interaction strength fcutofff_{\text{cutoff}} is chosen, and all the pairwise potential VijV_{ij} smaller than fcutofff_{\text{cutoff}} are set to zero in the cutoff Hamiltonian. Fig. S5 shows the relation between the state fidelity FF versus fcutofff_{\text{cutoff}}. A state fidelity value less than 1 is observed when fcutofff_{\text{cutoff}} is set to be equal to the averaged nearest-neighbor interaction strength fddf_{\text{dd}}. This result reflects higher order interactions in the spins ensemble are utilized for the entangled state generation.

Refer to caption
Figure S5: Average state fidelity vs. different cutoff strength in HddH_{\text{dd}}. The shaded area corresponds to the error range. Data obtained from 3D-random N=10,m=5N=10,m=5, 50-cases optimization results.

Non-Markovian noise sensing performance

Refer to caption
Figure S6: Average Ramsey protocol’s results of the generated entangled states in 3D random configurations when considering non-Markovian noise in the signal accumulation step. Blue and orange correspond to two different noise models (ν=2\nu=2 and 44).

Optimized states with different readout fidelity

We run the optimization with imperfect readout for N=4N=4 and N=10N=10 2D square lattice spin configurations. The optimized states resemble GHZ states (high RF), SSS (low RF), CSS (RF close to 50%). For N=4N=4 case, the Gaussian state appears for RF lower than 92%, but for N=10N=10 case, the Gaussian states appears when RF is about 96%. We expected that for large spin system with finite RF, Gaussian states (e.g. SSS) are advantageous for quantum-enhanced metrology.

Refer to caption
Figure S7: Optimized states’ Wigner distributions when finite RF is assumed in the CFI calculation.

Relative experimental parameter table (full)

Table S1: Experimental platforms’ data
System T2(best)T_{2}^{\text{(best)}} T2(DD)T_{2}^{\text{(DD)}} f¯dd\bar{f}_{\text{dd}} PiniP_{\text{ini}} FreadoutF_{\text{readout}} ν\nu
NV ensemble 1.58(7)1.58(7)sa 7.9(2)μ7.9(2)\musb 3535kHzb 97.5%97.5\%c 97.5%97.5\%c 242-4b
P1 centers 0.80.8mse(DEER) 4.4μ4.4\musf 0.70.7kHze,0.920.92MHzf 95%95\%e 95%95\%e ?
Rare-Earth crystals 23.2±0.5ms23.2\pm 0.5msg 2.5μ2.5\mush 1.961.96MHzh 97%97\%i 94.6%94.6\%j 2.4±0.1g2.4\pm 0.1^{\text{g}}
Cold Molecules 1~{}1sk 8080msl 5252Hzl,1.51.5kHzm 97%m97\%^{\text{m}} 97%m97\%^{\text{m}} ?

a{}^{\text{a}} T.H.Taminiau, NComm 2018, b{}^{\text{b}} H.Zhou, PRX 2020, B.J.Shields, c{}^{\text{c}} M.D.Lukin, PRL 2015, d{}^{\text{d}} L.Childress Science 2006
e{}^{\text{e}} T.H.Taminiau, NComm 2021, f{}^{\text{f}} N.Yao, Nature 2021
e{}^{\text{e}} P.Bertet, Science advances 2021, h{}^{\text{h}} A.Reiserer, PRL 2021, i{}^{\text{i}} J.Thompson, Science 2020, j{}^{\text{j}} J.Thompson, NComm 2020
k{}^{\text{k}} M.R Tarbutt PRL 2020, l{}^{\text{l}} B.Yan, J.Ye, Nature 2013, m{}^{\text{m}} J Doyle, PRL 2020

Based on the simulation results shown in Fig.4(c) in main text, we need f¯ddT25\bar{f}_{dd}T_{2}\geq 5 to generate metrological states that beat the SQL. It’s worth mentioning that the T2T_{2} in this situation stands for the coherence time without the dipole-dipole interaction’s influence. During the state preparation step, the dipolar interactions between the spins are included in the system Hamiltonian for the entanglement generation (DD gate in Fig.1(c) in main text). Thus, the T2T_{2}(DD) in Table S1 is a lower bound and T2T_{2}(best) is a more precise estimation for the spin coherence time.

Supplementary Derivations

CFI with respect to angle and frequency

In general, the Classical Fisher Information (CFI) measures the sensitivity of a statistical model to small changes of a parameter θ\theta [Braunstein and Caves, 1994, Strobel et al., 2014]. Let ZZ be a random variable and Pz(θ)P(z|θ)P_{z}(\theta)\equiv P(z|\theta) be its probability distribution which depends on θ\theta. Let Θ\Theta be an unbiased estimator of θ\theta, i.e.

θ=Θ=zΘPz(θ).\displaystyle\theta=\langle\Theta\rangle=\sum_{z}\Theta\cdot P_{z}(\theta). (S17)

From Eq. (S17) and the fact that the sum of probabilities of all outcomes is 11,

1\displaystyle 1 =Θθ=θzΘPz(θ),\displaystyle=\frac{\partial\langle\Theta\rangle}{\partial\theta}=\frac{\partial}{\partial\theta}\sum_{z}\Theta P_{z}(\theta), (S18)
0\displaystyle 0 =θzPz(θ).\displaystyle=\frac{\partial}{\partial\theta}\sum_{z}P_{z}(\theta). (S19)

Subtracting Eq. (S19) multiplied by θ\theta from Eq. (S18), we get

1\displaystyle 1 =z(Θθ)θPz(θ)\displaystyle=\sum_{z}(\Theta-\theta)\frac{\partial}{\partial\theta}P_{z}(\theta)
=zPz(θ)(Θθ)1Pz(θ)θPz(θ)\displaystyle=\sum_{z}P_{z}(\theta)(\Theta-\theta)\frac{1}{P_{z}(\theta)}\frac{\partial}{\partial\theta}P_{z}(\theta)
=(Θθ)1Pz(θ)θPz(θ)\displaystyle=\langle(\Theta-\theta)\frac{1}{P_{z}(\theta)}\frac{\partial}{\partial\theta}P_{z}(\theta)\rangle
=(Θθ)θlogPz(θ).\displaystyle=\langle(\Theta-\theta)\frac{\partial}{\partial\theta}\log P_{z}(\theta)\rangle. (S20)

Letting X=ΘθX=\Theta-\theta and Y=θlogPz(θ)Y=\frac{\partial}{\partial\theta}\log P_{z}(\theta), by the Cauchy-Schwartz inequality for random variables: XY2X2Y2\langle XY\rangle^{2}\leq\langle X^{2}\rangle\langle Y^{2}\rangle, we have

(Θθ)2(θlogPz(θ))21,\displaystyle\langle(\Theta-\theta)^{2}\rangle\bigg{\langle}\left(\frac{\partial}{\partial\theta}\log P_{z}(\theta)\right)^{2}\bigg{\rangle}\geq 1, (S21)

where

(Θθ)2\displaystyle\langle(\Theta-\theta)^{2}\rangle =Θ2(2θΘθ2)\displaystyle=\langle\Theta^{2}\rangle-(2\theta\langle\Theta\rangle-\langle\theta^{2}\rangle)
=Θ2(2θ2θ2)\displaystyle=\langle\Theta^{2}\rangle-(2\theta^{2}-\theta^{2})
=Θ2Θ2\displaystyle=\langle\Theta^{2}\rangle-\langle\Theta\rangle^{2}
=ΔΘ2\displaystyle=\Delta\Theta^{2} (S22)

is the variance of Θ\Theta. Defining

CFI=zPz(θ)(θlogPz(θ))2,\displaystyle\mathrm{CFI}=\sum_{z}P_{z}(\theta)\left(\frac{\partial}{\partial\theta}\log P_{z}(\theta)\right)^{2}, (S23)

we have

ΔΘ21CFI.\displaystyle\Delta\Theta^{2}\geq\frac{1}{\mathrm{CFI}}. (S24)

If the measurement is repeated MM times, then by the additive property of CFI, we obtain the Cramér-Rao bound:

ΔΘ21MCFI.\Delta\Theta^{2}\geq\frac{1}{M\cdot\mathrm{CFI}}. (S25)

In our variational circuit, we use CFI with respect to an infinitesimal angle ϕ\phi as the cost function to generate entangled states. In our program, we use a method similar to parameter shift to calculate the CFIϕ\mathrm{CFI}_{\phi} of our optimized states [Cerezo et al., 2021,Meyer et al., 2021,Schuld et al., 2019]. In the following notation,

  1. 1.

    zz represents a multi-qubit state in the z-basis;

  2. 2.

    𝒰(ϕ)=eiϕJy\mathcal{U}(\phi)=e^{-i\phi J_{y}} is the rotation operator where ϕ\phi is a small angle;

  3. 3.

    ψ\psi is the state we create from the variational circuit;

  4. 4.

    Pz(θ)P_{z}(\theta) is the probability of measuring the state zz with the state after rotation.

Then

ϕPz(ϕ)|ϕ0=\displaystyle\frac{\partial}{\partial\phi}P_{z}(\phi)\Bigr{\rvert}_{\phi\rightarrow 0}= ϕ|z|𝒰(ϕ)|ψ|2|ϕ0\displaystyle\frac{\partial}{\partial\phi}|\langle z|\mathcal{U}(\phi)|\psi\rangle|^{2}\Bigr{\rvert}_{\phi\rightarrow 0}
=\displaystyle= ϕψ|𝒰(ϕ)|zz|𝒰(ϕ)|ψ|ϕ0\displaystyle\frac{\partial}{\partial\phi}\langle\psi|\mathcal{U}^{\dagger}(\phi)|z\rangle\langle z|\mathcal{U}(\phi)|\psi\rangle\Bigr{\rvert}_{\phi\rightarrow 0}
=\displaystyle= ψ|𝒰(ϕ)iJy|zz|𝒰(ϕ)|ψ|ϕ0+ψ|𝒰(ϕ)|zz|𝒰(ϕ)(i)Jy|ψ|ϕ0\displaystyle\langle\psi|\mathcal{U}^{\dagger}(\phi)iJ_{y}|z\rangle\langle z|\mathcal{U}(\phi)|\psi\rangle\Bigr{\rvert}_{\phi\rightarrow 0}+\langle\psi|\mathcal{U}^{\dagger}(\phi)|z\rangle\langle z|\mathcal{U}(\phi)(-i)J_{y}|\psi\rangle\Bigr{\rvert}_{\phi\rightarrow 0}
=\displaystyle= iψ|(Jy|zz||zz|Jy)|ψ.\displaystyle i\bra{\psi}\bigg{(}J_{y}\ket{z}\bra{z}-\ket{z}\bra{z}J_{y}\bigg{)}\ket{\psi}. (S26)

Note that assuming the rotation operator 𝒰(ϕ)=eiϕJy𝒰y(ϕ)\mathcal{U}(\phi)=e^{-i\phi J_{y}}\equiv\mathcal{U}_{y}(\phi) along yy-axis is for calculation simplicity. In experiments, the signal (e.g. the external B-field) usually induces a rotation along zz-axis, 𝒰z(ϕ)=eiϕJz\mathcal{U}_{z}(\phi)=e^{-i\phi J_{z}}. It’s equivalent to assume that the prepared state is firstly rotated by a Rx(π/2)R_{x}(\pi/2) pulse and then accumulates a signal ϕ\phi along yy-axis, or firstly accumulates a signal along zz-axis and then rotated by Rx(π/2)R_{x}(-\pi/2) pulse [Strobel et al., 2014]. In another word, Rx(π/2)𝒰z(ϕ)=𝒰y(ϕ)Rx(π/2)R_{x}(-\pi/2)\mathcal{U}_{z}(\phi)=\mathcal{U}_{y}(\phi)R_{x}(\pi/2), so the signal accumulation process we assumed in the calculation is able to simulate the experiments.

After creating the entangled states, we want to know how useful they are in a Ramsey spectroscopy, where the signal we want to detect is a frequency ω\omega. By the same calculation as above except the difference that we take derivative with respect to ω=ϕtR\omega=\frac{\phi}{t_{\text{R}}} where tRt_{\text{R}} is the Ramsey sensing time, we have

CFIω=CFIϕtR2.\displaystyle\mathrm{CFI}_{\omega}=\mathrm{CFI}_{\phi}\cdot t_{\text{R}}^{2}. (S27)

Relation beteen CFIω\text{CFI}_{\omega} and SNR in single qubit Ramsey experiment

We illustrate the Ramsey protocol for a single qubit.

  1. 1.

    The qubit is initialized into the ground state |0\ket{0}.

  2. 2.

    A π2\frac{\pi}{2} pulse along the y-direction is applied to transform it into a superposition state 12(|0+|1)\frac{1}{\sqrt{2}}(\ket{0}+\ket{1}). Its matrix form is

    ρ(t)=12(1111).\displaystyle\rho(t)=\frac{1}{2}\begin{pmatrix}1&1\\ 1&1\end{pmatrix}. (S28)
  3. 3.

    After evolving under noise and a signal with frequency ω\omega for time tt, its state becomes

    ρ(t)=12(1eiωte2γteiωte2γt1)\displaystyle\rho(t)=\frac{1}{2}\begin{pmatrix}1&e^{-i\omega t}e^{-2\gamma t}\\ e^{i\omega t}e^{-2\gamma t}&1\end{pmatrix} (S29)

    where γ\gamma is the decoherence rate.

  4. 4.

    A second π2\frac{\pi}{2} pulse along the x-direction is applied for readout. The qubit is then in the state

    Rx(π2)ρ(t)Rx(π2)\displaystyle R_{x}\left(\frac{\pi}{2}\right)\rho(t)R_{x}^{\dagger}\left(\frac{\pi}{2}\right) (S30)

    .

  5. 5.

    After the rotation, the probability of the qubit being in the ground state is

    P0=12+12e2γtsin(ωt).\displaystyle P_{0}=\frac{1}{2}+\frac{1}{2}e^{-2\gamma t}\sin{\omega t}. (S31)

The CFI with respect to ω\omega is

CFIω\displaystyle\mathrm{CFI}_{\omega} =1P0(P0ω)2+1P1(P1ω)2=t2cos2ωte4γtsin2ωt.\displaystyle=\frac{1}{P_{0}}\left(\frac{\partial P_{0}}{\partial\omega}\right)^{2}+\frac{1}{P_{1}}\left(\frac{\partial P_{1}}{\partial\omega}\right)^{2}=\frac{t^{2}\cos^{2}{\omega t}}{e^{4\gamma t}-\sin^{2}{\omega t}}. (S32)

Assuming only quantum projection noise, the Signal-to-Noise Ratio (SNR) is δP01MP0(1P0)\frac{\delta P_{0}}{\sqrt{\frac{1}{M}P_{0}(1-P_{0})}} where MM is the total number of measurements. Then

SNR2=Mt2cos2ωtδω2e4γtsin2ωt.\displaystyle\mathrm{SNR}^{2}=\frac{Mt^{2}\cos^{2}{\omega t}\delta\omega^{2}}{e^{4\gamma t}-\sin^{2}{\omega t}}. (S33)

Assuming no time overhead, i.e., M=TtottRM=\frac{T_{\text{tot}}}{t_{\text{R}}} where TtotT_{\text{tot}} is the total measurement time and tRt_{\text{R}} is the time between Ramsey pulses, we obtain the relationship

CFIωTtottRδω2=SNR2.\mathrm{CFI}_{\omega}\cdot\frac{T_{\text{tot}}}{t_{\text{R}}}\cdot\delta\omega^{2}=\mathrm{SNR}^{2}. (S34)

In unit time (Ttot=1T_{\text{tot}}=1), when SNR=1=1, the smallest signal we can measure is

δω=1MCFIω,\displaystyle\delta\omega=\frac{1}{\sqrt{M\cdot\mathrm{CFI}_{\omega}}}, (S35)

leading to the saturated Cramér-Rao bound.

Maximum Likelihood Estimator

Since a measurement collapses a quantum state to an eigenstate of the observable, it’s impossible to directly measure P(θ)P(\theta). In experiments, we repeat the sequence to obtain the results for estimating the P(θ)P(\theta) and then get an estimate value of θ\theta. To understand the relation between the variance of the estimation and CFI, we introduce the Maximum Likelihood Estimator (MLE), which has asymptotic properties to saturate the Cramér-Rao bound. Below we summarize the proof given in [Panchenko, ].

Let 𝑿={X1,X2,,XM}\bm{X}=\{X_{1},X_{2},...,X_{M}\} be a collection of independent and identically distributed (i.i.d.) random variables with a parametric family of probability distributions {P(X|θ)|θΘ}\{P(X|\theta)|\theta\in\Theta\}, where θ\theta is an unknown parameter and Θ\Theta is the parameter space. Let 𝒙={x1,x2,,xM|xiXi}\bm{x}=\{x_{1},x_{2},...,x_{M}|x_{i}\in X_{i}\} be the experimental data set from MM repetitions. The goal is to estimate θ\theta (the signal we want to measure) from 𝒙\bm{x}, i.e., find θ\theta that is most likely to produce the outcome 𝒙\bm{x}. Thus, the normalized log-likelihood function is defined as

LM(θ)\displaystyle L_{M}(\theta) =1MlogP(𝑿|θ)=1Mlogi=1MP(Xi|θ)=1Mi=1MlogP(Xi|θ).\displaystyle=\frac{1}{M}\log P(\bm{X}|\theta)=\frac{1}{M}\log\prod_{i=1}^{M}P(X_{i}|\theta)=\frac{1}{M}\sum_{i=1}^{M}\log P(X_{i}|\theta). (S36)

A MLE maximizes the log-likelihood function

ΘMLE=argmaxθΘLM(θ).\Theta_{\mathrm{MLE}}=\operatorname*{argmax}_{\theta\in\Theta}L_{M}(\theta). (S37)

In the following, we first show that

  1. 1.

    ΘMLE\Theta_{\mathrm{MLE}} converges to the true parameter θ0\theta_{0};

  2. 2.

    the distribution of M(ΘMLEθ0)\sqrt{M}(\Theta_{\mathrm{MLE}}-\theta_{0}) tends to a normal distribution 𝒩(0,1CFIθ0)\mathcal{N}\left(0,\frac{1}{\mathrm{CFI}_{\theta_{0}}}\right) as MM increases.

In other words, not only does the MLE converge to the true parameter, it converges at a rate 1M\frac{1}{\sqrt{M}}.

Define

L(θ)=logP(𝑿|θ)θ0\displaystyle L(\theta)=\langle\log P(\bm{X}|\theta)\rangle_{\theta_{0}} (S38)

which denotes the expected log-likelihood function with respect to θ0\theta_{0}, then by the Weak Law of Large Numbers (WLLN), the average outcomes from a large number of trials should approach the expected value:

θ,LM(θ)ML(θ).\forall\theta,L_{M}(\theta)\xrightarrow{\mathit{M\rightarrow\infty}}L(\theta). (S39)

In fact, θ0\theta_{0} maximizes L(θ)L(\theta):

θ,L(θ)L(θ0)\displaystyle\forall\theta,L(\theta)-L(\theta_{0}) =logP(𝑿|θ)θ0logP(𝑿|θ0)θ0\displaystyle=\langle\log P(\bm{X}|\theta)\rangle_{\theta_{0}}-\langle\log P(\bm{X}|\theta_{0})\rangle_{\theta_{0}}
=logP(𝑿|θ)P(𝑿|θ0)θ0\displaystyle=\bigg{\langle}\log\frac{P(\bm{X}|\theta)}{P(\bm{X}|\theta_{0})}\bigg{\rangle}_{\theta_{0}}
P(𝑿|θ)P(𝑿|θ0)1θ0\displaystyle\leq\bigg{\langle}\frac{P(\bm{X}|\theta)}{P(\bm{X}|\theta_{0})}-1\bigg{\rangle}_{\theta_{0}}
=𝒙𝑿(P(𝒙|θ)P(𝒙|θ0)1)P(𝒙|θ0)\displaystyle=\sum_{\bm{x}\in\bm{X}}\left(\frac{P(\bm{x}|\theta)}{P(\bm{x}|\theta_{0})}-1\right)P(\bm{x}|\theta_{0})
=11=0.\displaystyle=1-1=0. (S40)

Moreover, we show that θ0\theta_{0} is the unique maximizer. Jensen’s inequality states that for a strictly convex function ff and a random variable YY,

f(Y)>f(Y).\displaystyle\langle f(Y)\rangle>f(\langle Y\rangle). (S41)

Taking f(y)=logyf(y)=-\log y and P(𝑿|θ)P(𝑿|θ0)P(\bm{X}|\theta)\neq P(\bm{X}|\theta_{0}), we have

logP(𝑿|θ)P(𝑿|θ0)θ0>logP(𝑿|θ)P(𝑿|θ0)θ0=0,\bigg{\langle}-\log\frac{P(\bm{X}|\theta)}{P(\bm{X}|\theta_{0})}\bigg{\rangle}_{\theta_{0}}>-\log\langle\frac{P(\bm{X}|\theta)}{P(\bm{X}|\theta_{0})}\bigg{\rangle}_{\theta_{0}}=0, (S42)

or

L(θ0)>L(θ).L(\theta_{0})>L(\theta). (S43)

Therefore, since

  1. 1.

    ΘMLE\Theta_{\mathrm{MLE}} maximizes LM(θ)L_{M}(\theta),

  2. 2.

    θ0\theta_{0} maximizes L(θ)L(\theta), and

  3. 3.

    LM(θ)ML(θ)L_{M}(\theta)\xrightarrow{\mathit{M\rightarrow\infty}}L(\theta),

ΘMLE\Theta_{\mathrm{MLE}} converges to θ0\theta_{0}.

Now we use this property to prove that the distribution of ΘMLE\Theta_{\mathrm{MLE}} tends to the desired normal distribution, where we will apply the Central Limit Theorem (CLT): Suppose 𝑿={X1,,XM}\bm{X}=\{X_{1},...,X_{M}\} is a sequence of i.i.d. random variables with Xi=μ\langle X_{i}\rangle=\mu and Var(Xi)=σ2<\mathrm{Var}(X_{i})=\sigma^{2}<\infty. Then as MM\rightarrow\infty, the random variable M(𝑿¯μ)\sqrt{M}(\bar{\bm{X}}-\mu) converges in distribution to a normal 𝒩(0,σ2)\mathcal{N}(0,\sigma^{2}).

We start with the Mean Value Theorem for the function LML_{M}^{\prime}, the derivative of LML_{M} (continuous by assumption), on the interval [ΘMLE,θ0][\Theta_{\mathrm{MLE}},\theta_{0}]:

0=LM(ΘMLE)=LM(θ0)+LM′′(θ1)(θ0ΘMLE)\displaystyle 0=L_{M}^{\prime}(\Theta_{\mathrm{MLE}})=L_{M}^{\prime}(\theta_{0})+L_{M}^{\prime\prime}(\theta_{1})(\theta_{0}-\Theta_{\mathrm{MLE}})
θ0ΘMLE=LM(θ0)LM′′(θ1)\displaystyle\implies\theta_{0}-\Theta_{\mathrm{MLE}}=-\frac{L_{M}^{\prime}(\theta_{0})}{L_{M}^{\prime\prime}(\theta_{1})}
M(θ0ΘMLE)=MLM(θ0)LM′′(θ1)\displaystyle\implies\sqrt{M}(\theta_{0}-\Theta_{\mathrm{MLE}})=-\sqrt{M}\frac{L_{M}^{\prime}(\theta_{0})}{L_{M}^{\prime\prime}(\theta_{1})} (S44)

for some θ1[ΘMLE,θ0]\theta_{1}\in[\Theta_{\mathrm{MLE}},\theta_{0}]. We analyze the numerator and denominator respectively. The numerator

LM(θ0)=\displaystyle L_{M}^{\prime}(\theta_{0})= 1Mi=1M(logP(Xi|θ0))\displaystyle\frac{1}{M}\sum_{i=1}^{M}\left(\log P(X_{i}|\theta_{0})\right)^{\prime}
=\displaystyle= 1Mi=1M(logP(Xi|θ0))L(θ0)\displaystyle\frac{1}{M}\sum_{i=1}^{M}\left(\log P(X_{i}|\theta_{0})\right)^{\prime}-L^{\prime}(\theta_{0})
=\displaystyle= 1Mi=1M(logP(Xi|θ0))(logP(𝑿|θ0))θ0\displaystyle\frac{1}{M}\sum_{i=1}^{M}\left(\log P(X_{i}|\theta_{0})\right)^{\prime}-\langle\left(\log P(\bm{X}|\theta_{0})\right)^{\prime}\rangle_{\theta_{0}}
=\displaystyle= 1M(i=1MlogP(Xi|θ0))(logP(Xi|θ0))θ0\displaystyle\frac{1}{M}\left(\sum_{i=1}^{M}\log P(X_{i}|\theta_{0})\right)^{\prime}-\langle\left(\log P(X_{i}|\theta_{0})\right)^{\prime}\rangle_{\theta_{0}} (S45)

where the last equality is obtained from the linearity of expected value and derivative. By the CLT, the distribution of MLM(θ0)\sqrt{M}L_{M}^{\prime}(\theta_{0}) converges to

𝒩(0,Varθ0(logP(Xi|θ0)))\mathcal{N}\bigg{(}0,\mathrm{Var}_{\theta_{0}}(\log P(X_{i}|\theta_{0}))^{\prime}\bigg{)} (S46)

where the variance

Varθ0\displaystyle\mathrm{Var}_{\theta_{0}} (logP(Xi|θ0))=[(logP(Xi|θ0))]2θ0(logP(Xi|θ0)θ02\displaystyle(\log P(X_{i}|\theta_{0}))^{\prime}=\langle[(\log P(X_{i}|\theta_{0}))^{\prime}]^{2}\rangle_{\theta_{0}}-\langle(\log P(X_{i}|\theta_{0})^{\prime}\rangle^{2}_{\theta_{0}}
=xX1P(x|θ0)(P(x|θ0)P(x|θ0))2(L(θ0))2\displaystyle=\sum_{x\in X_{1}}P(x|\theta_{0})\left(\frac{P^{\prime}(x|\theta_{0})}{P(x|\theta_{0})}\right)^{2}-(L^{\prime}(\theta_{0}))^{2}
=CFIθ0\displaystyle=\mathrm{CFI}_{\theta_{0}} (S47)

by the definition of CFI and that θ0\theta_{0} maximizes L(θ)L(\theta). By the consistency property, ΘMLE\Theta_{\mathrm{MLE}} converges to θ0\theta_{0}, and thus θ1\theta_{1} converges to θ0\theta_{0}. The denominator

LM′′(θ1)\displaystyle L_{M}^{\prime\prime}(\theta_{1}) LM′′(θ0)=1Mi=1M[logP(Xi|θ0)]′′[logP(X1|θ0)]′′θ0\displaystyle\rightarrow L_{M}^{\prime\prime}(\theta_{0})=\frac{1}{M}\sum_{i=1}^{M}[\log P(X_{i}|\theta_{0})]^{\prime\prime}\rightarrow\langle[\log P(X_{1}|\theta_{0})]^{\prime\prime}\rangle_{\theta_{0}} (S48)

by the WLLN. We further show that Eq. (S48) is in fact the additive inverse of CFI:

[logP(X1\displaystyle\langle[\log P(X_{1} |θ0)]′′θ0=2θ2logP(X1|θ0)θ0\displaystyle|\theta_{0})]^{\prime\prime}\rangle_{\theta_{0}}=\bigg{\langle}\frac{\partial^{2}}{\partial\theta^{2}}\log P(X_{1}|\theta_{0})\bigg{\rangle}_{\theta_{0}}
=xX1[logP(x|θ0)]′′P(x|θ0)\displaystyle=\sum_{x\in X_{1}}[\log P(x|\theta_{0})]^{\prime\prime}P(x|\theta_{0})
=xX1(P′′(x|θ0)P(x|θ0)(P(x|θ0)P(x|θ0))2)P(x|θ0)\displaystyle=\sum_{x\in X_{1}}\left(\frac{P^{\prime\prime}(x|\theta_{0})}{P(x|\theta_{0})}-\left(\frac{P^{\prime}(x|\theta_{0})}{P(x|\theta_{0})}\right)^{2}\right)P(x|\theta_{0})
=xX1P′′(x|θ0)xX1(P(x|θ0))2P(x|θ0)\displaystyle=\sum_{x\in X_{1}}P^{\prime\prime}(x|\theta_{0})-\sum_{x\in X_{1}}\frac{(P^{\prime}(x|\theta_{0}))^{2}}{P(x|\theta_{0})}
=0CFIθ0=CFIθ0.\displaystyle=0-\mathrm{CFI}_{\theta_{0}}=-\mathrm{CFI}_{\theta_{0}}. (S49)

Finally, Eq. (Maximum Likelihood Estimator) becomes

M(θ0ΘMLE)\displaystyle\sqrt{M}(\theta_{0}-\Theta_{\mathrm{MLE}}) 𝑝𝒩(0,CFIθ0CFIθ02)=𝒩(0,1CFIθ0)\displaystyle\overset{p}{\to}\mathcal{N}\left(0,\frac{\mathrm{CFI}_{\theta_{0}}}{\mathrm{CFI}_{\theta_{0}}^{2}}\right)=\mathcal{N}\left(0,\frac{1}{\mathrm{CFI}_{\theta_{0}}}\right)
ΘMLE\displaystyle\implies\Theta_{\mathrm{MLE}} 𝑝𝒩(θ0,1MCFIθ0)\displaystyle\overset{p}{\to}\mathcal{N}\left(\theta_{0},\frac{1}{M\cdot\mathrm{CFI}_{\theta_{0}}}\right) (S50)

Thus, the MLE is asymptotically unbiased and saturates the Cramér-Rao bound.

Master equation for a non-Markovian environment

To simulate the performance of our optimized states during the Ramsey measurement with non-Markovian noise, we use a time-local master equation given by [Smirne et al., 2016]. A brief summary of the derivation is given below.

  1. 1.

    Let (d)\mathcal{L}(\mathbb{C}^{d}) be the Hilbert space of linear operators acting on d\mathbb{C}^{d}, where the inner product is defined as σ,τ=Tr(στ)\langle\sigma,\tau\rangle=\text{Tr}(\sigma^{\dagger}\tau) (the Hilbert-Schmidt inner product).

  2. 2.

    Let (d)\mathcal{LL}(\mathbb{C}^{d}) be the Hilbert space of linear operators acting on (d)\mathcal{L}(\mathbb{C}^{d}) which has dimension d2×d2d^{2}\times d^{2}. Let {li}i=1,,d2\{l_{i}\}_{i=1,...,d^{2}} be an orthonormal basis of (d)\mathcal{LL}(\mathbb{C}^{d}). Then the action of Λ(d)\Lambda\in\mathcal{LL}(\mathbb{C}^{d}) on τ(d)\tau\in\mathcal{L}(\mathbb{C}^{d}) can be expressed as

    Λ[τ]=ij=1d2li,Λ[lj]lj,τli.\displaystyle\Lambda[\tau]=\sum_{ij=1}^{d^{2}}\langle l_{i},\Lambda[l_{j}]\rangle\langle l_{j},\tau\rangle l_{i}. (S51)

    Thus, Λ\Lambda has a unique correspondence with the matrix Λ\mathsf{\Lambda} with entries

    Λijli,Λ[lj].\displaystyle\mathsf{\Lambda}_{ij}\equiv\langle l_{i},\Lambda[l_{j}]\rangle. (S52)
  3. 3.

    Λ(d)\Lambda\in\mathcal{LL}(\mathbb{C}^{d}) is trace- and hermicity-preserving if and only if its matrix representation Λ\mathsf{\Lambda} can be written as

    (1𝟎𝗺𝗠),\displaystyle\begin{pmatrix}1&\bm{0}\\ \mathsf{\bm{m}}&\mathsf{\bm{M}}\end{pmatrix}, (S53)

    where 𝟎\bm{0} is the zero row vector of length d21d^{2}-1, 𝗺\mathsf{\bm{m}} is a real column vector of length d21d^{2}-1, and 𝗠\mathsf{\bm{M}} is a (d21)(d21)(d^{2}-1)(d^{2}-1) real matrix.

  4. 4.

    For a single qubit, any operator ρ\rho on 2\mathbb{C}^{2} can be written as

    ρ=12(𝑰+𝒗𝝈)\displaystyle\rho=\frac{1}{2}(\bm{I}+\bm{v}\cdot\bm{\sigma}) (S54)

    where 𝒗\bm{v} is a three-dimensional real vector and 𝝈\bm{\sigma} is the vector of Pauli matrices. Then a map Λ\Lambda whose matrix representation is given by Eq. (S53) acting on ρ\rho gives

    Λ[ρ]=12(𝑰+(𝗺+𝗠𝒗)𝝈).\displaystyle\Lambda[\rho]=\frac{1}{2}(\bm{I}+(\mathsf{\bm{m}}+\mathsf{\bm{M}}\bm{v})\cdot\bm{\sigma}). (S55)
  5. 5.

    The noisy evolution of a state ρ\rho is described by

    ρ(t)=Λ(t)[ρ(0)].\displaystyle\rho(t)=\Lambda(t)[\rho(0)]. (S56)

    The time local master equation satisfies

    ddtρ(t)=Ξ(t)[ρ(t)].\displaystyle\frac{d}{dt}\rho(t)=\Xi(t)[\rho(t)]. (S57)

    So

    Ξ(t)=dΛ(t)dtΛ(t)1\displaystyle\Xi(t)=\frac{d\Lambda(t)}{dt}\circ\Lambda(t)^{-1} (S58)

    with the corresponding matrix representation

    Ξ(t)=dΛ(t)dtΛ(t)1.\displaystyle\mathsf{\Xi}(t)=\frac{d\mathsf{\Lambda}(t)}{dt}\mathsf{\Lambda}(t)^{-1}. (S59)
  6. 6.

    Consider the evolution of one qubit described by Λ(t)=𝒰(t)Γ(t)\Lambda(t)=\mathcal{U}(t)\circ\Gamma(t) . 𝒰(t)\mathcal{U}(t) is defined as

    𝒰(t)[ρ(0)]U(t)ρ(0)U(t)\displaystyle\mathcal{U}(t)[\rho(0)]\equiv U(t)\rho(0)U^{\dagger}(t) (S60)

    where U(t)=eiωt2σzU(t)=e^{-i\frac{\omega t}{2}\sigma_{z}} represents the signal accumulation. By Eq. (S51) and Eq. (S60), the matrix representation of 𝒰(t)\mathcal{U}(t) is

    𝖴(t)=(10000cos(ωt)sin(ωt)00sin(ωt)cos(ωt)00001).\displaystyle\mathsf{U}(t)=\begin{pmatrix}1&0&0&0\\ 0&\cos{\omega t}&-\sin{\omega t}&0\\ 0&\sin{\omega t}&\cos{\omega t}&0\\ 0&0&0&1\end{pmatrix}. (S61)

    Γ(t)\Gamma(t) represents the noise which is trace- and hermicity- preserving, i.e., has the form in Eq. (S53).

  7. 7.

    Solving the commutation relation that gives phase covariant qubit map [Smirne et al., 2016,Holevo, 1993]

    [𝒰(t),Γ(t)]=0[𝖴(t),Γ(t)]=0,\displaystyle[\mathcal{U}(t),\Gamma(t)]=0\iff[\mathsf{U}(t),\mathsf{\Gamma}(t)]=0, (S62)

    we obtain the matrix representation of Λ(t)\Lambda(t):

    Λ(t)=(10000η(t)cos(ωt)η(t)sin(ωt)00η(t)sin(ωt)η(t)cos(ωt)0κ(t)00η(t)),\displaystyle\mathsf{\Lambda}(t)=\begin{pmatrix}1&0&0&0\\ 0&\eta_{\perp}(t)\cos{\omega t}&-\eta_{\perp}(t)\sin{\omega t}&0\\ 0&\eta_{\perp}(t)\sin{\omega t}&\eta_{\perp}(t)\cos{\omega t}&0\\ \kappa(t)&0&0&\eta_{\parallel}(t)\end{pmatrix}, (S63)

    where 𝗺=(0,0,κ(t))T\mathsf{\bm{m}}=(0,0,\kappa(t))^{T} describes a translation along the zz-axis, and 𝗠=(η(t)cos(ωt)η(t)sin(ωt)0η(t)sin(ωt)η(t)cos(ωt)000η(t))\mathsf{\bm{M}}=\begin{pmatrix}\eta_{\perp}(t)\cos{\omega t}&-\eta_{\perp}(t)\sin{\omega t}&0\\ \eta_{\perp}(t)\sin{\omega t}&\eta_{\perp}(t)\cos{\omega t}&0\\ 0&0&\eta_{\parallel}(t)\end{pmatrix} describes a rotation along the zz-axis and a contraction characterized by η\eta_{\perp} and η\eta_{\parallel}.

  8. 8.

    By Eq. (S59), we obtain the time-local master equation for a single qubit:

    Ξ(t)[ρ(t)]=\displaystyle\Xi(t)[\rho(t)]= i2ω[σz,ρ(t)]\displaystyle-\frac{i}{2}\omega[\sigma_{z},\rho(t)]
    +γ+(t)(σ+ρ(t)σ12{σσ+,ρ(t)})\displaystyle+\gamma_{+}(t)(\sigma_{+}\rho(t)\sigma_{-}-\frac{1}{2}\{\sigma_{-}\sigma_{+},\rho(t)\})
    +γ(t)(σρ(t)σ+12{σ+σ,ρ(t)})\displaystyle+\gamma_{-}(t)(\sigma_{-}\rho(t)\sigma_{+}-\frac{1}{2}\{\sigma_{+}\sigma_{-},\rho(t)\})
    +γz(t)(σzρ(t)σzρ(t)),\displaystyle+\gamma_{z}(t)(\sigma_{z}\rho(t)\sigma_{z}-\rho(t)), (S64)

    where

    γ+(t)\displaystyle\gamma_{+}(t) =12(κ(t)η(t)η(t)(κ(t)+1)),\displaystyle=\frac{1}{2}\left(\kappa^{\mathrm{{}^{\prime}}}(t)-\frac{\eta^{\mathrm{{}^{\prime}}}_{\mathrm{\parallel}}(t)}{\eta_{\parallel}(t)}(\kappa(t)+1)\right), (S65)
    γ(t)\displaystyle\gamma_{-}(t) =12(κ(t)+η(t)η(t)(1κ(t))),\displaystyle=-\frac{1}{2}\left(\kappa^{\mathrm{{}^{\prime}}}(t)+\frac{\eta^{\mathrm{{}^{\prime}}}_{\mathrm{\parallel}}(t)}{\eta_{\parallel}(t)}(1-\kappa(t))\right), (S66)
    γz(t)\displaystyle\gamma_{z}(t) =14(η(t)η(t)2η(t)η(t)).\displaystyle=\frac{1}{4}\left(\frac{\eta^{\mathrm{{}^{\prime}}}_{\mathrm{\parallel}}(t)}{\eta_{\parallel}(t)}-2\frac{\eta^{\mathrm{{}^{\prime}}}_{\mathrm{\perp}}(t)}{\eta_{\perp}(t)}\right). (S67)

Considering only T2T_{2} noise, γ(t)=γ+(t)=0\gamma_{-}(t)=\gamma_{+}(t)=0, η\eta_{\parallel} is constant, and

η(t)=e(tT2)ν,\displaystyle\eta_{\perp}(t)=e^{-(\frac{t}{T_{2}})^{\nu}}, (S68)

where ν\nu is the stretch character which equals 11 for Markovian noise. Then

γz(t)=ν2tν1T2ν.\displaystyle\gamma_{z}(t)=\frac{\nu}{2}\frac{t^{\nu-1}}{T_{2}^{\nu}}. (S69)

We further need to express Ξ(t)\Xi(t) as a superoperator acting on the vectorization of ρ(t)\rho(t). Defining the vectorization of a matrix as the map

ρ=i,jρij|ij||ρ=i,jρij|j|i.\displaystyle\rho=\sum_{i,j}\rho_{ij}\ket{i}\bra{j}\mapsto\ket{\rho}=\sum_{i,j}\rho_{ij}\ket{j}\otimes\ket{i}. (S70)

Define the left and right multiplication superoperators by (A)[ρ]=Aρ\mathcal{L}(A)[\rho]=A\rho and (A)[ρ]=ρA\mathcal{R}(A)[\rho]=\rho A so that [A,ρ]=(A)[ρ](A)[ρ][A,\rho]=\mathcal{L}(A)[\rho]-\mathcal{R}(A)[\rho]. By this definition, we can calculate the matrix representation (A)=IA\mathcal{L}(A)=I\otimes A and (A)=ATI\mathcal{R}(A)=A^{T}\otimes I. Using the superoperator notation, we can express Ξ(t)\Xi(t) as

Ξ(t)=\displaystyle\Xi(t)= i2ω(IσzσzI)+γz(t)(σzσzII).\displaystyle-\frac{i}{2}\omega(I\otimes\sigma_{z}-\sigma_{z}\otimes I)+\gamma_{z}(t)(\sigma_{z}\otimes\sigma_{z}-I\otimes I). (S71)

With this expression, we numerically simulate the evolution of our entangled states under non-Markovian noise by using the Time-Dependent Master Equation Solver in QuTip [Johansson et al., 2012].

Performance of metrological states in a non-Markovian environment

To calculate the derivative of probability with respect to ω\omega in the calculation for CFIω\mathrm{CFI}_{\omega}, we use a method similar to parameter shift that utilizes the property that the signal accumulation operator (𝒰(ω)=eiωtJz\mathcal{U}(\omega)=e^{-i\omega tJ_{z}}) and the noisy operator commutes. In the following notation,

  1. 1.

    zz represents a multi-qubit state in the zz basis;

  2. 2.

    𝒰(ω)\mathcal{U}(\omega) is the effective signal accumulation operator: 𝒰(ω)=eiωtJy\mathcal{U}(\omega)=e^{-i\omega tJ_{y}};

  3. 3.

    ρ\rho is the state density matrix of our optimized state after the noisy evolution without signal for some Ramsey time and a π2\frac{\pi}{2} pulse along the xx direction (here we switch the order of the signal accumulation and the second pulse of the Ramsey protocol [Strobel et al., 2014]);

  4. 4.

    P(z|ω)P(z|\omega) is the probability of measuring the state zz with our rotated optimized state after the noisy evolution and signal accumulation.

Then

ωP(z|ω)|ω0\displaystyle\frac{\partial}{\partial\omega}P(z|\omega)\Bigr{\rvert}_{\omega\rightarrow 0} =ωTr[|zz|𝒰(ω)ρ𝒰(ω)]|ω0\displaystyle=\frac{\partial}{\partial\omega}\mathrm{Tr}[\ket{z}\bra{z}\mathcal{U}(\omega)\rho\mathcal{U}^{\dagger}(\omega)]\Bigr{\rvert}_{\omega\rightarrow 0}
=ωTr[𝒰(ω)|zz|𝒰(ω)ρ]|ω0\displaystyle=\frac{\partial}{\partial\omega}\mathrm{Tr}[\mathcal{U}^{\dagger}(\omega)\ket{z}\bra{z}\mathcal{U}(\omega)\rho]\Bigr{\rvert}_{\omega\rightarrow 0}
=Tr[ω𝒰(ω)|zz|𝒰(ω)ρ]|ω0+Tr[𝒰(ω)|zz|ω𝒰(ω)ρ]|ω0\displaystyle=\mathrm{Tr}[\frac{\partial}{\partial\omega}\mathcal{U}^{\dagger}(\omega)\ket{z}\bra{z}\mathcal{U}(\omega)\rho]\Bigr{\rvert}_{\omega\rightarrow 0}+\mathrm{Tr}[\mathcal{U}^{\dagger}(\omega)\ket{z}\bra{z}\frac{\partial}{\partial\omega}\mathcal{U}(\omega)\rho]\Bigr{\rvert}_{\omega\rightarrow 0}
=itTr[(Jy|zz||zz|Jy)ρ].\displaystyle={it\mathrm{Tr}[(J_{y}\ket{z}\bra{z}-\ket{z}\bra{z}J_{y})\rho]}. (S72)

From Eq. (S34), since TtotT_{\text{tot}} and δω2\delta\omega^{2} are constants, SNR is proportional to CFIωtR\sqrt{\frac{\mathrm{CFI}_{\omega}}{t_{\text{R}}}}. Thus we choose CFIωtR\frac{\mathrm{CFI}_{\omega}}{t_{\text{R}}} as the result we show in Fig.4(d) in the main text.

Time Overhead

Refer to caption
Figure S8: 50 cases average sensing performance of the optimized states when using 7-layer circuit on 3D random spin configuration.

In experiments, the time overhead, including the state preparation and readout time, reduces the repetition number of the sensing sequence and thus decreases the sensitivity. If we consider a nonzero time overhead, i.e., M=TtottR+tohM=\frac{T_{\text{tot}}}{t_{\text{R}}+t_{\text{oh}}}, the expression for SNR2\mathrm{SNR}^{2} for an uncorrelated spin state becomes

SNR2=TtottR2cos2(ωtR)δω2(tR+toh)(e2(tRT2)νsin2(ωtR)).\displaystyle\mathrm{SNR}^{2}=\frac{T_{\text{tot}}t_{\text{R}}^{2}\cos^{2}(\omega t_{\text{R}})\delta\omega^{2}}{(t_{\text{R}}+t_{\text{oh}})\left(e^{2\left(\frac{t_{\text{R}}}{T_{2}}\right)^{\nu}}-\sin^{2}(\omega t_{\text{R}})\right)}. (S73)

If toh>>tRt_{\text{oh}}>>t_{\text{R}}, we ignore the term tRt_{\text{R}} in the denominator and

SNR2tR2e2(tRT2)ν.\displaystyle\mathrm{SNR}^{2}\propto\frac{t_{\text{R}}^{2}}{e^{2\left(\frac{t_{\text{R}}}{T_{2}}\right)^{\nu}}}. (S74)

Taking the derivative of Eq. (S74) with respect to tRt_{\text{R}} gives us the best tRt_{\text{R}} if the time overhead is significantly larger:

tR=T2ν1ν.\displaystyle t_{\text{R}}=\frac{T_{2}}{\nu^{\frac{1}{\nu}}}. (S75)

Similarly, the same calculations for a GHZ state where the decay term in Eq. (S73) becomes e2n(tRT2)νe^{2n\left(\frac{t_{\text{R}}}{T_{2}}\right)^{\nu}} show that the best Ramsey sensing time is

tR=T2(nν)2ν.\displaystyle t_{\text{R}}=\frac{T_{2}}{(n\nu)^{\frac{2}{\nu}}}. (S76)

Plugging Eq. (S75) and Eq. (S76) into Eq. (S74), we find that the ratio of the SNR2\mathrm{SNR}^{2} of a GHZ state to that of an uncorrelated spin state is n12νn^{1-\frac{2}{\nu}}. Thus, only when

ν>2\displaystyle\nu>2 (S77)

do GHZ states provide an advantage in SNR over uncorrelated spin states when toh>>tRt_{\text{oh}}>>t_{\text{R}}. We compare the SNR of the states generated by the optimizer with that of the CSS and GHZ states when ν=2,3,4\nu=2,3,4. Fig. S8 shows that when we assume a long time overhead, the generated entangled states are less sensitive than CSS when ν=2\nu=2 and ν=3\nu=3 for large spin numbers.

State preparation time comparing to adiabatic method

State preparation time is one of the major components of the time overhead in the generalized Ramsey sensing sequence which influences the sensitivity. The state preparation time of the variational method depends on the circuit layer number mm, system size NN and is proportional to the inverse of average interaction strength 1/f¯dd1/\bar{f}_{\text{dd}}. The adiabatic method [Cappellaro and Lukin, 2009] is an alternative approach to generate entangled states for quantum metrology in dipolar-interacting spin systems by only using single-qubit rotations (global pulses).

To compare the performance of our variational method with the adiabatic method, we derive the relation between the squeezing parameter (Wineland parameter [Wineland et al., 1994]) and CFI. Without loss of generality, we consider a SSS with collective spin direction +x+x and is squeezed along the yy-axis (such as the 3rd Wigner distribution shown in Fig. S7(b)). In this case, the squeezing parameter is

ξ2=N(ΔJy)2|Jx|2,\displaystyle\xi^{2}=N\frac{(\Delta J_{y})^{2}}{|\langle J_{x}\rangle|^{2}}, (S78)

where (ΔO)2O2O2(\Delta O)^{2}\equiv\langle O^{2}\rangle-\langle O\rangle^{2} and NN is the number of spins. According to the uncertainty principle,

(ΔJy)2(ΔJz)214|Jx|2.\displaystyle(\Delta J_{y})^{2}(\Delta J_{z})^{2}\geq\frac{1}{4}|\langle J_{x}\rangle|^{2}. (S79)

The relation between the squeezing parameter and total spin angular momentum uncertainty projection in zz-direction is

4(ΔJz)2|Jx|2(ΔJy)2=N/ξ2.\displaystyle 4(\Delta J_{z})^{2}\geq\frac{|\langle J_{x}\rangle|^{2}}{(\Delta J_{y})^{2}}=N/\xi^{2}. (S80)

It’s been proven that for a pure Gaussian state, the quantum Fisher information (QFI) is directly related to the variance of the projected spin angular momentum [Braunstein and Caves, 1994,Pezzé and Smerzi, 2009,Hyllus et al., 2010]:

QFI=4(ΔJz)2.\displaystyle\text{QFI}=4(\Delta J_{z})^{2}. (S81)

Combining Eq. (S80) and Eq. (S81), we obtain the relation between CFI and squeezing parameter of a SSS:

CFIQFIN/ξ2.\displaystyle\text{CFI}\leq\text{QFI}\geq N/\xi^{2}. (S82)

The first inequality in Eq. (S82) is saturated by measuring the SSS along the direction where it is squeezed (yy-axis, or equivalently measuring it in zz-basis after applying a Rx(π2)R_{x}(\frac{\pi}{2}) pulse [Pedrozo-Peñafiel et al., 2020]). The second inequality originates from the uncertainty principle (Eq. (S79)). Since the optimal SSS saturate the Heisenberg uncertainty relation [Pezze et al., 2018] and the SSS generated by the adiabatic method [Cappellaro and Lukin, 2009] belongs to these states, we obtain the relation between the squeezing parameter and CFI

CFI=N/ξ2.\displaystyle\text{CFI}=N/\xi^{2}. (S83)

Based on the data shown in Fig.3 from ref. (Cappellaro and Lukin, 2009), it takes about 200μs200\mu\text{s} for the adiabatic method to prepare an 8-spin SSS with ξ2=0.4\xi^{2}=0.4 which corresponds to CFI=20\text{CFI}=20. The 2D spin density 8/(30nm×30nm)8/(30\text{nm}\times 30\text{nm}) corresponds to f¯dd=43.5kHz\bar{f}_{\text{dd}}=43.5\text{kHz}. According to Fig.3(d) in the main text, the variational method is able to prepare an 8-spin entangled state with CFI20\text{CFI}\approx 20 by a 4-layer circuit with f¯ddT=0.8\bar{f}_{\text{dd}}T=0.8. Plugging in the same average nearest neighbor dipolar interaction strength f¯dd\bar{f}_{\text{dd}}, we finally calculated the state preparation time of the variational method is T=18.4μsT=18.4\mu\text{s}, which is about 11 times faster than the adiabatic method under the same condition.

Controllability

Since all the black-box optimization algorithms cannot ensure that the optimized result is the global maximum/minimum point of in the parameter space, it is sill an open question that if the variational method is able to find the ’best’ metrological state for a given spin configuration or not. In this section, we’re interested in the theoretically achievable controllability of dipolar interacting spin systems. The question is, given any (possibly infinite) arbitrary sequence of evolution under each Hamiltonian governing the dynamics of our system, can we drive any arbitrary unitary operator? Quantum control systems of the general form

H(t)=H0+k=1Kuk(t)Hk,H(t)=H_{0}+\sum_{k=1}^{K}u_{k}(t)H_{k}, (S84)

governed by the Schrödinger equation, iddt|ψ(t)=H(t)|ψ(t),i\frac{d}{dt}\ket{\psi(t)}=H(t)\ket{\psi(t)}, have been studied extensively [d’Alessandro, 2021,Schirmer et al., 2001]. H0H_{0} is the unperturbed or free evolution Hamiltonian, HkH_{k} are the control interactions, and uk(t)u_{k}(t) are the piecewise continuous control fields. There are several distinct but related notions of controllability that have different conditions for ‘full’ controllability. The notion of ‘operator’ or ‘complete’ controllability is the strictest condition and is defined as above. For generic interacting spin systems, all of these notions are equivalent. Complete controllability is equivalent to universal quantum computation (UQC) in quantum information processing (QIP) [Wang et al., 2016,Ramakrishna and Rabitz, 1996].

Controllability Test

The way we investigate the controllability of a generic system (S84) is by examining the so-called ‘dynamical Lie algebra’ 0u(𝒩)\mathcal{L}_{0}\subseteq u(\mathcal{N}) or su(𝒩)su(\mathcal{N}) generated by the operators {iH0,iH1,,iHK},\{-iH_{0},-iH_{1},\ldots,-iH_{K}\}, which are represented by 𝒩×𝒩\mathcal{N}\times\mathcal{N} matrices in a basis we choose [d’Alessandro, 2021,Schirmer et al., 2001].

A quantum system of the form (S84) is completely controllable if either 0u(𝒩)\mathcal{L}_{0}\cong{}u(\mathcal{N}) or 0su(𝒩)\mathcal{L}_{0}\cong{}su(\mathcal{N}) [d’Alessandro, 2021], where u(𝒩)u(\mathcal{N}) is the unitary Lie algebra represented by the set of skew-Hermitian 𝒩×𝒩\mathcal{N}\times\mathcal{N} matrices and su(𝒩)su(\mathcal{N}) is the special unitary Lie algebra represented by the same set of matrices with the extra condition that they are traceless. Note that dimu(𝒩)=𝒩2\dim{u(\mathcal{N})}=\mathcal{N}^{2} and dimsu(𝒩)=𝒩21\dim{su(\mathcal{N})}=\mathcal{N}^{2}-1, and the difference of 11 comes from counting identity operation (II) as a dimension or not. We must find a basis for 0\mathcal{L}_{0} by iteratively taking the Lie bracket [,][\cdot,\cdot] of H0,H1,,HKH_{0},H_{1},\ldots,H_{K} until we have a set of dim0\dim{\mathcal{L}_{0}} linearly independent matrices, where the Lie bracket is the commutator [A,B]=ABBA[A,B]=AB-BA for matrices AA and BB. Ref.[d’Alessandro, 2021] and ref.[Schirmer et al., 2001] present an algorithm for generating this basis. Thus, if dim0=𝒩2\dim{\mathcal{L}_{0}}=\mathcal{N}^{2} or 𝒩21\mathcal{N}^{2}-1 we can say that the system is completely controllable. Note that for generic spin systems 𝒩=2N\mathcal{N}=2^{N} for NN spins.

Algorithm. Generating 0\mathcal{L}_{0} and finding dim0\dim{\mathcal{L}_{0}}.
Input: Hamiltonians I{H0,H1,,HK}I\equiv\{H_{0},H_{1},\ldots,H_{K}\}
1. BB\equiv maximal linearly independent subset of II
2. r|B|r\equiv\absolutevalue{B}
3. If r=N2r=N^{2} then OBO\equiv B else O{}O\equiv\{\}
4. If r=N2r=N^{2} or |B|=0\absolutevalue{B}=0 then terminate
5. C[O,B][B,B]C\equiv[O,B]\cup[B,B], where
[S1,S2]{[s1,s2]|s1S1,s2S2}\,\quad[S_{1},S_{2}]\equiv\{[s_{1},s_{2}]\,|\,s_{1}\in S_{1},s_{2}\in S_{2}\}
6. O=OBO=O\cup B
7. B=B= maximal linearly independent extension of OO with
    elements from CC
8. r=r+|B|r=r+\absolutevalue{B}; Go to 4
Output: basis OO of 0\mathcal{L}_{0} and dim0=r\dim{\mathcal{L}_{0}}=r
Table S2: Implementation of [Schirmer et al., 2001]’s algorithm with a few physically motivated modifications. Note |S|\absolutevalue{S} indicates the cardinality of set SS.

Controllability of Dipolar Interacting Spin Systems

We write our system in the form (S84) by defining the free evolution Hamiltonian to be the dipolar interaction HddH_{\text{dd}} and two control interactions JxJ_{x} and JyJ_{y}, as these operators are generators of rotation, with respective independent control fields θx(t)\theta_{x}(t) and θy(t)\theta_{y}(t):

H(t)=Hdd+θx(t)Jx+θy(t)Jy.H(t)=H_{\text{dd}}+\theta_{x}(t)J_{x}+\theta_{y}(t)J_{y}. (S85)

Ref.[Schirmer et al., 2001,Polack et al., 2009] demonstrate that we cannot achieve complete controllability with global controls due to inherent symmetries, so we know that dim0<4N1\dim{\mathcal{L}_{0}}<4^{N}-1.

However, complete controllability is a rather strict condition. Not being able to drive any arbitrary unitary does not mean we cannot drive unitaries that produce metrological states.

In fact, ref.[Chen et al., 2017] demonstrate for a long-range Ising spin model (all-to-all interactions) with global controls that metrological states, such as the GHZ and W states are reachable. Ref.[Albertini and D’Alessandro, 2018] extend their result for symmetric Ising spin networks with global controls and demonstrate that one can reach any state that preserves spin permutation invariance. This is known as subspace controllability. The dimension of their dynamical Lie algebra, IsingPIsu(2N)\mathcal{L}^{\text{Ising}}\equiv\mathcal{L}^{\text{PI}}\cap su(2^{N}), is shown to be (N+3N)1\binom{N+3}{N}-1. This is relevant to our system because [Albertini and D’Alessandro, 2021b] show that if we replace the Ising interaction with a more general two body interaction—which includes HddH_{\text{dd}}—the dimension of the dynamical Lie algebra is necessarily greater than or equal to that of the symmetric Ising case, and it is therefore subspace controllable. This means that we can write (N+3N)1dim0<4N1\binom{N+3}{N}-1\leq\dim{\mathcal{L}_{0}}<4^{N}-1 and say that 0\mathcal{L}_{0} is subspace controllable but not completely controllable. Therefore, we can achieve arbitrary permutation invariant states, including metrological states such as a GHZ state.

Lie algebra dimension N=2N=2 N=3N=3 N=4N=4 N=5N=5
Completely controllable: 4N4^{N} (or 4N14^{N}-1) 16 64 256 1024
HddH_{\text{dd}} 9 39 225
Symmetric Ising: (N+3N)1\binom{N+3}{N}-1 9 19 34 55
Table S3: Lie algebra dimensions for the complete controllable system, dipolar interacting system and symmetric Ising system (lower bound for subspace controllability). Dipolar interacting spin systems’ dim0\dim{\mathcal{L}_{0}} is calculated using an implementation of [Schirmer et al., 2001]’s algorithm, and is necessarily bounded by the complete and subspace controllability dimensions. Lie algebra dimensions for dipolar interacting systems are only calculated up to N=4N=4 due to stability issues stemming from numerical errors in how matrix rank is calculated.

Finding Reachable States

0\mathcal{L}_{0} is associated with a Lie group e0e^{\mathcal{L}_{0}} by the Lie group–Lie algebra correspondence [d’Alessandro, 2021]. The Lie algebra u(𝒩)u(\mathcal{N}) corresponds to the Lie group U(𝒩)U(\mathcal{N}), and su(𝒩)su(\mathcal{N}) corresponds to SU(𝒩)SU(\mathcal{N}). We can define e0\mathcal{R}\equiv e^{\mathcal{L}_{0}} as the reachable set of unitaries we can drive under {Hk}k=0,,K\{H_{k}\}_{k=0,\ldots,K}, and so starting from an initial state |ψ0,|ψ0\ket{\psi_{0}},\mathcal{R}_{\ket{\psi_{0}}} is the set of states we can reach.

As demonstrated in the previous section, our dynamical Lie algebra is a superset of Ising\mathcal{L}^{\text{Ising}} and a strict subset of su(2N)su(2^{N}), so we can write eIsinge0SU(2N)e^{\mathcal{L}^{\text{Ising}}}\subseteq e^{\mathcal{L}_{0}}\subset SU(2^{N}). Because |GHZ|0NIsing\ket{\text{GHZ}}\in\mathcal{R}_{\ket{0}^{\otimes N}}^{\text{Ising}} we can write |GHZ|0Ndipolar\ket{\text{GHZ}}\in\mathcal{R}_{\ket{0}^{\otimes N}}^{\text{dipolar}}. In fact, this is true for any permutation invariant state, which includes all metrological states we’re interested in.

While we know that metrological states are in the reachable set, determining the parameters that drive the unitaries to produce those states is a highly convex optimization problem equivalent to our variational circuit, using state fidelity between the ideal state and the current state instead of CFI as the cost function. That is we optimize the output unitary of the variational circuit,

𝒮(𝜽)=eiπ2Jyi=1meiτiHddeiϑiJxeiπ2JyeiτiHddeiπ2Jy,\mathcal{S}(\bm{\theta})=e^{-i\frac{\pi}{2}J_{y}}\prod_{i=1}^{m}e^{-i\tau_{i}H_{\text{dd}}}e^{-i\vartheta_{i}J_{x}}e^{i\frac{\pi}{2}J_{y}}e^{-i\tau_{i}^{\prime}H_{\text{dd}}}e^{-i\frac{\pi}{2}J_{y}}, (S86)

where mm is the (possibly infinite) number of layers, for state fidelity,

(|GHZ,𝒮(𝜽)|0N)=|GHZ|𝒮(𝜽)|0N|2,\mathcal{F}(\ket{\text{GHZ}},\mathcal{S}(\bm{\theta})\ket{0}^{\otimes N})=\absolutevalue{\bra{\text{GHZ}}{\mathcal{S}(\bm{\theta})\ket{0}^{\otimes N}}}^{2}, (S87)

for pure states. If there exists some 𝜽\bm{\theta} such that (|GHZ,𝒮(𝜽)|0N)=1\mathcal{F}(\ket{\text{GHZ}},\mathcal{S}(\bm{\theta})\ket{0}^{\otimes N})=1, then we can say that |GHZ|0Ndipolar\ket{\text{GHZ}}\in\mathcal{R}_{\ket{0}^{\otimes N}}^{\text{dipolar}}. From the previous section, we know such a 𝜽\bm{\theta} must exist, but it may be the case that mm\rightarrow\infty, in which case it is not possible to find this exactly. This is the method employed in ref.[Chen et al., 2017,Gao et al., 2013] to demonstrate the reachability of GHZ and W states for Ising spin models. Our variational circuit method represents an improvement in the efficiency of searching for such metrological states.