Skip to main content
NIST Author Manuscripts logoLink to NIST Author Manuscripts
. Author manuscript; available in PMC: 2023 Jan 5.
Published in final edited form as: J Appl Phys. 2021;130(14):10.1063/5.0055630. doi: 10.1063/5.0055630

Sequential Bayesian experiment design for adaptive Ramsey sequence measurements

Robert D McMichael 1, Sergey Dushenko 1,2, Sean M Blakley 1
PMCID: PMC9813949  NIHMSID: NIHMS1855758  PMID: 36618327

Abstract

The Ramsey sequence is a canonical example of a quantum phase measurement for a spin qubit. In Ramsey measurements, the measurement efficiency can be optimized through careful selection of settings for the phase accumulation time setting, τ. This paper implements a sequential Bayesian experiment design protocol in low-fidelity Ramsey measurements, and its performance is compared to a previously reported adaptive heuristic protocol, a quantum phase estimation algorithm, and random setting choices. A workflow allowing measurements and design calculations to run concurrently largely eliminates computation time from measurement overhead. When precession frequency is the lone parameter to estimate, the Bayesian design is faster by factors of roughly 2 and 4 and 5 relative to the adaptive heuristic, random τ choices and the quantum phase estimation algorithm respectively. When four parameters are to be determined, Bayesian experiment design and random τ choices can converge to roughy equivalent sensitivity, but the Bayesian method converges 4 times faster.

I. INTRODUCTION

The development of diamond NV centers as measurement tools is one of the most significant achievements of applied quantum physics in recent years. From initial concept1 and first demonstrations,2–4 NV-based magnetometry measurements5 have been developed for condensed-matter physics,6–10 engineering,11–13 biology14–19, nanoscale nuclear magnetic resonance,20–25 and commercial instrumentation is now becoming available.

The qubit that draws attention to the NV center is the S = 1 spin of the electronic ground state, which forms around a nitrogen atom, neighboring vacancy, and trapped electron in a diamond crystal. The coherence time of the spin state can extend into the millisecond range.26,27 At ambient temperatures, the spin state can be initialized and read out using laser light and detection of emitted photons. With incident green light, an NV center will begin to cycle between its electronic ground state and an excited state, absorbing a photon and relaxing. The key factor is that the relaxation process in NV centers is spin-dependent. Centers excited from the mz = 0 state will relax by emitting a photon and return to the same mz = 0 state, but centers excited from the mz = ±1 states can also relax without emitting a photon, and may switch one-way from mz = ±1 to mz = 0 in the process. Because readout resets the state to mz = 0, only photons from the first few absorb-relax cycles carry information about the initial spin state.

A persistent problem in NV center measurements is that it is often difficult to efficiently collect these few meaningful, spin-dependent photons. Improvements in collection efficiency have been demonstrated using solid immersion lenses28, optical resonators,29,30 and fabricated diamond nanostructures.31–33 Other characteristics of NV centers have also been successfully exploited. Additional information can be gleaned from the timing of emitted photons34. More exotic approaches include spin-dependent ionization of the NV center into different long-lasting charge states where differences in emission spectra can be measured through many excitation-emission cycles.35–41 Another approach has been to exploit features of a metastable state in the “dark” relaxation path of mz = ±1 states.42,43

While these methods improve readout fidelity, additional gains can be achieved through efficient measurement design, which allows experiments to measure faster and/or more precisely. Measurement design in this context refers to the choice of experimental settings. Previously, sequential Bayesian experiment design (SBED) produced order-of-magnitude decreases in both the number of measurements and measurement time as compared to swept-frequency measurements in optically detected magnetic resonance of NV centers.44 In this paper, we apply sequential Bayesian experiment design methods to Ramsey sequence measurements, and we compare results with other adaptive and non-adaptive methods. Section II reviews Ramsey measurements, and section III describes the measurement simulation and introduces the measurement methods. Section IV presents the results of measurement simulations comparing the different protocols, showing substantial improvement of the Bayesian experiment design over the other methods.

II. BACKGROUND

A. Ramsey experiment

The Ramsey sequence is an example of quantum interferometry, and it is the canonical approach to determine the energy difference ħω0 between two states. When the energy difference depends on a signal, the Ramsey sequence is the basis of quantum sensing.4,45

In a Ramsey experiment, a system with |0〉 and |1〉 states differing in energy by ΔE=ħω is prepared in the |0〉 and put into a superposition state |ψ0〉=12(|0〉+|1〉) with a π/2 operator. The system is allowed to propagate for a time τ, yielding a state |ψ(τ)〉=12(|0〉+e−iωτ|1〉). After another π/2 operation, the final state, |ψf(τ)〉=12(1+e−iωτ)|0〉+12(1−e−iωτ)|1〉, can be read out. In the ideal case, measurement of this final state yields a result m(m={0,1}for{|0〉,|1〉}) with conditional probability P(m∣τ,ω) given τ and ω:

P(m∣τ,ω)=12[1+(−1)mcosωτ]. (1)

Under conditions of high-fidelity, single-shot readout, quantum phase estimation schemes allow a phase ϕ=ωτ0 to be determined with precision Δϕ∝2−M in a total time Δt∝2M.46,47 Since ΔϕΔt is a constant, quantum phase estimation is said to achieve Heisenberg scaling of the precision. Such scaling can be achieved using entangled states, and approximated by adaptive measurement designs48–52 and non-adaptive designs.53–56

However, in ambient-temperature measurements using NV centers, readout fidelity is typically far from ideal, and the measurements have low efficiency, falling in the “averaged readout” category.45

The NV center Ramsey sequence is illustrated in figure 1. First, the spin of the NV’s electronic ground is initialized to |0〉 with a few microseconds of green light illumination followed by time to allow optically excited states to relax. Next, the spins are put into a superposition of |0〉 and |1〉 states with a calibrated π/2 microwave pulse. The spin state then evolves for a time τ according to the interactions included in the Hamiltonian. A second microwave pulse projects the phase-shifted state back onto |0〉 and |1〉 states for readout.

FIG. 1.

FIG. 1.

Timing diagram of Ramsey pulse sequences. Green areas in trace a) denote green laser excitation. In trace b), a microwave π/2 pulse initiates precession. After a time τ selected by the experiment design, another π/2 pulse projects the state for readout. In trace c), red curves indicate photoluminescence emission and pink zones show time intervals where emitted photons are counted. Signal photons are counted early in the laser pulse, and background photons are counted after a steady state is reached. The horizontal axis corresponds to elapsed time.

During readout, maximum spin-state contrast is achieved by counting signal photons during the first 100 ns to 200 ns of green light illumination before the NV center’s spin state is reinitialized to |0〉. After a steady state is reached, during the last 100 ns to 200 ns of the laser pulse, a second count of background photons is collected to monitor and compensate for experimental drift.

III. METHODS

A. Experiment simulation

The measurement process consists of a series of epochs, each epoch comprising ms repeated Ramsey sequences with the same τ setting value. Signal photon counts collected near the beginning of the laser pulse are summed for each epoch, yielding ns signal photons. Both τ and ms may be chosen flexibly, but we attempt to keep ms roughly consistent in order to focus on the effects of τ choices in the different protocols.

Background photon counts are collected near the trailing end of the laser pulse in order to monitor and compensate for changing laser intensity and other slow experimental drifts.

To simulate the count data, we model the shot noise of the ns and nb photon counts as samples from Poisson distributions

ns∼Pois(msλs(t)) (2)
nb∼Pois(msλb(t)) (3)

where λs(t) and λb(t) are counts-per-Ramsay-sequence photon rates and the time dependence denotes slow drifts.

To model the rates, we assume that signal and background channels drift with the same slow time dependence, and we define a drift-free ratio, R(θ,τ) which depends on λb(t), time-independent parameters θ≡{a,c,ω0,T2∗}, and setting τ.

λs(t)=R(θ,τ)λb(t) (4)
R(θ,τ)=a+ccos(ω0τ)e−(τ/T2∗)2. (5)

The parameters include background a, contrast c, precession frequency ω0, and decoherence time T2∗.

As a guide to measurement simulations, we use the Ramsey experimental data from Ulm University57 and the descriptions provided in ref. 58. The experimental overhead includes approximately 3 μs of laser illumination, 1 μs of relaxation time and 70 ns for microwave pulses and photodetector for a total overhead of 4.07 μs per sequence. Allowed values of τ range from 0.1 μs to 20 μs of precession time with 50 ns resolution.

We simulate photon counts using (4) and (5) with “true” parameter values a = 0.8, c = 0.13, ω0 = 9.4 μs−1, and either T2∗=10μs or T2∗→∞. We use an average background count rate λb = 0.15 photons per sequence.

B. Bayesian Inference

For all of the experiment designs described below, the simulated data is interpreted using Bayesian inference to refine the probability distribution of the model parameters.

In the ith epoch, ns,i and nb,i photons are detected and recorded from the signal and background channels, respectively. Then Pi(θ∣yi,di) is inferred given measured values yi≡{ns,i,nb,i} and setting (design) values di≡{τi,mi}. We use bold font to denote recorded values from the current epoch and all preceding epochs, i.e. ns,i≡{ns,1,ns,2,…,ns,i}.

The distribution of time-independent parameters θ is obtained recursively incorporating data using Bayes’ rule. In each epoch, the posterior P(θ∣yi,di) is proportional to the likelihood and the prior,

P(θ∣yi,τi)∝P(ns,i∣θ,di,n˜b,i,m˜b,i)P(θ∣yi−1,di−1) (6)

with likelihood

P(ns,i∣θ,τi,n˜b,i,m˜b,i)∝R(θ,τi)ns×[mi+m˜b,imiR(θ,τi)+m˜b,i]ns,i+n˜b,i, (7)

and the posterior of the preceding epoch, P(θ∣yi−1,di−1) as the prior. The first epoch uses P(θ∣y0,d0), the prior conditioned by no data. The derivation of (7) is given in Appendix A.

Background signal information is included in (7) using sums n˜b,i and m˜b,i over only the NΣ most recent epochs.

n˜b,i=∑j=max(i−NΣ+1,1)inb,j; (8)
m˜b,i=∑j=max(i−NΣ+1,1)ims,j. (9)

Using finite NΣ allows Pi(λb) to forget old data and respond to experimental drift. The simulations presented below use NΣ=10.

C. Experiment Design

The goal of the experiment designs is to choose τ values to make the measurements efficiently. In the simulations, we compare the effectiveness of four designs, including two adaptive protocols: sequential Bayesian experiment design (SBED), and an adaptive heuristic design58, and two non-adaptive designs: random setting selection and version of the quantum phase estimation algorithm (QPEA)34.

To motivate the SBED protocol, we first provide a brief overview of optimal Bayesian experiment design (OBED). More detailed descriptions of OBED may be found in the references.44,59–63 Software and documentation for SBED are available through ref. 63.

In each epoch, optimal Bayesian experiment design calculates which of the candidate τ′ settings would, on average, produce the greatest improvement in the parameter distribution relative to the cost of the measurement. To quantify improvement in the parameter distribution, the OBED method uses the information entropy,

Hθ[P]≡−∫P(θ)log[P(θ)]dθ (10)

as a metric. We add the subscript to Hθ to identify the entropy of a distribution over θ.

Suppose that a future measurement using setting design d′ yields result y′. (Primes denote predicted values to differentiate from unprimed, recorded values.) Bayesian inference would yield a projected new posterior distribution P′(θ∣y′,d′) from the prior P(θ). The beneficial information entropy difference between P(θ) and P′(θ∣y′,d′) is gauged using Kullback-Leibler divergence,

DKL(y′,d′)=−∫P′(θ∣y′,d′)log[P(θ)P′(θ∣y′,d′)]dθ. (11)

The utility U(τ′) is then the average DKL benefit,

U(d′)=∫DKL(y′,d′)P(y′∣d′)dy′, (12)

The optimal design is the design d′ that maximizes U(d′).

Application of Bayes rule allows the integrand in (11) to be expressed in terms of distributions over predicted y′. The result is the difference between two entropy-like terms:

U(d′)=Hy′∣d(d′)−∫Hy′∣θ,d′(θ,d′)P(θ)dθ, (13)

where the first term is the entropy of

P(y′∣d′)=∫P(y′∣θ,d′)P(θ)dθ, (14)

which is the distribution of measurement predictions broadened by the parameter distribution. The second term in (13) is essentially the entropy of measurement noise for fixed θ, averaged over θ.

The double integral prescribed in (13) and (14) is computationally demanding, so for SBED we desire a calculable proxy utility U∗(d′) with maxima near the maxima of the information-theoretic U(d′). Our proposed proxy utility is motivated by the following plausibility arguments.

We start by looking at an oversimplified case where both P(y′∣θ,d′) and P(y′∣d′) are normal distributions. In particular, P(y′∣θ,d′)∼N(ym(θ,d′),vδ) is a normal distribution around model value ym(θ,d′) with a noise variance vδ. In the Ramsay experiment, both the mean ym and the variance vδ of the Poisson-distributed signal count are equal to msλbR(θ,d′).

Also in this simple case, the distribution of model values

P(ym∣d′)=∫P(ym∣θ,d′)P(θ)dθ (15)

is assumed to be a normal distribution N(〈ym〉,vm) around a mean model value 〈ym〉 with variance vm stemming from the distribution of parameter values.

Under these over-simplifying assumptions, the utility can be expressed as

U(d′)|N=log[vm(d′)+vδ(d′)vδ(d′)], (16)

Where the effects of the parameter distribution on model values and the effects of measurement noise are separated into variances vm(d′) and vδ(d′) respectively.

In many cases of interest, the measurement noise can be modeled by a normal distribution. However, with nonlinear model functions, P(θ) and P(ym∣d′) are generally not normal, and we observe in simulation that P(θ) is often multimodal. Nevertheless, we have found in previous work that SBED protocols based on (16) perform well compared to non-adaptive protocols.44,63

In modeling the Ramsay experiment model, however, we found that (16) often performed worse than random setting selection, especially during the first few epochs of a run. This failure motivated us to reintroduce information entropy to gauge the effects of parameter distribution on measurement outcomes, but we keep the form of (16) where measurement noise and parameter distribution effects are separated. For SBED, we propose a proxy utility

U∗(d′)=[vm∗(d′)+vδ(d′)vδ(d′)], (17)

with effective variance vm∗(d′) defined as

vm∗(d′)=e2Hym(d′)2πe. (18)

In this expression, the entropy Hym(d′) of the model value distribution (15) is cast as a variance by inverting an expression for the entropy of a normal distribution. The absence of the log() function in U∗ (17) relative to (16) does not affect the maximal-utility d′ values because log() is monotonic.

Applied to Ramsay experiment modeling, y′≡msλbR(θ,d) is the signal channel count rate, θ≡{a,c,ω0,T2∗} and θ≡ω0, and d′≡τ′. The number of repeats per epoch, ms is set by the allocated measurement time.

Our computational method for selecting settings is presented in Algorithm 1. We draw Ns = 100 parameter samples and calculate corresponding model values y′ for the signal emission rate (4) using (5), we then estimate the entropy64 Hy′(d′) and compute the effective variance and the proxy utility. We estimate U∗(d′) corresponding to all allowed ≈ 400 discrete τ′ values, all using the same θ samples. Using a consistent set of θ samples endows U∗(d′) with a smoothness, eliminating sampling noise that might obscure the maxima of U∗(d′). Finally, we select the d′ setting with the greatest U∗(d′).

For comparison against SBED, we also consider an adaptive design for Ramsey experiments reported by Santagati et al.58 This heuristic design, “Tau” is attractively simple, with the τ setting determined by τ=h/σω0, where σω0 is the width of the frequency distribution and h ≈ 1 is a tuning parameter. Empirically, we found that a value of h ≈ 0.5 generated the best results in our simulations. A scaling argument (see Appendix B) suggests that the Tau protocol might show 1/T scaling, but the reported behavior appears to be closer to exponential decay.58 In Tau runs, σω0 eventually becomes small enough that 1/(2σω0)>20μs is outside the allowed setting range. In this case, τ is selected randomly from the top 10 % of τ values.

Third, we consider a non-adaptive protocol, “Random,” where τ is selected randomly from the allowed settings. This protocol provides a baseline, non-adaptive case for comparison with the adaptive protocols.

Finally, we test a non-adaptive design, “QPEA,” which incorporates many of the features of the quantum phase estimation algorithms,46–56 but follows Dinani et al. in application of these methods to a low-fidelity readout.34

Algorithm 1.

Pseudocode for SBED setting selection.

Input: Parameter distribution P(θ), candidate designs di
 for j ← 1...Ns do
  θj ← sample from P(θ)
 end for
 for i ← 1...Nd do ⊲ All candidate settings di
  for j ← 1...Ns do ⊲ Reuse θ samples
   yj ← model(θj, di) ⊲ Evaluate model function
  end for
  Hi←H({y1…yNs}) ⊲ Estimate entropy of P(y)
  vi←e2hi/(2πe) ⊲ Effective variance
  Ui∗←(vi+vδ)/vδ
 end for
 ibest←argmax(Ui∗) ⊲ Choose max utility setting
Output: dibest setting

In the QPEA design, the experimental model (5) as a function of parameters θ is extended to include a readout phase ψ in addition to the precession time τ.

R(θ,τ,ψ)=a+ccos(ω0τ+ψ)e−(τ/T2∗)2 (19)

The precession time takes on values τ=τ02k for k=0,1,…K, and measurements are repeated Mk times with ψ values at increments of π/Mk34,53. In our implementation, we create a randomly scrambled sequence of all (τ, ψ) setting combinations, and then repeat that sequence as needed, simulating ms = 500 repeats for each setting combination. The number of measurements allocated to each τ value is given by

Mk=G+F∗(K−k), (20)

where G and G + F measurements are allocated to the largest and smallest τ values, respectively.34,52–56. In its original context, each τ value contributes one binary bit to the result. The Mk formula above allocates additional measurements to more significant bits where errors have more severe consequences.53 In the simulations reported below, we used G = 25 and F = 1 with K = 8 and τ0 = (20μs)/28.

To compare these four designs/protools, we value elapsed time as the resource to be allocated. The exception is QPEA where measurement repeats are allocated according to Mk. Accordingly, measurement efficiency is judged on the basis of elapsed time. Therefore, in Tau and Random runs, a consistent time interval is allocated to each epoch, and the Ramsey sequence is repeated with the selected τ until the time is spent. In the Bayes runs, the measurement time is determined by computation time, as described in the following subsection.

D. Concurrent design and measurement

The computational time tcalc demanded by SBED may be the method’s greatest disadvantage. In a sequential measure-infer-design loop as illustrated in fig. 2(a), the measurement waits for instructions during the design calculations. This idle time adds to the experimental overhead and degrades the overall efficiency of the protocol. In the calculations for this paper, SBED computation required a few milliseconds per epoch. In the worse case of one sequence per epoch, a few milliseconds would be an enormous overhead compared to a Ramsey τ of a few microseconds.

FIG. 2.

FIG. 2.

Flow diagrams of computation and measurement using adaptive experiment design. Grey blocks indicate single measurement epochs. In a series workflow (a), data collection stops for data analysis and new setting decisions. In a concurrent workflow (b), measurements continue until new settings are ready.

To avoid adding computation time to overhead, we propose a concurrent workflow where measurements and design calculations run at the same time (See fig. 2(b)). In epoch i, the measurement process accumulates and averages data yi using a setting di designed in the previous iteration i − 1. Meanwhile, Bayesian regression incorporates the previous epoch’s measurement data yi−1 and chooses settings di+1 for the next iteration. After the calculations are completed, the measurement system reports data and receives the next setting design. By running measurements and calculations concurrently, the measurement can continue to collect data virtually nonstop. The fact that di+1 is based off accumulated data {y0,…,yi−1}, i.e. not including the current measurements yi has negligible effects in measurements that iterate for many epochs.

We also suggest that for adaptive measurement schemes, the computation time is more appropriately compared to the time tSNR required to reach a signal to noise ratio (SNR) ≈ 1. We propose that the infer/design calculations are fast enough if they can generate designs in a time comparable to the time required for measurement data to significantly change the parameter distribution. The parameter distribution only changes significantly following measurements with SNR≳1 or equivalent. Using shorter measurement times with fewer repetitions would produce incremental changes in the parameter distribution between computations. At the other extreme, many more repetitions between calculations might hurt efficiency by missing opportunities to switch to higher-utility settings.

In our simulations, tSNR can be estimated. Noise standard deviation equal to the contrast of c = 0.13 on a background of a = 0.8 would require ≈ 40 signal photons, or ms ≈ 300 repeats, or about 4.2 ms at the median setting τ = 10 μs. By coincidence, in the Bayes runs, the mean measurement time was 4.4 ms, which is comparable to tSNR.

IV. RESULTS AND DISCUSSION

Here we test sequential Bayesian experiment design (SBED) against the adaptive heuristic method of Santagati et al.,58 (Tau) Random selection of settings (Random), and a quantum phase estimation algorightm (QPEA).

Figure 3 displays statistics from 100-run batches of simulated Ramsey measurements where the precession frequency ω0 is the only unknown parameter, and T2∗→∞ makes decoherence unimportant. The measurement time in each epoch is roughly equivalent. In the QPEA simulations, each epoch repeats (τ, ψ) settings 500 times. The average time per epoch was 3.9 ms. Tau and Random runs are allocated 4 ms of measurement time per epoch, i.e. ms = 4 ms/(τ + 4.07 μs) repeats of the Ramsey sequence. SBED measurement simulations mimic a concurrent workflow, using the execution times of the inference and experiment design code to determine the measurement times. In these simulations, the mean epoch time is 4.4 ms.

FIG. 3.

FIG. 3.

Measurement simulations where only ω0 is treated as an unknown. (a) True R curve plotted as a function of τ with a = 0.8, c = 0.13, ω0 = 9.4 μs−1 and T2∗→∞ (b) Histograms comparing the number of times each τ setting was used chosen by four protocols. QPEA and Random are non-adaptive and Tau and SBED are adaptive protocols. (c) Evolution of mean σω0. The Bayesian protocol outperforms the heuristic protocol, and the random protocol produces roughly double the uncertainty. Shaded areas are 90 % credibility regions. Dotted lines are standard deviation of error. (d) Evolution of absolute sensitivity vs. elapsed ”wall clock” time. The SBED protocol is roughly twice as fast as the Tau protocol, four times as fast as Random and five times as fast as QPEA. Statistics are calculated over 100 individual runs.

The histograms in fig. 3(b) provide a comparison of how frequently the various protocols use different τ settings. The QPEA protocol places a very strong emphasis on small τ; in fact the median τ is 0.625 μs. The Random protocol also emphasizes low τ by virtue of the fact that measurement time is allocated uniformly, and more repeats are possible when τ is small.

The adaptive Tau and SBED protocols produce similar overall distributions of setting choices, shown in fig. 3(b). These protocols both exhibit an initial emphasis on small τ, later moving to large τ. A striking feature of the Bayes histogram of selected τ values is the comb-like structure indicating that the Bayesian method adaptively concentrates τ values where the model true curve (a) has maximum slope. By comparison, the Tau and Random protocols show no such phase selectivity, although such selectivity could be programmed into an improved heuristic.

The standard deviation of the ω distributions are plotted in fig. 3(c) as a function of the number of Ramsey sequences. Above ≈ 105 sequences, all four protocols converge to a (∑ms)−1/2 scaling. The inset replots the boxed region on linear scales over a doubling of the sequence count.

Figure 3(d) provides a comparison of the absolute sensitivity η of the Ramsey ω0 measurement used as a magnetometer. The uncertainties in field and frequency, σB and σω0 respectively, are related by σB=σω0/γ, where γ=2π28GHz/T is the gyromagnetic ratio. For uncertainties that scale as tlab−1/2, η2≡σB2tlab is a constant. All three protocols produce nearly constant η2 after about 1 s of laboratory time. The inset replots the boxed region on linear scales. To achieve equivalent uncertainties, the Bayes protocol is about twice as fast as Tau, four times as fast as Random, and five times as fast as QPEA.

At several places, in figure 3(c) and 3(d), and in figure 4 below, the plotted mean value lines fall outside the shaded 90% credibility region. In a typical run, the standard deviation will vary slowly and then rapidly fall orders of magnitude toward the asymptotic value. In a batch of 100 runs, there will be instances where most of the runs will have converged, while a few remain with high standard deviation. In these instances, the mean is heavily influenced by a few, very large outlier values that fall outside the credibility interval.

FIG. 4.

FIG. 4.

Simulations of measurements to estimate ω0, a, c and T2∗. (a) True R curve plotted as a function of τ with a = 0.8, c = 0.13, ω0 = 9.4 μs−1 and T2∗=15μs. (b) Histograms of τ setting values determined by Random selection and by SBED protocols. (c) Uncertainty in frequency, σω0 vs. Ramsey sequence count. (d) Absolute uncertainty η2 for SBED and random selections of τ. The Bayesian method uses concurrent measurement and calculation. In the random design data, the time required for data analysis has been discounted. Statistics are calculated over 100 individual runs.

Fig. 4 presents results from 100-run batches of measurement simulations where a, c, ω0, and T2∗ are all treated as unknowns. We compare only SBED and Random protocols, as no heuristic is available and QPEA is designed for frequency/phase determination only. As above, 4 ms were allotted for measurements in the Random protocol, but SBED code execution was slower with 4 variables, and an average of 13 ms were allocated per epoch in Bayes protocol runs.

Compared to the histogram in fig. 3(b), the SBED histogram structure in fig. 4(b) is much richer. For a qualitative interpretation of this structure, we note that the modeled signal given by (5) is most sensitive to contrast c at small τ extrema, is most sensitive to T2∗ for extrema near τ≈T2∗(=15μs) and is most sensitive to ω0 for large slope of the model function and τ≈T2∗/2. The maxima of the envelope are skewed to slightly smaller τ values by the fact that low-τ designs produce more photons per epoch, and deliver smaller uncertainty.

Presumably, an adaptive heuristic could be developed and tuned for this four-variable measurement. It is likely that the development would require significant labor, however. Implementation of the Bayes protocol was comparatively simple, requiring only minor adjustments to include T2∗ as unknowns in the model function.

Figs. 4(c)-(d) show that the Random protocol is slower to converge than the Bayes protocol, but the contrast in asymptotic performance is weaker than in the single-unknown case above. We attribute the apparent efficiency of the random approach to the fact high-utility τ values selected by SBED are widely distributed among the available settings, not tightly grouped at large τ as they appear in fig. 3(b). Our selection of T2∗=15μs in a 20 μs τ is close to optimal for the random protocol, artificially permitting τ selections to cover the same τ range that SBED protocol chooses adaptively. In other calculations using T2∗=10μs, (not shown) the SBED protocol self-limits to τ values less than 14 μs, where the signal is strong. The resulting OBED measurement is roughly 2 times faster than random in this case.

V. SUMMARY

The simulation results show that sequential Bayesian experiment design is an efficient protocol for single-NV Ramsey measurements, outperforming a tuned heuristic protocol, Tau, random setting selection, and the established QPEA method in efficient use of laboratory, “wall-clock” time. A key factor for the Bayes protocol is the introduction of a concurrent workflow, which allows measurements to continue until design calculations are complete, and effectively eliminates computation time from the overhead, at least when computation time is less than the time needed to attain SNR ≈ 1. Longer measurements might reduce efficiency through missed opportunities to select higher-utility settings.

The efficiency gains produced by sequential Bayesian experiment design in this work are significant, but modest compared to the order-of-magnitude gains previously reported for measurements of peaks on a wide, flat background.44 We explain this difference noting that measurements in the broad background of a spectrum offer little compared to the information-rich settings near the peaks, so large gains are possible by focusing measurements on the peak regions. In contrast, the Ramsey measurements tend to be informative over a larger range of setting values.

While this paper has focused on efficiency during data acquisition, sequential Bayesian experiment design also offers efficiency advantages in the time periods before and after data acquisition. For development of a protocol before measurement, the Bayes methods are easily adapted to new experiment models or to different measurement goals, especially when compared to the demands of designing efficient heuristics. Even in cases where Bayes calculations would be prohibitively slow, the Bayes protocols may serve as a reliable guide for heuristic protocol development. Also, if post-measurement data analysis is required, it might be reasonable to count analysis time as part of measurement overhead. In the Random protocol results above, data was analyzed at each epoch to show progress but the analysis time was discounted. But in a more typical use, a quick protocol would yield raw data, and any required data analysis might contribute to overhead. The Bayes protocol offers (almost) instant results because the data is continuously analyzed as part of the protocol.

ACKNOWLEDGMENTS

S.D. acknowledges support under the cooperative research agreement between the University of Maryland and the National Institute of Standards and Technology Physical Measurement Laboratory (Grant No. 70NANB14H209) through the University of Maryland. The authors thank Adam Pintar and Hossein T. Dinani for many helpful discussions.

Appendix A: Derivation of likelihood

This appendix provides a derivation of the likelihood, P(ns,i∣θ,di,n˜b,i,m˜b,i) of receiving ns,i signal counts given parameters θ, settings di={τi,mi} with precession time τi and ms, repeats. Background channel counts are incorporated via n˜b,i and m˜b,i given in (8) and (9) respectively.

P(θ∣yi,di)∝P(ns,i∣θ,di,n˜b,i,m˜b,i)P(θ∣yi−1,di−1). (A1)

where P(θ) incorporates n and m data from all preceding epochs. The derivation expresses the likelihood of nb counts in mb repeats as a function of a signal count rate λs, which is the product of the ratio R(θ,τ) and the background count λb.

The distribution P(λb) is determined from nb and mb, then eliminated from the final expression by integration. To simplify notation, we suppress the explicit τ dependence in the following.

The likelihood of receiving ns signal counts in ms repeats is a Poisson distribution with mean msR(θ)λb.

P(ns∣θ,ms,λb)=(msR(θ)λb)nse−msR(θ)λbns!. (A2)

The background count rate distribution is determined by n˜b and m˜b

P(λb)∝(m˜bλb)n˜be−m˜bλbn˜b!λbν. (A3)

The fraction in this expression is a Poisson distribution expressing the likelihood of counting n˜b photons. With m˜b=0 experiments and n˜b=0 photons collected, the trailing λbν can be viewed as a prior with exponent ν to be determined later. For the Jeffreys prior, ν = −1/2.

The distribution of λb values is incorporated into the likelihood of ns by integration.

P(ns∣θ,ms,n˜b,m˜b)=∫P(ns∣θ,ms,λb)P(λb∣n˜b,m˜b)dλb (A4)

Substituting from (A2) and (A3), the integral is tractable, yielding

P(ns∣θ,ms,n˜b,m˜b)=C[R(θ)nsmsR(θ)+m˜b]ns+n˜b+1+ν. (A5)

The prior exponent ν is selected so that the net effect of two likelihoods from two identical measurement results is the same as a single likelihood with combined data. That is, we require

P(ns∣θ,ms,n˜b,m˜b)2∝P(2ns∣θ,2ms,2n˜b,2m˜b), (A6)

which is satisfied by ν = −1.

Testing also confirmed ν = −1. Using ν = 0, the simulations converged to incorrect mean parameter values. With ν = −1 the simulations regularly converged to the true values within a standard deviation.

We also note that with the choice of ν = −1 (A3) is a gamma distribution of the general form

λb∼Γ(α,β)=βαλbα−1e−βλbΓ(α), (A7)

with α→0 and β→0 and where Γ(x) is the gamma function. Gamma distributions are conjugate priors for Poisson likelihoods, and in the case α→0 and β→0, the gamma distribution becomes “vague” as its variance → ∞.

The factor C in (A5) contains exponential functions ms!,m˜b!, and (ms+m˜b)!, which are computationally challenging for large m values. Since the θ distribution is explicitly normalized in software, we are free to choose a convenient pseudo normalization for the likelihood provided that the θ dependence is preserved. To eliminate factorials we choose the following pseudo-normalization,

P(ns∣θ,ms,n˜b,m˜b)∝R(θ)ns[ms+m˜bmsR(θ)+mb]ns+n˜b. (A8)

where C has been replaced by 1 and the θ-independent numerator ms+m˜b has been inserted to ensure that the fraction in square brackets is of order unity.

Figure 5 illustrates the performance and behavior (7) or (A8) for different numbers of background measurements, mb. The inset shows that the likelihood is a peaked function that approaches a Poisson distribution as m˜b increases. The main plot shows the effect of the m˜b on the performance of the SBED method. Only marginal improvements are gained by extending background measurements beyond nb≳10×ns.

FIG. 5.

FIG. 5.

Influence of background count averaging on the performance of the Bayesian protocol. The inset plots the likelihood of ns = 1 as a function of R for m = 10 repeats per epoch, background counts summed over NΣ epochs, and λb = 0.15. The line labeled “Poisson” is proportional to the Poisson distribution for ns = 1 assuming λs = Rλb. In both the main figure and inset, the benefits of background averaging saturate for NΣ≳10.

Appendix B: Scaling of Tau protocol

Each epoch begins with a consistent phase uncertainty σϕ=τσω0=h. If the number of repeats per epoch is constant, each epoch decreases uncertainty by a constant factor β<1 on average. After the kth epoch,

σ∝βk (B1)

Each epoch requires measurement time proportional to τ, neglecting overhead, so total measurement time T scales as

T∝β−(k+1) (B2)

The net behavior is therefore predicted to follow Heisenberg scaling,

σ∝1/T, (B3)g

under the assumption that the number of repeats per epoch is constant.

VI. DATA AVAILABILITY

The data that support the findings of this study are available from the corresponding author upon reasonable request.

REFERENCES

  • 1.Chernobrod BM and Berman GP, Journal of applied physics 97, 014903 (2005). [Google Scholar]
  • 2.Balasubramanian G, Chan IY, Kolesov R, Al-Hmoud M, Tisler J, Shin C, Kim C, Wojcik A, Hemmer PR, Krueger A, Hanke T, Leitenstorfer A, Bratschitsch R, Jelezko F, and Wrachtrup J, Nature 455, 648 (2008). [DOI] [PubMed] [Google Scholar]
  • 3.Maze JR, Stanwix PL, Hodges JS, Hong S, Taylor JM, Cappellaro P, Jiang L, Dutt MVG, Togan E, Zibrov AS, Yacoby A, Walsworth RL, and Lukin MD, Nature 455, 644 (2008). [DOI] [PubMed] [Google Scholar]
  • 4.Taylor JM, Cappellaro P, Childress L, Jiang L, Budker D, Hemmer PR, Yacoby A, Walsworth R, and Lukin MD, Nature Physics 4, 810 (2008). [Google Scholar]
  • 5.Rondin L, Tetienne J-P, Hingant T, Roch J-F, Maletinsky P, and Jacques V, Reports on Progress in Physics 77, 056503 (2014). [DOI] [PubMed] [Google Scholar]
  • 6.Hingant T, Tetienne J-P, Martínez LJ, Garcia K, Ravelosona D, Roch J-F, and Jacques V, Physical Review Applied 4, 014003 (2015). [Google Scholar]
  • 7.van der Sar T, Casola F, Walsworth R, and Yacoby A, Nature Communications 6, 7886 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Tetienne J-P, Hingant T, Kim J-V, Diez LH, Adam J-P, Garcia K, Roch J-F, Rohart S, Thiaville A, Ravelosona D, and Jacques V, Science 344, 1366 (2014). [DOI] [PubMed] [Google Scholar]
  • 9.Tetienne J-P, Dontschuk N, Broadway DA, Stacey A, Simpson DA, and Hollenberg LCL, Science Advances 3, e1602429 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Rondin L, Tetienne JP, Rohart S, Thiaville A, Hingant T, Spinicelli P, Roch JF, and Jacques V, Nature Communications 4, 2279 (2013). [DOI] [PubMed] [Google Scholar]
  • 11.Turner MJ, Langellier N, Bainbridge R, Walters D, Meesala S, Babinec TM, Kehayias P, Yacoby A, Hu E, Lončar M, Walsworth RL, and Levine EV, Physical Review Applied 14, 014097 (2020). [Google Scholar]
  • 12.Horsley A, Appel P, Wolters J, Achard J, Tallaire A, Maletinsky P, and Treutlein P, Physical Review Applied 10, 044039 (2018). [Google Scholar]
  • 13.Appel P, Ganzhorn M, Neu E, and Maletinsky P, New Journal of Physics 17, 112001 (2015). [Google Scholar]
  • 14.Kucsko G, Maurer PC, Yao NY, Kubo M, Noh HJ, Lo PK, Park H, and Lukin MD, Nature 500, 54 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.McGuinness LP, Yan Y, Stacey A, Simpson DA, Hall LT, Maclaurin D, Prawer S, Mulvaney P, Wrachtrup J, Caruso F, Scholten RE, and Hollenberg LCL, Nature Nanotechnology 6, 358 (2011). [DOI] [PubMed] [Google Scholar]
  • 16.McCoey JM, Matsuoka M, Gille RW, Hall LT, Shaw JA, Tetienne J, Kisailus D, Hollenberg LCL, and Simpson DA, Small Methods 4, 1900754 (2020). [Google Scholar]
  • 17.Ziem FC, Götz NS, Zappe A, Steinert S, and Wrachtrup J, Nano Letters 13, 4093 (2013). [DOI] [PubMed] [Google Scholar]
  • 18.Ermakova A, Pramanik G, Cai J-M, Algara-Siller G, Kaiser U, Weil T, Tzeng Y-K, Chang HC, McGuinness LP, Plenio MB, Naydenov B, and Jelezko F, Nano Letters 13, 3305 (2013). [DOI] [PubMed] [Google Scholar]
  • 19.Barry JF, Turner MJ, Schloss JM, Glenn DR, Song Y, Lukin MD, Park H, and Walsworth RL, Proceedings of the National Academy of Sciences 113, 14133 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.DeVience SJ, Pham LM, Lovchinsky I, Sushkov AO, Bar-Gill N, Belthangady C, Casola F, Corbett M, Zhang H, Lukin M, Park H, Yacoby A, and Walsworth RL, Nature Nanotechnology 10, 129 (2015). [DOI] [PubMed] [Google Scholar]
  • 21.Rugar D, Mamin HJ, Sherwood MH, Kim M, Rettner CT, Ohno K, and Awschalom DD, Nature Nanotechnology 10, 120 (2014). [DOI] [PubMed] [Google Scholar]
  • 22.Höberle T, Schmid-Lorch D, Reinhard F, and Wrachtrup J, Nature Nanotechnology 10, 125 (2015). [DOI] [PubMed] [Google Scholar]
  • 23.Mamin HJ, Kim M, Sherwood MH, Rettner CT, Ohno K, Awschalom DD, and Rugar D, Science 339, 557 (2013). [DOI] [PubMed] [Google Scholar]
  • 24.Bhallamudi VP and Hammel PC, Nature nanotechnology 10, 104 (2015). [DOI] [PubMed] [Google Scholar]
  • 25.Staudacher T, Shi F, Pezzagna S, Meijer J, Du J, Meriles CA, Reinhard F, and Wrachtrup J, Science 339, 561 (2013). [DOI] [PubMed] [Google Scholar]
  • 26.Jahnke KD, Naydenov B, Teraji T, Koizumi S, Umeda T, Isoya J, and Jelezko F, Applied Physics Letters 101, 012405 (2012). [Google Scholar]
  • 27.Balasubramanian G, Neumann P, Twitchen D, Markham M, Kolesov R, Mizuochi N, Isoya J, Achard J, Beck J, Tissler J, Jacques V, Hemmer PR, Jelezko F, and Wrachtrup J, Nature Materials 8, 383 (2009). [DOI] [PubMed] [Google Scholar]
  • 28.Hadden JP, Harrison JP, Stanley-Clarke AC, Marseglia L, Ho Y-LD, Patton BR, O’Brien JL, and Rarity JG, Applied Physics Letters 97, 241901 (2010). [Google Scholar]
  • 29.Jensen K, Leefer N, Jarmola A, Dumeige Y, Acosta V, Kehayias P, Patton B, and Budker D, Physical Review Letters 112, 160802 (2014). [DOI] [PubMed] [Google Scholar]
  • 30.Riedrich-Möller J, Pezzagna S, Meijer J, Pauly C, Mücklich F, Markham M, Edmonds AM, and Becher C, Applied Physics Letters 106, 221103 (2015). [Google Scholar]
  • 31.Babinec TM, Hausmann BJM, Khan M, Zhang Y, Maze JR, Hemmer PR, and Lončar M, Nature Nanotechnology 5, 195 (2010). [DOI] [PubMed] [Google Scholar]
  • 32.Maletinsky P, Hong S, Grinolds MS, Hausmann B, Lukin MD, Walsworth RL, Loncar M, and Yacoby A, Nature Nanotechnology 7, 320 (2012). [DOI] [PubMed] [Google Scholar]
  • 33.Pelliccione M, Jenkins A, Ovartchaiyapong P, Reetz C, Emmanouilidou E, Ni N, and Bleszynski Jayich AC, Nature Nanotechnology 11, 700 (2016). [DOI] [PubMed] [Google Scholar]
  • 34.Dinani HT, Berry DW, Gonzalez R, Maze JR, and Bonato C, Physical Review B 99, 125413 (2019). [Google Scholar]
  • 35.Waldherr G, Neumann P, Huelga SF, Jelezko F, and Wrachtrup J, Physical Review Letters 107, 090401 (2011). [DOI] [PubMed] [Google Scholar]
  • 36.Aslam N, Waldherr G, Neumann P, Jelezko F, and Wrachtrup J, New Journal of Physics 15, 013064 (2013). [Google Scholar]
  • 37.Shields B, Unterreithmeier Q, de Leon N, Park H, and Lukin M, Physical Review Letters 114, 136402 (2015). [DOI] [PubMed] [Google Scholar]
  • 38.Bluvstein D, Zhang Z, and Jayich ACB, Physical Review Letters 122, 076101 (2019). [DOI] [PubMed] [Google Scholar]
  • 39.Jaskula J-C, Shields B, Bauch E, Lukin M, Trifonov A, and Walsworth R, Physical Review Applied 11, 064003 (2019). [Google Scholar]
  • 40.Hacquebard L and Childress L, Physical Review A 97, 063408 (2018). [Google Scholar]
  • 41.Hopper DA, Grote RR, Exarhos AL, and Bassett LC, Physical Review B 94, 241201 (2016). [Google Scholar]
  • 42.Acosta VM, Jarmola A, Bauch E, and Budker D, Physical Review B 82, 201202 (2010). [Google Scholar]
  • 43.Acosta VM, Bauch E, Jarmola A, Zipp LJ, Ledbetter MP, and Budker D, Applied Physics Letters 97, 174104 (2010). [Google Scholar]
  • 44.Dushenko S, Ambal K, and McMichael RD, Physical Review Applied 14, 054036 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 45.Degen C, Reinhard F, and Cappellaro P, Reviews of Modern Physics 89, 035002 (2017). [Google Scholar]
  • 46.Kitaev AY, arXiv:quant-ph/9511026 (1995), arXiv: quant-ph/9511026.
  • 47.Kitaev AY, in Electr. Coll. Comput. Complex. (1996) pp. TR96–003.
  • 48.Higgins BL, Berry DW, Bartlett SD, Wiseman HM, and Pryde GJ, Nature 450, 393 (2007). [DOI] [PubMed] [Google Scholar]
  • 49.Berry DW, Higgins BL, Bartlett SD, Mitchell MW, Pryde GJ, and Wiseman HM, Physical Review A 80, 052114 (2009). [Google Scholar]
  • 50.Said RS, Berry DW, and Twamley J, Physical Review B 83, 125410 (2011). [Google Scholar]
  • 51.Cappellaro P, Physical Review A 85, 030301 (2012). [Google Scholar]
  • 52.Bonato C, Blok MS, Dinani HT, Berry DW, Markham ML, Twitchen DJ, and Hanson R, Nature Nanotechnology 11, 247 (2016). [DOI] [PubMed] [Google Scholar]
  • 53.Higgins BL, Berry DW, Bartlett SD, Mitchell MW, Wiseman HM, and Pryde GJ, New Journal of Physics 11, 073023 (2009). [Google Scholar]
  • 54.Nusran NM, Momeen MU, and Dutt MVG, Nature Nanotechnology 7, 109 (2012). [DOI] [PubMed] [Google Scholar]
  • 55.Waldherr G, Beck J, Neumann P, Said RS, Nitsche M, Markham ML, Twitchen DJ, Twamley J, Jelezko F, and Wrachtrup J, Nature Nanotechnology 7, 105 (2012). [DOI] [PubMed] [Google Scholar]
  • 56.Hayes AJF and Berry DW, Physical Review A 89, 013838 (2014). [Google Scholar]
  • 57.Gentile A, Santagati R, Schmitt S, and McGuinness LP, “Experimental Datasets,” (2019).
  • 58.Santagati R, Gentile A, Knauer S, Schmitt S, Paesani S, Granade C, Wiebe N, Osterkamp C, McGuinness L, Wang J, Thompson M, Rarity J, Jelezko F, and Laing A, Physical Review X 9, 021019 (2019). [Google Scholar]
  • 59.Chaloner K and Verdinelli I, Statistical Science 10, 273 (1995). [Google Scholar]
  • 60.Granade CE, Ferrie C, Wiebe N, and Cory DG, New Journal of Physics 14, 103013 (2012). [Google Scholar]
  • 61.Granade C, Ferrie C, Hincks I, Casagrande S, Alexander T, Gross J, Kononenko M, and Sanders Y, Quantum 1, 5 (2017), arXiv: 1610.00336. [Google Scholar]
  • 62.Huan X and Marzouk YM, Journal of Computational Physics 232, 288 (2013). [Google Scholar]
  • 63.McMichael RD, Blakley SM, and Dushenko S, Journal of Research of the National Institute of Standards and Technology 126, 126002 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 64.Vasicek O, Journal of the Royal Statistical Society. Series B (Methodological) 38, 54 (1976), publisher: [Royal Statistical Society, Wiley]. [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request.

RESOURCES