# Deep learning enhanced noise spectroscopy of a spin qubit environment

Stefano Martina1,2,∗, Santiago Hernández-Gómez3,2,∗, Stefano Gherardini4,2,
Filippo Caruso1,2, Nicole Fabbri5,2 1 Dipartimento di Fisica e Astronomia,
Università di Firenze, I-50019, Sesto Fiorentino, Italy  2 European Laboratory
for Non-linear Spectroscopy (LENS), Università di Firenze, I-50019 Sesto
Fiorentino, Italy  3 Research Laboratory of Electronics, Massachusetts
Institute of Technology, Cambridge, MA 02139  4 Istituto Nazionale di Ottica
del Consiglio Nazionale delle Ricerche (CNR-INO), Area Science Park,
Basovizza, I-34149 Trieste, Italy  5 Istituto Nazionale di Ottica del
Consiglio Nazionale delle Ricerche (CNR-INO), I-50019 Sesto Fiorentino, Italy
∗ Equally contributed to this work<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

The undesired interaction of a quantum system with its environment generally
leads to a coherence decay of superposition states in time. A precise
knowledge of the spectral content of the noise induced by the environment is
crucial to protect qubit coherence and optimize its employment in quantum
device applications. We experimentally show that the use of neural networks
can highly increase the accuracy of noise spectroscopy, by reconstructing the
power spectral density that characterizes an ensemble of carbon impurities
around a nitrogen-vacancy (NV) center in diamond. Neural networks are trained
over spin coherence functions of the NV center subjected to different Carr-
Purcell sequences, typically used for dynamical decoupling (DD). As a result,
we determine that deep learning models can be more accurate than standard DD
noise-spectroscopy techniques, by requiring at the same time a much smaller
number of DD sequences.

, , , ,

  *

Keywords: Deep learning, Neural networks, Machine learning, Quantum machine
learning, Quantum noise, Quantum sensing, Quantum noise spectroscopy.

##  1 Introduction

Quantum sensing combines theoretical results with experimental and engineering
techniques to carry out inference of signals with improved accuracy and/or
less computation time by making use of quantum physics [1, 2].

A quantum sensor takes advantage of the fragility of its quantum properties,
such as quantum coherence or entanglement, to improve the detection of
external perturbations with higher accuracy compared to any classic sensor.
However, this same property implies that the quantum sensor is subjected to
detrimental noise stemming from the coupling with its environment. For this
reason, it is desirable to fully characterize the sensor’s environment, either
to filter out its detrimental effect, or to take it into account when
detecting external signals, for example, in algorithms using quantum optimal
control [3, 4, 5, 6, 7].

Neural networks (NNs) [8, 9], i.e., algorithmic models provided by the
interconnection of a group of nodes commonly called neurons, could be a
powerful tool to infer the sensor’s environment. In this context, deep
learning has been already proposed theoretically for the classification and
detection of quantum noise features [10, 11, 12], and employed experimentally
for the following tasks. (a) Estimating the spectra of minuscule amounts of
complex molecules [13] for nano nuclear magnetic resonance; (b) the sensing of
magnetic-field strength at room temperature with high precision [14, 15] by
using nitrogen vacancy (NV) centers; (c) performing error mitigation [16] and
noise learning [17, 18, 19]; (d) the tracking of quantum trajectories [20];
(e) classification of many-body quantum states [21] in superconducting quantum
circuits; (f) improving quantum error correction [22]. Also quantum neural
networks are recently investigated in order to solve a given quantum
technology task with a greater accuracy than classical NNs [23, 24, 25].
However, to our knowledge, experimental noise spectroscopy in single color
centers in diamond via deep learning is still missing.

In this paper, we demonstrate that NNs can be used to process the data
obtained by a qubit, operating as a quantum sensor, and then reconstruct the
noise spectrum that induces dephasing into the qubit itself. In particular, we
focus on a qubit under dynamical decoupling (DD) control sequences [26, 27] in
the presence of classical random noise with an unknown power density spectrum,
usually denoted as _noise spectral density_ (NSD). Beyond testing numerically
our machine learning models, we use a single NV center in diamond as a spin
qubit sensor and we perform a spectroscopic reconstruction of the magnetic
noise of its local environment. The latter comprises 13C nuclear spins
randomly distributed in the diamond lattice [28, 29, 30] (see Fig. 1). The
dephasing affecting the qubit sensor is analyzed by applying a set of DD
control pulses that realize filter functions [26, 27, 31, 32] in the frequency
domain. The filter functions are designed to select specific noise components,
without sensing all other system-bath interactions. A widely used DD control
pulse is the Carr-Purcell (CP) sequence [33, 1] that is given by $N$
equidistant $\pi$ pulses, performed between an initial and a final $\pi/2$
pulse. CP sequences act in the frequency domain approximately as Dirac comb
filters [34]; hence, they have been used to perform spectroscopy of intricate
signals, e.g., for noise spectroscopy [35, 36]. With this protocol, the
requirement to achieve high values of the noise reconstruction accuracy is to
perform sequences with a high number of pulses meaning $N\in[30,120]$ (as in
Ref. [37]) or higher, so that the Dirac comb filter approximation remains
valid (in fact, $N$ determines the filter width). This usually leads to long
experiments to reconstruct the whole spectrum of the noise. Other techniques
using non-equidistant or even more sophisticated DD sequences [4, 38, 39, 40,
41] have proved to be effective for noise sensing, but sometimes at the price
of a higher computational burden.

Figure 1: NV center and Neural Networks for noise spectroscopy. The NV center
is surrounded by an ensemble of ${}^{13}C$ nuclear spins (orange spheres) that
collectively induce dephasing to the NV electronic spin (blue sphere). The NV
electronic spin is controlled with a DD sequence (specifically, a Carr-Purcell
(CP) sequence) with the aim to measure its dephasing, and therefore
characterize the NSD of the nuclear spin bath, i.e.,
$S(\omega;s_{0},A,\sigma)$. The CP sequence is formed by $N$ equidistant $\pi$
pulses in between an initial and a final $\pi/2$ pulse. The time $\tau$
between the $\pi$ pulses determines the measurement total time $T=N\tau$,
given that the time between the first $\pi/2$ and the train of $\pi$ pulse and
the time between the last $\pi$ and $\pi/2$ pulses are both equal to $\tau/2$.
Then, we measure the output of this experiment, which is the probability
$P=\frac{1}{2}(1+C(\tau,N))$ that the NV center remains in the initial state
$\ket{0}$. The spin coherence function $C(\tau,N)$ – evaluated at previously-
determined inter-pulse times in the set
$\tau\in\\{\tau_{1},\tau_{2},\ldots,\tau_{n}\\}$ is the input of the designed
Neural Networks (NNs). For illustrative purposes, here we only consider one
fixed value of $N$. In our study we also consider a set of different values of
N [Sec. 2.3].

After being trained, the NNs return the estimation of the NSD parameters.

For our sensing task, NNs are designed to solve a regression problem, i.e.,
the reconstruction of the NSD. Here, we assume that the NSD of the bath of
spins has a Gaussian profile [37, 42, 43]. The Gaussian NSD is thus
parametrized as a function of key parameters, i.e., the mean value, variance,
offset and noise power that we aim to reconstruct. Note that our proposal can
be adapted to other parametrized NSD functions. The NNs are trained over a set
of synthetic data generated by simulating how the coherence of the qubit
sensor decays over time under the influence of both the CP control pulses and
the NSD. Moreover, to make the measurement statistics as close as possible to
the ones obtained from the experiments, extra artificial errors sampled from a
normal distribution are added.

Our approach using NNs entails the following advantages that we have proven
experimentally. (i) NNs have the capability to predict never-before-seen
experimental data, and they can work with a better reconstruction accuracy
(even up to $7$ times better, as shown in the section Results below) than
standard noise spectroscopy, as the Álvarez-Suter method [36], by making use
at the same time of DD control sequence with a much smaller number of pulses.
(ii) The training dataset, which can contain both synthetic and experimental
data, is generated just once and then it can be applied several times, as long
as the new collected data reproduce the physical context under analysis. In
connection with (i), we are going to show that the amount of data used as
input to the NNs can be smaller than the one needed to resolve the NSD by
means of standard noise spectroscopy methods.

From our knowledge, this work is the first experimental proof of enhanced
reconstruction performance with NNs for carrying out noise spectroscopy in
single color centers in diamond. We thus expect that the techniques discussed
here could fast become a novel standard spectroscopy tool both for such
quantum systems and other quantum platforms in which regression problems have
to be solved.

##  2 Results

###  2.1 Generation of training dataset

The training dataset is composed of synthetic data that are originated by
simulating the coherence decay of the qubit sensor in a noise spectroscopy
experiment based on DD, as the one depicted in Fig 1. This standard sensing
procedure, which stems from Ramsey interferometry [1], maps information about
the quantum coherence of the sensor into the population in $|0\rangle$ that is
then effectively recorded. After having initialized the qubit sensor in the
ground state $|0\rangle$, a $\pi/2$ pulse is applied such that the qubit state
$|\psi\rangle$ is the superposition $(|0\rangle+|1\rangle)/\sqrt{2}$. Then, we
perform a CP control sequence consisting in a train of $\pi$ pulses that flips
repeatedly the qubit, and finally, a second $\pi/2$ pulse is applied in order
to map the phase of the qubit into its population. The probability that the
state of the quantum sensor is $|0\rangle$, which corresponds to the
observable population, equals to [1, 37]

$P=\frac{1}{2}\left(1+C(\tau,N)\right),$ (1)

where $N$ is the number of $\pi$ pulses and $\tau$ is the time between them.
The coherence function $C(\tau,N)$ is simulated numerically, for a set of
different values of $\tau$ and $N$, to generate the training dataset.

Let us now introduce the decoherence function that quantifies how the quantum
coherence $C(\tau,N)$ is modified under the action of both the external bath
of spins and a set of CP control pulses. The control sequence has the effect
to modulate the coherence content of the qubit sensor, while the interaction
with the bath, associated to the NSD $S(\omega)$, tends on average to destroy
such coherence. Overall, under the joint presence of control fields and a
noise source, the coherence decays as $C(\tau,N)\equiv e^{-\chi(\tau,N)}$,
where $\chi(\tau,N)$ denotes the _decoherence function_ [44, 45, 32, 46]:

$\chi(\tau,N)=\int\frac{d\omega}{\pi\omega^{2}}F(\omega,\tau,N)S(\omega)\,.$
(2)

In Eq. 2, the _filter function_ $F(\omega,\tau,N)\equiv|Y(\omega,\tau,N)|^{2}$
is the square modulus of the Fourier transform of the so-called modulation
function $y(t,\tau,N)$. The latter is constant piecewise, with values $\pm 1$,
and switches sign at the times $t=\tau/2,3\tau/2,\dots,(N-1/2)\tau$ where each
$\pi$ pulse is applied [2]. Notice that we are assuming that the $\pi$ pulses
are instantaneous, a reasonable assumption for our experimental setup where a
$\pi$ pulse duration is $\sim 0.1$ $\mu$s and the time between pulses is
$\tau\in[3.3,6.1]$ $\mu$s. Let us now recall the expression, in the frequency
domain, of the filter function for a CP sequence with even $N$:

$F(\omega,\tau,N)=8\sin^{2}\left(\frac{\omega\tau
N}{2}\right)\sec^{2}\left(\frac{\omega\tau}{2}\right)\sin^{4}\left(\frac{\omega\tau}{4}\right),$
(3)

while for odd $N$, $\sin^{2}(\omega\tau N/2)$ has to be replaced with
$\cos^{2}(\omega\tau N/2)$ [31, 2].

In order to generate the training dataset, the NSD $S(\omega)$ is
parameterized as

$S(\omega)=s_{0}+A\exp\left(-\frac{(\omega-\omega_{c})^{2}}{2\sigma^{2}}\right).$
(4)

Thus, being a Gaussian distribution, the NSD is fully described by the
_offset_ $s_{0}$, _amplitude_ $A$, _width_ $\sigma$ and _center_ $\omega_{c}$.
For the training dataset in the paper, the values of these parameters are
taken from the following intervals: $s_{0}\in[4\cdot 10^{-4},4\cdot 10^{-3}]$
MHz; $A\in[0.3,0.7]$ MHz; $\sigma\in[2\cdot 10^{-3},9\cdot 10^{-3}]$ MHz.
Instead, $\omega_{c}$ is kept constant. This is because in our experimental
setup the NSD stems from the interaction with a large ensemble of unresolved
13C impurities (nuclear spin bath) around the NV electronic spin. Therefore,
the center of the NSD corresponds to the Larmor frequency $\omega_{c}=\gamma
B$, where $\gamma=1.0705$ kHz/G is the gyromagnetic ratio of the 13C nuclear
spins, and $B$ is the amplitude of a static magnetic field aligned with the NV
quantization axis, $z$. Such static magnetic field is well known during the
experimental procedure since it determines the NV electronic spin resonances
($B=403.2\pm 2$ G).

The training dataset is generated by uniformly sampling $10^{4}$ sets of
parameters within the chosen intervals. Hence, overall we consider $10^{4}$
distinct sequences of NSD parameters that are used to simulate different
coherence curves $C(\tau,N)$. These sequences are taken in the time intervals
$\tau\in[3.3,3.66]~{}\mu$s and $[5.5,6.1]~{}\mu$s with sampling time
$\Delta\tau=1$ ns ($\Delta\tau=20$ ns in the experimental case, see below),
and for $N=\\{1,8,16,24,32,40,48\\}$. These intervals are significant for our
study because they include the values of $\tau$ at which the coherence decay
curve exhibits the first and second order collapses induced on the qubit
sensor by the bath of 13C impurities (for the coherence curves, the first and
second order of the collapses refer to the harmonics of the filter functions
$F(\omega,\tau,N)$, for more details see Ref. [37]). Finally, in order to make
the synthetic data used to train the NNs closer to the experimental setting,
extra artificial errors sampled from a normal distribution with zero expected
value and standard deviation equal to $0.05$ (comparable with the expected
error in our experimental measurements) are added to every point of the
generated coherence decay curves. In this way, one may mitigate the over-
fitting of the employed machine learning models that are thus expected to
better generalize to unseen data. In general, a model trained on synthetic
data cannot be successfully applied to real data without fine tuning it. But
in our case, it becomes possible, probably due to the fact that the simulated
data of the coherence decay are quite close to the experimentally observed
decay data induced by the environment.

As final remark, notice that, from the $10^{4}$ simulated curves $C(\tau,N)$,
$6000$ are used for the training of the NNs and $2000$ for their validation.
Instead, the test step is performed either by using the remaining $2000$
simulated curves, or by using experimental data as described below.

###  2.2 Neural networks working principles

Let us describe the main working features of the NNs employed in this paper to
carry out noise spectroscopy. Specifically, we are going to use the multi-
layer perceptron (MLP) that is composed of fully-connected layers, each of
them with a variable number of artificial neurons.

A single artificial neuron returns as output the scalar

$\hat{y}\equiv\Sigma({\bf w}^{T}\cdot{\bf x}+b)$ (5)

that, by definition, is provided by applying the non-linear function
$\Sigma:\mathbb{R}\rightarrow\mathbb{R}$ to the weighted sum of the input
vector ${\bf x}\in\mathbb{R}^{k}$ to which the bias term $b\in\mathbb{R}$ is
added. ${\bf w}\in\mathbb{R}^{k}$ denotes the vector of weights. In our
analysis, the activation function $\Sigma$ is chosen equal to the _rectifier_
$\Sigma(x)\equiv\max(0,x)$ [47, 48]. Thus, a MLP layer composed of $q$ neurons
(each with $k$ inputs) returns the vector

$\hat{{\bf y}}\equiv\Sigma(W^{T}{\bf x}+{\bf b}),$ (6)

where $\hat{{\bf y}}\in\mathbb{R}^{q}$, $W\in\mathbb{R}^{k\times q}$ is the
matrix of weights ($W$ collects all the weight vectors of the single neurons),
and ${\bf b}\in\mathbb{R}^{q}$ is the vector of the biases. Hence, a MLP with
$L$ layers is ruled by the recursion equation

${\bf h}[\ell]\equiv\Sigma\left(W[\ell]^{T}{\bf h}[\ell-1]+{\bf
b}[\ell]\right),$ (7)

where $\ell=1,\ldots,L$ is the index over the number of layers and ${\bf
h}[0]\equiv{\bf x}$. In Eq. 7, $W[\ell]$ and ${\bf b}[\ell]$ are,
respectively, the weights and the biases of the $\ell$-th layer. The output
vector of the MLP is $\hat{{\bf y}}\equiv{\bf h}[L]$. It is worth noting that
the number, dimension and activation functions (they are usually denoted as
the _hyperparameters_ $\xi$) of the NN layers are chosen through a single
optimization routine (cfr. Methods).

Let us now introduce the supervised learning process. Ideally, the purpose of
the latter is to find the parameters
$\theta^{*}=\textnormal{argmin}_{\theta}\mathcal{R}_{\mathcal{D}}(\theta,\xi)$
that minimize the _theoretical risk function_

$\mathcal{R}_{\mathcal{D}}(\theta,\xi)\equiv\mathbb{E}_{({\bf x},{\bf
y})\sim\mathcal{D}}\left[\mathcal{L}\left(\hat{{\bf y}},{\bf
y}\right)\right],$ (8)

where $\theta\equiv\\{W[1],{\bf b}[1],\ldots,W[L],{\bf b}[L]\\}$, and
$\hat{{\bf y}}$ are the estimated values of ${\bf y}$. By definition,
$\mathcal{R}_{\mathcal{D}}$ is the expected value of the _loss function_
$\mathcal{L}$ for $({\bf x},{\bf y})$ sampled from the distribution
$\mathcal{D}$ that generates the dataset [49]. The loss function $\mathcal{L}$
is a differentiable function that measures the distance between the prediction
$\hat{{\bf y}}$ (output of the MLP) and the desired output ${\bf y}$. However,
since one can only dispose of a finite set $\mathcal{S}=\\{({\bf x},{\bf
y})_{1},\dots,({\bf x},{\bf y})_{m}\\}$ of samples to train, validate and test
the employed ML models, the theoretical risk function is approximated by the
_empirical risk function_. Considering the partition
$\\{\mathcal{S}_{tr},\mathcal{S}_{va},\mathcal{S}_{te}\\}$ of $\mathcal{S}$ in
_training_ ($\mathcal{S}_{tr}$), _validation_ ($\mathcal{S}_{va}$) and _test_
($\mathcal{S}_{te}$) sets, the empirical risk function is defined by:

$\mathcal{R}_{\mathcal{S}_{tr}}(\theta,\xi)\equiv\frac{1}{|\mathcal{S}_{tr}|}\sum_{({\bf
x},{\bf y})\in\mathcal{S}_{tr}}\mathcal{L}\left(\hat{{\bf y}},{\bf y}\right),$
(9)

where $|\mathcal{S}_{tr}|$ is the cardinality of the training set. In fact,
$\mathcal{R}_{\mathcal{S}_{tr}}$ is the arithmetic mean of the loss function
$\mathcal{L}$ evaluated on the samples of the training set $\mathcal{S}_{tr}$.

In our paper, we take the loss function $\mathcal{L}$ equal to the _Mean
Squared Error_ (MSE), also called _L2_ loss:

$\mathcal{L}(\hat{\bf y},{\bf y})=\frac{1}{q}\sum_{i=1}^{q}(\hat{\bf
y}_{i}-{\bf y}_{i})^{2}$ (10)

for the $q$ outputs of the last layer (in our case three, corresponding to the
noise parameters $s_{0}$, $A$, $\sigma$). The MLP is trained by minimizing
(step-by-step over time) the empirical risk function
$\mathcal{R}_{\mathcal{S}_{tr}}(\theta,\xi)$ with respect to $\theta$ by means
of the _mini-batch gradient descent_ method, so as to obtain the optimal value
$\theta^{*}$ of the NN parameters. Each gradient descent step is defined by

$\theta_{t+1}=\theta_{t}-\eta\nabla_{\theta}\frac{1}{B}\sum_{b=1}^{B}\mathcal{L}(\hat{\bf
y}_{b,t},{\bf y}_{b,t}),$ (11)

where $\theta_{0}$ is a randomly chosen starting point, $\eta$ is the
_learning rate_ that defines the length of the step and
$\nabla_{\theta}\frac{1}{B}\sum_{b=1}^{B}\mathcal{L}(\hat{\bf y}_{t,b},{\bf
y}_{t,b})$ is the gradient of the loss function. The gradient is calculated
for any time $t$ on a batch of $B$ elements taken from the training set, and
the subscript $\theta$ in $\nabla_{\theta}$ indicates that the variables of
$\mathcal{L}$ during the gradient evaluation are the weights of the NN. In
this paper, $\mathcal{R}_{\mathcal{S}_{tr}}$ is minimized by means of Adam
[50] that is a gradient-based optimization algorithm performing the adaptive
estimation of lower-order moments. The minimization is stopped when the time-
derivative of the risk function evaluated on the validation set
$\mathcal{R}_{\mathcal{S}_{va}}(\theta^{*},\xi)$ becomes positive (_early
stopping_ strategy) or after a predefined number of gradient steps using all
the data of the training set (called _epochs_). Then, we use
$\mathcal{R}_{\mathcal{S}_{va}}(\theta^{*},\xi)$ to check if the MLP works
also for unseen data and tune the hyperparameters $\xi$ (cfr. Methods).
Finally, the test set $\mathcal{S}_{te}$ is employed to calculate the metrics
(discussed in detail below) used to generate the figures with the results that
we are going to illustrate.

###  2.3 Training and numerical test of neural networks

We now show the results obtained by using the trained machine learning models
to infer the value of the NSD parameters $\\{s_{0},A,\sigma\\}$. As already
mentioned, the NNs are tested with $2000$ different NSD parameters. For each
of these sets of parameters, the curves $C(\tau,N)$ have been simulated as
described in the previous subsections.

In order to determine the smallest amount of data required to reconstruct the
NSD, we perform the training, validation and test of the NNs with sub-sets of
the simulated curves. These sub-sets are defined by introducing the variable
$\overline{N}$ that denotes the upper bound for the number of pulses
$N\leq\overline{N}$ considered during the whole process. For example, for
$\overline{N}=16$ only the curves $C(\tau,N)$ with $N\in\\{1,8,16\\}$ are
considered. Note that the sub-sets defined for each value of $\overline{N}$
contain the curves for all the different NSD parameters ($6000$ for training,
$2000$ for validation, and $2000$ for testing), and for all the times $\tau$
in the intervals defined in section 2.1. In detail, the input of the neural
network is defined as the concatenation of all the values of $C(\tau,N)$, for
$\tau$ in the intervals defined before and $N=1,8,16,...,\overline{N}$.
Specifically, ${\bf
x}=\\{C(\tau_{1},1),C(\tau_{2},1),\dots,C(\tau_{n},1),C(\tau_{1},2),\dots,C(\tau_{n},2),\dots,C(\tau_{n},\overline{N})\\}$.

Figure 2:  Mean-square-errors (MSE) between original and estimated NSD
parameters for a set of 2000 test cases. Orange bullets with dash-dotted line
are the mean values returned by NNs. Blue squares with dotted line are the
mean values provided by the HS method. Finally, shaded areas denote the
standard deviation, taking into account all the 2000 cases.

The results of this analysis are shown in Fig. 2 (orange data), where the MSE
(the loss function) between the inferred parameters ($\hat{s_{0}}$, $\hat{A}$,
$\hat{\sigma}$) and the original parameters ($s_{0}$, $A$, $\sigma$) used to
generate the dataset is plotted as a function of $\overline{N}$. Remarkably,
the MSE seems to achieve its minimum value after $\overline{N}=16$. This
entails that the NNs do not significantly improve their precision on the
reconstruction of the NSD by using more data to train them beyond this point.

To establish how accurately a NN reconstructs the NSD, we need to compare the
corresponding results with those of a different method. In particular, we
concentrate on the method used in Ref. [37], which is itself based on Refs.
[36, 35]. According to them, the decay of the coherence function $C(\tau,N)$
is analyzed as a function of $N$, for each fixed value of $\tau_{i}$, i.e.,
for each fixed frequency component of the filter functions. In the limit of
high $N$, the decay of the coherence is exponential, with a rate that is
inversely proportional to the amplitude of the NSD [35]. In other words, the
amplitude of the NSD is directly estimated for a discrete set of frequencies
(each proportional to $1/\tau$). In contrast with the original proposals in
Refs. [36, 35], the method in Ref [37] demonstrates that it is better to use
the harmonics of the filter functions to reconstruct the NSD, in order to
avoid extra broadening of the reconstructed spectrum. For this reason, we
denote this method as _Harmonics Spectroscopy_ (HS).

We have analyzed the same $2000$ different curves $C(\tau,N)$ (used to test
the machine learning models) also with the HS method. The results are
collected and shown in Fig. 2 (blue data), where the first point is for
$\overline{N}=16$. This is due to the fact that, by definition, the HS method
fits the decay of the coherence as a function of $N$. This is possible only
for a dataset with at least three points (in this case $N=1,8,16$). As one can
observe in Fig. 2, the MSE values for the HS method (blue region) are always
above the MSE values for the NN method (orange region), especially for lower
values of $\overline{N}$. These results demonstrate that the NN method can
predict the parameters of the NSD with an improved accuracy (up to $5$ times
larger) with respect to the HS method. The test presented in this subsection
have been performed with simulated data. In the next subsection we are going
to repeat the same test but with experimental data.

###  2.4 Experimental test of neural networks

By this point we know that NNs can reliably predict the NSD from noisy
simulated data. In this section, we want to use the NNs (trained and validated
with noisy simulated data) to reconstruct the NSD using experimental data.

As quantum sensor we use a spin qubit encoded in the electronic spin of the
ground state of a single nitrogen-vacancy (NV) center in a bulk diamond at
room temperature. This system has proven as a sensitive quantum probe of
magnetic fields, with outstanding spacial resolution and sensitivity [51, 52].
The diamond sample in our experiments has a natural abundance of 13C
impurities ($1.1$%) that are randomly distributed in the diamond lattice [28,
29, 30]. The 13C nuclear spins constitute the external environment of the NV
center. They act as a collective bath of spins that induces dephasing into the
NV electronic spin, limiting the its coherence time $T_{2}\approx 100~{}\mu$s.
In the presence of strong bias magnetic field ($\geq 150$G) [53, 37], the weak
coupling of the NV spin with these carbon impurities can be modeled as a
classical stochastic field. The latter has a power spectrum density (here
called NSD) that follows a Gaussian distribution centered at the Larmor
frequency of the 13C nuclear spins. In order to measure the NV spin coherence
function $C(\tau,N)$, we apply a train of $\pi$ pulses (in our case a CP
sequence) to the NV spin qubit following the DD protocol described in Fig 1.
For more details on the experimental implementation and Hamiltonian of the
system see Ref. [37]. We have performed this experiment for
$N=\\{1,8,16,24,32,40,48\\}$, and for $\tau\in[3.3,3.66]$ $\mu$s and
$[5.5,6.1]$ $\mu$s with sampling time $\Delta t=20$ ns. The results are shown
in Fig.3(a) (blue bullets). Then, the collected coherence functions have been
processed and employed to reconstruct the NSD parameters by means of both the
NN (trained with the generated dataset) and the HS methods. In contrast with
the test using simulated data in the previous section, in the experimental
case we do not know the exact values of the NSD parameters. Therefore, we
cannot calculate the MSE to quantify the accuracy of the reconstructed
parameters. In order to estimate such accuracy we have used the following
procedure: from the inferred NSD, the coherence curves $C(\tau,N)$ are
simulated and then compared with the experimental results. An example of this
comparison is shown in Fig.3(a), where $C(\tau,N)$ is simulated under the
assumption that the NSD parameters are inferred either by the machine learning
models (orange) or by the HS method (red), both for $\overline{N}=16$.
Qualitatively it is clear that the orange curves are much closer to the
experimental data, than the red curves.

Figure 3: (a) Coherence function $C(\tau,N)$. The experimental data (blue
bullets) are shown together with the simulated ones using the NSD predicted
respectively by the HS method (red lines) and machine learning models (orange
lines), both for $\overline{N}=16$. (b) Reduced chi-squared $\chi_{\nu}^{2}$,
obtained by comparing simulation and experimental data, as a function of
$\overline{N}$. As in panel (a), orange and red curves refer to the NN and HS
method, respectively. Instead, the dashed line denotes the value of the
reduced chi-squared for the HS method when we employ additional measurements
for $N=56,64,72,80$ in the interval $\tau\in[5.5,6.1]$ $\mu$s. Inset: Same
results but quantified by the Mean-Absolute-Error (MAE) between the
experimental data and the predicted $C(\tau,N)$.

There are several options to quantitatively compare the experimental data and
the simulation results. Here we use both the _reduced chi-squared_
$\chi_{\nu}^{2}$ [54], and the _Mean-Absolute-Error_ (MAE) [55] between the
experimental data and the predicted coherence functions $C(\tau,N)$ (see
Methods for more details). The results of this comparison are shown in Fig.
3(b), where $\chi_{\nu}^{2}$ and the MAE are plotted as a function of
$\overline{N}$. Remarkably, the NSD reconstructed by the NN for
$\overline{N}=16$ behaves better that any case using the HS method. It is
worth observing that the same experimental data used to infer the NSD
parameters are partially used to estimate the $\chi_{\nu}^{2}$ and
MAE($C(\tau,N)$). For example, for $\overline{N}=16$, only the data for
$N=1,8,16$ are used to reconstruct the NSD, but we employ all the data
$N=1,8,16,\dots,48$ to obtain the $\chi_{\nu}^{2}$ and MAE($C(\tau,N)$).
Overall, we have observed enhanced performance in reconstructing the NSD of
the collective bath of spins, with a maximum improvement (about $7$ times
higher) for $\overline{N}=16$. In other words, for $\overline{N}=16$, once we
reconstruct the NSD, the quantum sensor dynamics can be predicted with an
average square deviation of $\simeq 1.86$ experimental error-bars by using the
NN method, or with an average square deviation of $\simeq 13$ error-bars if we
use the HS method.

##  3 Discussion

As shown pictorially in Fig. 1, the NN takes as input the spin qubit coherence
functions (the coherence of the quantum sensor decays due to the presence of
the external bath) obtained by using a set of different CP control sequences.
The NN returns as output the parameters of the unknown NSD in the frequency
domain. One can thus note that the NN, once validated, acts as a “time-
frequency converter” (making use of a quite complicated deconvolution) from
the measured signals living in the time domain – the spin coherence functions
– to the NSD defined in the frequency domain.

The results shown in the previous section, and summarized in Figs. 2 and 3(b),
demonstrate that NNs can be used to reconstruct the NSD affecting a quantum
sensor, achieving higher precision and with considerable less data than the
standard HS method. Improved values of the reconstruction accuracy have been
obtained with simulated and experimental data. Both the HS and NN methods are
comparable – in terms of NSD reconstruction accuracy – for high values of
$\overline{N}$, but not for small ones, where NNs give significantly better
results. Moreover, the main result of our study is that NNs trained with data
obtained for $\overline{N}=16$ reconstruct the NSD more accurately than the
best estimate provided by the HS method with $\overline{N}=48$. This
improvement is remarkable by itself, but it becomes more significant when we
consider that the time required to complete these experiments has a growth
faster than a linear function with respect to $\overline{N}$, following an
arithmetic progression. As an example, the total time to perform all the
experiments in the case of $\overline{N}=16$ and $48$ is respectively $\simeq
10$ minutes and $\simeq 1.2$ hours (for this estimation we consider $10^{5}$
repetitions as in our experiments, we recall that the total time for each
repetition of the single experiment is $T=N\tau$). This is an under-estimation
of the time difference between methods, because we are only considering the
bare measurement time, without taking into account the time delay between
different experiments. Furthermore, it is worth stressing that our results
also show that deep learning has a predictive power since it can be applied to
never-before-seen data. This naturally provides to the employed machine
learning models a connotation of _robustness_ that is crucial in real
applications.

As a general comment, we stress that it is difficult to identify a definite
reason why a machine learning model is more accurate (especially in the case
of small $\overline{N}$) than a standard DD technique for noise spectroscopy.
As said above, we observe experimentally that the employed NNs are able to
learn non trivial patterns in the sequences of input-output data. What the
neural network learn is to invert $C(\tau,N)$ as a function of the noise
parameters $s_{0}$, $A$ and $\sigma$ (see Eqs. (2) and (4) in the main text)
that we aim to reconstruct. It is known that NNs are universal approximators
of functions: this can be the reason why they are well suited to find the
parameters of the NSD from $C(\tau,N)$. Moreover, NNs do not consider
approximations of the filter function, and they manage to find the noise
parameters even for input data containing values of $C(\tau,N)$ with $N$
small. In contrast, the Álvarez-Suter method, as well as the HS methods in
general, arises from approximating the filter function as a Dirac comb. This
approximation is not valid for a small number of pulses, hence it is expected
to poorly reconstruct the noise spectrum using standard DD techniques. In
addition, reconstructing the parameters of a NSD using experimental data with
a NN trained with synthetic data has been made possible by training the NN
over an informative set of noise samples, used to generate the synthetic data.
The latter, indeed, are given by a collection of values of $C(\tau,N)$ that
implicitly include a parameterization of the NSD that is reasonable for the
experimental setting; in our case, a Gaussian distribution whose offset,
amplitude, width and center belong to finite-valued intervals estimated from
similar experimental conditions (e.g. Ref. [37]).

Let us also observe that regression tasks, which are successfully solved by
multi-layer perceptrons (one of the easiest form of NN), are less common with
respect to the ones to carry out classification; a review of some example
datasets and methods for regression is in Ref. [56]. Hence, we expect that the
synthetic data used in this work could be useful as a test bed also to the
audience of machine learning researchers and developers solving regression
problems in different contexts. With this in mind, we share the training
dataset with synthetic data and our codes for their generation, as well as the
code for machine learning experiments and NSD reconstruction [available on the
_GitHub_ repository (see Section “Data and code availability”)]. In this way,
we promote the improvement of machine learning models for noise sensing
purposes and their use to solve different regression tasks in the quantum
estimation framework.

##  4 Conclusions

In this paper, we use neural-networks (NNs) to carry out noise spectroscopy
with a quantum sensor using dynamical decoupling sequences with a much smaller
number of $\pi$ pulses and, at the same time, achieving a higher
reconstruction accuracy than standard methods (e.g., HS protocol). This means
that with our proposal the noise spectroscopy procedure will take less time
and give better results. More in detail, we experimentally demonstrate the
capability of NNs to reconstruct the NSD of the collective nuclear spin bath
that surrounds an electronic spin qubit, i.e., the ground state of a single
nitrogen-vacancy center in bulk diamond at room temperature.

To conclude, we outline some possible outlooks for our work. First of all, one
may evaluate the performance of NNs that are trained over input data obtained
using DD control sequences with more degrees of freedom than the CP ones [57,
58, 59, 60, 61]. Secondly, deep learning might be applied to noise
spectroscopy techniques beyond the HS methods, as for example optimal band-
limited control protocols [39, 40] and even non-Gaussian noise
characterization [62, 63, 64]. In this regard, notice that the NNs take as
input the data associated to the spin coherence, and return as output the
parameters of the noise spectral density. Therefore, a new NN for the
characterization of spin qubit’s environment can be trained with coherence
curves obtained from using any kind of coherent control sequences. The study
of the performance of NNs trained with data from these more general control
protocols is the next step in understanding how machine learning can enhance
quantum sensing. In addition, it might be worth investigating how deep
learning can be integrated to quantum sensing procedures that rely on the so-
called stochastic quantum Zeno effect [65, 66], whereby the quantum probe is
subjected to a sequence of quantum measurements that in the ideal case are
designed to confine the dynamics of the probe around the initial (nominal)
state [38, 67, 68]. We are also confident that the extent of our results can
be quite easily replicated in other experimental settings, as e.g.,
superconducting flux qubits [69, 70], trapped ions [71, 72], cold atoms [73,
74], quantum dots [75, 76], NMR experiments in molecules [36, 77], and
nanoelectronic devices [78]. For such a purpose, one might slightly adapt the
deep learning techniques used here to methods tailored for time series.

##  5 Methods

###  5.1 Technical details on the training of NNs

The NN models are developed using the PyTorch framework [79] on a machine with
32 CPU cores, 126Gb of RAM and a GeForce RTX 3090 GPU. The training time,
including the optimization of the hyperparameters, is around $12$ hours for
each $\overline{N}$ .

The hyperparameters optimization is implemented by means of the Ray Tune
library [80]. The _Hyperopt_ package [81] uses the _Tree-structured Parzen
Estimators_ [82] algorithm as a Bayesian optimization to search for the best
choice of the hyperparameters within a predefined search space. Hyperopt
suggest the likely better configurations of the hyperparameters and the
underlying model is updated after each trial that is run. The _ASHA_ scheduler
[83] is then used to stop the run of the least promising trials chosen by the
search algorithm, thus speeding up the hyperparameters optimization process.

The optimized hyperparameters are the following. (1) The _number_ of hidden
layers decides the value of $L-1$ in Eq. 7. The hidden layers are between the
input layer ${\bf h}[0]$ and the output layer ${\bf h}[L]$. (2) The
_dimension_ of the hidden layers is the value of $q$ in Eq. 6 that, for the
sake of simplicity, is equal for all the layers in Eq. 7. Both the number and
dimension of the hidden layers are chosen by sampling log-uniformly an integer
value from the space $[1,32)$ and $[1,1024)$, respectively. (3) The _learning
rate_ is responsible for the length of the gradient descent step and it is
optimized with a choice between $10^{-2}$, $10^{-3}$ and $10^{-4}$. (4) The
_batch size_ denotes the dimension of the batch on which the loss function is
summed for the gradient calculation in a single descent step. The batch size
is chosen between $2$, $4$, $8$, $16$, $32$. (5) The _dropout_ is a
regularization strategy that aims to reduce the overfitting by randomly turn
off the NN neurons with a predefined probability. Such probability is one
among $0$ (no dropout), $0.2$ and $0.5$. (6) The _weight decay_ is another
regularization technique that adds to the loss function the squared weights of
the NN multiplied by a decay value. The latter value is optimized choosing
between $0$ (no decay), $10^{-6}$, $10^{-5}$, $10^{-4}$ and $10^{-3}$.

To facilitate the reproducibility of the experiments, we summarize in table 1
the optimal values of the hyperparameters for the trained models. Each value
of $\overline{N}$ defines the input size of the neural network. Therefore, a
different optimization of the hyperparameters is performed for each case.

Table 1: Hyperparameters for the employed machine learning models. For each value of $\overline{N}$ (that determines the size of the input layer) we report: the number of hidden layers (h. l. num.), the dimension of each hidden layer (h. l. dim.) and the values of learning rate (learning r.), batch size, dropout and weight decay (weight d.). $\overline{N}$ | h. l. num. | h. l. dim. | learning r. | batch size | dropout | weight d.
---|---|---|---|---|---|---
$1$ | $1$ | $2$ | $10^{-2}$ | $16$ | $0$ | $10^{-3}$
$8$ | $5$ | $328$ | $10^{-4}$ | $4$ | $0$ | $10^{-4}$
$16$ | $2$ | $133$ | $10^{-3}$ | $8$ | $0$ | $10^{-6}$
$24$ | $3$ | $224$ | $10^{-4}$ | $2$ | $0$ | $10^{-4}$
$32$ | $3$ | $145$ | $10^{-4}$ | $4$ | $0$ | $10^{-5}$
$40$ | $3$ | $286$ | $10^{-4}$ | $4$ | $0$ | $10^{-4}$
$48$ | $3$ | $38$ | $10^{-3}$ | $8$ | $0$ | $10^{-4}$

###  5.2 Definition of quantifiers for reconstruction accuracy

The accuracy of NN and HS methods can be estimated by using the reconstructed
NSD to simulate the coherence function $C(\tau,N)$, and ‘measuring’ the
distance between the simulated data and the experimental values. To do so, we
use the _reduced chi-squared_ $\chi_{\nu}^{2}$, and the Mean-Absolute-Error
(MAE($C$)): We define $C_{\rm e}\pm\delta C_{\rm e}$ ($C_{\rm s}$) as the
experimental (simulated) values of $C(\tau,N)$, where $\delta C_{\rm e}$ is
the standard deviation of the experimental data. Then we can write _reduced
chi-squared_ and the MAE as

$\displaystyle\chi_{\nu}^{2}$ $\displaystyle\equiv$
$\displaystyle\frac{1}{\nu}\sum_{n,N}\frac{(C_{\rm e}(\tau_{n},N)-C_{\rm
s}(\tau_{n},N))^{2}}{\delta C_{\rm e}(\tau_{n},N)^{2}}$ (12)
$\displaystyle{\rm MAE}(C)$ $\displaystyle\equiv$
$\displaystyle\frac{1}{\nu}\sum_{n,N}\left|C_{\rm e}(\tau_{n},N)-C_{\rm
s}(\tau_{n},N)\right|,$ (13)

where $N=\\{1,8,16,24,\dots,\overline{N}\\}$, $\\{\tau_{n}\\}$ are the values
of the time between pulses within the time intervals defined in main text, and
$\nu$ is the total number of elements in the sum. Notice that $\chi_{\nu}^{2}$
takes into account the experimental precision to scale the difference between
experiment and simulation. The results showing both $\chi_{\nu}^{2}$ and the
MAE are in Fig. 3.

## Data and code availability

The source codes for the generation of the training dataset and the machine
learning experiments are available on _GitHub_ at the following address:
https://github.com/trianam/noiseSpectroscopyNV

## Acknowledgements

This work was supported by the European Commission’s Horizon Europe Framework
Programme under the Research and Innovation Action GA n. 101070546–MUQUABIS,
and by the European Defence Agency under the project Q-LAMPS Contract No B
PRJ-RT-989. S. H. G. acknowledges support from CNR-FOE-LENS-2020. F. C. and S.
M. acknowledge the European Union’s Horizon 2020 research and innovation
programme under FET-OPEN GA n. 828946–PATHOS.

## References

## References

  * [1] C. L. Degen, F. Reinhard, and P. Cappellaro.  Quantum sensing.  Rev. Mod. Phys., 89:035002, Jul 2017.
  * [2] Santiago Hernández-Gómez and Nicole Fabbri.  Quantum control for nanoscale spectroscopy with diamond nitrogen-vacancy centers: A short review.  Front. Phys., 8, 2021.
  * [3] F. Poggiali, P. Cappellaro, and N. Fabbri.  Optimal control for one-qubit quantum sensing.  Phys. Rev. X, 8:021059, Jun 2018.
  * [4] Matthias M. Müller, Stefano Gherardini, and Filippo Caruso.  Noise-robust quantum sensing via optimal multi-probe spectroscopy.  Scientific Reports, 8:14278, Sep 2018.
  * [5] Phila Rembold, Nimba Oshnik, Matthias M. Müller, Simone Montangero, Tommaso Calarco, and Elke Neu.  Introduction to quantum optimal control for quantum sensing with nitrogen-vacancy centers in diamond.  AVS Quantum Science, 2(2):024701, 2020.
  * [6] Alastair Marshall, Thomas Reisser, Phila Rembold, Christoph Müller, Jochen Scheuer, Martin Gierse, Tim Eichhorn, Jakob M. Steiner, Patrick Hautle, Tommaso Calarco, Fedor Jelezko, Martin B. Plenio, Simone Montangero, Ilai Schwartz, Matthias M. Müller, and Philipp Neumann.  Macroscopic hyperpolarization enhanced with quantum optimal control.  Phys. Rev. Res., 4:043179, Dec 2022.
  * [7] Feihao Zhang, Jian Xing, Xiaoxiao Hu, Xinyu Pan, and Guilu Long.  Coupling-selective quantum optimal control in weak-coupling NV-13 C system.  AAPPS Bulletin, 33(2), 2023.
  * [8] C.M. Bishop.  Pattern Recognition and Machine Learning.  Information Science and Statistics. Springer, 2006.
  * [9] Ian Goodfellow, Yoshua Bengio, and Aaron Courville.  Deep Learning.  MIT Press, 2016.  http://www.deeplearningbook.org.
  * [10] Akram Youssry, Gerardo A. Paz-Silva, and Christopher Ferrie.  Characterization and control of open quantum systems beyond quantum noise spectroscopy.  npj Quantum Information, 6:95, 2020.
  * [11] S. Martina, S. Gherardini, and F. Caruso.  Machine learning approach for quantum non-Markovian noise classification.  arXiv:2101.03221, 2021.
  * [12] David F. Wise, John J.L. Morton, and Siddharth Dhomkar.  Using deep learning to understand and mitigate the qubit noise environment.  PRX Quantum, 2:010316, Jan 2021.
  * [13] Nati Aharon, Amit Rotem, Liam P. McGuinness, Fedor Jelezko, Alex Retzker, and Zohar Ringel.  Nv center based nano-nmr enhanced by deep learning.  Scientific Reports, 9:17802, Nov 2019.
  * [14] R. Santagati, A. A. Gentile, S. Knauer, S. Schmitt, S. Paesani, C. Granade, N. Wiebe, C. Osterkamp, L. P. McGuinness, J. Wang, M. G. Thompson, J. G. Rarity, F. Jelezko, and A. Laing.  Magnetic-field learning using a single electronic spin in diamond with one-photon readout at room temperature.  Phys. Rev. X, 9:021019, Apr 2019.
  * [15] Kyunghoon Jung, M. H. Abobeih, Jiwon Yun, Gyeonghun Kim, Hyunseok Oh, Ang Henry, T. H. Taminiau, and Dohun Kim.  Deep learning enhanced individual nuclear-spin detection.  npj Quantum Information, 7:41, Feb 2021.
  * [16] Armands Strikis, Dayue Qin, Yanzhu Chen, Simon C. Benjamin, and Ying Li.  Learning-based quantum error mitigation.  PRX Quantum, 2:040330, Nov 2021.
  * [17] Robin Harper, Steven T. Flammia, and Joel J. Wallman.  Efficient learning of quantum noise.  Nature Physics, 16:1184, Dec 2020.
  * [18] Stefano Martina, Lorenzo Buffoni, Stefano Gherardini, and Filippo Caruso.  Learning the noise fingerprint of quantum devices.  Quantum Machine Intelligence, 4:1–12, 2022.
  * [19] Stefano Martina, Stefano Gherardini, Lorenzo Buffoni, and Filippo Caruso.  Noise fingerprints in quantum computers: Machine learning software tools.  Software Impacts, 12:100260, 2022.
  * [20] G. Koolstra, N. Stevenson, S. Barzili, L. Burns, K. Siva, S. Greenfield, W. Livingston, A. Hashim, R. K. Naik, J. M. Kreikebaum, K. P. O’Brien, D. I. Santiago, J. Dressel, and I. Siddiqi.  Monitoring fast superconducting qubit dynamics using a neural network.  Phys. Rev. X, 12:031017, Jul 2022.
  * [21] Ming Gong, He-Liang Huang, Shiyu Wang, Chu Guo, Shaowei Li, Yulin Wu, Qingling Zhu, Youwei Zhao, Shaojun Guo, Haoran Qian, Yangsen Ye, Chen Zha, Fusheng Chen, Chong Ying, Jiale Yu, Daojin Fan, Dachao Wu, Hong Su, Hui Deng, Hao Rong, Kaili Zhang, Sirui Cao, Jin Lin, Yu Xu, Lihua Sun, Cheng Guo, Na Li, Futian Liang, Akitada Sakurai, Kae Nemoto, W. J. Munro, Yong-Heng Huo, Chao-Yang Lu, Cheng-Zhi Peng, Xiaobo Zhu, and Jian-Wei Pan.  Quantum Neuronal Sensing of Quantum Many-Body States on a 61-Qubit Programmable Superconducting Processor.  arXiv:2201.05957, 2022.
  * [22] Li Ding, Haowen Wang, Yinuo Wang, and Shumei Wang.  Based on Quantum Topological Stabilizer Color Code Morphism Neural Network Decoder.  Quantum Engineering, 2022:9638108, 2022.
  * [23] Getahun Fikadu Tilaye and Amit Pandey.  Investigating the Effects of Hyperparameters in Quantum-Enhanced Deep Reinforcement Learning.  Quantum Engineering, 2023:2451990, 2023.
  * [24] Yao Zhang and Ni Qiang.  Design of quantum neuron model for quantum neural networks.  Quantum Engineering, 3(3):e75, 2021.
  * [25] ShiJie Wei, YanHu Chen, ZengRong Zhou, and GuiLu Long.  A quantum convolutional neural network on NISQ devices.  AAPPS Bulletin, 32(2), 2022.
  * [26] Lorenza Viola and Seth Lloyd.  Dynamical suppression of decoherence in two-state quantum systems.  Phys. Rev. A, 58:2733–2744, Oct 1998.
  * [27] L. Faoro and L. Viola.  Dynamical suppression of $1/f$ noise processes in qubit systems.  Phys. Rev. Lett., 92:117905, 2004.
  * [28] J. M. Taylor, P. Cappellaro, L. Childress, L. Jiang, D. Budker, P. R. Hemmer, A. Yacoby, R. Walsworth, and M. D. Lukin.  High-sensitivity diamond magnetometer with nanoscale resolution.  Nature Physics, 4(10):810–816, 2008.
  * [29] G. Goldstein, P. Cappellaro, J. R. Maze, J. S. Hodges, L. Jiang, A. S. Sorensen, and M. D. Lukin.  Environment assisted precision measurement.  Phys. Rev. Lett., 106(14):140502, 2011.
  * [30] M. H. Abobeih, J. Cramer, M. A. Bakker, N. Kalb, M. Markham, D. J. Twitchen, and T. H. Taminiau.  One-second coherence for a single electron spin coupled to a multi-qubit nuclear-spin environment.  Nature Communications, 9(2552), 2018.
  * [31] Lukasz Cywiński, Roman M. Lutchyn, Cody P. Nave, and S. DasSarma.  How to enhance dephasing time in superconducting qubits.  Phys. Rev. B, 77(17):174509, May 2008.
  * [32] M J Biercuk, A C Doherty, and H Uys.  Dynamical decoupling sequence construction as a filter-design problem.  Journal of Physics B: Atomic, Molecular and Optical Physics, 44(15):154002, jul 2011.
  * [33] H. Y. Carr and E. M. Purcell.  Effects of diffusion on free precession in nuclear magnetic resonance experiments.  Phys. Rev., 94:630–638, May 1954.
  * [34] J. R. Maze, P. L. Stanwix, J. S. Hodges, S. Hong, J. M. Taylor, P. Cappellaro, L. Jiang, A.S. Zibrov, A. Yacoby, R. Walsworth, and M. D. Lukin.  Nanoscale magnetic sensing with an individual electronic spin qubit in diamond.  Nature, 455:644–647, 2008.
  * [35] Tatsuro Yuge, Susumu Sasaki, and Yoshiro Hirayama.  Measurement of the noise spectrum using a multiple-pulse sequence.  Phys. Rev. Lett., 107:170504, Oct 2011.
  * [36] Gonzalo A. Álvarez and Dieter Suter.  Measuring the spectrum of colored noise by dynamical decoupling.  Phys. Rev. Lett., 107:230501, 2011.
  * [37] S. Hernández-Gómez, F. Poggiali, P. Cappellaro, and N. Fabbri.  Noise spectroscopy of a quantum-classical environment with a diamond qubit.  Phys. Rev. B, 98:214307, Dec 2018.
  * [38] Hoang-Van Do, Cosimo Lovecchio, Ivana Mastroserio, Nicole Fabbri, Francesco S Cataliotti, Stefano Gherardini, Matthias M Müller, Nicola Dalla Pozza, and Filippo Caruso.  Experimental proof of quantum zeno-assisted noise sensing.  New Journal of Physics, 21(11):113056, nov 2019.
  * [39] V. M. Frey, S. Mavadia, L. M. Norris, W. de Ferranti, D. Lucarelli, L. Viola, and M. J. Biercuk.  Application of optimal band-limited control protocols to quantum noise sensing.  Nature Communications, 8:2189, dec 2017.
  * [40] Virginia Frey, Leigh M. Norris, Lorenza Viola, and Michael J. Biercuk.  Simultaneous spectral estimation of dephasing and amplitude noise on a qubit sensor via optimally band-limited control.  Phys. Rev. Applied, 14:024021, Aug 2020.
  * [41] G. Wang, Y. Zhu, B. Li, C. Li, L. Viola, A. Cooper, and P. Cappellaro.  Digital noise spectroscopy with a quantum sensor.  arXiv:2212.09216, 2022.
  * [42] P Szańkowski, G Ramon, J Krzywda, D Kwiatkowski, and Ł Cywiński.  Environmental noise spectroscopy with qubits subjected to dynamical decoupling.  Journal of Physics: Condensed Matter, 29(33):333001, jul 2017.
  * [43] Piotr Szańkowski and Łukasz Cywiński.  Accuracy of dynamical-decoupling-based spectroscopy of gaussian noise.  Phys. Rev. A, 97:032101, Mar 2018.
  * [44] Goren Gordon, Noam Erez, and Gershon Kurizki.  Universal dynamical decoherence control of noisy single- and multi-qubit systems.  Journal of Physics B: Atomic, Molecular and Optical Physics, 40(9):S75–S93, apr 2007.
  * [45] Goren Gordon, Gershon Kurizki, and Daniel A. Lidar.  Optimal dynamical decoherence control of a qubit.  Phys. Rev. Lett., 101:010403, Jul 2008.
  * [46] Nicola Dalla Pozza, Stefano Gherardini, Matthias M. Müller, and Filippo Caruso.  Role of the filter functions in noise spectroscopy.  International Journal of Quantum Information, 17(08):1941008, 2019\.
  * [47] Xavier Glorot, Antoine Bordes, and Yoshua Bengio.  Deep sparse rectifier neural networks.  In Geoffrey Gordon, David Dunson, and Miroslav Dudík, editors, Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of Proceedings of Machine Learning Research, pages 315–323, Fort Lauderdale, FL, USA, 11–13 Apr 2011\. PMLR.
  * [48] Vinod Nair and Geoffrey E. Hinton.  Rectified linear units improve restricted boltzmann machines.  In Proceedings of the 27th International Conference on International Conference on Machine Learning, ICML’10, page 807–814, Madison, WI, USA, 2010. Omnipress.
  * [49] Shai Shalev-Shwartz and Shai Ben-David.  Understanding machine learning: From theory to algorithms.  Cambridge University Press, 2014.
  * [50] Diederik P. Kingma and Jimmy Ba.  Adam: A method for stochastic optimization.  arXiv:1412.6980, 2014.
  * [51] Marcus W. Doherty, Neil B. Manson, Paul Delaney, Fedor Jelezko, Jörg Wrachtrup, and Lloyd C.L. Hollenberg.  The nitrogen-vacancy colour centre in diamond.  Physics Reports, 528(1):1–45, 2013.  The nitrogen-vacancy colour centre in diamond.
  * [52] L Rondin, J-P Tetienne, T Hingant, J-F Roch, P Maletinsky, and V Jacques.  Magnetometry with nitrogen-vacancy defects in diamond.  Reports on Progress in Physics, 77(5):056503, may 2014.
  * [53] Friedemann Reinhard, Fazhan Shi, Nan Zhao, Florian Rempp, Boris Naydenov, Jan Meijer, Liam T. Hall, Lloyd Hollenberg, Jiangfeng Du, Ren-Bao Liu, and Jörg Wrachtrup.  Tuning a spin bath through the quantum-classical transition.  Phys. Rev. Lett., 108(20):200402, May 2012.
  * [54] Ifan Hughes and Thomas Hase.  Measurements and their uncertainties: a practical guide to modern error analysis, pages 107–107.  OUP Oxford, 2010.
  * [55] Claude Sammut and Geoffrey I. Webb, editors.  Mean Absolute Error, pages 652–652.  Springer US, Boston, MA, 2010.
  * [56] Manuel Fernández-Delgado, Manisha Sanjay Sirsat, Eva Cernadas, Sadi Alawadi, Senén Barro, and Manuel Febrero-Bande.  An extensive experimental survey of regression methods.  Neural Networks, 111:11–34, 2019.
  * [57] Götz S. Uhrig.  Keeping a quantum bit alive by optimized $\pi$-pulse sequences.  Phys. Rev. Lett., 98:100504, Mar 2007.
  * [58] Nan Zhao, Jian-Liang Hu, Sai-Wah Ho, Jones T K Wan, and R B Liu.  Atomic-scale magnetometry of distant nuclear spin clusters via nitrogen-vacancy spin in diamond.  Nature Nanotechnology, 6(4):242–6, April 2011.
  * [59] Alexandre M. Souza, Gonzalo A. Álvarez, and Dieter Suter.  Robust dynamical decoupling for quantum computing and quantum memory.  Phys. Rev. Lett., 106:240501, Jun 2011.
  * [60] Nan Zhao, Jörg Wrachtrup, and Ren-Bao Liu.  Dynamical decoupling design for identifying weakly coupled nuclear spins in a bath.  Phys. Rev. A, 90:032319, Sep 2014.
  * [61] J. Casanova, Z.-Y. Wang, J. F. Haase, and M. B. Plenio.  Robust dynamical decoupling sequences for individual-nuclear-spin addressing.  Phys. Rev. A, 92(4):042304, October 2015.
  * [62] Gerardo A. Paz-Silva and Lorenza Viola.  General transfer-function approach to noise filtering in open-loop quantum control.  Phys. Rev. Lett., 113:250501, Dec 2014.
  * [63] Leigh M. Norris, Gerardo A. Paz-Silva, and Lorenza Viola.  Qubit noise spectroscopy for non-gaussian dephasing environments.  Phys. Rev. Lett., 116:150503, Apr 2016.
  * [64] Youngkyu Sung, Félix Beaudoin, Leigh M. Norris, Fei Yan, David K. Kim, Jack Y. Qiu, Uwe von Lüpke, Jonilyn L. Yoder, Terry P. Orlando, Simon Gustavsson, Lorenza Viola, and William D. Oliver.  Non-gaussian noise spectroscopy with a superconducting qubit sensor.  Nature Communications, 10:3715, Sep 2019.
  * [65] A. I. Shushin.  The effect of measurements, randomly distributed in time, on quantum systems: stochastic quantum zeno effect.  J. Phys. A: Math. Theor., 44(055303), 2011.
  * [66] Stefano Gherardini, Shamik Gupta, Francesco Saverio Cataliotti, Augusto Smerzi, Filippo Caruso, and Stefano Ruffo.  Stochastic quantum zeno by large deviation theory.  New J. Phys., 18(013048), 2016.
  * [67] Matthias M. Müller, Nicola Dalla Pozza, Stefano Gherardini, and Filippo Caruso.  Noise sensing via stochastic quantum zeno.  Phys. Lett. A, 384(13), 2020.
  * [68] Salvatore Virzì, Alessio Avella, Fabrizio Piacentini, Marco Gramegna, Tomá š Opatrný, Abraham G. Kofman, Gershon Kurizki, Stefano Gherardini, Filippo Caruso, Ivo Pietro Degiovanni, and Marco Genovese.  Quantum Zeno and Anti-Zeno Probes of Noise Correlations in Photon Polarization.  Phys. Rev. Lett., 129:030401, Jul 2022.
  * [69] Jonas Bylander, Simon Gustavsson, Fei Yan, Fumiki Yoshihara, Khalil Harrabi, George Fitch, David G. Cory, Yasunobu Nakamura, Jaw-Shen Tsai, and William D. Oliver.  Noise spectroscopy through dynamical decoupling with a superconducting flux qubit.  Nature Physics, 7:565, Jul 2011.
  * [70] Fumiki Yoshihara, Yasunobu Nakamura, Fei Yan, Simon Gustavsson, Jonas Bylander, William D. Oliver, and Jaw-Shen Tsai.  Flux qubit noise spectroscopy using rabi oscillations under strong driving conditions.  Phys. Rev. B, 89:020503, Jan 2014.
  * [71] Michael J. Biercuk, Hermann Uys, Aaron P. VanDevender, Nobuyasu Shiga, Wayne M. Itano, and John J. Bollinger.  Optimized dynamical decoupling in a model quantum memory.  Nature, 458:996, Apr 2009.
  * [72] Shlomi Kotler, Nitzan Akerman, Yinnon Glickman, Anna Keselman, and Roee Ozeri.  Single-ion quantum lock-in amplifier.  Nature, 473:61, May 2011.
  * [73] Yoav Sagi, Ido Almog, and Nir Davidson.  Process tomography of dynamical decoupling in a dense cold atomic ensemble.  Phys. Rev. Lett., 105:053201, Jul 2010.
  * [74] Ido Almog, Yoav Sagi, Goren Gordon, Guy Bensky, Gershon Kurizki, and Nir Davidson.  Direct measurement of the system–environment coupling as a tool for understanding decoherence and dynamical decoupling.  Journal of Physics B: Atomic, Molecular and Optical Physics, 44(15):154006, jul 2011.
  * [75] K. W. Chan, W. Huang, C. H. Yang, J. C. C. Hwang, B. Hensen, T. Tanttu, F. E. Hudson, K. M. Itoh, A. Laucht, A. Morello, and A. S. Dzurak.  Assessment of a silicon quantum dot spin qubit environment via noise spectroscopy.  Phys. Rev. Applied, 10:044017, Oct 2018.
  * [76] Filip K. Malinowski, Frederico Martins, Łukasz Cywiński, Mark S. Rudner, Peter D. Nissen, Saeed Fallahi, Geoffrey C. Gardner, Michael J. Manfra, Charles M. Marcus, and Ferdinand Kuemmeth.  Spectrum of the nuclear environment for gaas spin qubits.  Phys. Rev. Lett., 118:177702, Apr 2017.
  * [77] Yue Fu, Yang Wu, Yingqiu Dai, Xi Qin, Xing Rong, and Jiangfeng Du.  Molecular-spin-qubit noise spectroscopy through dynamical decoupling.  Phys. Rev. Applied, 15:L061001, Jun 2021.
  * [78] Juha T. Muhonen, Juan P. Dehollain, Arne Laucht, Fay E. Hudson, Rachpon Kalra, Takeharu Sekiguchi, Kohei M. Itoh, David N. Jamieson, Jeffrey C. McCallum, Andrew S. Dzurak, and Andrea Morello.  Storing quantum information for 30 seconds in a nanoelectronic device.  Nature Nanotechnology, 9:986, Dec 2014.
  * [79] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala.  Pytorch: An imperative style, high-performance deep learning library.  In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
  * [80] R. Liaw, E. Liang, R. Nishihara, P. Moritz, J. E. Gonzalez, and I. Stoica.  Tune: A Research Platform for Distributed Model Selection and Training.  arXiv:1807.05118, 2018.
  * [81] James Bergstra, Daniel Yamins, and David Cox.  Making a science of model search: Hyperparameter optimization in hundreds of dimensions for vision architectures.  In Sanjoy Dasgupta and David McAllester, editors, Proceedings of the 30th International Conference on Machine Learning, volume 28 of Proceedings of Machine Learning Research, pages 115–123, Atlanta, Georgia, USA, 17–19 Jun 2013. PMLR.
  * [82] James Bergstra, Rémi Bardenet, Yoshua Bengio, and Balázs Kégl.  Algorithms for hyper-parameter optimization.  Advances in neural information processing systems, 24, 2011.
  * [83] Liam Li, Kevin Jamieson, Afshin Rostamizadeh, Ekaterina Gonina, Jonathan Ben-tzur, Moritz Hardt, Benjamin Recht, and Ameet Talwalkar.  A system for massively parallel hyperparameter tuning.  In I. Dhillon, D. Papailiopoulos, and V. Sze, editors, Proceedings of Machine Learning and Systems, volume 2, pages 230–246, 2020.