Spectral Methods for Quantum Optimal Control A. Wodecki, G. Korpas, J. Marecek
supplement

# Spectral Methods for Quantum Optimal Control: Artificial Boundary Conditions

Ales Wodecki Department of Computer Science, Czech Technical University in
Prague, Czech Republic. Contact<EMAIL_ADDRESS>Jakub Marecek
Department of Computer Science, Czech Technical University in Prague, Czech
Republic. Vyacheslav Kungurtsev Department of Computer Science, Czech
Technical University in Prague, Czech Republic. Pavel Eichler Faculty of
Nuclear Sciences and Physical Engineering, Czech Technical University in
Prague, Czech Republic Georgios Korpas Quantum Technologies Group, Innovation
& Ventures, HSBC Lab, London, UK. Philip Intallura Quantum Technologies Group,
Innovation & Ventures, HSBC Lab, London, UK.

###### Abstract

The problem of quantum state preparation is one of the main challenges in
achieving the quantum advantage. Furthermore, classically, for multi-level
problems, our ability to solve the corresponding quantum optimal control
problems is rather limited. The ability of the latter to feed into the former
may result in significant progress in quantum computing. To address this
challenge, we propose a formulation of quantum optimal control that makes use
of artificial boundary conditions for the Schrödinger equation in combination
with spectral methods. The resulting formulations are well suited for
investigating periodic potentials and lend themselves to direct numerical
treatment using conventional methods for bounded domains.

###### keywords:

Harmonic Analysis, Quantum Computation, Quantum Optimal Control, Spectral
Methods

##  1 Introduction

Quantum optimal control [19] has a number of important applications, including
initial state preparation and gate implementation quantum computing [46, 37,
24, 16, 41], or laser control of chemical reactions [58, 5, 63, 32, 59, 6].
All of this is of considerable and growing importance.

In the context of quantum computing, certain quantum algorithms promise
substantial speedup, over classical counterparts, in a variety of applications
including quantum alternatives to Monte Carlo simulations [31] or quantum
optimization [1]. However, to preserve these speedups, the initial quantum
state preparation (or distribution) [33] must be carried out in a unit amount
of time. When the complexity of initial quantum state preparation using one
controlled rotation per scalar, also known as the Grover-Rudolph state
preparation [26], is considered, the speed-up may vanish. A prime example
includes quantum algorithms replacing classical Monte Carlo simulations [31],
where Grover-Rudolph state preparation is known to remove the quadratic speed-
up even in the case of log-concave probability distributions [29]. In general,
loading an arbitrary quantum state over $n$-qubit registers requires
$O(4^{n})$ CNOT gates [27, 47] which conflate any potential for useful speed-
up. It is hence natural to seek alternative methods for initial quantum-state
preparation. Although several interesting approaches have been suggested in
the literature, the most widely used generative approaches [67, 66] do not
necessarily scale as desired, while parametrized circuit approaches often
suffer from the typical problems associated with them, that is barren plateaus
[57, 39, 54, 48, 18] and while several approaches have been proposed to
(partially) overcome this problem [22, 49, 64, 43] these methods, to the best
of our knowledge, have not been tested in the context of the state preparation
problem.

Diving deeper, within the quantum circuit model in quantum computing, the
performance depends crucially on the fidelity of two-qubit gates [62, 60].
These are typically implemented using microwave or laser pulses, which are
computed using quantum optimal control [35]. While it has been traditionally
suggested that performance of local-search methods such as GRAPE [34] and CRAB
[15] applied to simple two-qubit Hamiltonians is sufficient, it is
increasingly recognized that one could improve the performance substantially
by considering methods [13, e.g.] that provably converge to the global optima
and, perhaps even more importantly, one should like to consider open quantum
systems, rather than closed quantum systems. In the latter, to address issues
such as cross-talk, one may need to consider a multi-qubit system, in order to
design the pulse implementing a two-qubit model.

Outside of quantum computing, in applications such as the laser control of
chemical reactions [63, 6] or coherent population transfer among quantum
states of atoms and molecules [56, 12] more broadly, one would naturally like
to implement quantum optimal control of many-level systems, but even popular
heuristics such as GRAPE and CRAB do not scale sufficiently.

In this article, we address the scalability of quantum optimal control methods
by considering a spectral-domain (or frequency-domain) approach [23, 3]. In
their pioneering work, Friesecke _et al_. [23] provide structural results
pertaining to the time-frequency transformation of a quantum system, providing
time-frequency formulated constraints along with an alternative cost function
regularization, which penalizes with respect to the frequency space. Their
results provide structural underpinnings for time-frequency methods in general
and may be directly applied to systems with a finite-level Hamiltonian.
Further validating this approach are examples of physical systems which have a
finite number of components in frequency space. Some examples of such systems
are spin-1/2 particles in a magnetic field or electronic states of atoms in
laser fields. Numerically, [23] have shown that this setting leads to
frequency-space sparse controls in many cases. Building on the aforementioned
approach, we develop a time-frequency formulation which allows for direct
numerical treatment even for infinite-level Hamiltonians. This further
develops the ideas in [23] making them applicable to a wider class of
problems.

In particular, we propose a formulation of the control problem that makes use
of _artificial boundary conditions_ [10, 17, 55] for the Schrödinger equation
in combination with the aforementioned time-spectral methods. The resulting
formulations are well suited for investigating periodic potentials and lend
themselves to direct numerical treatment using conventional methods for
bounded domains. This could be seen as a harmonic-analytic approach to quantum
optimal control, inasmuch as we utilize the Laplace transform and the inverse
Laplace transform to control the complexity of the problem solved classically
in order to control the quantum system optimally.

##  2 Problem Formulation

There are many numerical treatments that lead to the successful solution of
the Schrödinger equation [2, 53, 11]. Several of these methods are centered on
finding ways to reduce the infinite spatial domain, which is inherent in the
problem [25, 4, 38]. In particular, pseudospectral methods make use of a
Fourier basis of test functions to discretize both the temporal and spatial
domains, resulting in a fully discrete problem [14]. Another noteworthy
approach, called the artificial boundary method, is inspired by classical
numerics [55, 4, 21]. In this method, one attempts to impose artificial
boundary conditions on the Schrödinger equation, making it solvable using
conventional numerical methods (finite elements, finite differences, etc.).
Imposing these artificial boundary conditions finds utility in a broad range
of quantum and non-quantum applications [44, 17, 10], including non-Markovian
open quantum systems [28]. For completeness, we note that, in rare cases, it
is possible to transform the original problem domain into a bounded one and
avoid the construction of these artificial boundary conditions [25, 38]. In
the following, a hybid method is presented, combining both of these “schools
of thought”.

Although the presented techniques apply to the spatial domain of any fixed
dimenstion [61, 4], i.e. to $\mathbb{R}^{n}$, the presentation is kept simple
by assuming that $n=1$. Let $\psi_{\text{ini}}\in
L^{2}\left(\mathbb{R}\right)$ be a compactly supported initial condition, and
let $V:\mathbb{R}\times\mathbb{R}_{0}^{+}\rightarrow\mathbb{R}$ be a potential
that satisfies

(1) $V\left(x\right)=\begin{cases}V_{l}&\text{ for }x\leq x_{l}\\\
V_{r}&\text{ for }x\geq x_{r},\end{cases}$

where $x_{l},x_{r}\in\mathbb{R}$. The quantum system of interest is described
by the Schrödinger equation

(2) $\displaystyle i\frac{\partial\psi\left(x,t\right)}{\partial
t}=-\frac{\partial^{2}\psi\left(x,t\right)}{\partial
x^{2}}+V\left(x,t\right)\psi\left(x,t\right),$ $\displaystyle\text{where
}\left(x,t\right)\in\mathbb{R}\times\mathbb{R}_{0}^{+},$
$\displaystyle\underset{\left|x\right|\rightarrow+\infty}{\lim}\psi\left(x,t\right)=0,$
$\displaystyle\text{ for all }t\in\mathbb{R}_{0}^{+},$
$\displaystyle\psi\left(x,0\right)=\psi_{\text{ini}}\left(x\right),$
$\displaystyle\text{ for all }x\in\mathbb{R}.$

The control is introduced in Eq. (2) by assuming that
$V\left(x,t\right)=V\left(x,t;\eta\right),$ where $\eta$ is a finite or
infinite-dimensional control parameter that belongs to the set $C$.
Additionally, assume that there exists
$\widehat{x}_{l},\widehat{x}_{r}\in\mathbb{R}$ such that

(3) $\text{for all }\eta\in C\text{ , }V\left(x,t;\eta\right)\text{ is
constant on }\left(-\infty,\widehat{x}_{l}\right)\text{ and
$\left(\widehat{x}_{r},+\infty\right)$}.$

The above condition allows us to fix the spatial coordinates at which the
artifical boundary conditions are imposed.

###  2.1 The Possible Formulations of the Control Set

Using the setting described in the previous section, one can define two very
distinct ways in which the control can be imposed. To derive the first one of
these, let us assume that there is no a-priori assumption on the potential
$V$, while still imposing (3). Using the standard existence result for the
Schrödinger equation (add a link to the appendix and ref), we may consider the
following control sets

(4) $\displaystyle
C_{\text{hom}}^{\widehat{x}_{l},\widehat{x}_{r}}=\left\\{V\in
C\left(\mathbb{R}_{0}^{+},L^{\infty}\left(\mathbb{R}\right)\right):V\left(x,t\right)=0\text{
for
}x\in\left(-\infty,\widehat{x}_{l}\right)\cup\left(\widehat{x}_{r},+\infty\right)\forall
t\in\mathbb{R}_{0}^{+}\right\\},$ $\displaystyle
C^{\widehat{x}_{l},\widehat{x}_{r}}=\left\\{V\in
C\left(\mathbb{R}_{0}^{+},L^{\infty}\left(\mathbb{R}\right)\right):V\text{ is
constant on }\left(-\infty,\widehat{x}_{l}\right)\text{ and
}\left(\widehat{x}_{r},+\infty\right)\forall t\in\mathbb{R}_{0}^{+}\right\\},$

where notably both of these sets are convex subsets of the Banach space
$C\left(\mathbb{R}_{0}^{+},L^{\infty}\left(\mathbb{R}\right)\right)$, which
ensures the existence of a solution in
$C\left(\mathbb{R}_{0}^{+},L^{2}\left(\mathbb{R}\right)\right)$ for any such
control [30].

In the second approach, we assume that the potential has a given structure
based on some knowledge of the system. A simple, but illustrative example of
this is a driven quantum harmonic oscillator, which has the potential

(5)
$V\left(x,t\right)=\frac{\omega^{2}\left(t\right)q^{2}\left(x,t\right)}{2m}-\widetilde{J}\left(x,t\right)q\left(x,t\right),$

where $\omega$ denotes the angular velocity, $q$ is the position operator and
$\widetilde{J}$ is a bounded function, which describes the corrected drive of
the oscilator. The correction is incorporated so that condition (3) is
satisfied, i.e.

(6) $\widetilde{J}\left(x,t\right)=J\left(t\right)+R\left(x,t\right),$

where $J$ is the physically acurate drive and

(7)
$R\left(x,t\right)=\begin{cases}\frac{1}{x\left(t\right)}\left[x_{r}+\frac{\omega^{2}\left(t\right)x^{2}\left(t\right)}{2m}J\left(t\right)\right],&\text{for
}x\in\left(x_{r},+\infty\right)\\\ 0,&\text{for
}x\in\left(x_{l},x_{r}\right)\\\
\frac{1}{x\left(t\right)}\left[x_{l}+\frac{\omega^{2}\left(t\right)x^{2}\left(t\right)}{2m}J\left(t\right)\right],&\text{for
}x\in\left(-\infty,x_{l}\right)\end{cases}$

is the correction term. Since (7) needs to be imposed to ensure that the left
and right artificial boundary conditions remain at the spatial points
$x_{l},x_{r}$, respectively, it is clear that the drive $J$ can not have an
arbitrary form. To guarantee the existence of soltuion, $J$ must be chosen so
that (5) is of class
$C\left(\mathbb{R}_{0}^{+},L^{\infty}\left(\mathbb{R}\right)\right)$. Using
this example, we may define the control set as

(8) $C_{\text{spec}}=\left\\{J\in L^{2}\left(\mathbb{R}_{0}^{+}\right):\exists
R\in
L^{\infty}\left(\mathbb{R}_{0}^{+},L^{\infty}\left(\mathbb{R}\right)\right)\text{
s.t. }V=J+R\in
C\left(\mathbb{R}_{0}^{+},L^{\infty}\left(\mathbb{R}\right)\right)\right\\},$

where the convexity of such a control set is problem dependant.

###  2.2 Possible Extensions of the Formulation

The previous section describes how one can impose a control given by a
potential in the Schrödinger equation. It is important to note that this does
not cover all the possibilities of control. In particular, incorporating the
effects of a controllable magnetic field on a quantum harmonic oscilator leads
to a change of the momentum operator, i.e.

(9) $\frac{\partial^{2}}{\partial
x^{2}}\rightarrow\frac{\partial^{2}}{\partial x^{2}}+\eta A,$

where $A$ is the vector potential of the magentic field and $\eta$ is the
controlable strength of the magnetic field. Even though this case is not
treated in the present article, the generalization is streightforward.

###  2.3 Formulation of the Problem Using Artificial Boundary Conditions

To derive artifical boundary conditions for the problem (2) the spatial domain
is divided into two parts

(10) $\Omega_{\text{in}}=\left(x_{l},x_{r}\right)\text{ and
}\Omega_{\text{out}}=\left(-\infty,x_{l}\right)\cup\left(x_{r},+\infty\right),$

resulting in the coupled system

(11) $\begin{aligned} i\frac{\partial v}{\partial
t}+\frac{\partial^{2}v}{\partial x^{2}}=Vv\text{,}&&\text{on
}\Omega_{\text{in}}\times\mathbb{R}_{0}^{+}\\\ \frac{\partial v}{\partial
x}=\frac{\partial w}{\partial x}\text{,}&&\text{on
}\left\\{x_{l},x_{r}\right\\}\times\mathbb{R}_{0}^{+}\\\
v=\psi_{\text{ini}}\text{,}&&\text{on
}\Omega_{\text{in}}\times\left\\{0\right\\}\\\ i\frac{\partial w}{\partial
t}+\frac{\partial^{2}w}{\partial x^{2}}=Vw\text{,}&&\text{on
}\Omega_{\text{out}}\times\mathbb{R}_{0}^{+}\\\ v=w\text{,}&&\text{on
}\left\\{x_{l},x_{r}\right\\}\times\mathbb{R}_{0}^{+},\\\
\underset{\left|x\right|\rightarrow+\infty}{\lim}w\left(x,t\right)=0\text{,}&&\text{for
all }t\in\mathbb{R}^{+}\\\ w=0\text{,}&&\text{on
}\Omega_{\text{out}}\times\left\\{0\right\\}\end{aligned},$

where $v$ and $w$ are the respective solutions on the interior
$\Omega_{\text{in}}$ and exterior $\Omega_{\text{out}}$ of the full spatial
domain $\mathbb{R}$. If $v$ and $\frac{\partial v}{\partial x}$ (or
equivalently $w$ and $\frac{\partial w}{\partial x}$) are such that (11) is
well posed we call the boundary conditions absorbing (ABC). If the boundary
conditions yield a solution the conincides with the original problem (2),
these boundary conditions are called transparent (TBC).

A transparent boundary condition for problem (11) can be derived as follows.
Let

(12)
$\Omega_{\text{l}}=\left(-\infty,x_{l}\right),\quad\Omega_{\text{r}}=\left(x_{r},+\infty\right).$

Transforming the eqution on $\Omega_{\text{r}}$ (given by Eq. (11)) with
respect to time using the unilateral Laplace transform we arrive at

(13) $is\widehat{w}+\frac{\partial^{2}\widehat{w}}{\partial
x^{2}}=V_{r}\widehat{w}\text{, where }x\in\Omega_{\text{r}},s\in\mathbb{C},$

where $V_{r}$ denotes the constant value of the potential on
$\Omega_{\text{r}}$. The general solution of this ODE reads

(14)
$\widehat{w}\left(x,s\right)=c\left(s\right)^{+}e^{\sqrt{-is+V_{r}}x}+c\left(s\right)^{-}e^{-\sqrt{-is+V_{r}}x}\text{,
where }x\in\Omega_{\text{r}},s\in\mathbb{C}.$

A physical solution of the equation must be such that the real part of
$\sqrt{-is+V_{r}}x$ is postive and so

(15) $\widehat{w}\left(\cdot,s\right)\in
L^{2}\left(\Omega_{\text{r}}\right)\Rightarrow c\left(s\right)^{+}=0.$

The functions $v$ and $w$ are by Eq. (11) identical on the boundary, and so
(using the continuity of the solution up to the boundary) we get

(16)
$\widehat{w}\left(x,s\right)=e^{\sqrt{-is+V_{r}}\left(x-x_{r}\right)}\widehat{v}\left(x_{r},s\right).$

Taking the derivative of (16) leads to

(17) $\frac{\partial}{\partial
x}\widehat{w}\left(x,s\right)\left|{}_{x=x_{r}}\right.=-\sqrt{-is+V_{r}}\widehat{v}\left(x_{r},s\right)=-\sqrt{-is+V_{r}}\widehat{w}\left(x_{r},s\right).$

An analogous procedure leads to the condition for the left boundary, which
reads

(18) $-\frac{\partial}{\partial
x}\widehat{w}\left(x,s\right)\left|{}_{x=x_{l}}\right.=-\sqrt{-is+V_{l}}\widehat{v}\left(x,s\right)\left|{}_{x=x_{l}}\right.=-\sqrt{-is+V_{l}}\widehat{w}\left(x,s\right)\left|{}_{x=x_{l}}\right.$

Applying the inverse Laplace transform and recalling the inner problem of (11)
yields the formulation

(19) $\displaystyle i\frac{\partial v}{\partial
t}+\frac{\partial^{2}v}{\partial x^{2}}=Vv\text{,}$ $\displaystyle\text{on
}\Omega_{\text{in}}\times\mathbb{R}_{0}^{+}$ $\displaystyle\frac{\partial
v}{\partial x}=\mathcal{L}^{-1}\left(f\right)\text{,}$ $\displaystyle\text{on
}\left\\{x_{l},x_{r}\right\\}\times\mathbb{R}_{0}^{+}$ $\displaystyle
v=\psi_{\text{ini}}\text{,}$ $\displaystyle\text{on
}\Omega_{\text{in}}\times\left\\{0\right\\},$

where

(20)
$f\left(x,s\right)=\begin{cases}-\sqrt{-is+V_{r}}\widehat{v}\left(x,s\right)\left|{}_{x=x_{r}}\right.&x=x_{r}\\\
\sqrt{-is+V_{l}}\widehat{v}\left(x,s\right)\left|{}_{x=x_{l}}\right.&x=x_{l}\end{cases}.$

Note that the presented approach is not limited to the case of a constant
potential $V$. In particular, the method above has been generalized to linear,
piecewise constant and even periodic potentials [65, 45, 40, 20].

##  3 Direct Formulation of the Optimization Problem

Let $\overline{\psi}\in L^{2}\left(\Omega_{\text{in}}\right)$ denote the
target state to be achieved in time $T>0$ and $p,q\in\mathbb{N}$. Using the
state equation (11) with the dependance on the control described by (4) or (8)
the control problem of interest can be formulated as follows (using (16))

(21)
$\displaystyle\underset{\eta}{\min}\frac{\alpha}{p}\underset{\Omega_{\text{in}}}{\int}\left|v\left(x,T;\eta\right)-\overline{\psi}\left(x\right)\right|^{p}dx+\beta\frac{1}{q}\underset{\mathbb{R}\times\mathbb{R}_{0}^{+}}{\int}\mu\left(\eta\left(x,t\right)\right)^{q}d\left(x,t\right)$
$\displaystyle\text{s.t. }i\frac{\partial v}{\partial
t}+\frac{\partial^{2}v}{\partial x^{2}}=V\left(\eta\right)v\text{,}$
$\displaystyle\text{on }\Omega_{\text{in}}\times\mathbb{R}_{0}^{+}$
$\displaystyle\frac{\partial v}{\partial
x}=\mathcal{L}^{-1}\left(f\left(\eta\right)\right)\text{,}$
$\displaystyle\text{on }\left\\{x_{l},x_{r}\right\\}\times\mathbb{R}_{0}^{+}$
$\displaystyle v=\psi_{\text{ini}}\text{,}$ $\displaystyle\text{on
}\Omega_{\text{in}}\times\left\\{0\right\\}$ $\displaystyle i\frac{\partial
w}{\partial t}+\frac{\partial^{2}w}{\partial
x^{2}}=V\left(\eta\right)w\text{,}$ $\displaystyle\text{on
}\Omega_{\text{out}}\times\mathbb{R}_{0}^{+}$ $\displaystyle
w=\mathcal{L}^{-1}\left(g\left(\eta\right)\right)\text{,}$
$\displaystyle\text{on }\left\\{x_{l},x_{r}\right\\}\times\mathbb{R}_{0}^{+},$
$\displaystyle\underset{\left|x\right|\rightarrow+\infty}{\lim}w\left(x,t\right)=0\text{,}$
$\displaystyle\text{for all }t\in\mathbb{R}^{+}$ $\displaystyle w=0\text{,}$
$\displaystyle\text{on }\Omega_{\text{out}}\times\left\\{0\right\\}$

where $\mu:C\rightarrow\mathbb{R}_{0}^{+}$ denotes the measure applied to
quantify the cost of the control, $\alpha,\beta>0$ denote regularization
strengths and

(22)
$g\left(\eta\right)=e^{-\sqrt{-is+V_{r}}\left(x-x_{r}\right)}\widehat{v}\left(x_{r},s\right).$

Assuming the controllability of the system, the first summand of the cost
function may be removed and the constraint

(23) $\overline{\psi}\left(\cdot,T\right)=v\left(\cdot,T\right)$

imposed.

It should be noted that the formulation (21) is designed to be numerically
solvable. For example, one could use a direct optimization method and solve
the problem in $\Omega_{\text{in}}$ for a given control $\eta$ and then draw
upon the known analytical solution for the problem on $\Omega_{\text{out}}$
(this is possible due to the convenient form of the potential on
$\Omega_{\text{in}}$). As we will see in the following section, it remains
numerically treatable even after transformation into frequency space.

##  4 Spectral Formulation of the Optimization Problem

The problem (21) has been constructed with two objectives in mind:

  * •

The direct numerical solvability.

  * •

The possibility of reformulation using spectral methods.

Using (20) and (22) along with (13) and analogous computations performed for
$\Omega_{\text{in}}$ and $\Omega_{\text{l}}$ lead to the semi-spectral variant
of the optimization problem, which reads

(24)
$\displaystyle\underset{\eta}{\min}\frac{\alpha}{p}\underset{\Omega_{\text{in}}}{\int}\left|\mathcal{L}^{-1}\left(\widehat{v}\left(s,T;\eta\right)\right)\left(x\right)-\overline{\psi}\left(x\right)\right|^{p}dx+\frac{\beta}{q}\underset{\mathbb{R}\times\mathbb{R}_{0}^{+}}{\int}\mu\left(\eta\left(x,t\right)\right)^{q}d\left(x,t\right)$
$\displaystyle\text{s.t.
}is\widehat{v}+\frac{\partial^{2}\widehat{v}}{\partial
x^{2}}=\mathcal{L}\left(V\left(\eta\right)v\right)\text{,}$
$\displaystyle\text{on }\Omega_{\text{in}}\times\mathbb{R}_{0}^{+}$
$\displaystyle\frac{\partial\hat{v}}{\partial x}=f\left(\eta\right)\text{,}$
$\displaystyle\text{on }\left\\{x_{l},x_{r}\right\\}\times\mathbb{R}_{0}^{+}$
$\displaystyle\widehat{v}=\frac{1}{s}\psi_{\text{ini}}\text{,}$
$\displaystyle\text{on }\Omega_{\text{in}}\times\left\\{0\right\\}$
$\displaystyle is\widehat{w}+\frac{\partial^{2}\widehat{w}}{\partial
x^{2}}=\mathcal{L}\left(V\left(\eta\right)w\right)\text{,}$
$\displaystyle\text{on }\Omega_{\text{out}}\times\mathbb{R}_{0}^{+}$
$\displaystyle\widehat{w}=g\left(\eta\right)\text{,}$ $\displaystyle\text{on
}\left\\{x_{l},x_{r}\right\\}\times\mathbb{R}_{0}^{+},$
$\displaystyle\underset{\left|x\right|\rightarrow
0}{\lim}\widehat{w}\left(x,t\right)=0\text{,}\text{for all
}t\in\mathbb{R}^{+}$ $\displaystyle\widehat{w}=0\text{,}$
$\displaystyle\text{on }\Omega_{\text{out}}\times\left\\{0\right\\}.$

Due to the results of [20, 65] the formulation (24) can also be derived for
periodic potentials as well. For these types of potentials, the semi-spectral
variant of the optimization problem (24) will produce straightforward
algebraic expressions in place of these potentials.

Furthermore, one may reformulate the control and cost functional using the
uni-lateral Laplace transform resulting in

(25)
$\underset{\widehat{\eta}}{\min}\frac{\alpha}{p}\underset{\Omega_{\text{in}}}{\int}\left|\widehat{v}\left(s,T;\widehat{\eta}\right)\left(x\right)-\mathcal{L}\left(\overline{\psi}\left(x\right)\right)\right|^{p}dx+\frac{\beta}{q}\underset{\mathbb{R}\times\mathbb{R}_{0}^{+}}{\int}\widehat{\mu}\left(\widehat{\eta}\left(x,t\right)\right)^{q}d\left(x,t\right),$

where $\widehat{\eta}$ denotes the control in frequency space and
$\widehat{\mu}$ is an alternative measure to attribute cost to the control.

##  5 Examples

This section is dedicated to working out a couple of examples that show how
the presented technique can be used to achieve desired states for the transmon
[50, 52, 36] and fluxonium [42, 8] qubits. First, the specification of the
system to qubits of the transmon and fluxonium kind is discussed. Dependent on
the aforementioned state equations, a method that can be used to translate
binary data into this setting is detailed.

###  5.1 The Motivation for Considering Optimization in Frequency Space

The following example illustrates the possible benefits of frequency space
optimization. Many quantum algorithms require an even superposition as the
initial state on which the computation is performed. For a two-qubit system,
this state may be represented as

(26)
$\left|\psi_{\text{initial}}\right\rangle=\frac{1}{2}\left(\left|00\right\rangle+\left|01\right\rangle+\left|10\right\rangle+\left|11\right\rangle\right),$

where $\left|\psi_{\text{initial}}\right\rangle$ denotes a target state for
the optimization (which is the initial state for the actual quantum
computation). The matrix for the Quantum Fourier Transform with respect to the
canonical basis for a two qubit system reads

(27) $F_{2}=\frac{1}{2}\left[\begin{array}[]{cccc}1&1&1&1\\\ 1&i&-1&-i\\\
1&-1&1&-1\\\ 1&-i&-1&i\end{array}\right].$

One may notice that

(28) $F_{2}\left|\psi_{\text{initial}}\right\rangle=\left|00\right\rangle,$

which reveals that the target vector in frequency space may be captured with
the use of only a single basis vector instead of four. Assuming now that we
include only this basis vector from the frequency space, which already
contains the target state, we may “add harmonics”, i.e. vectors that form an
orthogonal basis which include

(29)
$\left|\psi_{\text{initial}}\right\rangle=\left(\frac{1}{2}\left[\begin{array}[]{c}1\\\
1\\\ 1\\\
1\end{array}\right]\right)_{\text{canonical}}=\left(\left[\begin{array}[]{c}1\\\
0\\\ 0\\\ 0\end{array}\right]\right)_{\text{frequency space}}.$

Using this process, we may control the numerical extent of the problem, while
always including the target state. In many cases, quantum systems exhibit
symmetries within the frequency domain, and this results in a small number of
harmonics being sufficient to solve the problem accurately.

###  5.2 The Transmon Qubit

A common formulation of the Hamiltonian for a superconducting transmon qubit
reads

(30)
$H=4E_{C}\left(\widehat{n}-n_{g}\right)^{2}-E_{J}\cos\left(\widehat{\varphi}\right),$

where the observables are the phase operator $\widehat{\varphi}$ and the
charge operator $\widehat{n}$ satisfying the canonical commutation relation
$\left[\widehat{n},\widehat{\varphi}\right]=\hbar i$. The value $n_{g}$ gives
the equilibrium charge value, the charging and Josephson energies are denoted
by $E_{C}$ and $E_{J}$ respectively while the electron charge $e$ and total
capacitance $C_{\varSigma}$ relate with the charging energy by

(31) $E_{C}=\frac{e^{2}}{2C_{\varSigma}}.$

Relating this formulation to the preceding chapters, one can also split the
Hamiltonian into the potential and momentum operator parts by defining

(32) $P\left(\widehat{n}\right)=4E_{C}\left(\widehat{n}-n_{g}\right)^{2},\quad
Q\left(\widehat{\varphi}\right)=-E_{J}\cos\left(\widehat{\varphi}\right),$

which allows us to write

(33) $H=P\left(\widehat{n}\right)+Q\left(\widehat{\varphi}\right).$

To finish the formulation of the Schrödinger equation in coordinate space, a
transformation into a “phase basis” is considered. Using this technique, the
phase operator $\widehat{\varphi}$ becomes a position variable and the charge
operator $\widehat{n}$ becomes $-i\frac{\partial}{\partial\varphi}$. This
effort culminates in a form of the Schrödinger equation, which reads

(34)
$\left[4E_{C}\left(-i\frac{\partial}{\partial\varphi}-n_{g}\right)^{2}-E_{J}\cos\left(\varphi\right)\right]\psi\left(\varphi,t\right)=i\hbar\frac{\partial}{\partial
t}\psi\left(\varphi,t\right),$

where the (complex-valued) wave function additionally satisfies a periodic
condition [36] $\psi\left(\varphi,t\right)=\psi\left(\varphi+2k\pi,t\right)$.
According to [52] it is possible to engineer the surrounding circuitry of a
transmon qubit in such a way that $E_{C}$ and $E_{J}$ may be controlled within
a given range. The formulation of the transparent boundary conditions for (34)
can be made as [51]. This directly leads to a control problem of type (21) or
(24), where the control set is $\theta=E_{J}$. As mentioned in Section 2.2, we
can extend the formulation to include the control of $E_{C}$, resulting in the
control set $\theta=\left(E_{J},E_{C}\right)$, which leads to the ability to
control the ratio $\frac{E_{J}}{E_{C}}$, which impacts the energy spectrum,
especially at higher levels.

###  5.3 The Fluxonium Qubit

Following the same ideas, the fluxonium qubit [7] can be treated. In contrast
to its transmon counterpart, the fluxonium qubit has an additional control
parameter, induced by a magnetic field, which is the consequence of adding
multiple Josephson junctions into the circuit [42, 8]. The Hamiltonian in this
case reads

(35)
$H=4E_{C}\left(\widehat{n}-n_{g}\right)^{2}-E_{J}\cos\left(\widehat{\varphi}+\varphi_{\text{ext}}\right)+\frac{1}{2}E_{L}\widehat{\varphi}^{2},$

where $\varphi_{\text{ext}}$ relates to the external magnetic flux and $E_{L}$
is the inductive energy of the qubit. Just like in the case of the transmon
qubit, the Schrödinger equation can be derived and reads

(36)
$\left[4E_{C}\left(-i\frac{\partial}{\partial\varphi}-n_{g}\right)^{2}-E_{J}\cos\left(\varphi+\varphi_{\text{ext}}\right)+\frac{1}{2}E_{L}\varphi^{2}\right]\psi\left(\varphi,t\right)=i\hbar\frac{\partial}{\partial
t}\psi\left(\varphi,t\right).$

Treating the boundary conditions as before, we arrive at a control problem
formulation with control sets $\theta=\left(E_{J}\right)$ or
$\theta=\left(E_{J},E_{C},\varphi_{\text{ext}}\right)$ depending on the
whether the approach of Section 2.2 is applied, or not.

###  5.4 A Possible Encoding of Data - Preparing an Initial State for Quantum
Computation

To detail the application of the proposed frequency domain-based optimization
a particular example of achieving an initial state for a computation on a
quantum computer is presented. This example serves only as an illustration of
a possible application and does not exclude the application of the method to
different quantum systems, in which the initial data may not be subject to the
qubit interpretation.

For clarity, the procedure is detailed using a single qubit system, but
extends readily to a multi qubit system, which is discussed subsequently. Let
$\left|\psi_{\text{target}}\right\rangle\in\mathbb{C}^{2}$ be the target state
satisfying the usual norm condition
$\left\|\left|\psi_{\text{target}}\right\rangle\right\|_{\mathbb{C}^{2}}=1$.
More explicitly, one may then assume that there exist
$\alpha,\beta\in\mathbb{C}$ such that

(37)
$\left|\psi_{\text{target}}\right\rangle=\alpha\left|0\right\rangle+\beta\left|1\right\rangle,$

where the norm condition reads
$\left|\alpha\right|^{2}+\left|\beta\right|^{2}=1$ and
$\left|0\right\rangle,\left|1\right\rangle$ are a basis of $\mathbb{C}^{2}$.

It is known [9] that transmon qubit systems decribed by (37) has a discrete
energy spectrum and its eigenvalues may be approximated

(38)
$E_{n}\approx\hbar\omega_{0}\left(n+\frac{1}{2}\right)-\frac{E_{c}}{12}\left(6n^{2}+6n+3\right),$

where $\hbar$ denotes the Planck constant. Due to the form of (38) it is
possible to manipulate the spacing between the energy levels by means of
$E_{c}$. Any state $\left|\varphi\right\rangle$ may be written in the
countable eigenbasis as

(39)
$\left|\varphi\right\rangle=\sum_{i=0}^{\infty}a_{i}\left|i\right\rangle,$

where $\left|i\right\rangle$ are the eigenstates of the Hamiltonian. It is
common practice to construct transmon qubits, such that only the first two
energy levels are accessible, which validates the use of the two dimensional
model, which makes use of the space $\mathbb{C}^{2}$ instead of the infinite
dimensional separable Hilbert space in which the state (39) is found.

Using these assumptions and the fact that the state (37) may also be
considered to be an element of this larger Hilbert space if we interpret the
basis vectors in (37) as eigenvectors of the Hamiltonian, the target state
represents a valid element within the solution space of the Schrodinger
equation. Applying the Laplace transform

(40)
$\overline{\psi}=\mathcal{L}^{-1}\left(\psi_{\text{initial}}\right)=\alpha\mathcal{L}^{-1}\left(\left|0\right\rangle\right)+\beta\mathcal{L}^{-1}\left(\left|1\right\rangle\right)$

yields the target state for the semi-spectral problem (24).

To extend this construction to the case of the multi qubit setting, one only
needs to consider target states that are a tensor product of constituent
states and consider a tensor product solution space for the Schrödinger
equation also. In this setting, the aforementioned steps may be repeated.

##  6 Conclusion

A semi-spectral method for optimizing state preparation was presented. Due to
the chosen method of derivation, the artificial boundary conditions were shown
to be directly translatable to the semi-spectral form. This method directly
generalizes to other types of potentials outside of the domain, especially
periodic ones, which due to the spectral formulation of the optimization
problem (24) will have a simple form.

#### Acknowledgement

Ales Wodecki acknowledges the support of the Czech Science Foundation
(23-07947S).

#### Disclaimer

This paper was prepared for information purposes and is not a product of HSBC
Bank Plc. or its affiliates. Neither HSBC Bank Plc. nor any of its affiliates
make any explicit or implied representation or warranty, and none of them
accept any liability in connection with this paper, including, but not limited
to, the completeness, accuracy, reliability of information contained herein
and the potential legal, compliance, tax, or accounting effects thereof. This
document is not intended as investment research or investment advice, or a
recommendation, offer or solicitation for the purchase or sale of any
security, financial instrument, financial product or service, or to be used in
any way for evaluating the merits of participating in any transaction.

## References

  * [1] A. Abbas, A. Ambainis, B. Augustino, A. Bärtschi, H. Buhrman, C. Coffrin, G. Cortiana, V. Dunjko, D. J. Egger, B. G. Elmegreen, et al., Quantum optimization: Potential, challenges, and the path forward, arXiv preprint arXiv:2312.02279, (2023).
  * [2] Abdurrouf, M. A. Pamungkas, and M. Nurhuda, Numerical solution of the Schrödinger equation with periodic Coulomb potential, Journal of Physics: Conference Series, 1825 (2021), p. 012105, doi:10.1088/1742-6596/1825/1/012105, https://dx.doi.org/10.1088/1742-6596/1825/1/012105.
  * [3] A. Aerts, P. Kockaert, S.-P. Gorza, A. Brown, J. Vander Auwera, and N. Vaeck, Laser control of a dark vibrational state of acetylene in the gas phase—fourier transform pulse shaping constraints and effects of decoherence, The Journal of Chemical Physics, 156 (2022).
  * [4] X. Antoine, A. Arnold, C. Besse, M. Ehrhardt, and a. schaedle, A review of transparent and artificial boundary conditions techniques for linear and nonlinear schrödinger equations, Communications in Computational Physics, 4 (2008), pp. 729–796.
  * [5] A. Assion, T. Baumert, M. Bergt, T. Brixner, B. Kiefer, V. Seyfried, M. Strehle, and G. Gerber, Control of chemical reactions by feedback-optimized phase-shaped femtosecond laser pulses, Science, 282 (1998), p. 919–922, doi:10.1126/science.282.5390.919, http://dx.doi.org/10.1126/science.282.5390.919.
  * [6] G. G. Balint-Kurti, S. Zou, and A. Brown, Optimal control theory for manipulating molecular processes, Advances in chemical physics, 138 (2008), pp. 43–94.
  * [7] F. Bao, H. Deng, D. Ding, R. Gao, X. Gao, C. Huang, X. Jiang, H.-S. Ku, Z. Li, X. Ma, et al., Fluxonium: An alternative qubit platform for high-fidelity operations, Physical Review Letters, 129 (2022), p. 010502.
  * [8] F. Bao, H. Deng, D. Ding, R. Gao, X. Gao, C. Huang, X. Jiang, H. sheng Ku, Z. Li, X. Ma, X. Ni, J. Qin, Z. Song, H. Sun, C. Tang, T. Wang, F. Wu, T. Xia, W. L. Yu, F. Zhang, G. Zhang, X. Zhang, J. Zhou, X. Zhu, Y. Shi, J. Chen, H.-H. Zhao, and C. Deng, Fluxonium: An alternative qubit platform for high-fidelity operations., Physical review letters, 129 1 (2021), p. 010502.
  * [9] J. Bardin, D. Sank, O. Naaman, and E. Jeffrey, Quantum computing: An introduction for microwave engineers, IEEE Microwave Magazine, 21 (2020), pp. 24–44, doi:10.1109/MMM.2020.2993475.
  * [10] V. Baskakov and A. Popov, Implementation of transparent boundaries for numerical solution of the schrödinger equation, Wave Motion, 14 (1991), pp. 123–128, doi:https://doi.org/10.1016/0165-2125(91)90053-Q, https://www.sciencedirect.com/science/article/pii/016521259190053Q.
  * [11] A. D. Becke and R. M. Dickson, Numerical solution of Schrödinger’s equation in polyatomic molecules, The Journal of Chemical Physics, 92 (1990), pp. 3610–3612, doi:10.1063/1.457869, https://doi.org/10.1063/1.457869, arXiv:https://pubs.aip.org/aip/jcp/article-pdf/92/6/3610/9732556/3610_1_online.pdf.
  * [12] K. Bergmann, H. Theuer, and B. Shore, Coherent population transfer among quantum states of atoms and molecules, Reviews of Modern Physics, 70 (1998), p. 1003.
  * [13] D. I. Bondar, K. Jacobs, G. Korpas, J. Marecek, et al., Quantum optimal control via polynomial optimization: A globally convergent approach, arXiv preprint arXiv:2209.05790, (2022).
  * [14] A. Borzì, G. Ciaramella, and M. Sprengel, Formulation and numerical solution of quantum control problems, 2017.
  * [15] T. Caneva, T. Calarco, and S. Montangero, Chopped random-basis quantum optimization, Physical Review A, 84 (2011), doi:10.1103/physreva.84.022326, http://dx.doi.org/10.1103/PhysRevA.84.022326.
  * [16] D. D’Alessandro, Introduction to quantum control and dynamics, Chapman and Hall/CRC, Boca Raton, July 2021.
  * [17] R. A. Dalrymple and P. A. Martin, Perfect boundary conditions for parabolic water-wave models, Proceedings of the Royal Society of London. Series A: Mathematical and Physical Sciences, 437 (1992), pp. 41 – 54.
  * [18] N. L. Diaz, D. García-Martín, S. Kazi, M. Larocca, and M. Cerezo, Showcasing a barren plateau theory beyond the dynamical lie algebra, 2023, arXiv:2310.11505.
  * [19] D. d’Alessandro, Introduction to quantum control and dynamics, CRC press, 2021.
  * [20] M. Ehrhardt and C. Zheng, Exact artificial boundary conditions for problems with periodic structures, Journal of Computational Physics, 227 (2008), pp. 6877–6894, doi:10.1016/j.jcp.2008.03.042.
  * [21] W. R. Frensley, Boundary conditions for open quantum systems driven far from equilibrium, Rev. Mod. Phys., 62 (1990), pp. 745–791, doi:10.1103/RevModPhys.62.745, https://link.aps.org/doi/10.1103/RevModPhys.62.745.
  * [22] L. Friedrich and J. Maziero, Avoiding barren plateaus with classical deep neural networks, Physical Review A, 106 (2022), doi:10.1103/physreva.106.042433, http://dx.doi.org/10.1103/PhysRevA.106.042433.
  * [23] G. Friesecke, F. Henneke, and K. Kunisch, Frequency-sparse optimal quantum control, Mathematical Control and Related Fields, 8 (2018), pp. 155–176.
  * [24] S. J. Glaser, U. Boscain, T. Calarco, C. P. Koch, W. Köckenberger, R. Kosloff, I. Kuprov, B. Luy, S. Schirmer, T. Schulte-Herbrüggen, et al., Training schrödinger’s cat: Quantum optimal control: Strategic report on current status, visions and goals for research in europe, The European Physical Journal D, 69 (2015), pp. 1–24.
  * [25] C. E. Grosch and S. A. Orszag, Numerical Solution of Problems in Unbounded Regions: Coordinate Transforms, Journal of Computational Physics, 25 (1977), pp. 273–295, doi:10.1016/0021-9991(77)90102-4.
  * [26] L. Grover and T. Rudolph, Creating superpositions that correspond to efficiently integrable probability distributions, arXiv preprint quant-ph/0208112, (2002).
  * [27] L. K. Grover, Synthesis of quantum superpositions by quantum computation, Physical Review Letters, 85 (2000), p. 1334–1337, doi:10.1103/physrevlett.85.1334, http://dx.doi.org/10.1103/PhysRevLett.85.1334.
  * [28] J. R. Hellums and W. R. Frensley, Non-markovian open-system boundary conditions for the time-dependent schrödinger equation, Phys. Rev. B, 49 (1994), pp. 2904–2906, doi:10.1103/PhysRevB.49.2904, https://link.aps.org/doi/10.1103/PhysRevB.49.2904.
  * [29] S. Herbert, No quantum speedup with Grover-Rudolph state preparation for quantum monte carlo integration, Physical Review E, 103 (2021), p. 063302.
  * [30] M. Hinze, R. Pinnau, M. Ulbrich, and S. Ulbrich, Optimization with PDE Constraints, vol. 23, 01 2009, pp. xii+270, doi:10.1007/978-1-4020-8839-1.
  * [31] P. Intallura, G. Korpas, S. Chakraborty, V. Kungurtsev, and J. Marecek, A survey of quantum alternatives to randomized algorithms: Monte carlo integration and beyond, arXiv preprint arXiv:2303.04945, (2023).
  * [32] R. S. Judson and H. Rabitz, Teaching lasers to control molecules, Phys. Rev. Lett., 68 (1992), pp. 1500–1503, doi:10.1103/PhysRevLett.68.1500, https://link.aps.org/doi/10.1103/PhysRevLett.68.1500.
  * [33] S. Kak, The initialization problem in quantum computing, Foundations of Physics, 29 (1999), pp. 267–279.
  * [34] 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, Journal of Magnetic Resonance, 172 (2005), p. 296–305, doi:10.1016/j.jmr.2004.11.004, http://dx.doi.org/10.1016/j.jmr.2004.11.004.
  * [35] C. P. Koch, U. Boscain, T. Calarco, G. Dirr, S. Filipp, S. J. Glaser, R. Kosloff, S. Montangero, T. Schulte-Herbrüggen, D. Sugny, and F. K. Wilhelm, Quantum optimal control in quantum technologies. strategic report on current status, visions and goals for research in europe, EPJ Quantum Technology, 9 (2022), doi:10.1140/epjqt/s40507-022-00138-x, http://dx.doi.org/10.1140/epjqt/s40507-022-00138-x.
  * [36] J. Koch, T. M. Yu, J. Gambetta, A. A. Houck, D. I. Schuster, J. Majer, A. Blais, M. H. Devoret, S. M. Girvin, and R. J. Schoelkopf, Charge-insensitive qubit design derived from the cooper pair box, Phys. Rev. A, 76 (2007), p. 042319, doi:10.1103/PhysRevA.76.042319, https://link.aps.org/doi/10.1103/PhysRevA.76.042319.
  * [37] V. F. Krotov, Global Methods in Optimal Control Theory, Birkhäuser Boston, 1993, p. 74–121.
  * [38] F. Ladouceur, Boundaryless beam propagation, Opt. Lett., 21 (1996), pp. 4–5, doi:10.1364/OL.21.000004, https://opg.optica.org/ol/abstract.cfm?URI=ol-21-1-4.
  * [39] M. Larocca, P. Czarnik, K. Sharma, G. Muraleedharan, P. J. Coles, and M. Cerezo, Diagnosing barren plateaus with tools from quantum optimal control, Quantum, 6 (2022), p. 824.
  * [40] M. Levy, Perfectly matched layer truncation for parabolic wave equation models, Proceedings of The Royal Society A: Mathematical, Physical and Engineering Sciences, 457 (2001), doi:10.1098/rspa.2001.0848.
  * [41] 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 (2021), p. 010101.
  * [42] V. Manucharyan, J. Koch, L. Glazman, and M. Devoret, Fluxonium: Single cooper-pair circuit free of charge offsets, Science (New York, N.Y.), 326 (2009), pp. 113–6, doi:10.1126/science.1175552.
  * [43] D. Mastropietro, G. Korpas, V. Kungurtsev, and J. Marecek, Fleming-viot helps speed up variational quantum algorithms in the presence of barren plateaus, arXiv preprint arXiv:2311.18090, (2023).
  * [44] J. Papadakis, Exact, nonreflecting boundary conditions for parabolic-type approximations in underwater acoustics, Journal of Computational Acoustics, 02 (2011), doi:10.1142/S0218396X94000075.
  * [45] J. S. Papadakis and E. T. Flouri, A neumann to dirichlet map for the bottom boundary of a stratified sub-bottom region in parabolic approximation, Journal of Computational Acoustics, 16 (2008), pp. 409–425, doi:10.1142/S0218396X08003658, https://doi.org/10.1142/S0218396X08003658, arXiv:https://doi.org/10.1142/S0218396X08003658.
  * [46] A. P. Peirce, M. A. Dahleh, and H. Rabitz, Optimal control of quantum-mechanical systems: Existence, numerical approximation, and applications, Physical Review A, 37 (1988), p. 4950.
  * [47] M. Plesch and Č. Brukner, Quantum-state preparation with universal gate decompositions, Physical Review A, 83 (2011), p. 032302.
  * [48] M. Ragone, B. N. Bakalov, F. Sauvage, A. F. Kemper, C. O. Marrero, M. Larocca, and M. Cerezo, A unified theory of barren plateaus for deep parametrized quantum circuits, 2023, arXiv:2309.09342.
  * [49] N. F. Robertson, A. Akhriev, J. Vala, and S. Zhuk, Escaping barren plateaus in approximate quantum compiling, arXiv preprint arXiv:2210.09191, (2022).
  * [50] T. Roth and S. Elkin, One-dimensional Maxwell-Schrodinger hybrid simulation of transmon qubits, (2022), doi:10.48550/arXiv.2210.07923.
  * [51] T. E. Roth and S. T. Elkin, Maxwell-schrödinger modeling of superconducting qubits coupled to transmission line networks, 2023, arXiv:2210.07923.
  * [52] T. E. Roth, R. Ma, and W. C. Chew, The transmon qubit for electromagnetics engineers: An introduction, IEEE Antennas and Propagation Magazine, 65 (2023), pp. 8–20, doi:10.1109/MAP.2022.3176593.
  * [53] M. Salehi and N. Granpayeh, Numerical solution of the schrödinger equation in polar coordinates using the finite-difference time-domain method, J. Comput. Electron., 19 (2020), p. 91–102, doi:10.1007/s10825-020-01446-0, https://doi.org/10.1007/s10825-020-01446-0.
  * [54] M. Schumann, F. K. Wilhelm, and A. Ciani, Emergence of noise-induced barren plateaus in arbitrary layered noise models, 2023, arXiv:2310.08405.
  * [55] I. L. Sofronov, Artificial boundary conditions of absolute transparency for two- and three-dimensional external time-dependent scattering problems, European Journal of Applied Mathematics, 9 (1998), p. 561–588, doi:10.1017/S0956792598003507.
  * [56] N. V. Vitanov, T. Halfmann, B. W. Shore, and K. Bergmann, Laser-induced population transfer by adiabatic passage techniques, Annual review of physical chemistry, 52 (2001), pp. 763–809.
  * [57] S. Wang, E. Fontana, M. Cerezo, K. Sharma, A. Sone, L. Cincio, and P. J. Coles, Noise-induced barren plateaus in variational quantum algorithms, Nature communications, 12 (2021), pp. 1–11.
  * [58] A. Weiner, D. Leaird, J. Patel, and J. Wullert, Programmable shaping of femtosecond optical pulses by use of 128-element liquid crystal phase modulator, IEEE Journal of Quantum Electronics, 28 (1992), pp. 908–920, doi:10.1109/3.135209.
  * [59] J. Werschnik and E. K. U. Gross, Quantum optimal control theory, 2007, arXiv:0707.1883.
  * [60] K. Wright, K. M. Beck, S. Debnath, J. M. Amini, Y. Nam, N. Grzesiak, J.-S. Chen, N. C. Pisenti, M. Chmielewski, C. Collins, K. M. Hudek, J. Mizrahi, J. D. Wong-Campos, S. Allen, J. Apisdorf, P. Solomon, M. Williams, A. M. Ducore, A. Blinov, S. M. Kreikemeier, V. Chaplin, M. Keesan, C. Monroe, and J. Kim, Benchmarking an 11-qubit quantum computer, Nature Communications, 10 (2019), doi:10.1038/s41467-019-13534-2, http://dx.doi.org/10.1038/s41467-019-13534-2.
  * [61] G. Yao, N. V. da Silva, and D. Wu, An effective absorbing layer for the boundary condition in acoustic seismic wave simulation, Journal of Geophysics and Engineering, 15 (2018), pp. 495–511, doi:10.1088/1742-2140/aaa4da, https://doi.org/10.1088/1742-2140/aaa4da, arXiv:https://academic.oup.com/jge/article-pdf/15/2/495/25533352/jge_15_2_495.pdf.
  * [62] D. M. Zajac, A. J. Sigillito, M. Russ, F. Borjans, J. M. Taylor, G. Burkard, and J. R. Petta, Resonantly driven cnot gate for electron spins, Science, 359 (2018), p. 439–442, doi:10.1126/science.aao5965, http://dx.doi.org/10.1126/science.aao5965.
  * [63] R. N. Zare, Laser control of chemical reactions, Science, 279 (1998), pp. 1875–1879, doi:10.1126/science.279.5358.1875.
  * [64] K. Zhang, L. Liu, M.-H. Hsieh, and D. Tao, Escaping from the barren plateau via gaussian initializations in deep variational quantum circuits, Advances in Neural Information Processing Systems, 35 (2022), pp. 18612–18627.
  * [65] C. Zheng, An exact absorbing boundary condition for the schrödinger equation with sinusoidal potentials at infinity, Communications in Computational Physics, 3 (2008).
  * [66] E. Y. Zhu, S. Johri, D. Bacon, M. Esencan, J. Kim, M. Muir, N. Murgai, J. Nguyen, N. Pisenti, A. Schouela, K. Sosnova, and K. Wright, Generative quantum learning of joint probability distribution functions, Phys. Rev. Res., 4 (2022), p. 043092, doi:10.1103/PhysRevResearch.4.043092, https://link.aps.org/doi/10.1103/PhysRevResearch.4.043092.
  * [67] C. Zoufal, A. Lucchi, and S. Woerner, Quantum generative adversarial networks for learning and loading random distributions, npj Quantum Information, 5 (2019), doi:10.1038/s41534-019-0223-2, http://dx.doi.org/10.1038/s41534-019-0223-2.


# An Intelligent Assistant for Converting City Requirements to Formal
Specification

Zirong Chen1, Isaac Li2, Haoxiang Zhang3, Sarah Preum4, John A. Stankovic2,
Meiyi Ma1
1 Vanderbilt University 2 University of Virginia 3 Columbia University 4
Dartmouth College
{zirong.chen<EMAIL_ADDRESS>{il5fq<EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

As more and more monitoring systems have been deployed to smart cities, there
comes a higher demand for converting new human-specified requirements to
machine-understandable formal specifications automatically. However, these
human-specific requirements are often written in English and bring missing,
inaccurate, or ambiguous information. In this paper, we present CitySpec [1],
an intelligent assistant system for requirement specification in smart cities.
CitySpec not only helps overcome the language differences brought by English
requirements and formal specifications, but also offers solutions to those
missing, inaccurate, or ambiguous information. The goal of this paper is to
demonstrate how CitySpec works. Specifically, we present three demos: (1)
interactive completion of requirements in CitySpec; (2) human-in-the-loop
correction while CitySepc encounters exceptions; (3) online learning in
CitySpec.

###### Index Terms:

Requirement Specification, Intelligent Assistant, Monitoring, Smart City

##  I Introduction

The demand for safety guarantees in smart cities has been increasing in recent
years. Although monitoring systems have been developed and tested to be
effective and efficient while dealing with machine-understandable formal
specifications [2, 3, 4], they require two important inputs, i.e., the real-
time data streams and formal specified requirements. In other words, the
inputs to the monitoring systems need to be machine-understandable formal
specification streams. However, the city requirements given by the city policy
makers are often written in English instead. The language difference between
English specified requirements and their corresponding formal specifications
is significant. The introduction of mathematical symbols even makes the
translation more difficult. A case study of our dataset indicates that 2

Other than the language difference, the English requirements also introduce
missing, inaccurate, or ambiguous information. In our dataset, there are lots
of requirements that have missing parts, i.e., 27.6% of the requirements lack
location information, 29.1% of the requirements miss a proper quantifier, and
even 90% of the requirements do not have or only have a default time (e.g.,
always) defined. Beside missing information, ambiguity and inaccuracy are
found in the dataset as well, i.e., a specific number is needed to measure
“close to”. As a result, it is considered difficult or impossible for
monitoring systems to monitor these requirements properly.

In this demonstration, we show CitySpec [1], an intelligent assistant system
for smart city requirement specifications that bridges the gap between English
requirements and formal specifications while also efficiently dealing with
missing, inaccurate, or ambiguous information. CitySpec is designed to assist
city policy makers in precisely filling out English city requirements using an
intelligent interface, and then automatically converting them to formal
specifications. The detailed system structure is introduced in Section II.
CitySpec is deployed online, Section III introduces the workflow of the online
CitySpec tool. To evaluate the proposed system, we demonstrate three cases:
(1) interactive completion of requirements in CitySpec; (2) human-in-the-loop
correction while CitySepc encounters exceptions; (3) online learning in
CitySpec in Section IV.

##  II CitySpec Overview

CitySpec aims to help city policy makers write English requirements in an
interactive interface and then coverts the collected requirements to formal
specifications automatically. The system is deployed online. CitySpec consists
of four components:

  * •

An intelligent and interactive conversation-based interface that helps
communicate with city policy makers. Users first input a requirement in
English, CitySpec then passes the requirement to the translation model and
gets a formal requirement with keywords including, $\mathsf{entity}$: the
requirement’s main object, e.g., “the number”, $\mathsf{quantifier}$: the
scope of an entity, e.g., “taxi”, $\mathsf{location}$: the location where this
requirement is in effect, which is missing from the above example requirement,
$\mathsf{time}$: the time period during which this requirement is in effect,
e.g., “between 7 am to 8 am”, $\mathsf{condition}$: the specific constraint on
the entity, such as an upper or lower bound of $\mathsf{entity}$, e.g., “10”.

  * •

A Requirement Synthesis component that extracts city knowledge and synthesizes
new requirements to build the translation model. The knowledge from city
requirements is abstracted into vocabulary and pattern. Vocabulary stores
semantic information and pattern stores syntactic information. To deal with
data scarcity, a controllable synthesizing approach is introduced into this
component.

  * •

A Translation Model that converts city requirements to formal specifications.
The inputs of the translation model are requirements, and the outputs of this
component are formal specifications with token-level classification. We pick
BiLSTM+CRF and BERT as the final reasoning neural models to handle the
downstream NER task. Other NLP packages are applied to refine the final
outputs, i.e., time refinement and negation detection.

  * •

A Online Learning component that adapts the system to new knowledge. When
CitySpec encounters unknown/uncertain inputs, it will launch an online
learning session to ask the user for clarification. Both short-term and long-
term online learning methods are provided in this component. The short-term
learning is designed to store the user clarification temporarily and
accommodate the same user in one session of requirement specification with the
temporary memory. Long-term learning is designed to adapt the new knowledge to
the model permanently. To better filter out malicious or suspicious samples, a
validation function is applied before the long-term learning.

##  III Webpage Workflow

CitySpec is deployed online and offers service with an online user interface.
In this section, we introduce the workflow of the online CitySpec tool. There
provides six example requirements for users to begin with at the bottom of our
website:

  * •

The indoor concentrations of carbon monoxide should be no more than 7 mg/m3 in
any 24 hours period in all the buildings.

  * •

In all the buildings, annual average concentration of tetrachloroethylene
should be no more than 0.25 mg/m3.

  * •

All portable LED Luminaries should have Power Factor of no less than 0.70
everywhere.

  * •

In all buildings, the average concentration of Bacterial should be no more
than 2500 cfu/m3 for every day.

  * •

The air quality within 3 miles of school A should always be better than
moderate for the next 2 hours.

  * •

The indoor concentrations of carbon monoxide should be no more than 7 mg/m3 in
any 24 hours period in all the buildings.

Figure 1: Online CitySpec tool layout

As shown in Fig. 1, there are two buttons, two display windows, and one
conversation window in the online CitySpec tool. In addition to the back-and-
forth conversation on a single requirement specification, CitySpec also
supports multiple requirement processing from the uploaded file. The top-left
start a new requirement button starts a new conversation while single
requirement is given. The upload button on the right of the start button
directs to a new page that supports file uploading and batch processing. The
main body is the conversation window where the user can type in requirements,
one requirement has already been typed in Fig. 1. On the right, there are two
display windows, one for keyword results, another for generated formal
specification. Keyword results are necessary references to generate final
specifications. The window to display formal specifications modifies the final
output a little bit. We consider our users, who are mainly city policy makers,
do not have much expertise in formal languages. Thus, directly showing them
the formal specifications can cause confusion and misunderstandings while
users are trying to make corrections.

##  IV Demonstration

We demonstrate three use cases of CitySpec in this section: (1) interactive
completion of requirements in CitySpec; (2) human-in-the-loop correction while
CitySepc encounters exceptions; (3) online learning in CitySpec.

Figure 2: Case I (top) & Case II (bottom) demonstration

###  IV-A Interactive Completion

When the user gives well-specified requirements, like ‘The indoor
concentrations of carbon monoxide should be no more than 7 mg/m3 in any 24
hours period in all the buildings.’ in Fig. 1, CitySpec calls its backend NER
model to give intermediate NER results to fill in all the necessary domains
for final formal specification generation. In the example shown in Fig. 1,
$\mathsf{entity}$ is extracted as ‘indoor concentrations’,
$\mathsf{description}$ (aka $\mathsf{quantifier}$) is now ‘carbon monoxide’,
$\mathsf{location}$ is ‘buildings’, $\mathsf{time}$ is ‘24 hours period’, and
$\mathsf{time}$ is ‘7 mg/m3’. After having all these preliminary NER results,
CitySpec will throw a request for user confirmation before reporting the final
results. If the user confirms, then the final results will be reported through
both the conversation window and the two display windows on the right, see
case I in Fig. 2 for more details.

###  IV-B Human-in-the-loop Correction

If the user does not confirm the preliminary results, then a human-in-the-loop
correction will be needed, see case II in Fig. 2. Take the same requirement in
Subsection IV-A for example, if the user decides to use ‘all the buildings’ as
the $\mathsf{location}$ instead of ‘buildings’, then all the user needs for
correction is to type “location all the buidlings” in the conversation window
to correct the preliminary results. After this, all preliminary
$\mathsf{location}$ results will be changed as typed (see red arrows in Fig.
2). Similar to case I, no matter how many times the user changes the
preliminary results, another round of user confirmation will be needed before
CitySpec reports the final results.

###  IV-C Short-term and Long-term Online Learning

Figure 3: Case III demonstration

CitySpec provides preliminary results in both cases in Subsection IV-A and
IV-B. If CitySpec has trouble giving preliminary results, then human-in-the-
loop correction and online learning will be launched. Take this requirement –
“In all the buildings, during weekdays from 2pm to 5pm, the average
concentration of tetrachloroethylene should be no more than 0.25 mg/m3.” as an
example, when CitySpec takes it as input, it has trouble giving
$\mathsf{time}$ information, as a result, there is no preliminary result
reported. Instead of asking for confirmation, CitySpec directly throws a
request for user clarification about the $\mathsf{time}$ information. At the
same time, if the user is not satisfied with the preliminary results, like the
“buildings” in this case, the user can always change it halfway, see details
in the first part of Fig. 3. After receiving clarification and correction,
CitySpec stores it temporarily. When CitySpec is being queried with the same
requirement, it will directly give the stored results, see the second image in
Fig. 3. After the user signs out, the temporarily stored clarification is used
for long-term online learning. Before injecting knowledge into the backend
model, a validation function is applied to filter out malicious/suspicious
inputs. After all, the deployed model is updated periodically with validated
knowledge so that it promises to learn continuously.

##  V Conclusion

In this demonstration abstract, we introduce CitySpec which is an intelligent
assistant system for requirement specification, describe how it works in a
component level, and demonstrate how it handles and further learn continuously
from requirements with or without missing, inaccurate or ambiguous
information.

## Acknowledgment

This work was funded, in part, by NSF CNS-1952096.

## References

  * [1] Z. Chen, I. Li, Z. Haoxiang, S. Preum, J. A. Stankovic, and M. Ma, “Cityspec: An intelligent assistant system for requirement specification in smart cities,” in _2022 IEEE International Conference on Smart Computing (SMARTCOMP)_. IEEE, 2022.
  * [2] M. Ma, E. Bartocci, E. Lifland, J. A. Stankovic, and L. Feng, “A novel spatial–temporal specification-based monitoring system for smart cities,” _IEEE Internet of Things Journal_ , vol. 8, no. 15, pp. 11 793–11 806, 2021\.
  * [3] M. Ma, J. A. Stankovic, and L. Feng, “Cityresolver: a decision support system for conflict resolution in smart cities,” in _2018 ACM/IEEE 9th International Conference on Cyber-Physical Systems (ICCPS)_. IEEE, 2018, pp. 55–64.
  * [4] M. Ma, J. Stankovic, E. Bartocci, and L. Feng, “Predictive monitoring with logic-calibrated uncertainty for cyber-physical systems,” _ACM Transactions on Embedded Computing Systems (TECS)_ , vol. 20, no. 5s, pp. 1–25, 2021.