††thanks<EMAIL_ADDRESS><EMAIL_ADDRESS>
# Supervised Learning for Robust Quantum Control in Composite-Pulse Systems

Zhi-Cheng Shi  Fujian Key Laboratory of Quantum Information and Quantum
Optics, Fuzhou University, Fuzhou 350108, China  Department of Physics, Fuzhou
University, Fuzhou 350108, China  Jun-Tong Ding  Fujian Key Laboratory of
Quantum Information and Quantum Optics, Fuzhou University, Fuzhou 350108,
China  Department of Physics, Fuzhou University, Fuzhou 350108, China  Ye-Hong
Chen  Fujian Key Laboratory of Quantum Information and Quantum Optics, Fuzhou
University, Fuzhou 350108, China  Department of Physics, Fuzhou University,
Fuzhou 350108, China  Theoretical Quantum Physics Laboratory, Cluster for
Pioneering Research, RIKEN, Wakoshi, Saitama 351-0198, Japan  Quantum
Information Physics Theory Research Team, Center for Quantum Computing, RIKEN,
Wakoshi, Saitama 351-0198, Japan  Jie Song  Department of Physics, Harbin
Institute of Technology, Harbin 150001, China  Yan Xia  Fujian Key Laboratory
of Quantum Information and Quantum Optics, Fuzhou University, Fuzhou 350108,
China  Department of Physics, Fuzhou University, Fuzhou 350108, China  X. X.
Yi  Center for Quantum Sciences and School of Physics, Northeast Normal
University, Changchun 130024, China Franco Nori  Theoretical Quantum Physics
Laboratory, Cluster for Pioneering Research, RIKEN, Wakoshi, Saitama 351-0198,
Japan  Quantum Information Physics Theory Research Team, Center for Quantum
Computing, RIKEN, Wakoshi, Saitama 351-0198, Japan  Department of Physics,
University of Michigan, Ann Arbor, Michigan 48109-1040, USA

###### Abstract

In this work, we develop a supervised learning model for implementing robust
quantum control in composite-pulse systems, where the training parameters can
be either phases, detunings, or Rabi frequencies. This model exhibits great
resistance to all kinds of systematic errors, including single, multiple, and
time-varying errors. We propose a modified gradient descent algorithm for
adapting the training of phase parameters, and show that different sampling
methods result in different robust performances. In particular, there is a
tradeoff between high-fidelity and robustness for a given number of training
parameters, and both of them can be simultaneously enhanced by increasing the
number of training parameters (pulses). For its applications, we demonstrate
that the current model can be used for achieving high-fidelity arbitrary
superposition states and universal quantum gates in a robust manner. This work
provides a highly efficient learning model for fault-tolerant quantum
computation by training various physical parameters.

##  I Introduction

Quantum control with high precision is an essential prerequisite for the
implementation of reliable quantum computation Nielsen and Chuang (2000).
Here, high precision has two meanings: one for perfect control, with knowledge
of given physical parameters, and the other for being as free as possible from
the effects of various systematic errors. The former is readily available, for
instance, by adopting the familiar resonant pulse technique Allen and Eberly
(1975). The latter is truly difficult and requires a great deal of attention.
One of the main reasons is that we cannot really capture the complicated
nature of systematic errors, such as the inevitable parameter perturbations
and decoherence noises. Thus far, numerous approaches have been put forward to
address them, including: adiabatic passage Vitanov  _et al._ (2001); Liu  _et
al._ (2005); Král  _et al._ (2007); Wei  _et al._ (2008); Vitanov  _et al._
(2017), dynamical decoupling Viola  _et al._ (1999); Khodjasteh and Lidar
(2005); Souza  _et al._ (2012), quantum feedback Ashhab and Nori (2010);
Wiseman (2011); Zhang  _et al._ (2013); Yang  _et al._ (2015); Zhang  _et al._
(2017), single-shot shaped pulses Daems  _et al._ (2013); Van-Damme  _et al._
(2017), derivative removal by adiabatic gate Motzoi  _et al._ (2009);
Schutjens  _et al._ (2013); Theis  _et al._ (2016), and sampling-based
algorithms Chen  _et al._ (2014); Dong  _et al._ (2015, 2016a, 2016b, 2020);
Dong and Petersen (2023).

The emergence of machine learning Mohri  _et al._ (2012) offers an alternative
and powerful way to tackle the issue of robustness against various errors.
Essentially, machine learning is a process of using data to learn the rules
applicable to it, and then utilizing the learned rules to make predictions on
new data. Typical algorithms involved in machine learning are decision trees,
neural networks, support vector machines, random forests, and collaborative
filtering, to name a few. Broadly speaking, machine learning can be divided
into three main categories: unsupervised learning, supervised learning, and
reinforcement learning. Over the last few years, machine learning Biamonte
_et al._ (2017); Dunjko and Briegel (2018); Carleo  _et al._ (2019); Arrachea
(2023); Krenn  _et al._ (2023), especially supervised learning, has achieved
great success in many fields of physics, such as the study of nonequilibrium
quantum dynamics problems Zhang and Wang (2019); Zeng  _et al._ (2020); Che
_et al._ (2020); Ding  _et al._ (2021a); Ai  _et al._ (2022); Nomura  _et al._
(2021); Ahmed  _et al._ (2021a); Huang  _et al._ (2022a); Wu  _et al._ (2020);
Wise  _et al._ (2021), the classification of quantum states Ma and Yung
(2018); Glasser  _et al._ (2018); Gao  _et al._ (2018); Harney  _et al._
(2020); Ahmed  _et al._ (2021b); Vintskevich  _et al._ (2023), and the design
of control fields for high-fidelity quantum gate operations Zahedinejad  _et
al._ (2015, 2016); Yang  _et al._ (2018); Sabapathy  _et al._ (2019); Arrazola
_et al._ (2019); Zeng  _et al._ (2022). To date, there are a variety of
methods used to update control variables in machine learning, including the
Krotov Krotov (1996), gradient ascent pulse engineering (GRAPE) Khaneja  _et
al._ (2005), evolutionary Zahedinejad  _et al._ (2014); Huang  _et al._
(2022b), and variational quantum algorithms Magann  _et al._ (2021). Among
them, the high-efficiency GRAPE algorithm Khaneja  _et al._ (2005) and its
variants Roslund and Rabitz (2009); Johansson  _et al._ (2013); Wu  _et al._
(2019); Ding and Wu (2019); Ge  _et al._ (2020); Ding  _et al._ (2021b); Li
_et al._ (2022) have been very successful in designing the parameters of
control fields to sharply suppress various errors, such as amplitude
uncertainty and frequency drift.

In this work, we provide a systematic methodology for robust quantum control
through constructing a supervised learning model in composite-pulse systems.
This model is quite universal and very robust to all kinds of systematic
errors, including single error, multiple types of errors, time-varying errors,
and so forth. Specifically, we establish the cost function of the supervised
learning model, and then propose a modified version of the GRAPE algorithm to
train different physical parameters (e.g., phases or detunings).

In this model, one of the most critical steps is to ascertain the _sampling_
method, reflecting in the sampling range and distribution, and we demonstrate
that it is necessary to select a suitable sampling range to avoid overfitting
and underfitting phenomena. Furthermore, the generalization ability of this
model is significantly enhanced by increasing the number of pulses. We finally
extend this model to train any physical parameters to implement robust quantum
control. Our method paves an efficient way toward the establishment of high-
precision and reliable quantum gates for fault-tolerant quantum computation.

The rest of this paper is organized as follows. In Sec. II, we first present
the physical system for constructing a supervised learning model, and show how
to design the cost function for this model. Next, we propose a modified
gradient descent algorithm to train the phase parameters, and then investigate
in detail the sampling methods and the generalization ability of this model.
In Sec. III, we provide some applications of this model, including the
implementation of arbitrary superposition states and universal quantum gates,
which are robust against all kinds of systematic errors. In Sec. IV, we
finally illustrate that this model has the ability of training any physical
parameters to achieve robust quantum control. Conclusions are given in Sec. V.

##  II Supervised Learning Model

###  II.1 Physical model

Consider a qubit coherently driven by a control field, and the general form of
the Hamiltonian in the interaction picture reads ($\hbar=1$)

$\displaystyle H(\theta)=\Delta\sigma_{z}+\Omega e^{-i\theta}\sigma_{+}+\Omega
e^{i\theta}\sigma_{-},$ (1)

where $\Delta$ represents the detuning between the transition frequency of the
qubit and the carrier frequency of the control field, $\Omega$ is the Rabi
frequency, $\theta$ denotes the phase, and
$\sigma_{\pm}=\frac{1}{2}(\sigma_{x}\pm i\sigma_{y})$, with $\sigma_{\nu}$
($\nu=x,y,z$) being Pauli operators.

To achieve universal single-qubit gates, the most intuitive and fastest method
is to adopt a resonant pulse, i.e., $\Delta=0$. Then, the evolution operator
of this system becomes

$\displaystyle U(\theta)=e^{-iH(\theta)t}=\left[\begin{array}[]{cc}\cos
A&-ie^{i\theta}\sin{A}\\\\[6.45831pt] -ie^{-i\theta}\sin{A}&\cos
A\end{array}\right],$ (4)

with pulse area $A=\Omega t$. Through simply choosing different pulse areas
and phases, we can effortlessly obtain a multitude of single-qubit gates.
However, the major disadvantage of the resonant pulse is its high
susceptibility to systematic errors. To significantly enhance the robustness
against systematic errors, one can turn to the composite pulses Levitt and
Freeman (1979); Levitt (1986); Wimperis (1994), a train of pulses with
identical amplitudes and relative phases to be addressed. A general expression
for the total evolution operator of composite pulses can be formulated as
follows:

$\displaystyle U_{\mathrm{tot}}=U(\theta_{N})U(\theta_{N-1})\cdots
U(\theta_{2})U(\theta_{1}),$ (5)

where $U(\theta_{n})=\exp[-iH(\theta_{n})T]$ is the evolution operator of the
$n$th pulse with pulse duration $T$ and Hamiltonian $H(\theta_{n})$,
$n=1,\dots,N$.

There are numerous methods to determine the values of the phase parameters
$\theta_{n}$ ($n=1,\dots,N$). Among them, the most commonly used is to employ
the Taylor expansion in the vicinity of the error $\epsilon=0$ Cummins  _et
al._ (2003); Brown  _et al._ (2004); Ichikawa  _et al._ (2011); Genov and
Vitanov (2013); Jones (2013); Genov  _et al._ (2011); Torosov and Vitanov
(2019a); Cohen  _et al._ (2016); Dridi  _et al._ (2020); Torosov and Vitanov
(2020); Kyoseva  _et al._ (2019); Bulmer  _et al._ (2020); Torosov and Vitanov
(2019b), which have been experimentally demonstrated in various physical
platforms Rong  _et al._ (2015); Mount  _et al._ (2015); Ivanov  _et al._
(2022); Torosov and Vitanov (2022). This method has its own limitations.
Although there are some analytical solutions for phases in some simple cases
of a single error Torosov  _et al._ (2011); Torosov and Vitanov (2011); Genov
_et al._ (2014); Torosov and Vitanov (2018); Low  _et al._ (2014); Genov  _et
al._ (2020, 2017), more often, the expressions of the coefficients in Taylor
series become particularly cumbersome for multiple types of systematic errors.
As a result, even if the long and complicated expressions are given, only
numerical solutions for phases are accessible Wang  _et al._ (2012, 2014a);
Torosov  _et al._ (2015); Demeter (2016); Shi  _et al._ (2021); Gevorgyan and
Vitanov (2021); Torosov  _et al._ (2020); Zhang  _et al._ (2022). Worse still,
the numerical solutions may not exist sometimes, and thus one requires the aid
of various cost functions Shi  _et al._ (2022); Wu  _et al._ (2023).

Here, we would ascertain the phase parameters $\theta_{n}$ ($n=1,\dots,N$) by
training the samples using the supervised learning model, which can
effectively settle the aforementioned issues. Not only that, this model can
also solve problems that traditional composite pulses are incapable of
handling, e.g., for time-varying errors D’Arrigo  _et al._ (2016); Huang and
Goan (2017); Kestner  _et al._ (2013); Wang  _et al._ (2014b); Colmenar and
Kestner (2022); Milne  _et al._ (2020); Kang  _et al._ (2023); Araki  _et al._
(2023). For briefness, from now on, we adopt the vector $\bm{\theta}$ to
represent all phase parameters, i.e.,
$\bm{\theta}=(\theta_{1},\dots,\theta_{N})$.

###  II.2 Cost function

We begin by constructing the cost function for robust quantum control
(operations) in the supervised learning model. Given a set of training data
$\\{\bm{x}_{k},y_{k}\\}$, the goal of supervised learning is to learn a
mapping from $\bm{x}$ to $y$, where $y_{k}$ is called the label or target of
the sample $\bm{x}_{k}$ (usually a vector) in the data set. Here, the phases
$\bm{\theta}$ are the training parameters to be learned to make quantum
operations as immune to errors as possible.

In the absence of errors, one can acquire perfect quantum operations by
composite pulses. Nevertheless, the fidelity of quantum operations declines to
varying degrees when the system exhibits different types of errors. Under
these circumstances, the fidelity of quantum operations can be regarded as a
function of errors. Therefore, the samples come from various errors of this
system, i.e.,

$\displaystyle\bm{x}_{k}=\bm{\epsilon}_{k}=(\epsilon_{k}^{1},\dots,\epsilon_{k}^{l},\dots,\epsilon_{k}^{L}),$
(6)

where $L$ represents the maximum dimension of errors, and the components
$\epsilon^{l}_{k}$ characterize different types (times) of errors,
$l=1,\dots,L$. In other words, the errors can be unknown constant or time-
varying noises in this model. The label we adopt here is the expected fidelity
$\hat{F}(\bm{\epsilon}_{k})$ of quantum operations,

$\displaystyle y_{k}=\hat{F}(\bm{\epsilon}_{k}).$ (7)

In ideal situations, we naturally expect the system to be completely resistant
to all errors, i.e., $\hat{F}(\bm{\epsilon}_{k})=1$ for all samples
$\bm{\epsilon}_{k}$, reflecting in the nominal fact that quantum operations
are fully accurate in the presence of a variety of errors.

For each sample $\bm{\epsilon}_{k}$, we define the following loss function

$\displaystyle\mathcal{L}_{k}=\hat{F}(\bm{\epsilon}_{k})-{F}(\bm{\epsilon}_{k}),$
(8)

where ${F}(\bm{\epsilon}_{k})$ is the actual fidelity of quantum operations in
the presence of the error $\bm{\epsilon}_{k}$. Note that the expression for
${F}(\bm{\epsilon}_{k})$ can take different forms for different quantum
operations. For quantum state preparations, ${F}(\bm{\epsilon}_{k})$ can be
given by

$\displaystyle{F}(\bm{\epsilon}_{k})=|\langle\Psi_{\mathrm{T}}|\Psi\rangle|^{2},$
(9)

where $|\Psi_{\mathrm{T}}\rangle$ is the target state, and $|\Psi\rangle$ is
the final state of the system after performing composite pulses. With regard
to quantum gate operations, ${F}(\bm{\epsilon_{k}})$ can be written as

$\displaystyle{F}(\bm{\epsilon}_{k})=\frac{1}{M}\mathrm{tr}(U^{{\dagger}}_{\mathrm{T}}U),$
(10)

where $U_{\mathrm{T}}$ is the target quantum gate, $M$ is the dimension of
$U_{\mathrm{T}}$, and $U$ denotes the total evolution operator for composite
pulses. Then, the cost function of the supervised learning model is defined by

$\displaystyle
J=\frac{1}{K}\sum_{k=1}^{K}\mathcal{L}_{k}=\frac{1}{K}\sum_{k=1}^{K}\left[\hat{F}(\bm{\epsilon}_{k})-{F}(\bm{\epsilon}_{k})\right],$
(11)

which represents the average of all loss functions, and $K$ is the sample
size.

###  II.3 Training and testing

Given the cost function (11), we are going to train the phase parameters
$\bm{\theta}$ to yield its minimum value, and then test the robust performance
for composite pulses by the phase parameters learned. Namely, we divide the
learning procedure into two steps: _training_ and _testing_. It is important
to stress that the errors $\bm{\epsilon}$ are continuous variables in this
model. Hence, we sample $K$ samples for errors in the training stage, while we
consider all errors instead of resampling them in the testing stage.

In the _training stage_ , we first select $K$ samples of errors through some
common probability distributions, such as the Gaussian distribution, the
uniform distribution, the Beta distribution, and the exponential distribution.
With $K$ samples, we calculate the value of the cost function $J$ via a random
set of initial phase parameters, and then update them using the modified
gradient descent algorithm, which is introduced in the next section.
Consequently, the cost function $J$ gradually diminishes with the passage of
iterations.

Figure 1: Schematic diagram of the data space. (a) $2$-dimensional space
composed of the error $\epsilon$ and the fidelity $F(\epsilon)$, where the
symbols $\bullet$ and $\blacklozenge$ represent the expected and actual
fidelities for samples, respectively. According to the labelled training set
$\\{\epsilon_{k},\hat{F}(\epsilon_{k})\\}$, the phase parameters $\bm{\theta}$
are trained to make the red dotted curve fit by the data points as close as
possible to the orange solid line, where $k=1,\dots,K$, and $K$ is the sample
size. (b) $(L\\!+\\!1)$-dimensional space, where the $L$-dimensional
hyperplane $\hat{F}(\epsilon^{1},\dots,\epsilon^{l},\dots,\epsilon^{L})=1$
represents an ideal situation in which the fidelity of quantum operations is
completely unaffected by all types (times) of errors. We have to train the
phase parameters $\bm{\theta}$ so that the red hypersurface fit by the symbols
$\blacklozenge$ approaches as much as possible the orange hyperplane
$\hat{F}(\epsilon^{1},\dots,\epsilon^{l},\dots,\epsilon^{L})=1$.

For example, in the one-dimensional data space, we update the training
parameters $\bm{\theta}$ to make the red dotted curve as close to the orange
solid line as possible, as shown in Fig. 1(a). The training parameters in
high-dimensional data spaces are updated in the same way as in one-dimension,
where the label $\hat{F}(\bm{\epsilon_{k}})=1$ becomes a hyperplane rather
than a line; see Fig. 1(b). It is worth mentioning that the update of the
training parameters does not end until seeking out the minimum value or
reaching a certain threshold of the cost function $J$.

In the _testing stage_ , we apply the learned phase parameters $\bm{\theta}$
in the training stage to all systematic errors in the interval
$[\epsilon_{-},\epsilon_{+}]$, and then evaluate the robust performance for
this composite pulse sequence in terms of the average fidelity. If the average
fidelity reaches the expected value, we accept this learned phase parameters
and terminate the learning procedure. Otherwise, the learning procedure is a
failure and we must retrain the phase parameters to obtain another solution,
i.e., returning to the training stage with a new set of samples or initial
phase parameters.

###  II.4 Modified gradient descent algorithm

In the original GRAPE algorithm Khaneja  _et al._ (2005), the control
variables are _amplitudes_ of control fields, but they become _phases_ here.
As a result, the original GRAPE algorithm cannot be directly applied in the
current model, and a modified version of the GRAPE algorithm is urgently
required to accommodate this situation. We next explain this modified GRAPE
algorithm.

At first, we make a proper deformation for the Hamiltonian of the $n$-th pulse
($n=1,\dots,N$)

$\displaystyle H(\theta_{n})$ $\displaystyle=$ $\displaystyle
e^{-i\theta_{n}}\sigma_{+}+e^{i\theta_{n}}\sigma_{-}$ (12) $\displaystyle=$
$\displaystyle\cos\theta_{n}\sigma_{x}+\sin\theta_{n}\sigma_{y}$
$\displaystyle=$ $\displaystyle u_{n,x}H_{x}+u_{n,y}H_{y},$

where $H_{x(y)}=\sigma_{x(y)}$, and $\Omega$ has been regarded as unit. In Eq.
(12), two virtual variables $u_{n,x}$ and $u_{n,y}$ are exploited to
substitute for the phase parameter $\theta_{n}$, and they satisfy the relation

$\displaystyle\theta_{n}=\arctan\frac{u_{n,y}}{u_{n,x}}.$ (13)

After this substitution, we can use the gradient descent algorithm to update
the virtual variables $u_{n,x}$ and $u_{n,y}$, i.e.,

$\displaystyle u^{\prime}_{n,x}$ $\displaystyle=$ $\displaystyle
u_{n,x}-\alpha_{x}\frac{\delta J}{\delta u_{n,x}},$ (14) $\displaystyle
u^{\prime}_{n,y}$ $\displaystyle=$ $\displaystyle
u_{n,y}-\alpha_{y}\frac{\delta J}{\delta u_{n,y}},$

where both $\alpha_{x}$ and $\alpha_{y}$ are some prescribed learning rates.
Then, the new phase parameters in the next iteration read

$\displaystyle\theta^{\prime}_{n}=\arctan\frac{u^{\prime}_{n,y}}{u^{\prime}_{n,x}}.$
(15)

It is worth stressing that $u_{n,x}$ and $u_{n,y}$ are only introduced as a
mathematical tool, and they do not have to possess physical meaning. Figure 2
illustrates the geometric interpretation of the gradient descent principle.

Figure 2: Geometric interpretation of the modified GRAPE algorithm. First, the
phase $\theta_{n}$ ($n=1,\dots,N$) is mapped onto the unit circle to yield a
unit vector (the green line). By orthogonal decomposition of this vector, we
obtain two variables $u_{n,x}$ and $u_{n,y}$. Then, we use the gradient
descent algorithm to calculate the increment in both directions, and thus
acquire the increment vector (the gray line). According to the parallelogram
law of vectors, we obtain a new vector (the orange line) whose direction is
actually the gradient descent direction. As a result, we have the new phase
$\theta_{n}^{\prime}$ in the next iteration. The iteration process continues
until reaching the threshold of the gradient. Modified GRAPE algorithm
---
1\. Randomly input the initial phase parameters $\theta_{n}$.
2\. Calculate the virtual variables $u_{n,x}=\cos\theta_{n}$ and
$u_{n,y}=\sin\theta_{n}$.
3\. Evaluate the increments and update the virtual variables,
labelled as $u^{\prime}_{n,x}$ and $u^{\prime}_{n,y}$.
4\. Calculate the parameters $\theta^{\prime}_{n}=\arctan
u^{\prime}_{n,y}/u^{\prime}_{n,x}$.
5\. Regard $\theta^{\prime}_{n}$ as new phase parameters.
6\. Go to Step 2 until the threshold is reached.

It is important to note that the modified GRAPE (m-GRAPE) algorithm is pretty
crude, not because we cannot find a solution of the training parameters
$\bm{\theta}$, but because there are very many locally optimal solutions. For
example, in Fig. 3, we plot different excitation profiles using 100 groups of
the learned parameters $\bm{\theta}$, obtained through different
initializations and samples in the supervised learning model. To be specific,
the effective training rates are about 22% and 24% for pulse numbers $N=5$ and
$7$, respectively, where the effective trainings are accounted only when the
average fidelity $\bar{F}(-0.1,0.1)$ is larger than 0.9999 [the definition of
the average fidelity can be found in Eq. (20)]. Obviously, most of the
trainings failed, because the corresponding solutions do not make the system
robust against the pulse area error; see also in Fig. 3. Moreover, it is
difficult to distinguish which solutions are global optimal. Therefore, we
have to properly amend the m-GRAPE algorithm.

Figure 3: Fidelity $F(\epsilon_{A})$ vs the pulse area error $\epsilon_{A}$
for pulse numbers $N=5$ (top panel) and $N=7$ (bottom panel). Each excitation
profile is plotted according to the learned phase parameters $\bm{\theta}$,
which are obtained by training different samples in the supervised learning
model. The pulse area of each pulse is set to $\pi/2$. The samples
$\epsilon^{A}_{k}$ are sampled uniformly and randomly from the interval
$[-0.3,0.3]$ with sample size $K=1000$.

To search global optimal solutions of the training parameters (probably more
than one), two common methods of “escaping” or “restarting” are usually
adopted; namely, searching in other directions based on the current solution,
or ignoring the current solution and searching again in a new parameter space.

During the learning process, we need to evaluate the performance of the
training each time, which can be qualified by the average fidelity. Let us
start with the case of one-dimensional error. Given the learned phase
parameters $\bm{\theta}$, the definition of the average fidelity $\bar{F}$ is
expressed by

$\displaystyle\bar{F}=\int\\!\rho(\epsilon)\;F_{\bm{\theta}}(\epsilon)\;d\epsilon,$
(16)

where $F_{\bm{\theta}}(\epsilon)$ represents the fidelity of quantum
operations in the presence of the error $\epsilon$, and $\rho(\epsilon)$ is
the probability density distribution of the error. In reality, it is difficult
to exactly predetermine the specific distribution of $\rho(\epsilon)$. The
usual way to tackle it is to use _a priori_ density distribution such as the
uniform distribution or the Gaussian distribution. Here, $\rho(\epsilon)$ is
simply adopted by a uniform distribution, i.e., all errors in the interval
$[\epsilon_{-},\epsilon_{+}]$ are considered equally weighted in the testing
stage. Therefore, the form of $\rho(\epsilon)$ is

$\displaystyle\rho(\epsilon)=\left\\{\begin{array}[]{ll}\displaystyle\frac{1}{\epsilon_{+}-\epsilon_{-}},&~{}~{}~{}\epsilon\in[\epsilon_{-},\epsilon_{+}],\\\\[12.05553pt]
0,&~{}~{}~{}\mathrm{others}.{}{}\\\ \end{array}\right.$ (19)

As a result, Eq. (16) becomes

$\displaystyle\bar{F}(\epsilon_{-},\epsilon_{+})=\frac{1}{\epsilon_{+}-\epsilon_{-}}\int_{\epsilon_{-}}^{\epsilon_{+}}F_{\bm{\theta}}(\epsilon)\;d\epsilon.$
(20)

And its discrete version reads

$\displaystyle\bar{F}(\epsilon_{-},\epsilon_{+})=\frac{1}{\epsilon_{+}-\epsilon_{-}}\sum_{k}F_{\bm{\theta}}(\epsilon_{k})\;\Delta\epsilon_{k}.$
(21)

Note that the value of $\bar{F}(\epsilon_{-},\epsilon_{+})$ does not have to
be set manually, but is self-adaptive during the learning process.
Alternatively, we can use the generalization error to characterize the robust
performance of this supervised learning model, which is defined by

$\displaystyle
G(\epsilon_{-},\epsilon_{+})=\frac{1}{\epsilon_{+}-\epsilon_{-}}\int_{\epsilon_{-}}^{\epsilon_{+}}\\!\\!\big{[}1\\!-\\!F_{\bm{\theta}}(\epsilon)\big{]}\;d\epsilon=1\\!-\\!\bar{F}(\epsilon_{-},\epsilon_{+}).$
(22)

Moreover, we can define the robust width $W(\xi)$ for this model as well,
i.e.,

$\displaystyle W(\xi)=\epsilon_{\mathrm{max}}-\epsilon_{\mathrm{min}},$ (24)

where all the points in the interval
$[\epsilon_{\mathrm{min}},\epsilon_{\mathrm{max}}]$ satisfy

$\displaystyle\max\big{\\{}1-F_{\bm{\theta}}(\epsilon)\big{\\}}\leq\xi,~{}~{}~{}\epsilon\in[\epsilon_{\mathrm{min}},\epsilon_{\mathrm{max}}],$
(25)

with a given error threshold $\xi$. Remarkably, these definitions are easily
generalized to the case of multi-dimensional errors.

The _escaping_ method is manipulated as follows. We first employ the m-GRAPE
algorithm for learning $M$ groups of phase parameters $\bm{\theta}_{m}$ as a
starting point, where $m=1,\dots,M$. To escape the locally optimal solution,
we artificially add a stochastic gradient to each phase so as to generate new
input variables. By making use of the m-GRAPE algorithm again, we would obtain
the new learned parameters $\bm{\theta^{\prime}}_{m}$ and the corresponding
average fidelity $\bar{F}^{\prime}_{m}(\epsilon_{-},\epsilon_{+})$, where the
subscript $m$ represents the $m$-th group of training. If
$\bar{F}^{\prime}_{m}(\epsilon_{-},\epsilon_{+})\leq\bar{F}_{m}(\epsilon_{-},\epsilon_{+})$,
it means that the new learned parameters $\bm{\theta}^{\prime}_{m}$ are not as
good as the old ones. As a result, they should be abandoned, and we still keep
the original learned parameters $\bm{\theta}_{m}$. However, if
$\bar{F}^{\prime}_{m}(\epsilon_{-},\epsilon_{+})>\bar{F}_{m}(\epsilon_{-},\epsilon_{+})$,
it represents that the solution has jumped out of locally optimal regions, and
thus we accept the new ones. After updating each training group $\mathcal{N}$
times, we next calculate the total average fidelity for all training groups,

$\displaystyle\bar{F}_{\mathrm{tot}}=\frac{1}{M}\sum_{m=1}^{M}\bar{F}_{m}(\epsilon_{-},\epsilon_{+}).$
(26)

Then, the learned parameters whose average fidelity are lower than
$\bar{F}_{\mathrm{tot}}$ are discarded. This iteration process continues until
the threshold of the total average fidelity is reached. At the end, the
optimal solutions for robust quantum control will be left.

Escape-based GRAPE algorithm
---
1\. Use m-GRAPE algorithm to learn $M$ group parameters
$\bm{\theta}_{m}$ and calculate the average fidelity
$\bar{F}_{m}(\epsilon_{-},\epsilon_{+})$.
2\. Add stochastic gradient $\delta\theta^{m}_{n}$ to the learned parameters:
$\theta^{m}_{n}\\!\\!\leftarrow\\!\theta^{m}_{n}\\!+\\!\delta\theta^{m}_{n}$,
regarded as new input variables.
3\. Reuse the m-GRAPE algorithm to learn new parameters
$\bm{\theta}^{\prime}_{m}$ and the average fidelity
$\bar{F}^{\prime}_{m}(\epsilon_{-},\epsilon_{+})$.
4\. If
$\bar{F}_{m}(\epsilon_{-},\epsilon_{+})>\bar{F}^{\prime}_{m}(\epsilon_{-},\epsilon_{+})$,
then $\bm{\theta}_{m}\leftarrow\bm{\theta}^{\prime}_{m}$ and
$\bar{F}_{m}(\epsilon_{-},\epsilon_{+})\leftarrow\bar{F}^{\prime}_{m}(\epsilon_{-},\epsilon_{+})$.
5\. Repeat Steps 2 through 4 $\mathcal{N}$ times.
6\. Calculate the total average fidelity $\bar{F}_{\mathrm{tot}}$.
7\. Discard learned parameters $\bm{\theta}_{m}$ when
$\bar{F}_{m}(\epsilon_{-},\epsilon_{+})<\bar{F}_{\mathrm{tot}}$.
8\. Go to Step 2 until
$\big{(}\max\\{\bar{F}_{m}(\epsilon_{-},\epsilon_{+})\\}-\bar{F}_{\mathrm{tot}}\big{)}<\varepsilon$.

For the _restarting_ method, we must increase the number of training groups to
a large enough size, and each group is trained individually. After
accomplishing the training, we measure the performance of each group using the
average fidelity defined by Eq. (20). Then, the phase parameters that make the
average fidelity reach the desired value are left, and the rest is simply
abandoned.

Note that the restarting method is very practical when the dimension of
training parameters is small. However, if the dimension is sufficiently large,
it may be difficult to choose enough groups of training parameters. In this
situation, it is more suitable for adopting the escaping method to obtain the
optimal solutions of training parameters.

###  II.5 Sampling methods

In the supervised learning model, one of the most important parts is to
acquire enough samples, and the samples should be representative. If the
sample size is too small, it is easy to observe underfitting, where the
parameter law of the model may not be learned effectively. Furthermore, a
highly concentrated distribution of samples may result in a lack of
representativeness, increasing the risk of overfitting and ultimately
degrading the forecast accuracy of new samples. Neither of these situations is
capable of unearthing the maximum potential of this model. Therefore, how to
efficiently sample enough samples becomes particularly critical in supervised
learning. Specifically, the usage of different samples for training will
produce different training parameters, and such discrepancies can
significantly impact the quality of robust quantum control. During the
sampling process, two factors have to be concerned, i.e., sampling range and
distribution. In this section, we focus on this issue.

Figure 4(a) shows the relationship between the generalization error
$\bar{G}(\epsilon^{\prime}_{+},\epsilon^{\prime}_{+})$ and the total number of
samples. It is readily found that the generalization error is relatively large
and oscillates when the sample size $K$ is not large enough. With the
increasing of the sampling size, the generalization error gradually decreases
and stabilizes at a relatively low level. This implies that having sufficient
samples are imperative for successfully training the parameters. Furthermore,
a comparison of points with different shapes shows that increasing the number
of training groups also facilitates parameter training, making it easier to
find the optimal solutions; see the points with the asterisk.

Figure 4: (a) Generalization error
$G(\epsilon^{\prime}_{-},\epsilon^{\prime}_{+})$ vs the sampling size $K$. The
objective is to robustly attain population inversion for a pulse area error,
where we uniformly sample the samples from the interval $[0,0.3]$, set the
pulse area of each pulse to $\pi/2$, choose the pulse number $N=7$, adopt a
learning rate of 0.001, and randomly select the initial values of the training
parameters $\bm{\theta}$ from the range of $[-\pi,\pi]$. (b) Generalization
error $G(\epsilon^{\prime}_{-},\epsilon^{\prime}_{+})$ vs the sampling
boundary $\epsilon^{\prime}_{+}$, where the samples are uniformly sampled from
the interval $[0,\epsilon^{\prime}_{+}]$ with a sample size of $K=1000$.
Figure 5: Robust performances for different sampling methods. We obtain 500
groups of phase parameters after training 1000 samples by using the uniform
distribution $U(\epsilon_{-},\epsilon_{+})$ with sampling interval
$[\epsilon_{-},\epsilon_{+}]$, the Gaussian distribution $G(\mu,\nu)$ with
expectation $\mu$ and variance $\nu$, the exponential distribution
$E(\lambda)$ with rate parameter $\lambda$, and the Beta distribution
$B(\alpha,\beta)$ with parameters $\alpha$ and $\beta$, respectively. The bar
chart at the bottom counts the average fidelity $\bar{F}(-0.2,0.2)$ for
different intervals, and the panels at the top depict the corresponding
fidelity versus the pulse area error by using 20 groups of phase parameters
that have been learned. The pulse number is $N=7$, and other parameters are
the same as in Fig. 4.

In Fig. 4(b), we plot trends in the generalization error by using different
sampling ranges. The samples are uniformly sampled from the interval
$[0,\epsilon^{\prime}_{+}]$, where the symbol $\prime$ is added in
$\epsilon_{+}$ to distinguish the sampling boundary from the error boundary.
We can see that the generalization error
$\bar{G}(-\epsilon^{\prime}_{+},\epsilon^{\prime}_{+})$ tends to increase on
the whole when increasing the sampling range. This result means that a small
sampling range is beneficial to obtain relatively high fidelity of quantum
operations. Nevertheless, smaller sampling ranges are not always superior,
because an excessively small sampling range may be counterproductive to
improving the robust width, as explained in Sec. II.6. Thus, an appropriate
sampling range favors attaining high fidelity and a broad robust width.

We next investigate the influence of different sampling distributions on the
robust performance of quantum control. Figure 5 demonstrates robust
performances for various learned phase parameters $\bm{\theta}$, which are
trained by some common sampling distributions, including the uniform
distribution $U(\epsilon_{-},\epsilon_{+})$ with sampling interval
$[\epsilon_{-},\epsilon_{+}]$, the Gaussian distribution $G(\mu,\nu)$ with
expectation $\mu$ and variance $\nu$, the exponential distribution
$E(\lambda)$ with rate parameter $\lambda$, and the Beta distribution
$B(\alpha,\beta)$ with parameters $\alpha$ and $\beta$. Obviously, different
sampling distributions exhibit different robust performances of quantum
control.

First, the training effect is relatively poor for symmetric sampling with
respect to null error, e.g., the distributions $U(-0.3,0.3)$ and $G(0,0.2)$,
because at least half of the average fidelity $\bar{F}(-0.2.0.2)$ is lower
than 0.9, as shown by the orange bar in Figs. 5(a) and 5(c). To shed light on
it more specifically, at the top of Fig. 5, we also plot the fidelity as a
function of the pulse area error for different learned phase parameters
$\bm{\theta}$. It can be easily observed that a large number of excitation
profiles do not present a plateau in the vicinity of the pulse area error
$\epsilon=0$, implying that these trainings failed. The reason behind these
results is that the solutions of the training parameters $\bm{\theta}$
converge more easily to local optimality and hardly escape from these regions.

When we employ asymmetric sampling, as shown in the insets of Figs. 5(b),
5(d), 5(e) and 5(f), almost all excitation profiles exhibit a high-fidelity
window, and thus most of the training is valid. A closer look at those
excitation profiles reveals that different sampling distributions lead to
slightly different robust features. Among them, the exponential distribution
performs the worst in terms of the amount of high-fidelity
[$\bar{F}(-0.2,0.2)>0.9999$]; see the blue bar in Fig. 5. This is mainly
attributed to the fact that the training process takes into account a certain
number of samples with a large error magnitude.

For the uniform distribution, it performs the best in the high-fidelity window
[$\bar{F}(-0.2,0.2)>0.9999$], because only samples with low error magnitude
are used in this case. For the remaining two distributions, the effects of
training are similar. Therefore, selecting a proper sampling distribution can
facilitate the training of parameters. In the following, we tend to train the
phase parameters $\bm{\theta}$ with an asymmetric uniform distribution, unless
otherwise specified.

###  II.6 Generalization ability

The generalization ability is a key indicator to measure the quality of
supervised learning models. It refers to the ability to generalize from the
training set to the testing set. Generally speaking, the supervised learning
model possesses strong generalization ability when executing well in
predicting samples that have never been seen before. In the current model,
bounded by the sampling boundary $\epsilon^{\prime}_{+}$, we divide the never-
before-seen samples into two parts: internal samples and external samples. As
a result, the generalization ability is primarily manifested in two aspects:

(_i_) Generalization of errors within the sampling range, which can be
quantified by the generalization error
$G(\epsilon^{\prime}_{-},\epsilon^{\prime}_{+})$ in Eq. (22). Specifically, a
greater generalization ability within the sampling range is reflected by a
smaller generalization error $G(\epsilon^{\prime}_{-},\epsilon^{\prime}_{+})$.
In other words, a small $G(\epsilon^{\prime}_{-},\epsilon^{\prime}_{+})$
represents that the learned phase parameters $\bm{\theta}$ have strong
robustness against the errors within the sampling range.

(_ii_) Generalization of the error range. For a given error threshold $\xi$,
it is very necessary to know within what error range rather than sampling
range the learned phase parameters $\bm{\theta}$ have good robustness, and
this quantity can be measured by the robust width $W(\xi)$ in Eq. (24). In
fact, this quantity is mainly used to characterize whether or not the learned
phase parameters $\bm{\theta}$ work well when the errors are beyond the
sampling range.

Before elaborating on the generalization ability, we stress that there are
some differences between the traditional supervised learning model Bishop
(2006) and the current one. In traditional supervised learning Bishop (2006),
when the complexity of the model exceeds a certain level, the algorithm is
easy to overfit, and thus affects the accuracy of sample prediction. Namely,
more training parameters is not always better. On the contrary, the more
complex the current model, the stronger generalization ability the system has,
because a more complex model implies that _more phase parameters can be used
for training_. Namely, model complexity (i.e., _increasing pulse numbers_) is
conducive to promoting the generalization ability. The reason is that the rule
that needs to be learned is already known, i.e., the hyperplane
$\hat{F}(\epsilon^{1},\dots,\epsilon^{l},\dots,\epsilon^{L})=1$ as shown in
Fig. 1(b). We next study this issue in detail.

Figure 6: Generalization error $G(-\epsilon_{+},\epsilon_{+})$ vs the pulse
number $N$ for different sample ranges. The samples $\epsilon_{k}$ are sampled
by the uniform distributions (a) $U(0,0.2)$, (b) $U(0,0.4)$, (c) $U(0,0.6)$,
and (d) $U(0,0.8)$, where other parameters are the same as in Fig. 4.

Figure 6 displays the generalization error $G(-\epsilon_{+},\epsilon_{+})$ for
different pulse numbers and sampling ranges. As shown by the dark blue bar in
Fig. 6(a), i.e., $G(-0.2,0.2)\ll 10^{-5}$, the generalization of errors within
the sample range is excellent for small sampling range. In addition to this,
the generalization of the error range does not behave well, as it fails to
exhibit a substantial reduction in correlation with an increase in the error
range; see the light blue bars in Fig. 6(a). Particularly, there is not much
improvement in the robust performance when increasing the number of pulses.
Those results reveal that when the sampling range is too small, the phase
parameters may not be effectively trained, especially for a large number of
pulses. When increasing the sampling range, the generalization of the error
range is gradually enhanced, but at the cost of a loss in the average
fidelity; see also the dark blue bars in Figs. 6(a)–6(d). Hence, a suitable
sampling range enables better training of phase parameters, thereby enhancing
the robustness of this model. As an example, for pulse number $N=9$ and
sampling range $[0,0.6]$, as shown in Fig. 6(c), the generalization error
$G(-0.6,0.6)$ is on the order of $10^{-5}$, less than the fault tolerance
threshold $10^{-4}$ Nielsen and Chuang (2000). This implies that the fidelity
of population inversion is much larger than 0.9999 even though there is an
$\pm 60$% pulse area error in this system.

In Fig. 7(a), we show the relationship between the robust width $W(\xi)$ and
the sampling boundary $\epsilon^{\prime}_{+}$, where error threshold $\xi$ is
equal to $10^{-4}$. In cases where the sampling range is not particularly
large, e.g., $\epsilon^{\prime}_{+}\leq 0.2$, the robust width does not vary
greatly depending on the number of pulses. This is mainly due to the fact that
the sampling range is too narrow to effectively represent all errors. As a
result, although complex models may possess strong generalization abilities,
they are prone to overfitting, a phenomenon of overlearning on the training
samples. To overcome the overfitting phenomenon and enhance the robustness
against errors over a broader range, we require to either expand the sampling
range or change the sampling method (e.g., employing the Gaussian distribution
to consider a small amount of errors with large magnitude) to have more
representative samples.

Broadly speaking, for a given pulse number, the robust width exhibits a
positive correlation with an escalation of the sampling range; see also in
Fig. 7(a). While the sampling range exceeds a certain threshold, the robust
width drops sharply. The main reason lies in the fact that, in such
circumstances, this model may appear underfitting, a phenomenon in which the
model inadequately fits the training samples. Hence, it is necessary to select
a suitable sampling range to maximize the generalization ability of this model
prior to the onset of underfitting. On the other hand, the threshold of the
sampling range varies depending on the number of pulses; see distinct
positions of the maximum robust width in Fig. 7(a). Remarkably, increasing the
pulse number leads to an increase in the sampling range, verifying that a more
sophisticated model tends to possess a stronger generalization ability.

Figure 7: (a) Robust width $W(\xi)$ vs the sampling boundary
$\epsilon^{\prime}_{+}$ for different pulse numbers. (b) Generalization error
$G(-\epsilon_{+},\epsilon_{+})$ vs the error boundary $\epsilon_{+}$ for
$N=9$. The samples $\epsilon_{k}$ are sampled by the uniform distribution
$U(0,\epsilon^{\prime}_{+})$, the error threshold is set to $\xi=10^{-4}$, and
other parameters are the same as in Fig. 4.

Figure 7(b) shows the generalization error as a function of the error
boundary, where different color curves represent different sampling ranges,
and we set the pulse number $N=9$. It can be seen that the generalization
errors change slowly and their values are relatively small when the error
falls within the sampling range. This indicates that the generalization
ability of this model is very strong within the sampling range. Nevertheless,
once the error goes beyond the sampling range, there is a sharp growth in the
generalization error, signifying an unsatisfactory generalization performance
in this range.

Thereby, for a particular number of training parameters (or equivalently,
pulses), generalization of errors within the sampling range and generalization
of the error range are always contradictory in the current model. In other
words, there is a tradeoff between high fidelity and wide robust range of
quantum control for a given pulse number. High fidelity usually leads to a
reduction in robust width, and vice versa. To promote these two generalization
abilities, a feasible way is to increase the complexity of the supervised
learning model (equivalently, the pulse number) so that more phase parameters
can be involved in the training. By doing this, both high fidelity and wide
robust range can be simultaneously attained in the current model. This is also
confirmed in Fig. 6 showing that the generalization error generally decreases
when increasing the pulse number.

##  III Applications: Robust Quantum Control

###  III.1 Single type of error

We begin by illustrating a scenario in which the system exhibits only one type
of error. That is, the samples are one-dimensional. Indeed, we have detailedly
explained in Sec. II how to successfully train the phase parameters
$\bm{\theta}$ in the presence of the pulse area error $\epsilon_{A}$. We next
demonstrate that this supervised learning model is equally applicable to
suppress other types of errors, such as the detuning error.

Figure 8: Fidelity $F(\epsilon_{\Delta})$ vs the detuning error
$\epsilon_{\Delta}$. Each excitation profile is plotted according to the
learned phase parameters $\bm{\theta}$, where the detuning errors
$\epsilon^{\Delta}_{k}$ are sampled from the uniform distribution $U(0,0.3)$,
and other parameters are the same as in Fig. 4.

Figure 8 shows the performance of the fidelity in the presence of the detuning
error $\epsilon_{\Delta}$ by the learned phase parameters, where the samples
$\epsilon^{\Delta}_{k}$ are sampled from the uniform distribution $U(0,0.3)$.
An inspection of Fig. 8 reveals that it is also feasible to make the system
robust with respect to the detuning error by training on the phase parameters.

####  III.1.1 Arbitrary superposition state

So far, we illustrate the supervised learning model with the example of
population inversion. Actually, this model is suitable for implementing
arbitrary population transfer in a robust manner as well. To this end, it is
imperative to transform the target state into a superposition state we desire
to prepare, whose general form is given by

$\displaystyle|\psi_{T}\rangle=\cos\phi|0\rangle+e^{i\varphi}\sin\phi|1\rangle,$
(27)

where $\phi$ and $\varphi$ can be arbitrary. After establishing the target
state, we then employ Eq. (9) to train the phase parameters to accomplish this
goal.

Figure 9 shows the time-evolution trajectories of the system state by the
learned phase parameters $\bm{\theta}$. We can see that when there is an pulse
area error in this system, the trajectories (the dashed and dot-dashed curves)
gradually deviate from the exact one (the solid curve) during the evolution
process. Despite this, those three trajectories eventually come together later
on. Therefore, the learned phase parameters $\bm{\theta}$ do ensure that the
target state $|\psi_{T}\rangle$ is still obtained with an ultrahigh fidelity
even in the presence of systematic errors.

####  III.1.2 Quantum gate

Figure 9: Visualization of preparing different superposition states on the
Bloch sphere. Left: $\phi=\pi/4$ and $\varphi=0$. Right: $\phi=\pi/3$ and
$\varphi=0$. The phase parameters $\bm{\theta}$ are attained by training in
the supervised learning model, where the sampling distribution takes the form
$U(-0.1,0.3)$. The blue (red) arrow denotes the Bloch vector pointing to the
initial (final) state. The solid, dashed, and dot-dashed curves represent the
trajectories of the system state in the presence of the pulse area error
$\epsilon_{A}=0$, $+0.1$, and $-0.1$, respectively, and the dynamical
evolution movie can be found in the supplementary material. The pulse number
is chosen as $N=7$, with the pulse area of each pulse being $\pi/4$, and other
parameters are the same as in Fig. 4.

This supervised learning model can be used not only to prepare arbitrary
superposition states, but also to implement universal quantum gates. The
expression can be written as

$\displaystyle\mathcal{U}(\phi,\varphi,\Phi)=\left[\begin{array}[]{cc}e^{i\Phi}\cos\phi&~{}~{}-e^{-i(\varphi+\Phi)}\sin\phi\\\\[6.45831pt]
e^{i(\varphi+\Phi)}\sin\phi&e^{-i\Phi}\cos\phi\end{array}\right],~{}~{}~{}$
(30)

where $\phi,\varphi$, and $\Phi$ are arbitrary real numbers based on the
desired quantum gate. In the current model, there are two methods to robustly
obtain the universal quantum gate given by Eq. (30). Next, we present each of
these two methods individually.

Figure 10: Real and imaginary parts of the evolution operator $U(NT)$ after
different iterations. We set the pulse area of each pulse to $\pi/4$, the
pulse number to $N=9$, and sample the pulse area error $\epsilon^{A}_{k}$ from
the uniform distribution $U(-0.1,0.3)$, while other parameters are the same as
in Fig. 4.

(_i_) _State-based method_. Given that the initial state of the system is
$|0\rangle$, we first train the phase parameters $\bm{\theta}$ to robustly
obtain a superposition state
$|\psi_{T}\rangle=\cos\phi|0\rangle+e^{i\varphi}\sin\phi|1\rangle$, where the
values of $\phi$ and $\varphi$ are determined by the desired quantum gate.
Then, we shift the learned phase parameters by an appropriate angle:

$\displaystyle\bm{\theta}\leftarrow\bm{\theta}+\Phi,$ (31)

where the shift angle $\Phi$ is dependent on the desired quantum gate as well.
We emphasize that this phase shift manipulation does not change the
probability amplitude of the matrix elements in Eq. (30); rather, it modifies
only the relative phase between different matrix elements. Therefore, the
final learned phase parameters for implementing the universal quantum gate in
a robust manner become $\bm{\theta}+\Phi$. As an example, the learned phase
parameters $\bm{\theta}$ adopted in Fig. 9(a) can also be used to implement a
Hadamard gate with a specific phase, and the phase of the Hadamard gate is
properly modulated by the phase shift $\Phi$.

(_ii_) _Evolution operator-based method_. We directly solve the Schrödinger
equation for the evolution operator $U(t)$ of this system,

$\displaystyle\dot{U}(t)=-iH(t)U(t),$ (32)

where $H(t)$ is the system Hamiltonian, and $U(0)=\textbf{1}$ is an identity
operator at the initial time. The target quantum gate
$\mathcal{U}(\phi,\varphi,\Phi)$ now can be reached via an evolution operator
after $N$ pulses, i.e.,

$\displaystyle U(NT)=\mathcal{U}(\phi,\varphi,\Phi).$ (33)

In this situation, we adopt Eq. (10) to calculate the corresponding gradients.

Suppose now that we intend to execute a Hadamard gate:

$\displaystyle\mathrm{H}=\frac{1}{\sqrt{2}}\left[\begin{array}[]{cc}1&1\\\\[6.45831pt]
1&-1\end{array}\right].$ (36)

To this goal, we proceed to train the phase parameters $\bm{\theta}$ through
minimizing the cost function given by Eq. (11). Figure 10 shows the variation
of tomography results after different iterations. We can see that the
evolution operator of the system gradually approaches the Hadamard gate as the
number of iterations increases, and eventually reaches the goal with ultrahigh
fidelity.

Different from the case of population inversion, the robust performance of
quantum gates is strongly correlated with the sampling distribution of samples
here. In other words, by training on different ranges of samples, we would
learn different phase parameters. And these phase parameters exhibit different
robust performance for systematic errors.

In Fig. 11, we plot the fidelity of the Hadamard gate versus the pulse area
error using various learned phase parameters attained from distinct sampling
ranges. It is shown that the learned phase parameters manifest varying degrees
of robustness to the pulse area error $\epsilon_{A}$ under different sampling
distributions.

Figure 11: Robust performances for the pulse area error by using different
ranges of sampling distributions. Parameters except for the sampling
distribution are the same as in Fig. 10.

###  III.2 Multiple types of errors

When the system simultaneously exhibits different types of errors (e.g., the
pulse area error and the detuning error), it is also convenient to employ this
supervised learning model to implement robust quantum control. In this
situation, the sample space becomes multidimensional, where each dimension
represents a specific type of errors. As a result, the training set can be
represented as
$\\{\epsilon^{A}_{k},\epsilon^{\Delta}_{k},\dots,\hat{F}(\epsilon^{A}_{k},\epsilon^{\Delta}_{k},\dots)\\}$,
where $\hat{F}(\epsilon^{A}_{k},\epsilon^{\Delta}_{k},\dots)=1$ is a
hyperplane, $k=1,\dots,K.$ In Fig. 12, we plot the fidelity as a function of
the pulse area error and the detuning error by training different numbers of
phase parameters, and the results demonstrate that the training methodology is
able to maintain its efficacy even when confronted with multiple types of
errors.

Figure 12: Contour plots of the fidelity $F(\epsilon_{A},\epsilon_{\Delta})$
vs the pulse area error $\epsilon_{A}$ and the detuning error
$\epsilon_{\Delta}$ for different numbers of phase parameters. (a) $N=7$. (b)
$N=9$. Both the pulse area error $\epsilon^{A}_{k}$ and the detuning error
$\epsilon^{\Delta}_{k}$ are sampled from the uniform distribution $U(0,0.22)$,
and other parameters are the same as in Fig. 4.

###  III.3 Time-varying errors

In this section, we manage to train the phase parameters when the errors are
time-dependent. As we know, it is impossible to exactly give out the Taylor
expansion for time-varying errors by using traditional composite pulse
technologies Freeman (1997), because the Hamiltonian generally cannot commute
with itself at different times. One common method of tackling time-varying
errors is to take advantage of appropriate unitary transformations to formally
divide the evolution operator of the system into error-free and error
components, and then design related parameters to minimize the influence of
the error term Green  _et al._ (2013); Kabytayev  _et al._ (2014); Paz-Silva
and Viola (2014); Zhen  _et al._ (2016); Haas  _et al._ (2019); Li  _et al._
(2021); Su  _et al._ (2021). While this method is effective, it is quite
cumbersome.

Figure 13: (a) Testing performance for the learned phase parameters
$\bm{\theta}$, where the five-dimensional samples are sampled from the
Gaussian distribution $G(0.1,0.02)$, and the average fidelity is 99.59% for
1000 testing samples. (b) $F(\epsilon_{A})$ vs the pulse area error
$\epsilon_{A}$, where the pulse area error suffers from time-dependent
Gaussian noises with the expectation $0.1\epsilon_{A}$ and the variance
$0.1\epsilon_{A}$. All pulse area errors $\epsilon^{t_{l}}_{k}$ are sampled
from the Gaussian distribution $G(0.1,0.02)$, $N=5$ pulses, the time interval
$t_{l+1}-t_{l}=T$, and other parameters are the same as in Fig. 4.

Here we show that the supervised learning model is still feasible to address
the case of time-varying errors. In this case, the training set needs to be
modified as
$\\{\epsilon^{1}_{k},\dots,\epsilon^{t_{L}}_{k},\hat{F}(\epsilon^{1}_{k},\dots,\epsilon^{t_{L}}_{k})\\}$,
where $\hat{F}(\epsilon^{1}_{k},\dots,\epsilon^{t_{L}}_{k})=1$ represents a
hyperplane, and $\epsilon^{t_{l}}_{k}$ denotes the error magnitude in the time
interval $[t_{l},t_{l+1}]$, $l=1,\dots,L$, $k=1,\dots,K$. Namely, the time-
dependent nature of errors is reflected in the fact that errors in different
time intervals are regarded as distinct dimensions of the samples.

Unlike the case of time-independent errors, we cannot account for all time-
varying errors in the testing stage. To validate the learned phase parameters
$\bm{\theta}$ obtained from the training stage, we require to sample the time-
varying errors for different time intervals to obtain enough testing samples.
The fidelity of each testing sample is plotted in Fig. 13(a) by using the
learned phase parameters $\bm{\theta}$, where the Gaussian distribution is
$G(0.1,0.02)$. It is clearly shown that the learned phase parameters
$\bm{\theta}$ perform very well in the vast majority of testing samples, where
a total average fidelity of 99.59% is achieved. Furthermore, we demonstrate in
Fig. 13(b) how to successfully obtain robust population inversion by training
the phase parameters $\bm{\theta}$ in the presence of time-varying errors. For
a comparison, Fig. 13(b) also shows the fidelity as a function of the time-
independent errors. We can observe that the robustness with respect to time-
independent errors is much better than that of time-varying errors.

##  IV Further Extensions

Up to now, we have regarded the phases as training parameters in the
supervised learning model. Actually, the phases do not have unique
specifications, and thus other physical parameters (e.g., detunings or Rabi
frequencies) are also able to serve as training parameters instead. In the
following, we investigate the feasibility of utilizing the detuning
$\Delta_{n}$ ($n=1,\dots,N$) of each pulse as training parameters to implement
robust quantum control. Undoubtedly, the training of Rabi frequencies can also
be accomplished through a comparable procedure. To simplify the notation, all
detuning parameters $\Delta_{n}$ are collectively represented by a vector
$\bm{\Delta}$, i.e., $\bm{\Delta}=(\Delta_{1},\dots,\Delta_{N})$.

Figure 14(a) shows the relationship between the cost function and the number
of iterations for different number of detuning parameters in the training
process. During the procedure of iterations, the detuning $\Delta_{n}$ is
reinitialized if $\Delta_{n}/\Omega_{n}>10$. The reason for this can be found
as follows. From a physical point of view, the pulse becomes highly detuned
and primarily influences the phase rather than probability amplitude of
quantum states when $\Delta_{n}$ is excessively large. As a result, the pulse
with large $\Delta_{n}$ makes little contribution to population transfer, and
thus needs to be reinitialized.

It is shown in Fig. 14(a) that the value of the cost function for $N=9$ is
larger than that of other two situations. This is because the uniform
distributions are chosen from different ranges for different pulse numbers. As
explained in Sec. II.5, a large sampling range leads to a large value of the
cost function. Thus, what we care about is not the value of the cost function,
but its convergence. When the cost function converges to a small steady value,
we can claim that a set of solutions for the training parameters is obtained.
Clearly, the training is successful in Fig. 14(a), since the cost function
gradually diminishes with each subsequent iteration and finally tends to an
extremely small value.

We can also see from the inset of Fig. 14(a) that the learned detuning
parameters $\bm{\Delta}$ perform particularly well in terms of robustness
against the pulse area error. Furthermore, similar to the case of the phase
parameters, the system becomes more resilient to the pulse area error when
increasing the number of detuning parameters, as shown by different high-
fidelity windows in the inset of Fig. 14(a).

Figure 14: (a) Cost function vs the number of iterations for different numbers
of training parameters. We train 500 groups of samples with $K=1000$, and
display the group with the highest degree of robustness (the remaining groups
are not shown in the figure). Inset: Robust performances for the pulse area
error by distinct learned detuning parameters $\bm{\Delta}$. (b) Fidelity vs
the pulse area error by using the learned phase parameters $\bm{\theta}$ in a
three-level system, where we set $\Omega_{a}=\Omega_{b}=\Omega$ for
simplicity. The pulse area errors $\epsilon^{A}_{k}$ ($k=1,\dots,K$) are
sampled from different uniform distributions depending on the pulse number.
Specifically, the uniform distributions used are $U(0,0.2)$ for $N=5$,
$U(0,0.3)$ for $N=7$, and $U(0,0.4)$ for $N=9$. The initial values of
${\Delta_{n}}$ and ${\theta^{a(b)}_{n}}$ are randomly selected from the range
of $[-3,3]$ and $[-\pi,\pi]$, respectively, the learning rate is 0.1, and the
duration of the $n$th pulse is chosen as (a)
$T_{n}=\pi/(2\sqrt{\Omega_{n}^{2}+\Delta_{n}^{2}})$ and (b)
$T_{n}=\pi/\sqrt{2}\Omega$.

So far, the supervised learning model has only been demonstrated to work well
in the two-dimension Hilbert space. Actually, this model can also be applied
in higher-dimension Hilbert spaces. Next, we take three dimensions as an
example to briefly show robust population inversion between the states
$|1\rangle$ and $|3\rangle$, while the treatment in higher dimensions is
similar. Assume that a three-level system is resonantly driven by two external
fields, and the Hamiltonian under the rotating-wave approximation can be
written as

$\displaystyle
H(\theta_{a},\theta_{b})=\Omega_{a}e^{-i\theta_{a}}|1\rangle\langle
2|+\Omega_{b}e^{-i\theta_{b}}|2\rangle\langle 3|,$ (37)

where $\Omega_{a(b)}$ denotes the Rabi frequency between the system and the
first (second) external field with the corresponding phase $\theta_{a(b)}$.
For simplicity, we again regard the phases $\theta_{a}$ and $\theta_{b}$ as
training parameters, i.e.,
$\bm{\theta}=(\theta^{a}_{1},\theta^{b}_{1},\dots,\theta^{a}_{N},\theta^{b}_{N})$.
As shown in Fig. 14(b), there is a high-fidelity window for population
inversion in the presence of the pulse area error, verifying that robust
quantum control is accessible in a high-dimension Hilbert space by using this
supervised learning model.

##  V Conclusion

In conclusion, we have proposed a supervised learning model used for
implementing robust quantum control in composite-pulse systems. We first
construct the cost function for this model, and demonstrate how this model
works. By introducing virtual variables, we put forward a modified gradient
descent algorithm to train phase parameters. To avoid falling into locally
optimal solutions, we further amend the modified algorithm by using escaping
or restarting methods. We find that the robust performance of the system
depends heavily on sampling methods, embodying in sampling range and
distribution. To be specific, the generalization error tends to enlarge as the
sampling range increases, and different sampling distributions result in
different robust performances.

Afterwards, we characterize the generalization ability of this model. The
results demonstrate that this model is susceptible to overfitting when the
sampling range is too small, whereas it may produce underfitting once the
sampling range exceeds a certain threshold. In particular, there is a
corresponding strengthening of the generalization ability when increasing the
model complexity (i.e., increasing the pulse number). Therefore, for a given
number of pulses, the suitable sampling range is conductive to maximize the
generalization ability of the model.

The current supervised learning model exhibits a powerful robustness to
errors, and thus has a wide range of applications, e.g., the robust
realization of arbitrary superposition states as well as universal quantum
gates. Specifically, the learned phase parameters in this model perform very
well in robustness against various systematic errors, such as single error,
multiple errors, and time-varying errors. It is particularly important that
all kinds of situations (including single, multiple, and time-varying errors)
can be well tackled by training the same model, and the only difference lies
in the dimension of the samples. To implement universal quantum gates in a
robust manner, we proposed two different methods, the state-based and
evolution operator-based methods, to train the phase parameters and its robust
property depends on the sampling range. We finally demonstrate that this model
can be applied in higher-dimensional Hilbert spaces, and suitable for training
any physical parameters to attain robust quantum control. It is believed that
this supervised learning model provides a universal and high-efficiency
plateau for realizing reliable quantum information processing in different
quantum systems.

###### Acknowledgements.

We would like to thank the valuable suggestions of Dr. Ye-Xiong Zeng, Dr.
Yanming Che, and Dr. Clemens Gneiting. This work is supported by the Natural
Science Foundation of Fujian Province under Grant No. 2021J01575, the Natural
Science Funds for Distinguished Young Scholar of Fujian Province under Grant
No. 2020J06011, and the Project from Fuzhou University under Grant No.
JG202001-2. F.N. is supported in part by: Nippon Telegraph and Telephone
Corporation (NTT) Research, the Japan Science and Technology Agency (JST) [via
the Quantum Leap Flagship Program (Q-LEAP), and the Moonshot R&D Grant Number
JPMJMS2061], the Asian Office of Aerospace Research and Development (AOARD)
(via Grant No. FA2386-20-1-4069), the Office of Naval Research (ONR Global),
and the Foundational Questions Institute Fund (FQXi) via Grant No. FQXi-
IAF19-06.

## References

  * Nielsen and Chuang (2000) M. A. Nielsen and I. L. Chuang,  _Quantum Computation and Quantum Information_ (Cambridge University Press, Cambridge, 2000).
  * Allen and Eberly (1975) L. Allen and J. H. Eberly,  _Optical Resonance and Two-Level Atoms_ (New York: Dover Publications, 1975).
  * Vitanov  _et al._ (2001) N. V. Vitanov, T. Halfmann, B. W. Shore, and K. Bergmann, Laser-induced population transfer by adiabatic passage techniques, Annu. Rev. Phys. Chem. 52, 763 (2001).
  * Liu  _et al._ (2005) Y.-X. Liu, J. Q. You, L. F. Wei, C. P. Sun, and F. Nori, Optical Selection Rules and Phase-Dependent Adiabatic State Control in a Superconducting Quantum Circuit, Phys. Rev. Lett. 95, 087001 (2005).
  * Král  _et al._ (2007) P. Král, I. Thanopulos, and M. Shapiro, Colloquium: Coherently controlled adiabatic passage, Rev. Mod. Phys. 79, 53 (2007).
  * Wei  _et al._ (2008) L. F. Wei, J. R. Johansson, L. X. Cen, S. Ashhab, and F. Nori, Controllable Coherent Population Transfers in Superconducting Qubits for Quantum Computing, Phys. Rev. Lett. 100, 113601 (2008).
  * Vitanov  _et al._ (2017) N. V. Vitanov, A. A. Rangelov, B. W. Shore, and K. Bergmann, Stimulated Raman adiabatic passage in physics, chemistry, and beyond, Rev. Mod. Phys. 89, 015006 (2017).
  * Viola  _et al._ (1999) L. Viola, E. Knill, and S. Lloyd, Dynamical Decoupling of Open Quantum Systems, Phys. Rev. Lett. 82, 2417 (1999).
  * Khodjasteh and Lidar (2005) K. Khodjasteh and D. A. Lidar, Fault-Tolerant Quantum Dynamical Decoupling, Phys. Rev. Lett. 95, 180501 (2005).
  * Souza  _et al._ (2012) A. M. Souza, G. A. Álvarez, and D. Suter, Robust dynamical decoupling, Phil. Trans. R. Soc. A 370, 4748 (2012).
  * Ashhab and Nori (2010) S. Ashhab and F. Nori, Control-free control: Manipulating a quantum system using only a limited set of measurements, Phys. Rev. A 82, 062103 (2010).
  * Wiseman (2011) H. M. Wiseman, Squinting at quantum systems, Nature 470, 178 (2011).
  * Zhang  _et al._ (2013) J. Zhang, Y.-X. Liu, R.-B. Wu, K. Jacobs, and F. Nori, Non-Markovian quantum input-output networks, Phys. Rev. A 87, 032117 (2013).
  * Yang  _et al._ (2015) N. Yang, J. Zhang, H. Wang, Y.-X. Liu, R.-B. Wu, L.-Q. Liu, C.-W. Li, and F. Nori, Noise suppression of on-chip mechanical resonators by chaotic coherent feedback, Phys. Rev. A 92, 033812 (2015).
  * Zhang  _et al._ (2017) J. Zhang, Y.-X. Liu, R.-B. Wu, K. Jacobs, and F. Nori, Quantum feedback: Theory, experiments, and applications, Phys. Rep. 679, 1 (2017).
  * Daems  _et al._ (2013) D. Daems, A. Ruschhaupt, D. Sugny, and S. Guérin, Robust Quantum Control by a Single-Shot Shaped Pulse, Phys. Rev. Lett. 111, 050404 (2013).
  * Van-Damme  _et al._ (2017) L. Van-Damme, D. Schraft, G. T. Genov, D. Sugny, T. Halfmann, and S. Guérin, Robust NOT gate by single-shot-shaped pulses: Demonstration of the efficiency of the pulses in rephasing atomic coherences, Phys. Rev. A 96, 022309 (2017).
  * Motzoi  _et al._ (2009) F. Motzoi, J. M. Gambetta, P. Rebentrost, and F. K. Wilhelm, Simple Pulses for Elimination of Leakage in Weakly Nonlinear Qubits, Phys. Rev. Lett. 103, 110501 (2009).
  * Schutjens  _et al._ (2013) R. Schutjens, F. A. Dagga, D. J. Egger, and F. K. Wilhelm, Single-qubit gates in frequency-crowded transmon systems, Phys. Rev. A 88, 052330 (2013).
  * Theis  _et al._ (2016) L. S. Theis, F. Motzoi, F. K. Wilhelm, and M. Saffman, High-fidelity Rydberg-blockade entangling gate using shaped, analytic pulses, Phys. Rev. A 94, 032306 (2016).
  * Chen  _et al._ (2014) C. Chen, D. Dong, R. Long, I. R. Petersen, and H. A. Rabitz, Sampling-based learning control of inhomogeneous quantum ensembles, Phys. Rev. A 89, 023402 (2014).
  * Dong  _et al._ (2015) D. Dong, M. A. Mabrok, I. R. Petersen, B. Qi, C. Chen, and H. Rabitz, Sampling-Based Learning Control for Quantum Systems With Uncertainties, IEEE Trans. Control Syst. Technol. 23, 2155 (2015).
  * Dong  _et al._ (2016a) D. Dong, C. Wu, C. Chen, B. Qi, I. R. Petersen, and F. Nori, Learning robust pulses for generating universal quantum gates, Sci. Rep. 6, 36090 (2016a).
  * Dong  _et al._ (2016b) D. Dong, I. R. Petersen, Y. Wang, X. Yi, and H. Rabitz, Sampled-data design for robust control of open two-level quantum systems with operator errors, IET Control Theory Appl. 10, 2415 (2016b).
  * Dong  _et al._ (2020) D. Dong, X. Xing, H. Ma, C. Chen, Z. Liu, and H. Rabitz, Learning-Based Quantum Robust Control: Algorithm, Applications, and Experiments, IEEE Trans. Cybern. 50, 3581 (2020).
  * Dong and Petersen (2023) D. Dong and I. R. Petersen,  _Learning and Robust Control in Quantum Technology_ (Springer International Publishing, 2023) pp. 65–92.
  * Mohri  _et al._ (2012) M. Mohri, A. Rostamizadeh, and A. Talwalkar,  _Foundations of Machine Learning_ (MIT Press, Cambridge, 2012).
  * Biamonte  _et al._ (2017) J. Biamonte, P. Wittek, N. Pancotti, P. Rebentrost, N. Wiebe, and S. Lloyd, Quantum machine learning, Nature 549, 195 (2017).
  * Dunjko and Briegel (2018) V. Dunjko and H. J. Briegel, Machine learning & artificial intelligence in the quantum domain: a review of recent progress, Rep. Prog. Phys. 81, 074001 (2018).
  * Carleo  _et al._ (2019) G. Carleo, I. Cirac, K. Cranmer, L. Daudet, M. Schuld, N. Tishby, L. Vogt-Maranto, and L. Zdeborová, Machine learning and the physical sciences, Rev. Mod. Phys. 91, 045002 (2019).
  * Arrachea (2023) L. Arrachea, Energy dynamics, heat production and heat–work conversion with qubits: toward the development of quantum machines, Rep. Prog. Phys. 86, 036501 (2023).
  * Krenn  _et al._ (2023) M. Krenn, J. Landgraf, T. Foesel, and F. Marquardt, Artificial intelligence and machine learning for quantum technologies, Phys. Rev. A 107, 010101 (2023).
  * Zhang and Wang (2019) C. Zhang and X. Wang, Spin-qubit noise spectroscopy from randomized benchmarking by supervised learning, Phys. Rev. A 99, 042316 (2019).
  * Zeng  _et al._ (2020) Y. Zeng, J. Shen, S. Hou, T. Gebremariam, and C. Li, Quantum control based on machine learning in an open quantum system, Phys. Lett. A 384, 126886 (2020).
  * Che  _et al._ (2020) Y. Che, C. Gneiting, T. Liu, and F. Nori, Topological quantum phase transitions retrieved through unsupervised machine learning, Phys. Rev. B 102, 134213 (2020).
  * Ding  _et al._ (2021a) Y. Ding, Y. Ban, J. D. Martín-Guerrero, E. Solano, J. Casanova, and X. Chen, Breaking adiabatic quantum control with deep learning, Phys. Rev. A 103, L040401 (2021a).
  * Ai  _et al._ (2022) M.-Z. Ai, Y. Ding, Y. Ban, J. D. Martín-Guerrero, J. Casanova, J.-M. Cui, Y.-F. Huang, X. Chen, C.-F. Li, and G.-C. Guo, Experimentally realizing efficient quantum control with reinforcement learning, Sci. China Phys. Mech. Astron. 65, 250312 (2022).
  * Nomura  _et al._ (2021) Y. Nomura, N. Yoshioka, and F. Nori, Purifying Deep Boltzmann Machines for Thermal Quantum States, Phys. Rev. Lett. 127, 060601 (2021).
  * Ahmed  _et al._ (2021a) S. Ahmed, C. Sánchez Muñoz, F. Nori, and A. F. Kockum, Quantum State Tomography with Conditional Generative Adversarial Networks, Phys. Rev. Lett. 127, 140502 (2021a).
  * Huang  _et al._ (2022a) T. Huang, Y. Ban, E. Y. Sherman, and X. Chen, Machine-Learning-Assisted Quantum Control in a Random Environment, Phys. Rev. Appl. 17, 024040 (2022a).
  * Wu  _et al._ (2020) R.-B. Wu, X. Cao, P. Xie, and Y.-X. Liu, End-To-End Quantum Machine Learning Implemented with Controlled Quantum Dynamics, Phys. Rev. Appl. 14, 064020 (2020).
  * Wise  _et al._ (2021) D. F. Wise, J. J. Morton, and S. Dhomkar, Using Deep Learning to Understand and Mitigate the Qubit Noise Environment, PRX Quantum 2, 010316 (2021).
  * Ma and Yung (2018) Y.-C. Ma and M.-H. Yung, Transforming Bell’s inequalities into state classifiers with machine learning, npj Quantum Inf. 4, 34 (2018).
  * Glasser  _et al._ (2018) I. Glasser, N. Pancotti, M. August, I. D. Rodriguez, and J. I. Cirac, Neural-Network Quantum States, String-Bond States, and Chiral Topological States, Phys. Rev. X 8, 011006 (2018).
  * Gao  _et al._ (2018) J. Gao, L.-F. Qiao, Z.-Q. Jiao, Y.-C. Ma, C.-Q. Hu, R.-J. Ren, A.-L. Yang, H. Tang, M.-H. Yung, and X.-M. Jin, Experimental Machine Learning of Quantum States, Phys. Rev. Lett. 120, 240501 (2018).
  * Harney  _et al._ (2020) C. Harney, S. Pirandola, A. Ferraro, and M. Paternostro, Entanglement classification via neural network quantum states, New J. Phys. 22, 045001 (2020).
  * Ahmed  _et al._ (2021b) S. Ahmed, C. Sánchez Muñoz, F. Nori, and A. F. Kockum, Classification and reconstruction of optical quantum states with deep neural networks, Phys. Rev. Res. 3, 033278 (2021b).
  * Vintskevich  _et al._ (2023) S. V. Vintskevich, N. Bao, A. Nomerotski, P. Stankus, and D. A. Grigoriev, Classification of four-qubit entangled states via machine learning, Phys. Rev. A 107, 032421 (2023).
  * Zahedinejad  _et al._ (2015) E. Zahedinejad, J. Ghosh, and B. C. Sanders, High-Fidelity Single-Shot Toffoli Gate via Quantum Control, Phys. Rev. Lett. 114, 200502 (2015).
  * Zahedinejad  _et al._ (2016) E. Zahedinejad, J. Ghosh, and B. C. Sanders, Designing High-Fidelity Single-Shot Three-Qubit Gates: A Machine-Learning Approach, Phys. Rev. Appl. 6, 054005 (2016).
  * Yang  _et al._ (2018) X.-C. Yang, M.-H. Yung, and X. Wang, Neural-network-designed pulse sequences for robust control of singlet-triplet qubits, Phys. Rev. A 97, 042324 (2018).
  * Sabapathy  _et al._ (2019) K. K. Sabapathy, H. Qi, J. Izaac, and C. Weedbrook, Production of photonic universal quantum gates enhanced by machine learning, Phys. Rev. A 100, 012326 (2019).
  * Arrazola  _et al._ (2019) J. M. Arrazola, T. R. Bromley, J. Izaac, C. R. Myers, K. Brádler, and N. Killoran, Machine learning method for state preparation and gate synthesis on photonic quantum computers, Quantum Sci. Technol. 4, 024004 (2019).
  * Zeng  _et al._ (2022) Y.-X. Zeng, Z.-Y. Zhou, E. Rinaldi, C. Gneiting, and F. Nori, Approximate Autonomous Quantum Error Correction with Reinforcement Learning, arXiv:2212.11651 (2022).
  * Krotov (1996) V. F. Krotov,  _Global Methods in Optimal Control Theory_ (Dekker, New York, 1996).
  * Khaneja  _et al._ (2005) N. Khaneja, T. Reiss, C. Kehlet, T. Schulte-Herbrüggen, and S. J. Glaser, Optimal control of coupled spin dynamics: Design of NMR pulse sequences by gradient ascent algorithms, J. Magn. Reson. 172, 296 (2005).
  * Zahedinejad  _et al._ (2014) E. Zahedinejad, S. Schirmer, and B. C. Sanders, Evolutionary algorithms for hard quantum control, Phys. Rev. A 90, 032310 (2014).
  * Huang  _et al._ (2022b) Y. Huang, Q. Li, X. Hou, R.-B. Wu, M.-H. Yung, A. Bayat, and X. Wang, Robust resource-efficient quantum variational ansatz through an evolutionary algorithm, Phys. Rev. A 105, 052414 (2022b).
  * Magann  _et al._ (2021) A. B. Magann, C. Arenz, M. D. Grace, T.-S. Ho, R. L. Kosut, J. R. McClean, H. A. Rabitz, and M. Sarovar, From Pulses to Circuits and Back Again: A Quantum Optimal Control Perspective on Variational Quantum Algorithms, PRX Quantum 2, 010101 (2021).
  * Roslund and Rabitz (2009) J. Roslund and H. Rabitz, Gradient algorithm applied to laboratory quantum control, Phys. Rev. A 79, 053417 (2009).
  * Johansson  _et al._ (2013) J. Johansson, P. Nation, and F. Nori, QuTiP 2: A Python framework for the dynamics of open quantum systems, Comp. Phys. Comm. 184, 1234 (2013).
  * Wu  _et al._ (2019) R.-B. Wu, H. Ding, D. Dong, and X. Wang, Learning robust and high-precision quantum controls, Phys. Rev. A 99, 042327 (2019).
  * Ding and Wu (2019) H.-J. Ding and R.-B. Wu, Robust quantum control against clock noises in multiqubit systems, Phys. Rev. A 100, 022302 (2019).
  * Ge  _et al._ (2020) X. Ge, H. Ding, H. Rabitz, and R.-B. Wu, Robust quantum control in games: An adversarial learning approach, Phys. Rev. A 101, 052317 (2020).
  * Ding  _et al._ (2021b) H.-J. Ding, B. Chu, B. Qi, and R.-B. Wu, Collaborative Learning of High-Precision Quantum Control and Tomography, Phys. Rev. Appl. 16, 014056 (2021b).
  * Li  _et al._ (2022) B. Li, S. Ahmed, S. Saraogi, N. Lambert, F. Nori, A. Pitchford, and N. Shammah, Pulse-level noisy quantum circuits with QuTiP, Quantum 6, 630 (2022).
  * Levitt and Freeman (1979) M. H. Levitt and R. Freeman, NMR population inversion using a composite pulse, J. Magn. Reson. 33, 473 (1979).
  * Levitt (1986) M. H. Levitt, Composite pulses, Prog. NMR Spectrosc. 18, 61 (1986).
  * Wimperis (1994) S. Wimperis, Broadband, Narrowband, and Passband Composite Pulses for Use in Advanced NMR Experiments, J. Magn. Reson. 109, 221 (1994).
  * Cummins  _et al._ (2003) H. K. Cummins, G. Llewellyn, and J. A. Jones, Tackling systematic errors in quantum logic gates with composite rotations, Phys. Rev. A 67, 042308 (2003).
  * Brown  _et al._ (2004) K. R. Brown, A. W. Harrow, and I. L. Chuang, Arbitrarily accurate composite pulse sequences, Phys. Rev. A 70, 052318 (2004).
  * Ichikawa  _et al._ (2011) T. Ichikawa, M. Bando, Y. Kondo, and M. Nakahara, Designing robust unitary gates: Application to concatenated composite pulses, Phys. Rev. A 84, 062311 (2011).
  * Genov and Vitanov (2013) G. T. Genov and N. V. Vitanov, Dynamical Suppression of Unwanted Transitions in Multistate Quantum Systems, Phys. Rev. Lett. 110, 133002 (2013).
  * Jones (2013) J. A. Jones, Designing short robust NOT gates for quantum computation, Phys. Rev. A 87, 052317 (2013).
  * Genov  _et al._ (2011) G. T. Genov, B. T. Torosov, and N. V. Vitanov, Optimized control of multistate quantum systems by composite pulse sequences, Phys. Rev. A 84, 063413 (2011).
  * Torosov and Vitanov (2019a) B. T. Torosov and N. V. Vitanov, Robust high-fidelity coherent control of two-state systems by detuning pulses, Phys. Rev. A 99, 013424 (2019a).
  * Cohen  _et al._ (2016) I. Cohen, A. Rotem, and A. Retzker, Refocusing two-qubit-gate noise for trapped ions by composite pulses, Phys. Rev. A 93, 032340 (2016).
  * Dridi  _et al._ (2020) G. Dridi, M. Mejatty, S. J. Glaser, and D. Sugny, Robust control of a NOT gate by composite pulses, Phys. Rev. A 101, 012321 (2020).
  * Torosov and Vitanov (2020) B. T. Torosov and N. V. Vitanov, High-fidelity composite quantum gates for Raman qubits, Phys. Rev. Research 2, 043194 (2020).
  * Kyoseva  _et al._ (2019) E. Kyoseva, H. Greener, and H. Suchowski, Detuning-modulated composite pulses for high-fidelity robust quantum control, Phys. Rev. A 100, 032333 (2019).
  * Bulmer  _et al._ (2020) J. F. F. Bulmer, J. A. Jones, and I. A. Walmsley, Drive-noise tolerant optical switching inspired by composite pulses, Opt. Express 28, 8646 (2020).
  * Torosov and Vitanov (2019b) B. T. Torosov and N. V. Vitanov, Arbitrarily accurate variable rotations on the Bloch sphere by composite pulse sequences, Phys. Rev. A 99, 013402 (2019b).
  * Rong  _et al._ (2015) X. Rong, J. Geng, F. Shi, Y. Liu, K. Xu, W. Ma, F. Kong, Z. Jiang, Y. Wu, and J. F. Du, Experimental fault-tolerant universal quantum gates with solid-state spins under ambient conditions, Nat. Commun. 6, 8748 (2015).
  * Mount  _et al._ (2015) E. Mount, C. Kabytayev, S. Crain, R. Harper, S.-Y. Baek, G. Vrijsen, S. T. Flammia, K. R. Brown, P. Maunz, and J. Kim, Error compensation of single-qubit gates in a surface-electrode ion trap using composite pulses, Phys. Rev. A 92, 060301 (2015).
  * Ivanov  _et al._ (2022) S. S. Ivanov, B. T. Torosov, and N. V. Vitanov, High-Fidelity Quantum Control by Polychromatic Pulse Trains, Phys. Rev. Lett. 129, 240505 (2022).
  * Torosov and Vitanov (2022) B. T. Torosov and N. V. Vitanov, Experimental Demonstration of Composite Pulses on IBM’s Quantum Computer, Phys. Rev. Appl. 18, 034062 (2022).
  * Torosov  _et al._ (2011) B. T. Torosov, S. Guérin, and N. V. Vitanov, High-Fidelity Adiabatic Passage by Composite Sequences of Chirped Pulses, Phys. Rev. Lett. 106, 233001 (2011).
  * Torosov and Vitanov (2011) B. T. Torosov and N. V. Vitanov, Smooth composite pulses for high-fidelity quantum information processing, Phys. Rev. A 83, 053420 (2011).
  * Genov  _et al._ (2014) G. T. Genov, D. Schraft, T. Halfmann, and N. V. Vitanov, Correction of Arbitrary Field Errors in Population Inversion of Quantum Systems by Universal Composite Pulses, Phys. Rev. Lett. 113, 043001 (2014).
  * Torosov and Vitanov (2018) B. T. Torosov and N. V. Vitanov, Arbitrarily accurate twin composite $\pi$-pulse sequences, Phys. Rev. A 97, 043408 (2018).
  * Low  _et al._ (2014) G. H. Low, T. J. Yoder, and I. L. Chuang, Optimal arbitrarily accurate composite pulse sequences, Phys. Rev. A 89, 022341 (2014).
  * Genov  _et al._ (2020) G. T. Genov, M. Hain, N. V. Vitanov, and T. Halfmann, Universal composite pulses for efficient population inversion with an arbitrary excitation profile, Phys. Rev. A 101, 013827 (2020).
  * Genov  _et al._ (2017) G. T. Genov, D. Schraft, N. V. Vitanov, and T. Halfmann, Arbitrarily Accurate Pulse Sequences for Robust Dynamical Decoupling, Phys. Rev. Lett. 118, 133202 (2017).
  * Wang  _et al._ (2012) X. Wang, L. S. Bishop, J. Kestner, E. Barnes, K. Sun, and S. Das Sarma, Composite pulses for robust universal control of singlet–triplet qubits, Nat. Commun. 3, 997 (2012).
  * Wang  _et al._ (2014a) X. Wang, L. S. Bishop, E. Barnes, J. P. Kestner, and S. Das Sarma, Robust quantum gates for singlet-triplet spin qubits using composite pulses, Phys. Rev. A 89, 022310 (2014a).
  * Torosov  _et al._ (2015) B. T. Torosov, E. S. Kyoseva, and N. V. Vitanov, Composite pulses for ultrabroad-band and ultranarrow-band excitation, Phys. Rev. A 92, 033406 (2015).
  * Demeter (2016) G. Demeter, Composite pulses for high-fidelity population inversion in optically dense, inhomogeneously broadened atomic ensembles, Phys. Rev. A 93, 023830 (2016).
  * Shi  _et al._ (2021) Z.-C. Shi, H.-N. Wu, L.-T. Shen, J. Song, Y. Xia, X. X. Yi, and S.-B. Zheng, Robust single-qubit gates by composite pulses in three-level systems, Phys. Rev. A 103, 052612 (2021).
  * Gevorgyan and Vitanov (2021) H. L. Gevorgyan and N. V. Vitanov, Ultrahigh-fidelity composite rotational quantum gates, Phys. Rev. A 104, 012609 (2021).
  * Torosov  _et al._ (2020) B. T. Torosov, M. Drewsen, and N. V. Vitanov, Chiral resolution by composite Raman pulses, Phys. Rev. Research 2, 043235 (2020).
  * Zhang  _et al._ (2022) C. Zhang, Y. Liu, Z.-C. Shi, J. Song, Y. Xia, and S.-B. Zheng, Robust population inversion in three-level systems by composite pulses, Phys. Rev. A 105, 042414 (2022).
  * Shi  _et al._ (2022) Z.-C. Shi, C. Zhang, D. Ran, Y. Xia, R. Ianconescu, A. Friedman, X. X. Yi, and S.-B. Zheng, Composite pulses for high fidelity population transfer in three-level systems, New J. Phys. 24, 023014 (2022).
  * Wu  _et al._ (2023) H.-N. Wu, C. Zhang, J. Song, Y. Xia, and Z.-C. Shi, Composite pulses for optimal robust control in two-level systems, Phys. Rev. A 107, 023103 (2023).
  * D’Arrigo  _et al._ (2016) A. D’Arrigo, G. Falci, and E. Paladino, High-fidelity two-qubit gates via dynamical decoupling of local $1/f$ noise at the optimal point, Phys. Rev. A 94, 022303 (2016).
  * Huang and Goan (2017) C.-H. Huang and H.-S. Goan, Robust quantum gates for stochastic time-varying noise, Phys. Rev. A 95, 062325 (2017).
  * Kestner  _et al._ (2013) J. P. Kestner, X. Wang, L. S. Bishop, E. Barnes, and S. Das Sarma, Noise-Resistant Control for a Spin Qubit Array, Phys. Rev. Lett. 110, 140502 (2013).
  * Wang  _et al._ (2014b) X. Wang, F. A. Calderon-Vargas, M. S. Rana, J. P. Kestner, E. Barnes, and S. Das Sarma, Noise-compensating pulses for electrostatically controlled silicon spin qubits, Phys. Rev. B 90, 155306 (2014b).
  * Colmenar and Kestner (2022) R. K. L. Colmenar and J. P. Kestner, Reverse engineering of one-qubit filter functions with dynamical invariants, Phys. Rev. A 106, 032611 (2022).
  * Milne  _et al._ (2020) A. R. Milne, C. L. Edmunds, C. Hempel, F. Roy, S. Mavadia, and M. J. Biercuk, Phase-Modulated Entangling Gates Robust to Static and Time-Varying Errors, Phys. Rev. Appl. 13, 024022 (2020).
  * Kang  _et al._ (2023) M. Kang, Y. Wang, C. Fang, B. Zhang, O. Khosravani, J. Kim, and K. R. Brown, Designing Filter Functions of Frequency-Modulated Pulses for High-Fidelity Two-Qubit Gates in Ion Chains, Phys. Rev. Appl. 19, 014014 (2023).
  * Araki  _et al._ (2023) T. Araki, F. Nori, and C. Gneiting, Robust quantum control with disorder-dressed evolution, Phys. Rev. A 107, 032609 (2023).
  * Bishop (2006) C. M. Bishop,  _Pattern Recognition and Machine Learning_ (Springer, Singapore, 2006).
  * Freeman (1997) R. Freeman,  _Spin Choreography_ (Spektrum, Oxford, 1997).
  * Green  _et al._ (2013) T. J. Green, J. Sastrawan, H. Uys, and M. J. Biercuk, Arbitrary quantum control of qubits in the presence of universal noise, New J. Phys. 15, 095004 (2013).
  * Kabytayev  _et al._ (2014) C. Kabytayev, T. J. Green, K. Khodjasteh, M. J. Biercuk, L. Viola, and K. R. Brown, Robustness of composite pulses to time-dependent control noise, Phys. Rev. A 90, 012316 (2014).
  * Paz-Silva and Viola (2014) G. A. Paz-Silva and L. Viola, General Transfer-Function Approach to Noise Filtering in Open-Loop Quantum Control, Phys. Rev. Lett. 113, 250501 (2014).
  * Zhen  _et al._ (2016) X.-L. Zhen, T. Xin, F.-H. Zhang, and G.-L. Long, Experimental demonstration of concatenated composite pulses robustness to non-static errors, Sci. China Phys. Mech. Astron. 59, 103011 (2016).
  * Haas  _et al._ (2019) H. Haas, D. Puzzuoli, F. Zhang, and D. G. Cory, Engineering effective Hamiltonians, New J. Phys. 21, 103011 (2019).
  * Li  _et al._ (2021) B. Li, F. A. Calderon-Vargas, J. Zeng, and E. Barnes, Designing arbitrary single-axis rotations robust against perpendicular time-dependent noise, New J. Phys. 23, 093032 (2021).
  * Su  _et al._ (2021) Q. D. Su, R. Bruinsma, and W. C. Campbell, Quantum gates robust to secular amplitude drifts, Phys. Rev. A 104, 052625 (2021).