{'fraction_non_alphanumeric': 0.034945081389552574, 'fraction_numerical': 0.0062052013682383075, 'mean_word_length': 4.573139189577546, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Accuracy of dynamical-decoupling-based spectroscopy of Gaussian noise

The fundamental assumption of dynamical decoupling based noise spectroscopy is that the coherence decay rate of qubit (or qubits) driven with a sequence of many pulses, is well approximated by the environmental noise spectrum spanned on frequency comb defined by the sequence. Here we investigate the precise conditions under which this commonly used spectroscopic approach is quantitatively correct. To this end we focus on two representative examples of spectral densities: the long-tailed Lorentzian, and finite-ranged Gaussian---both expected to be encountered when using the qubit for nano-scale nuclear resonance imaging. We have found that, in contrast to Lorentz spectrum, for which the corrections to the standard spectroscopic formulas can easily be made negligible, the spectra with finite range are more challenging to reconstruct accurately. For Gaussian line-shape of environmental spectral density, direct application of the standard dynamical decoupling based spectroscopy leads to erroneous attribution of long-tail behavior to the reconstructed spectrum. Fortunately, artifacts such as this, can be completely avoided with the simple extension to standard reconstruction method.

The fundamental assumption of dynamical decoupling based noise spectroscopy is that the coherence decay rate of qubit (or qubits) driven with a sequence of many pulses, is well approximated by the environmental noise spectrum spanned on frequency comb defined by the sequence. Here we investigate the precise conditions under which this commonly used spectroscopic approach is quantitatively correct. To this end we focus on two representative examples of spectral densities: the long-tailed Lorentzian, and finite-ranged Gaussian-both expected to be encountered when using the qubit for nano-scale nuclear resonance imaging. We have found that, in contrast to Lorentz spectrum, for which the corrections to the standard spectroscopic formulas can easily be made negligible, the spectra with finite range are more challenging to reconstruct accurately. For Gaussian line-shape of environmental spectral density, direct application of the standard dynamical decoupling based spectroscopy leads to erroneous attribution of long-tail behavior to the reconstructed spectrum. Fortunately, artifacts such as this, can be completely avoided with the simple extension to standard reconstruction method.
The single qubit DDNS method utilizes a two level probe coupled to its environment via a phase noise Hamil-tonianĤ int ∝Vσ z . Here the Pauli operatorσ z pertains to the qubit, while the environmental operatorV can be replaced with a stochastic function when the semiclassical approximation is applicable to environmentqubit coupling. It is assumed that the coupling does not facilitate energy intake from the environmental noise (i.e. the coupling operator commutes with the free Hamiltonian of the qubit, [Ĥ Q ,Ĥ int ] = 0), so that the interaction only affects the coherence betweenσ z operator eigenstates |± . Ultimately, it leads to the decay of this coherence-this is the process of pure dephasing, a specific kind of decoherence. The course of this decoherence process is directly influenced by the properties of the noise. Hence, it is possible to infer those properties from the examination of the qubit's evolution. However, a passive observation offers only limited insight, and in order to obtain more detailed quantitative information one needs a method for signal analysis. This is accomplished by controlling the qubit with a sequences of virtually instantaneous π pulses that cause its Bloch vector to * piotr.szankowski@ifpan.edu.pl flip, without introducing any other kind of disruption to the normal phase evolution. The properly devised pulse sequences act as an adjustable narrow-band frequency filter of the incoming noise [1, 3-6, 11, 21-23]. Originally, this method was used to decouple the qubit from the environment (and in this way enhance its coherence time) by setting the passband of the filter beyond the frequency range of the noise [24][25][26][27][28][29][30]. Because of this initial application, the qubit control via pulse sequences is often referred to as dynamical decoupling. In the context of noise spectroscopy, it allows one to dissect the spectral distribution of the signal by decoupling the qubit from all but a handful of frequencies, thus relating the dephasing rate only to those specific parts of the noise spectrum [1, 3-5, 11, 21].
The standard theoretical formulation of the noise spectroscopy method relies on the approximation where the width of the passband of the pulse sequence-induced frequency filter is set to zero. In practice, this approximation amounts to replacing the band-pass filter function that modulates the noise, with a series of Dirac deltas (so-called Dirac comb) centered at frequencies defined by the properties of the applied pulse sequence [1, 3-5, 21, 28, 31]. The resultant expression for the qubit's decoherence rate, to which we will refer to as the spectroscopic formula, establishes an invertible relation with the values of noise spectrum, enabling their reconstruction from the measured coherence lifetimes. The main goal of this paper is to quantitatively understand the behavior of the corrections to this approximate result, and consequently to elucidate the conditions under which they become negligible-in other words, to quantitatively define the spectroscopic regime of evolution parameters. To this end we will examine the exact results for the decoherence and compare it with the spectroscopic formulas. It goes without saying that these kinds of calculations are not feasible for completely arbitrary noise spectrum. Instead, we consider two representative types of noise spectra, relevant for nanoscale nuclear sensing [12,20,[32][33][34][35][36]: (i) a spectral density with a long tail, i.e. having a power-law decay for large frequencies (∼ (1/ω) β as ω → ∞, with β 2 and β ∈ Integers), exemplified by the Lorentzian spectrum, (ii) the finite-range Gaussianshaped spectrum, that decays faster than power-law [37]. The most important, from practical point of view, conclusion of our analysis is that the noise spectroscopy method based on the assumption of operating within a deltafunction approximation leads to artifacts in reconstruction of tails of Gaussian-shaped spectrum (more generally, any spectrum with finite range). The basic reason for this is the following. The peaks of the frequency filter generated by the pulse sequence are of course only approximately delta-shaped-in fact the envelope of the filter decays as a power-law as a function of detuning from one of its maxima. The overlap between these tails of the filter envelope and the spectrum is the main source of corrections to the spectroscopic formula. The crucial, and somewhat obvious, observation regarding the finite-ranged type spectrum is that when the characteristic frequency of the sequence is set outside of its range, the spectral density at this frequency becomes negligibly small, which in turn makes the "spectroscopic" contribution negligible as well. When this is the case, the only contribution to dephasing is due to the above-mentioned corrections. In those circumstances, when one operates under an assumption that the delta-function approximation holds true, one is forced to mistakingly interpret the correction as a feature of the reconstructed spectrum. While a similar problem might also arise in the case of long-tailed spectrum, the key difference is that the dependencies of the spectroscopic formula and the correction on the "filtering frequency" of the sequence are now of the same character-both exhibit power-law tails, which makes the relative error much easier to manage with adjustments to used pulse sequences. Unfortunately, in the case of finite-ranged spectra, no feasible modifications of pulse sequences could overcome this problem. However, we show that a simple extension to the reconstruction method allows one to obtain results completely free of these artifacts, even if the relative error between spectroscopic formula and the correction is large.
The structure of the paper is the following. In Sec. II we briefly summarize the theoretical underpinnings of DDNS, and the possible sources of inaccuracies of spectrum reconstruction. Then, in Sec. III, we elucidate the structure of the exact result for decoherence due to Gaussian phase noise, and identify the expressions corresponding to the spectroscopic regime, and the correction terms. The calculations for Lorentzian-and Gaussian-shaped spectra are presented in Sec.IV and V, respectively, the latter section ending with discussion of erroneous attribution of the long tail to the finite-ranged spectrum when the standard reconstruction method is applied. We show how to fix this problem with an appropriate modification to the standard method introduced in Sec. VI. Finally, in Sec. VII we discuss the other sources of reconstruction errors (due to use of a finite number of measurements) for the modified spectroscopic method.

II. STATEMENT OF THE THEORETICAL PROBLEM
In technical terms, the phase noise driving the evolution of the qubit imprints some information about its properties onto the off-diagonal elements of the qubit density matrix-its coherence Here, |± are the eigenstates of the Z-component of the qubit spin operator, andρ Q is the density matrix of the qubit obtained by averaging over noise realizations in the case of classical noise, or by partial tracing the full qubitenvironment state. The exponent above is called the attenuation function, and for stationary Gaussian noise is determined by the noise correlation function C(|t|) (this is true for both classical and quantum noise [1,9]), where the time-domain filter function, encapsulates the effects of the control sequence composed of n π-pulses applied to the qubit at times t 1 , t 2 , . . . , t n (we also used the conventional notation where t 0 = 0 and t n+1 = T ). In the spectroscopic regime (discussed in greater detail in Sec. III) the filter functions are approximated by the frequency Dirac comb and the imprinted information consists of the noise power spectrum, S(ω) = ∞ −∞ e −iωt C(|t|)dt, encoded in the decoherence rate via spectroscopic formula, (Note the absence of zero frequency term in the sum.) The coefficients weighting the spectrum are the Fourier series coefficients of the filter, and the characteristic frequency of the sequence, ω p , is the smallest multiple of 2π/T present in the expansion [1]. The lack of zero frequency term in Eq. (4) is a consequence of an additional assumption that all pulse sequences considered here are "balanced" , i.e. c 0 = T −1 T 0 f T (t)dt = 0. Assuming the spectroscopic formula is exact, the function S(ω) can now be reconstructed using theÁlvarez-Suter method [1,4]. The necessary data is acquired in a series of experiments, each performed with a different pulse sequence characterized by frequency ω j and Fourier coefficients c (j) mωj . Then, the relationship between the corresponding measured attenuation functions and the unknown values of spectral density can be cast into vector form, Here, U j,m is a matrix composed of known Fourier coefficients, S m are the components of the vector of spectrum values picked out by the frequency combs of each applied sequence. Because of the frequency cut-off, m c , introduced so that U is of finite dimension, it becomes possible to invert the above relation and restore the noise spectrum, S m = j U −1 m,j χ (j) (T j )/T j . Of course, the inverse of U j,m exists only if sequences used in the procedure are chosen in an appropriate way, e.g., the number of sequences (indexed with j) must be compatible with cut-off m c , so that U is a square matrix.
Clearly, the accuracy of the reconstruction scheme is directly linked to the veracity of the spectroscopic formula itself. The disparity between the real value of the measured attenuation function and Eq. (4) has two main sources: the execution and the methodology errors.
The execution errors include all "technical" shortcomings of the procedure: (i) the measurement error, and (ii) the discrepancy between the actual physical realization of π-pulse and their idealization that leads to filter function (6). From this point we will assume that the procedure is being executed perfectly and the above errors are negligibly small. Such an assumption is well motivated, since in many noise spectroscopy experiments [12,38] the systematic pulse errors are being efficiently neutralized by routinely employed countermeasures [39]. However, recently it was noticed that non negligible pulse durations might lead to an appearance of a modified filter function, for which the contributions from higher harmonics of ω p are amplified [40]. In certain circumstances, this can complicate the reconstruction of spectra of a particular structure [40]. This can be counteracted by replacing short pulses with appropriately optimized continuous driving [41]. Here we neglect this kind of error, as we focus on single-peaked spectral densities the results for which should not be strongly affected by finite pulse width.
The methodology errors account for inaccurate statements made during the development of the theoretical side of the problem, namely: 1. The presence of transverse coupling that deviates the qubit evolution from the pure dephasing model. 2. Possible non-Gaussian nature of the noise, which causes the "pollution" of attenuation function (2) with contribution from higher order noise correlations (noise cumulants).
3. In practice, the theoretical value of the coherence given by Eq. (1) cannot be acquired directly, but rather it must be estimated from a finite number of measurements. This limitation unavoidably leads to an imperfect estimation of the attenuation function (2).
4. The deviation from frequency comb approximation to filter functions.
5. The introduction of cut-off m c required by the spectrum reconstruction method discussed above.
Here we shall assume that the noise is exactly Gaussian and the contribution from transverse couplings is negligible, so that the first and second point of the list can be completely ignored. As a side note, DDNS methods can be adapted to characterize the spectrum of transversely coupled low-frequency noise [42], and a proposition for a general extension to DDNS enabling an analog of spectroscopy for the case of non-Gaussian noises has been recently reported in [43]. Moreover, we assume that the inaccuracies in the estimation of the attenuation function described in the third point, can be also safely neglected. The Bayesian approach to analysis of such finite sets of data was eloquently advocated for in the context of noise spectroscopy in [44]. The fourth point is the main focus of the investigations presented in the following sections. The fifth item of the list will be addressed in Sec. VII, where we will discuss the cut-off error of the modifiedÁlvarez-Suter method (introduced in Sec. VI).

III. THE SPECTROSCOPIC REGIME
The foundation of DDNS method, the spectroscopic formula (4), is an approximate form of the attenuation function (2). When the pulse sequence parameters (i.e., the duration T , and the characteristic frequency ω p ) allow for approximating the attenuation function by Eq. (4) with desired accuracy, we then operate in the spectroscopic regime. The main purpose of this section is to define this regime. Anticipating the structure of the final result we start by substituting in (2) the time-domain filter functions with their Fourier series expansions (5), The attenuation function has been split into two parts: the "diagonal" part that is proportional to T , and the "off-diagonal" remainder. In a nutshell, the main objective of the spectroscopic approximation is to extend the upper limit of integration in (8) to infinity. By doing so the time integrals become Fourier transforms of C, thus providing the access to parts of noise spectrum at frequencies commensurate with the characteristic frequency of the sequence ω p . This objective can be achieved when, for fixed ω p , the sequence duration is much longer than the noise correlation time τ c , which quantifies the range of the correlation function, i.e., such τ c that C(τ ) τ τc −−−→ 0. This decay of correlation function is expected on physical grounds. For a completely deterministic signal the correlation time is infinite, because it is possible to determine with certainty the value of the signal at one time point knowing its value at a different time (via its equations of motion). With the introduction of randomness the correlation time is shortened, as the ability of the observer to predict the value of the signal from its earlier state or to deduce its previous values from a given state, is diminished.
When T τ c the upper limit may just as well be infinity, because the integration effectively terminates at τ c as the integrand vanishes beyond that point. Moreover, in the diagonal term we have 1 − τ /T ≈ 1, since under the integral τ τ c T . Also, in the same regime, the off-diagonal remainder term can be dropped because | ∞ 0 dτ C(|τ |)e imωpτ | ≤ ∞ 0 dτ |C(|τ |)| ∝ τ c , which is much smaller than the T -scaling diagonal term. In summary, we have so that the spectroscopic formula is obtained asymptotically for long sequence durations. An alternative and more popular approach is to first transform the attenuation function to frequency space, wheref T (ω) is the Fourier transform of f T (t). For large T the frequency-domain filter |f T (ω)| 2 has a form of sharply multi-peaked function, since The Dirac comb structure is obtained by passing to the limit of (infinitely) long sequence duration, Of course, strictly speaking, the limit T → ∞ is unachievable, and instead T should be compared with some characteristic time scale associated with S(ω). Usually it is argued that the spectral density changes significantly on frequency scales of order τ −1 c . Therefore, provided that T τ c , the rate of change of the spectrum is much slower than sinc functions, so that S(ω) can be treated as a constant around each peak. In this regime, each peak can be simply substituted with a delta function like in Eq. (12), even for finite T . Inserting this form of filter function into Eq. (10) yields the spectroscopic formula.
As it was touched upon previously, the conditions for achieving a spectroscopic regime should be investigated in the settings where ω p is fixed while the duration of the sequence T is treated as an adjustable parameter. Furthermore, by adopting an additional constrain that the sequence duration is manipulated only by increasing or decreasing the number of repetitions of a given pulse sequence, also the Fourier coefficients c mωp become independent of T and can be considered as fixed. To verify this assertion, let us define f T B (t) as the time-domain filter function of the "base" sequence to be repeated, with duration T B and characteristic frequency ω p . Keeping in mind that ω p is by definition a multiple of 2π/T B , we get where is the filter function representing a pulse sequence composed of n repetitions of the base sequence with total duration of T = nT B . Clearly, the Fourier coefficients do not depend on n and are set exclusively by the base sequence.
Within the setting described above, it is in principle possible to increase the sequence duration to an arbitrary extent, so that the spectroscopic regime can be achieved even for signals with extremely long correlation times. However, the spectroscopic formula indicates the linear T -scaling of the attenuation function, and consequently, the exponential decay of the coherence function W (T ). Therefore, there is a fine balance to be struck: on one hand T must be long enough to overcome τ c , but on the other hand it must be short enough so the measured coherence still remains significant enough to yield reliable data. Depending on the overall strength of the noise and its correlation time, achieving this balance might prove to be impossible. In such a case it is certainly better to sacrifice the possibility of reaching spectroscopic regime via "brute force," in favor of retaining non-zero coherence, and it becomes necessary to investigate the corrections to the spectroscopic formula, The following sections are dedicated to this task.

IV. LORENTZIAN SPECTRUM
Consider a model where the noise source (the environment) emits a signal with a spectral line at frequency ω s (and its mirror image at −ω s due to symmetries of Fourier transform) yielding a spectral density of the following form: with the line shape given by Lorentzian function Here v 2 is the effective noise strength and τ c is the noise correlation time. This type of line broadening is expected in, e.g. liquid or gaseous systems where the nuclear magnetic moments contributing to the emitted noise are in rapid relative motion (i.e. the system is in the motional narrowing regime), and the central frequency ω s can then be ascribed to precession in the external magnetic field [37]. A single-line Lorentzian spectrum (ω s = 0) is characteristic for the Ornstein-Uhlenbeck noise [45], that was shown to well describe the decoherence of electron spin qubit dipolarly coupled to a bath of electron spins [38]. The case of Lorentzian spectrum with ω s = 0 is also encountered for a qubit coupled to a source of random telegraph noise-a classical two-level fluctuator often encountered in solid state systems. While this type of noise has non-Gaussian statistics [i.e., it is not fully characterized by correlation function C(|t|)], for a weak qubitfluctuator coupling the Gaussian approximation works quite well, see [1] and references therein. The attenuation function for Lorentzian spectrum can be calculated exactly using methods of contour integrals in a complex plane, Poles of: The detailed derivation of this result is presented in Appendix A. Here we shall restrict the discussion to few key concepts which, although technical in nature, provide a valuable insight into physical origins of this particular form of the attenuation function. When treated as functions of a complex argument z, both the Lorentzian spectrum S(z) and the frequencydomain filter function |f T (z)| 2 are analytic functions in the whole complex plane except for isolated points where functions diverge-their poles. As it is depicted in Fig. 1, the Lorentzian spectrum possess a quartet of poles, distributed symmetrically in each quadrant of the complex The poles of the filter function are all located on the real line, exactly at the multiples of the characteristic frequency of the pulse sequence, mω p . (Technically speaking, sinc functions in (11) have only removable singularities, but ultimately, it is the positive or negative frequency parts exp[±i(z − mω p )T /2]/(z − mω p ) that individually contribute to integrals.) By taking advantage of this fact, the attenuation function in the form of overlap integral (10) can be calculated utilizing the residue theorem of complex analysis. Then it is straightforward to show that the spectroscopic formula χ S (T ) is a residue of poles of the "diagonal part" of the frequency-domain filter function (11a), while the contribution from poles of the "off-diagonal part", (11b), simply vanishes. Simulta-neously, the entirety of the correction ∆χ(T ) is composed of contribution from poles of the spectral density. This clear-cut distinction between the role of filter and spectrum poles suggest a following interpretation: the spectroscopic formula results from the spectrum being filtered by the filter, while the correction term results from a sort of role reversal, the filter being filtered by the spectrum.
With the exact form of the attenuation function (19) in hand we may proceed to examine the conditions under which the corrections to spectroscopic formula become negligible. For given base pulse sequence (i.e. fixed ω p and c mωp ) the value of ∆χ(T ) rapidly saturates, as the only T -dependent part proportional to e −T /τc , goes to zero for T τ c . Therefore, ∆χ(T ) can become negligible in comparison to χ S (T ) only because the linear Tscaling of the spectroscopic formula allows one to ramp up the sequence duration so that it overshadows the correction. The question now becomes, what is the bound on T which yields a satisfactorily small relative error. In general, providing a useful answer could prove to be problematic. Indeed, in principle, the parametric dependence of a spectroscopic formula and the correction to it on both the characteristic frequency and the Fourier coefficients of the sequence could be completely different. If that would be the case, then the bounds on T might vary wildly depending on which part of the spectrum we wish to probe (the choice of ω p ), and the manner in which we chose to do it (the choice of c mωp ). However, since the Lorentzian spectral density and the frequency-domain filter have similar analytical properties (most notably the presence of the power-law tail) the dependencies on ω p and c mωp of χ S and ∆χ are very much alike. Therefore, it is justifiable to simply ignore the ω p and c mωp dependence when comparing χ S and ∆χ, and focus only on T -dependence: According to the above formula, the relative error scales as τ c /T , and thus it can be efficiently diminished to the desired level, regardless of the choice of other pulse sequence parameters. We will encounter a very different situation for Gaussian-shaped spectrum in Sec. V. Note that relation (20) is nonperturbative, i.e., due to slow convergence it is impractical to represent the correction to a spectroscopic formula as a truncated Taylor series around some small parameter. Instead, it is more appropriate to approximate it with an asymptotic series in a large parameter T /τ c . On one hand, this observation is consistent with our description of the spectroscopic approximation, where the spectroscopic regime is achieved by extending the upper limit of time integrals in Eq. (8) far beyond τ c , so that T τ c . On the other hand, it suggests a significant conceptual problem in the approach where the frequency-domain filter in Eq. (10) is approximated by a Dirac comb. As we argued previously, the Dirac delta substitution is valid when the spectrum around peaks of |f T (ω)| 2 can be regarded as  (20) (empty symbols). The spectroscopic formula χS and the correction ∆χ were calculated for single line Lorentzian spectrum (ωs = 0) and a base two-pulse CP sequence with characteristic frequencies set to τcωp = 0.1 (circles), 1.0 (squares), and 2.0 (triangles), see Eqs. (21) and (22). The duration was manipulated by repeating the base sequences n times, so that T = n × 2π/ωp, where π/ωp = τp is the inter-pulse interval.
constant. The corrections to this 0th order term would be obtained by replacing S(ω) with its power series expansion around each peak, which would in turn lead to an undesirable Taylor series representation of (20). Therefore, the Dirac comb picture of the spectroscopic approximation has only limited utility: It provides a practical quantitative description only when the corrections to the spectroscopic formula can be completely neglected, but it is not a good starting point for consideration of corrections to this description. The importance of this point becomes particularly apparent in case of spectra with finite range, e.g. Gaussian spectrum discussed in the upcoming section.
The results of this section are illustrated with an example of a single line Lorentzian spectrum (ω s = 0) probed by a qubit subjected to an n ∈ even pulse Carr-Purcell (CP) sequence defined by pulse times t k = (k− 1 2 )τ p . The characteristic frequency of CP sequence is ω p = π/τ p , its Fourier coefficients are given by c (CP) mωp = e i π 2 m 2/(iπm) for m ∈ odd and zero otherwise, and the duration is T = nτ p = nπ/ω p . (Note that the n pulse CP sequence is equivalent to the n/2 repetitions of the base two-pulse CP sequence.) In this case the sums in Eqs. (19) can be carried out analytically yielding the following results Figure 2 compares the ratio of the correction to the spectroscopic formula given by the above formula and Eq. (20), as a function of sequence duration for three values of τ c ω p .

V. GAUSSIAN SPECTRUM
The second case we wish to investigate is, again, a spectrum with line at ω s (and its mirror image), but with the Gaussian line shape This form of line broadening is found, e.g. in magnetic noise emitted by immobile nuclear magnetic moments of crystal lattice [37], and thus it is an expected line-shape when a qubit such as a nitrogen-vacancy center is used to sense a group of nuclear spins from a nearby protein attached to the surface of a diamond nano-crystal [20].
Since the Lorentzian spectrum is characterized by its long tail, the feature obviously lacking in Gaussian spectrum, one should expect some fundamental differences between their respective correction to the spectroscopic formula. The first major difference is that the contour integrals method cannot be employed to calculate the attenuation function for the Gaussian spectrum. In short, since S G (z = iR) ∝ e R 2 R→∞ − −−− → ∞, it is impossible to devise an appropriate closed contour which would yield vanishing integrals when its radius is stretched to infinity (compare with Appendix A). Unfortunately, this implies that the clear-cut distinction between the roles of S(ω) and |f T (ω)| 2 we were able to find for Lorentzian spectrum cannot be invoked here.
The simplest approach to calculating the exact form of the attenuation function for the Gaussian spectrum we where able to identify is to instead remain in time-domain [i.e., to use Eq. (8)] and to utilize the error function defined as Note that for complex z it is implied that the integration is performed over a curve in a complex plane with fixed endpoint at 0 and z. Since e −z 2 is an analytical function and it does not posses any poles, the path of integration can be chosen arbitrarily, as the result is independent of its course. The resultant expression for attenuation function have a familiar structure of "diagonal" and "off-diagonal" sums over multiples of characteristic frequency, where the auxiliary J and K are given in terms of error functions: Although exact, the above expressions are not transparent enough to allow for clear interpretation and convincing estimation of spectroscopic regime conditions. Hence, we are forced to simplify them with an application of carefully tailored approximations, which we proceed to discuss below. First, let us consider in brief the frequency-domain overlap integral form of attenuation function (10). Even though, not useful for the purpose of concrete calculations, this form provides helpful insight into structure of the expression. For example, by comparing terms proportional to a given combinations of Fourier coefficients in (10) and (26), we can see that the diagonal part of χ results from the overlap with peaks of (11a), while the off-diagonal part from the overlap with peaks of (11b). Carrying this peaks-overlapping-with-spectrum picture to its logical conclusion, we can divide terms in χ into two groups [see panel (a) of Fig. 3]: (i) terms resultant from the overlap with peaks centered at frequencies mω p that lie far beyond the range of the spectrum, i.e., τ c |ω s − mω p | 1, (ii) terms resultant from peaks lying near the spectrum, so that τ c |ω s − mω p | 1. Note that such a divide between filter peaks is impossible for Lorentzian spectrum. The power-law decay of its tails is not abrupt enough to facilitate a sharply defined border between far and near frequencies. Of course, in the case of Gaussian spectrum, such a border exists, virtually by the very definition of finite-ranged spectral density. Having established this hierarchy of terms, the need to account for overlap with near peaks is certainly indisputable. On the other hand, it might seem reasonable to simply neglect whole contributions from far peaks, since the Gaussian spectrum decays very rapidly beyond its range. It is essential to recognize that this would be incorrect, because filter peaks possess long tails, see panel (b) of Fig. 3. Therefore, even for far peaks, the cumulative contribution from the overlap of their tails with the spectrum can be substantial, and should be included in some form. This is especially crucial when no peaks of the filter can be considered near-the contribution from the overlap of the peak tail with the spectrum is then the only nonvanishing term in the attenuation function.
Next, the minimal requirement for robust noise spectroscopy is the sequence duration to be much longer than the correlation time. Then, the matter of real interest is the manner in which the spectroscopic formula dominates over corrections to it. Therefore, it is justifiable to examine the exact formula for the attenuation function in the limit T τ c . This is in agreement with the comments on correction approximation from a previous section, which suggested the use of an asymptotic expansion for χ(T /τ c ).
Both the limit of long duration, and of far peaks can be treated within the same framework of the asymptotic series expansion. More precisely, since the difficulty with the interpretation of result (26) is directly tied to error functions, it is enough to approximate them with their asymptotic series: Re z > 0 : erf(z) Re z = 0 : erf(z = iy) The first series is relevant for T -dependent parts of J and K (Eqs. (27a) and (28a)), both for far and near peak terms. The second series can be applied only to Tindependent parts of auxiliary functions (Eqs. (27b) and (28b)), and only to far peak terms where erf arguments satisfy τ c |ω| 1. Expanding an appropriate expressions to the lowest order recovers the spectroscopic formula χ S (T ) ∝ T and the correction term, which we split into three parts: the T -dependent ∆χ T and far and near peak T -independent ∆χ 0,far/near , Here J 0 and K 0 are the T -independent parts of auxiliary functions, given by Eq. (27b) and (28b) respectively. We also introduced a shorthand notation m ∈ far which indicates that the sum runs over only such m-s that satisfy |m|ω p − ω s τ −1 c , and m ∈ near to indicate sums over all other m-s.
For T τ c , as seen in Eq. (33), the extremely rapid decay of the absolute value of ∆χ T renders it completely negligible, as it can be made arbitrarily small (e.g. smaller then the expected measurement errors) with minimal increments of the duration. Therefore, analogous to the case of Lorentzian spectrum, also for Gaussian spectrum the mechanism behind spectroscopic approximation is the linear T -scaling of the spectroscopic formula χ S dominating over the T -independent ∆χ 0,near and ∆χ 0,far . However, in contrast to Lorentzian, the differences in analytical properties of Gaussian spectrum and the filter function lead to significant differences in parametric dependence of χ S and the correction on ω p and c mωp . In certain circumstances, this feature of finite range spectra puts a substantial constraint on applicability of spectroscopic approximation. For example, consider a case when CP sequence is used, and characteristic frequency is set to be significantly greater than central frequency of the spectral line, ω p − ω s τ −1 c . Additionally, the number of pulses n is set high enough so that the duration of the sequence, T = nπ/ω p , is much longer than τ c and ∆χ T ≈ 0. In these settings, the filter is exclusively composed of far peaks and the correction is given by ∆χ ≈ ∆χ 0,far (ω p ) ∼ (ω s /ω p ) 4 . The spectroscopic formula can then be approximated by retaining only the first term of series, χ S (ω p ) ∼ T exp −τ 2 c (ω s − ω p ) 2 /2 ; obviously it decays much faster than ∆χ(ω p ) with increasing ω p . Therefore, the cost of maintaining a constant level of relative error, paid in the number of additional pulses, ramps up super-polynomially when the sequence probes the edges of spectral line. This effect might lead to some difficulties with spectrum reconstruction for unaware observer. Unless an a priori knowledge allows one to anticipate the need for such an extreme ramp up of the duration (provided that this option in even within the technical limitations of the experiment), the correction eventually overtakes the finite range spectrum, appearing as if the long tail is an actual feature of spectral density. Figure 4 depicts an example of a scenario where such erroneous attribution would take place. In contrast, in the case of Lorentzian spectrum reconstruction, pitfalls like this are never encountered. Indeed, when the pulse sequence probes frequencies distant from the line center, ω p ω s , the correction behaves as ∼ (1/τ c ω p ) 4 -a generic feature for spectra with powerlaw tails (see Appendix B). This means that the decay of the correction is actually faster than that of the spectroscopic formula, which depends on characteristic frequency as ∼ (1/τ c ω p ) 2 . Therefore, in this case, when ω p is increased, the relative error improves even without the need for application of additional pulses. However, if the exponent of the power-law spectrum is greater, i.e. S(ω) → (1/ω) β with β > 4, the relative error might become larger with the increase of ω p , unless it is compensated for by the ramped up duration. Of course, this effect will never be as oppressive as in the case of finiteranged spectral densities.
It should be reiterated that the difficulties described One of them clearly overlaps with the spectrum, so that τc|mnωp − ωs| 1, and hence it is considered as a near peak. The other one is positioned away from the center of the spectral line, so that τc|m f ωp − ωs| 1, and in consequence is counted among far peaks. Panel (b) shows the overlap between the far peak and the Gaussian spectral line in the log scale. The distinction between far and near peaks is impossible to establish for long-tailed spectra, such as Lorentzian given by Eq. (17) and (18), and depicted here in orange, dashed line. (The correlation time is the same for both spectra.) The spectra and filter peaks have been normalized here to be of the same height.
above are of concern when one intends to reconstruct the tails of the spectral density. However, since the spectrum in the tail region is naturally much smaller than in vicinity of the spectral line center, the data required for tail reconstruction must be acquired with large enough accuracy to allow for observation of relatively small decay of the coherence. While recent experiments (see e.g. [20]) have not reached such accuracy yet, the ultimate experimental goal is to reach much higher precision, and then knowing about pitfalls such as the one described above becomes crucial. c . The number of pulses in each sequence was always the same, hence there was no attempt to ramp up the duration in order to compensate for rapid decay of the spectral density. The figure shows on the log scale the spectra S (AS) reconstructed with the exact χ (ωp) (crosses) and the approximate χ (ωp) ≈ χS + ∆χ0,near + ∆χ 0,far (circles), and compares them with the real course of the spectral density S(ω) (dotted line). The latter is in fact approximated very well by the spectroscopic formula, S (AS) (ωp) ≈ χS/T |cω p | 2 ≈ S(ωp) (squares). Note how the corrections ∆χ 0,far , ∆χ0,near dominate over χS, which then leads to erroneous attribution of the long-tailed behavior to the reconstructed spectrum.

VI. THE MODIFIED DATA ACQUISITION SCHEME FOR SPECTRUM RECONSTRUCTION METHOD
The discussion of the corrections to the spectroscopic formula for Gaussian spectrum revealed a serious drawback of standard approach to noise spectroscopy. The data required for the reconstruction of the spectral line shape, with limited prior knowledge of its character, has to be acquired with a large spread of pulse sequence characteristic frequencies ω p . For spectra with finite range, as the scanning frequency of the sequences strays from the center of the line, the contribution from the long tailed corrections start to dominate over rapidly decaying spectral density. In contrast to long-tailed spectra, this decay cannot be efficiently counteracted by the linear amplification with the sequence duration T of the spectroscopic formula. For this reason, it can become difficult to reliably distinguish whether one records the actual long tail of the spectrum, or merely an artifact of the method. Fortunately, our previous considerations also suggest a workaround for this conundrum.
The common feature of both the Lorentzian and the Gaussian spectrum is the rapid decay of the T -dependent part of the correction to the spectroscopic formula. In fact, a rough estimate for an arbitrary spectrum (see, Appendix B) shows that this decay is not a coincidence, and that it is at least as fast as C(|T |)-the correlation function of the noise at T . It follows, that as the duration becomes long in comparison to τ c , the only T -dependence in the attenuation function that remains is the linear scaling of the spectroscopic formula. Therefore, the contribution from long tailed correction can be circumvented by performing a linear fit F (T ) = a T + b to data points gathered in a series of measurements with fixed ω p and c mωp , and progressively longer duration. The slope of the fit to the data points for which the abscissa satisfies T τ c , is simply i.e. the duration independent part of the correction. The intercept b can then be discarded and the slope a fed as an input to the standardÁlvarez-Suter method for the spectrum reconstruction. The application of the above scheme solves two major problems of standard noise spectroscopy. (i) The use of the slopes a of the linear fit as an input forÁlvarez-Suter reconstruction method completely removes the contribution from the corrections to the spectroscopic formula. This obviously results in an improvement of the accuracy of the noise spectroscopy, but more importantly, it eliminates the possibility of accidental attribution of incorrect long tail behavior to the reconstructed spectral densities. (ii) The second is a more subtle, but nevertheless, important problem. As it was discussed multiple times, a successful implementation of noise spectroscopy hinges on having the ability to set the duration so that T τ c . More precisely, what is required is that the Tdependent correction to the spectroscopic formula, ∆χ T , is negligible, for which the condition T τ c is sufficient (but not necessary). However, since the noise spectrum is unknown until it is reconstructed, it is unreasonable to expect one to know in advance the value of τ c . If so, then how one could anticipate what value of T is long enough to enable a reliable reconstruction? Fortunately, the problem of ascertaining whether the condition T τ c is satisfied (or more generally, whether ∆χ T ≈ 0) can be solved by inspecting the data points used for the linear fit. Ideally, the values of the attenuation function, gathered in a measurement series would form a pattern similar to one shown in Fig. 5. The scattering of the initial points around the asymptotic linear trend signifies that ∆χ T is not yet negligible. This means that the durations corresponding to those points are comparable with τ c (which also provides an estimate for noise Here TB is the duration of 2-pulse CP sequence employed in the measurement of the first datum. The nth data point was obtained with a sequence composed of n repetitions of the first sequence, so that ωp and cmω p were fixed, while the duration was extended to nTB. The figure shows that for durations comparable with τc, when the T -dependent correction is still significant, the data points are scattered around the linear trend. Only after a number of duration increments, ∆χT becomes small enough, so that the points start to fall on a line. Hence, from the course of the plot we can determine that T ≈ 6TB is a minimal duration that satisfies the condition T τc. The following values of parameters where chosen for the simulations: ωp = 1, ωs = 0.7ωp, TB = 2π/ωp, τc = 3.5π/ωp and the noise spectrum was given by Eq. (23). correlation time, even before the spectrum is fully reconstructed). Therefore, the condition T τ c is satisfied for values of T greater than the duration beyond which the data points start to fall on a line, and the slope of this line is the suitable input forÁlvarez-Suter method. If all the data points fit to linear function, the slope can be obtained readily, at a rather low cost of lost opportunity for independent τ c estimation. More attention should be drawn to the eventuality when the data points are not fit well with a linear function. Encountering such a case should be read as a signal that the gathered data is not suited for the purpose of spectrum reconstruction, because either the durations used in the measurement series did not satisfy T τ c , or some of the fundamental assumptions of the theory are not met (e.g. the noise is not stationary, and hence, the spectral density is not defined). Obviously, such an "early warning system" is of a great value, as it allows to avoid mistakes which might have been missed if theÁlvarez-Suter method would be applied uncritically.

VII. THE ERROR ESTIMATION FOR MODIFIEDÁLVAREZ-SUTER METHOD
As it was touched upon in section II, the shape of the spectral line can be reconstructed withÁlvarez-Suter method, which takes as an input the measured attenuation functions acquired in a series of experiments performed with a properly chosen variety of pulse sequences. The first basic requirement for the method to workachieving the spectroscopic regime-can be effectively satisfied by employing the linear fit scheme described in Sec. VI. Then, the inputs expected by the reconstruction method in a form of normalized attenuation functions χ (j) (T j )/T j are replaced by slopes a j found for each pulse sequence. The vector relation between inputs and unknown spectrum values, (7), is now rewritten as As before, S m is the vector of unknown values of spectrum at frequencies picked out by pulse sequences, and U is the matrix of known Fourier coefficients. In order to invert this relation, the cut-off for dimensions of U has to be assumed, which is equivalent to approximation where the infinite sum over frequencies in a slope a j (or in the spectroscopic formula) is truncated at some m c : Therefore, the second requirement for successful implementation of the method is to introduce an error to its results with the cut-off m c . Here, our goal is to estimate this error.
We focus on the case where theÁlvarez-Suter method is implemented with CP sequences exclusively. The char-acteristic frequency of the first sequence is chosen arbitrarily as ω 1 = ω p . The remaining sequences have their frequencies set to subsequent harmonics of the first sequence: ω 2 = 3ω p , . . . , ω j = (2j − 1)ω p , . . . , ω jc = (2j c − 1)ω p = m c ω p , so that the totality of (m c + 1)/2 slopes a j can be generated. When we assume that the infinite series in each a j was truncated beyond mω j m c ω 1 = m c ω p , the elements of matrix U can be written in a compact way as where index j runs from 1 to j c = (m c + 1)/2, while m = 1, 3, . . . , m c . The value of spectrum at ω p can be recovered by applying the inverse of U The superscript (AS) reminds us that it is an approximation, and this value would equal real S(ω p ) only if the assumed cut-off was in effect. The inversion of U can be done analytically, and the relevant matrix elements are given by the following For simplicity we shall assume that the cut-off is fixed on m c = 13, so that the only elements of U −1 contributing to Eq. (41) come in with the negative sign. Substituting for a j the exact infinite sums, we obtain where J = {2, 3, 4, 6, 7} is the set of indices greater than 1 and no greater than j c = (m c + 1)/2, for which the matrix elements U −1 1,j are non-zero. The relative error between S (AS) (ω p ) and the actual value of the spectrum S(ω p ) is then bounded from above by The bound shows clearly that the error introduced by the cut-off assumption is mostly insignificant for spectra with finite range, as they decrease much faster than ln (e.g. for Gaussian spectrum with τ c ω s = 3 the relative error for m c = 1 and ω p = ω s is of order 10 −7 ). For long tailed spectra the error might be more significant, but still remains relatively small, as it is illustrated with an example of Lorentzian spectrum in Fig. 6.
For spectra centered around zero frequency (relevant for Ornstein-Uhlenbeck noise and weak coupling to random telegraph noise, as mentioned before) the bound (44) ceases to be useful, as it significantly overestimates the actual error. The spectrum of such a noise is a single line Lorentzian, and hence, we can employ the exact formulas for the infinite sums in (43), as given by Eqs. (21) and (22). The result is presented in Fig. 7, and it shows that even with cut-off set to m c = 3, the error is smaller than 10%, and drops below 1% for larger frequencies.

VIII. CONCLUSION
We investigated the exact results for the attenuation function of qubit exposed to Gaussian noise for two cases: the long-tailed Lorentzian-shaped and finiteranged Gaussian-shaped spectra of the noise. Our goal was to better understand the conditions for achieving the spectroscopic regime of pulse sequence parameters, in which the qubit's dephasing rate at time T is related in a simple way to values of the noise spectrum at a discrete set of frequencies determined by the sequence [4]. More formally, the spectroscopic regime is achieved, when the attenuation function χ(T ) from Eq. (1) is well approximated by the spectroscopic formula χ S (T ) from Eq. (15).
We argued that the correct approach to this problem is to fix the characteristic frequency ω p and the Fourier coefficients c mωp of the applied pulse sequences.
In these settings, the duration of evolution T becomes an adjustable parameter, which can be manipulated by changing the number of repetitions of the chosen pulse sequence. When T is much longer than the noise correlation time, the spectroscopic formula approximates very well the exact attenuation function, but this often comes at a price of making the coherence too small to be reliably measurable. It is thus important to understand the dependence of the correction to the spectroscopic formula, ∆χ [see Eq. (16)] on T , ω p and c mωp .
We have shown that for the long-tailed Lorentzian spectrum the correction and the spectroscopic formula depend parametrically on ω p and c mωp in a similar manner, and consequently the spectroscopic regime can be achieved unconditionally by increasing the duration, so that the linear in T scaling of the spectroscopic formula overpowers the T -independent correction. In contrast, the finite-ranged Gaussian spectrum decays much faster with increasing ω p than the long-tailed correction. Therefore, for characteristic frequencies far from the central frequency of the spectrum, the T -overpowering mechanism ceases to be efficient, as it must compensate for rapid decay of the spectral line edges. While these observations have been made by inspecting the exact calculations of the attenuation function for the case of Lorentzian-and Gaussian-shaped spectral densities, the qualitative difference in significance of corrections to the spectroscopic formula between the noise spectra that possess power-law tails, and the ones that are of finite-range, is a general result. The approximate calculations of attenuation function for arbitrary shape of spectral density presented in appendix B, support this assertion.
The unreliable spectroscopic approximation for finite ranged spectra may lead to misinterpretation of the reconstructed line shape, where the long tail of the correction is incorrectly ascribed to the spectrum of the noise. In other words, an uncritical use of the standard noise spectroscopy method can lead to reconstruction of spectrum with artificial power-law tails, when the real spectrum is in fact finite-ranged. We have proposed a scheme that circumvents this problem by exploiting the linear T -dependence of the attenuation function for long enough durations. The spectroscopic formula is recovered as a slope of the linear fit to data acquired in a series of measurements with fixed ω p and c mωp and progressively longer T .
Finally, we have discussed the accuracy ofÁlvarez-Suter spectrum reconstruction method [4] applied to data obtained with the modified scheme, and we have derived a simple bound on the error introduced by the assumed frequency cut-off.
Here we utilized the relation mT ω p = 2πk (k ∈ Integers) and we introduced the convergence factor η which sightly pushes the poles of the integrand into the upper part of the complex plane (the sign of η can be chosen arbitrarily). The first integral over real axis can be equated to the line integral over closed semicircle (understood here as an arc and the line segment connecting its endpoints) arcing in the upper half of the complex plane C + . Since the Lorentzian spectrum decays as 1/|z| 2 for large z, and T is positive, as the radius of the semicircle is sent to infinity, only the part of contour integral that coincides with the real line remains. Then, the contour integral can be calculated using Cauchy's residue theorem. Denoting by Res z0 [S(z)] the residue of S(z) in point z 0 , by z + j = iτ −1 c + ω s , iτ −1 c − ω s the poles of Lorentzian spectrum in the upper half-plane, and by mω p the second order pole of filter function, we proceed with the calculations: Thus we can see here, that the constituent of the spectroscopic formula, T /2S(mω p ), was obtained as a residue of the filter function. The second term of Eq. (A1) can be calculated in an analogous manner, except the semicircle has to be closed in the lower half-plane (so that the exp(−iT z) decays when the radius goes to infinity): Here, the poles of spectrum in the lower half-plane are − ω s , and due to convergence factor η, the filter function does not contribute any residues.
Having dealt with the diagonal terms, we turn to the second group, the "off-diagonal" terms proportional to combinations c m1ωp c m2ωp with m 1 = m 2 : Again, we turn to contour integrals and residue theorem which gives us the following result: (A5) Note the contribution form poles of filter function vanish identically because of m i T ω p = 2πk. Substituting this result back into the off-diagonal sum over m 1 and m 2 , it can be shown (utilizing symmetries of the Fourier coefficients, c −mωp = c * mωp and by interchanging the names of indices) that together with the diagonal sum, the whole expression can be transformed into form presented in Eqs. (19).
Appendix B: Estimate of the correction to the spectroscopic formula for arbitrary spectral line shape An arbitrary double line spectral density is of the form where ±ω s are the line positions (mirrored due to required symmetry of the spectrum), S 0 (ω) is the line shape, and C(|t|) = C 0 (|t|) cos ω s t is the corresponding correlation function. Throughout the following calculations we will also assume that the CP pulse sequence was in use, so that c mωp = e im π 2 2/(iπm). First we consider the case when the spectrum has a finite range τ −1 c . We will now estimate the value of the correction using the following approximations: (i) we substitute form (11) of frequency-domain filter into Eq. (10) for attenuation function, and (ii) since the line shape has finite range, we can split the sums into far and near peaks terms (see, Sec. V), (iii) in case of near terms we approximate sinc functions with Dirac deltas, as it was discussed in Sec. III, Eq. (12), (iv) in case of far peaks, bearing in mind relation m i T ω p = 2πk (k ∈ Integers), we treat the tails of sinc functions as slowly varying in comparison to spectral density. When we apply those prescriptions we obtain the following Therefore, our rough estimate shows that the T -dependent part of the correction scales as ∼ C(|T |), which decays rapidly for T τ c . We verified the veracity of the above approximation by performing numerical experiment where we attempt to use the unmodifiedÁlvarez-Suter method to reconstruct the tails of exponential spectrum S(ω) = [S E (ω − ω s ) + S E (ω + ω s )]/2, S E (ω) = e −τc|ω| (compare Sec. V). The result is presented in Fig. 8, and it confirms that (i) the estimate for attenuation function is accurate, (ii) similarly to the Gaussian spectrum, the reconstruction of the exponential spectral density faces difficulties with erroneous attribution of long tail behavior. c . The number of pulses in each sequence was always the same, hence there was no attempt to ramp up the duration in order to compensate for rapid decay of the spectral density. The figure shows on the log scale the spectra S (AS) reconstructed with the exact χ (ωp) (crosses) and the approximate formula (B2) (circles), and compares them with the real course of the spectral density S(ω) (dotted line).
Second, we consider the case when the spectrum has a long tail, i.e. the line shape S 0 decay as (1/|z|) β for |z| → ∞ (β 2 and β ∈ Integers). We can calculate the attenuation function using the same technique of contour integrals as for the Lorentzian spectrum. However, before we proceed with the calculations, it is very helpful to determine the properties of poles and residues of S(z) by examining features of the corresponding correlation function.
For positive t, the correlation function can be calculated using the residue theorem by closing the contour of integration in the upper half-plane. Denoting the poles of S(z) enclosed by the contour by z + j = iτ −1 j + ω j and the order of the pole by r j , we obtain the following expression: The correlation function is Real for every value of t, hence C(t > 0) =