An Application of Pontryagin Neural Networks to Solve Optimal Quantum
  Control Problems
Reliable high-fidelity quantum state transformation has always been
considered as an inseparable part of quantum information processing. In this
regard, Pontryagin maximum principle has proved to play an important role to
achieve the maximum fidelity in an optimum time or energy. Motivated by this,
in this work, we formulate a control constrained optimal control problem where
we aim to minimize time and also energy subjected to a quantum system
satisfying the bilinear Schrodinger equation. We derive the first order
optimality conditions through the application of Pontryagin Maximum (minimum)
Principle, which results in a boundary value problem. Next, in order to obtain
efficient numerical results, we exploit a particular family of physics-informed
neural networks that are specifically designed to tackle the indirect method
based on the Maximum Principle of Pontryagin. This method has not yet been
studied in the quantum context, but it can significantly speed up the process.
To this end, we first obtain a set of relations which finally let us compute
the optimal control strategy to determine the time- and energy-optimal protocol
driving a general initial state to a target state by a quantum Hamiltonian with
bounded control. We make use of the so-called "qutip" package in python, and
the newly developed "tfc" python package.
Nahid Binandeh Dehaghani, A. Pedro Aguiar
# An Application of Pontryagin Neural Networks to Solve Optimal Quantum Control Problems

###### Abstract

Reliable high-fidelity quantum state transformation has always been considered as an inseparable part of quantum information processing. In this regard, Pontryagin maximum principle has proved to play an important role to achieve the maximum fidelity in an optimum time or energy. Motivated by this, in this work, we formulate a control constrained optimal control problem where we aim to minimize time and also energy subjected to a quantum system satisfying the bilinear Schrodinger equation. We derive the first order optimality conditions through the application of Pontryagin Maximum (minimum) Principle, which results in a boundary value problem. Next, in order to obtain efficient numerical results, we exploit a particular family of physics-informed neural networks that are specifically designed to tackle the indirect method based on the Maximum Principle of Pontryagin. This method has not yet been studied in the quantum context, but it can significantly speed up the process. To this end, we first obtain a set of relations which finally let us compute the optimal control strategy to determine the time- and energy-optimal protocol driving a general initial state to a target state by a quantum Hamiltonian with bounded control. We make use of the so-called "qutip" package in python, and the newly developed "tfc" python package.

## I Introduction

Over the last years, understanding the optimization methods of quantum systems has been a challenge for researchers. In the most quantum control protocols, the control law is preferably computed without experimental feedback in an open-loop layout. In this regard, Optimal Control Theory (OCT) provides powerful tools, allowing to formulate quantum control problems in order to seek a set of admissible controls satisfying the system dynamics while optimizing a cost functional (e.g., fidelity, time or energy). For optimizing a cost functional in an optimal control setup, several numerical solution methods have been developed, which can generally be divided into direct and indirect subcategories, [2]. In the former method, the optimal control problem is considered as a non-linear optimization/programming problem, while the latter method is based on the optimality conditions of Pontryagin Maximum (or Minimum) Principle (PMP), which results in a two-point boundary value problem (BVP) in the state and adjoint conditions that possibly can be solved by shooting methods. As an example, a time discretized computational scheme has been proposed in [1], aiming to solve a high fidelity quantum state transfer problem by means of an indirect method based on PMP.

Generally, dynamical quantum control originates from a time dependent quantum-mechanical Hamiltonian that steers the dynamics of the quantum system subjected to the constraints, e.g., relaxation processes. Hence, the realization of an optimal sequence is highly complicated in quantum control problems, and is dependant on the particular system under study. One way to deal with the problem complexity is the introduction of physics-informed neural networks (PINNs) to the context of quantum control. The term physics-informed neural networks is used to indicate the neural networks (NNs) for which the loss function comprises the physics as a regularization term, [3]. PINNs can be applied to any quantum evolution with a well-known model. Recently, the flexibility of PINNs has been shown in quantum control context, [4].

In this work, we implement a quantum optimal control problem by applying the PMP and modeling a NN representation of the state-adjoint pair, for which the residuals of the BVP are considered as the loss to be as close to zero as possible. We will utilize the PINN methodology, developed in [5, 10], in quantum framework. In this method, PINNs are trained to learn actions satisfying PMP, so the optimality is guaranteed by learning the solutions of the associated BVP. These PINNs, named Pontryagin NNs (PoNNs), play an effective role in learning optimal control actions. Finally, considering the importance of quantum state to state transition problem in quantum information processing, we propose a time- and energy-minimum optimal control problem to achieve a high fidelity quantum state transfer through exploiting PoNNs.

The paper is organized as follows: We first recall the set of PMP optimality conditions for a general unconstrained quantum optimal control problem. Then, we review how PoNNs can be employed to learn the optimal control actions from the unknown solutions of the BVP arising from the PMP necessary optimality conditions. Afterwards, we formulate a quantum state transition problem under control constraints and obtain the necessary conditions of optimality. We then use PoNNs to solve the BVP, which is resulted from the application of PMP through the indirect method. The simulation results have been shown for the quantum state transfer problem in a three-level system. The paper ends with conclusions and an overview on prospective research challenges.

Notation.For a general continuous-time trajectory \(x\), the term \(x(t)\) indicates the trajectory assessed at a specific time \(t\). For writing the transpose of a matrix (or vector) we use the superscript \(T\), and we use \(\dagger\) to show the conjugate
transpose of a matrix (or vector). Throughout the text, the vectors are shown by vectorbold command. To denote the wave functions as vectors, we use the Dirac notation such that \(\left|\psi\right\rangle=\sum\limits_{k=1}^{n}\alpha_{k}\left|\hat{\psi}_{k}\right\rangle\), where \(\left|\psi\right\rangle\) indicates a state vector, \(\alpha_{k}\) are the complex-valued expansion coefficients, and \(\left|\hat{\psi}_{k}\right\rangle\) are basis vectors that are fixed. The notation bra is defined such that \(\left\langle\psi\right|=\left|\psi\right\rangle^{\dagger}\). For writing partial differential equations (PDEs), we denote partial derivatives using subscripts. In the general situation where \(f\) denotes a function of \(n\) variables including \(x\), then \(f_{x}\) denotes the partial derivative relative to the \(x\) input.

## II An Overview on Quantum Optimal Control

In quantum mechanics, a pure state is described by a unit vector wave function \(\left|\psi\right\rangle\) in a complex Hilbert space \(\mathbb{H}\), represented as

\[\left|\psi\right\rangle=\cos\frac{\theta}{2}\left|0\right\rangle+e^{i\varphi} \sin\frac{\theta}{2}\left|1\right\rangle \tag{1}\]

in which \(\theta\in\left[0,\pi\right]\), and \(\varphi\in\left[0,2\pi\right]\). The evolution of an n-level pure state \(\left|\psi(t)\right\rangle\) can be modelled through the bilinear time-dependent Schrodinger equation for closed quantum systems as

\[i\hbar\frac{\partial}{\partial t}\left|\psi(t)\right\rangle=H\left(t\right) \left|\psi(t)\right\rangle \tag{2}\]

where \(\left|\psi(t)\right\rangle\) takes values on the state-space \(S^{2n-1}\), and \(\hbar\) is the reduced Planck's constant, considered as a unit in the rest of the paper. The control evolution is determined through the quantum-mechanical system Hamiltonian \(H(t)\), represented by

\[H\left(u(t)\right) =H_{d}+H_{C}\left(t\right) \tag{3}\] \[=H_{d}+\sum\limits_{k=1}^{m}u_{k}(t)H_{k}\]

The first term indicates the Hermitian matrix known as a drift Hamiltonian \(H_{d}=diag(E_{1},E_{2},\cdots,E_{n})\), where \(E_{k}\) represents a real number concerning the energy level. The second term captures a set of external control functions \(u_{k}(t)\in\mathbb{R}\) coupled to the quantum system via time independent interaction Hamiltonians \(H_{k}\), which are Hermitian matrices to describe the coupling between the control and the system. One important objective of optimal control in quantum information processing is to the address state to state transition problem in the state space, so before going ahead, we must address the problem of controllability to check if it is possible to steer the system from one state to another for all pairs of possible states. To do so, we first check the controllability of the system evolution operator \(U(t)\) satisfying

\[i\frac{\partial}{\partial t}U\left(t\right)=H\left(t\right)U(t) \tag{4}\]

which is right-invariant on the compact Lie group \(su(n)\). Note that it satisfies the necessary and sufficient condition of controllability since

\[Lie\{iH_{d},iH_{1},\cdots,iH_{m}\}=su(n) \tag{5}\]

which results in the controllability of (2) simply because the controllability of a right invariant system results in the controllability of the bilinear system.

We now proceed with the optimal control formulation. For convenience and in order to express the problem in terms of only real quantities, we implement the system state and Hamiltonian as, [13, 15],

\[\left|\bar{\psi}\left(t\right)\right\rangle=\begin{bmatrix}\text{Re}\left( \left|\psi\left(t\right)\right\rangle\right)\\ \text{Im}\left(\left|\psi\left(t\right)\right\rangle\right)\end{bmatrix} \tag{6}\]

and

\[\tilde{H}\left(u(t)\right):=\begin{pmatrix}\text{Re}\left(-iH\left(u\left(t \right)\right)\right)&-\text{Im}\left(-iH\left(u\left(t\right)\right)\right) \\ \text{Im}\left(-iH\left(u\left(t\right)\right)\right)&\text{Re}\left(-iH \left(u\left(t\right)\right)\right)\end{pmatrix} \tag{7}\]

so we can rewrite (2) as

\[\frac{\partial}{\partial t}\left|\bar{\psi}\left(t\right)\right\rangle= \tilde{H}\left(u\left(t\right)\right)\left|\bar{\psi}\left(t\right)\right\rangle \tag{8}\]

In the following, we deal with a problem to find a way to drive an initial state \(\left|\bar{\psi}\left(t_{0}\right)\right\rangle=\left|\psi_{0}\right\rangle\) to a desired final state \(\left|\bar{\psi}\left(t_{f}\right)\right\rangle=\left|\psi_{f}\right\rangle\) while minimizing a cost functional. The methods to design the quantum optimal controller vary according to the choice of the cost functional, the construction of the Pontryagin-Hamiltonian, and the computation scheme using the Maximum Principle conditions. Let us consider the following unconstrained optimal control problem (\(OCP_{u}\)),

\[\begin{array}{l}\text{minimize}\quad J\left(\left|\bar{\psi}\left(t\right) \right\rangle,u\left(t\right),t\right)\\ \\ \quad=\Phi\left(\left|\psi_{0}\right\rangle,\left(t_{0}\right),\left|\psi_{f} \right\rangle,\left(t_{f}\right)\right)+\int\limits_{t_{0}}^{t_{f}}L\left( \left|\bar{\psi}\left(t\right)\right\rangle,u\left(t\right),t\right)dt\end{array} \tag{9}\]

_subjected to_

\[\left|\hat{\psi}\left(t\right)\right\rangle=f\left(\left|\bar{ \psi}\left(t\right)\right\rangle,u\left(t\right),t\right)\] \[\Phi\left(\left|\psi_{0}\right\rangle,t_{0}\right)=\Phi_{0}\] \[\Phi\left(\left|\psi_{f}\right\rangle,t_{f}\right)=\Phi_{f}\]

where \(J\) in the cost function in which the term \(\Phi\) indicates the end-point cost, and \(L\) is the Lagrangian. The state and control are indicated by \(\left|\bar{\psi}\left(t\right)\right\rangle\) and \(u(t)\), respectively, and \(t\) in the independent variable with \(t_{0}\) showing the initial and \(t_{f}\) as the final time. For applying PMP within the indirect method, the Pontryagin Hamiltonian is defined by adjoining the constraints on the system dynamics to the Lagrangian \(L\) via introducing time-varying Lagrange multiplier vector \(\left|\lambda\left(t\right)\right\rangle\), whose elements are called the costates of the system. Hence, the Pontryagin Hamiltonian \(\mathcal{H}\) for all \(t\in\left[t_{0},t_{f}\right]\) is constructed as

\[\begin{array}{l}\mathcal{H}(\left|\bar{\psi}\left(t\right)\right\rangle,u(t), \lambda\left(t\right),t)\\ \\ \quad=\left|\lambda\left(t\right)\right\rangle^{T}\tilde{H}\left(u\left(t\right) \right)\left|\bar{\psi}\left(t\right)\right\rangle+L(\left|\bar{\psi}\left(t \right)\right\rangle),u(t)\end{array} \tag{10}\]

The first-order necessary optimality conditions of the PMP are then derived as

\[\frac{\partial\mathcal{H}}{\partial u}=0 \tag{11}\]

\[\left|\hat{\psi}\right\rangle=\frac{\partial\mathcal{H}}{\partial\left|\lambda \right\rangle} \tag{12}\]
\[\left|\hat{\lambda}\right\rangle=-\frac{\partial\mathcal{H}}{\partial\left|\hat{ \psi}\right\rangle} \tag{13}\]

Equations (12) and (13) that represent a boundary value problem are accompanied by the following possible transversality conditions on the Hamiltonian

\[\left|\lambda\left(t_{0}\right)\right\rangle=-\frac{\partial J}{\partial\left| \psi_{0}\right\rangle} \tag{14}\]

\[\mathcal{H}\left(t_{0}\right)=\frac{\partial J}{\partial t_{0}} \tag{15}\]

\[\left|\lambda\left(t_{f}\right)\right\rangle=\frac{\partial J}{\partial\left| \psi_{f}\right\rangle} \tag{16}\]

\[\mathcal{H}\left(t_{f}\right)=-\frac{\partial J}{\partial t_{f}} \tag{17}\]

represent a boundary value problem (BVP).

## III Physics-Informed Neural Networks Based on the Theory of Functional Connections

The boundary value problem resulted from the necessary optimality conditions has already been solved with several methods such as the so-called shooting method for quantum optimal control problems. In this section, we gave an overview of the newly-developed Pontryagin neural network method in [5], and, then, we apply the formulations in quantum context. The main feature of PINNs is to embed the differential equations (DEs) and boundary conditions describing the physics of the problem in their cost functions. PINNs can be designed to solve two classes of problems, including data-driven solution and data-driven discovery of PDEs, [3], following the original idea of using artificial neural networks to solve ordinary differential equations (ODEs) and PDEs in [8]. PINNs are a kind of universal function approximators that by means of a single neural network can approximate the solution of differential equations. To better understand the procedure of PINNs, let consider the following differential equation of a generic BVP:

\[F_{i}\left(t,y_{j}\left(t\right),\dot{y}_{j}\left(t\right) \right) =0\] \[\text{ \emph{subjected to} :}\begin{cases}y_{j}\left(t_{0}\right)=y_{0_{j}}\\ y_{j}\left(t_{f}\right)=y_{f_{j}}\\ \dot{y}_{j}\left(t_{0}\right)=\dot{y}_{0_{j}}\\ \dot{y}_{j}\left(t_{f}\right)=\dot{y}_{f_{j}}\end{cases} \tag{18}\]

in which \(i\) indicates the number of DEs forming the ODE system, and \(j\) shows the number of unknown solutions of the system that are approximated by a NN. By considering \(\theta\) as the NN parameters, which are trained by means of gradient-based methods, the PoNN is represented by, [5],

\[y_{j}\left(t\right)=y_{j}^{NN}\left(t,\theta\right) \tag{19}\]

where the time \(t\) is the input. PoNN is an especially trained NN satisfying the PMP through learning the solution of the arising BVP. To solve the BVP by applying the theory of functional connection (tfc) method, [5, 10], we first need to derive the constrained formulations together with their derivatives as

\[y_{j}^{m}\left(t,g\left(t\right)\right)=g_{j}^{m}\left(t\right)+\sum_{k=1}^{n _{j}}s_{k}^{m}\left(t\right)\eta_{kj} \tag{20}\]

in which \(g\left(t\right):\mathbb{R}\rightarrow\mathbb{R}\) indicates a user-specified function, \(s_{k}\left(t\right):\mathbb{R}\rightarrow\mathbb{R}\) are the so-called support functions, and the coefficients \(\eta_{k}\) represent constraint information, for all \(n_{j}\) constraints. Here, the superscript \(m\) and the subscript \(j\) refer to the \(m\)th derivative and \(j\)th unknown function, respectively. The support functions are linearly independent, and can possibly be chosen as \(s_{k}(t)=t^{k-1}\). By computing \(\eta_{kj}\)s, we can insert the boundary conditions to the constrained expression. Hence, by substituting the constrained expressions to (18), we can obtain a new unconstrained set of equations, which are only a function of \(g\left(t\right)\), represented as

\[\tilde{F}_{i}\left(t,g_{j}\left(t\right),\dot{g}_{j}\left(t\right),\dot{g}_{j }\left(t\right)\right) \tag{21}\]

The free function \(g_{j}\left(t\right)\), as developed in [7] based on the theory of extreme learning machine (ELM), is modeled by a single hidden layer feedforward neural network (SLFN) as

\[g_{j}\left(z\right)=\sum_{n=1}^{L}\xi_{j,j}h\left(\omega_{l}z_{j}+b_{l}\right) =\xi_{j}^{T}h_{j}\left(z\right) \tag{22}\]

where the summation is over all \(L\) hidden neurons, and \(h(\cdot)\) is the activation function. The output weight \(\xi_{l}\) and the input weights \(\omega_{l}=\left[\omega_{1},\omega_{2},\cdots,\omega_{L}\right]\) connect the \(l\)th hidden node to the output node and input nodes, respectively. \(b_{l}\) indicates the threshold of the \(l\)th hidden node. Since the domain of \(h(\cdot)\) and the \(t\) domain are not synchronous, we must do a mapping between \(t\) and \(z\), as \(z_{j}=z_{0}+c\left(t_{j}-t_{0}\right)\), where \(c>0\) is the mapping coefficient. Therefore, the derivatives of \(g_{j}\left(t\right)\) are transformed from \(t\) to \(z\) domain as

\[\frac{d^{m}g_{j}}{dt^{n}}=\xi_{j}^{T}\frac{d^{n}h_{j}\left(z\right)}{dz^{n}}c^ {n} \tag{23}\]

Since the theory of ELM is used for training the neural network, the unknowns would be \(\xi_{j}=\left[\xi_{j,1},...,\xi_{j,L}\right]^{T}\). Moreover, for the free final time optimal control problems, the coefficient \(c\) also becomes an unknown that needs to be computed. Now, we can summarize (21) as

\[\tilde{F}_{i}\left(z_{j},\xi_{j}\right)=0 \tag{24}\]

for which we need to discretize \(z_{j}\) into \(N\) points in order to obtain the set of unconstrained differential equations expressed as loss functions, so

\[\mathcal{L}_{i}\left(\xi_{j}\right)=\left\{\begin{aligned} \tilde{F}_{i}\left(z_{0},\xi_{j}\right)\\ \tilde{F}_{i}\left(z_{1},\xi_{j}\right)\\ \vdots\\ \tilde{F}_{i}\left(z_{N-1},\xi_{j}\right)\\ \tilde{F}_{i}\left(z_{N},\xi_{j}\right)\end{aligned}\right\} \tag{25}\]

For \(\tilde{N}\) differential equations, (25) is augmented to the loss function \(\mathbb{L}^{T}=\left[\mathcal{L}_{1},\mathcal{L}_{2},...\mathcal{L}_{i},..., \mathcal{L}_{\tilde{N}}\right]\). By imposing a true solution, we have

\[\mathbb{L}=0_{Ns\tilde{N}} \tag{26}\]
Therefore, the \(\xi_{j}\) coefficients can be learnt. It can be done by means of various optimization techniques, [5].

## IV Quantum State Transition by a Pontryagin Neural Network Approach

For many quantum operations, it is crucial to achieve the quantum state transition in the shortest possible time. However, for a given control objective, control amplitude is inversely proportional to the control time. Hence, in the case that state transition needs to be done in the shortest possible time, the control amplitude may be very large, which is not practically possible since the amplitude of control cannot be infinite. To address this problem, we now extend the optimal time-energy control problem formulation for the input constrained case. More precisely, in the sequel, we are interested in solving the input constrained optimal control problem (\(OCP_{c}\)):

\[\begin{array}{c}\min_{u,t_{f}}\\ \text{subject to}\quad\left|\tilde{\psi}(t)\right\rangle=f(\left|\tilde{\psi} (t)\right\rangle,u(t)\,,t)=\tilde{H}\left(u\left(t\right)\right)\left|\tilde{ \psi}(t)\right\rangle\\ \left|\tilde{\psi}(t_{0})\right\rangle=\left|\psi_{0}\right\rangle\in\mathbb{R} ^{n}\\ t_{0}\leq t\leq t_{f}\\ u\left(t\right)\in\mathcal{U}:=\left\{u\in L_{\infty}:u\left(t\right)\in \Omega\subset\mathbb{R}\right\}\\ \Omega=\left[u_{\min},u_{\max}\right]\end{array}\]

where \(\Gamma\) and \(\eta\) in the performance index (cost functional) \(J\) are non-negative coefficients, and \(t_{f}\) is the free final time to be optimized. The second term of \(J\) is a common choice for the cost functional in molecular control, which measures the energy of the control field in the interval \(\left[t_{0},t_{f}\right]\). Moreover, the control constraint is represented by a sufficiently smooth function with two-sided interval bounds.

First, let turn our attention to transform the defined \(OCP_{c}\) into an unconstrained optimal control problem \(OCP_{u}\). Following the procedure that originally has been explained in [2], and has also been used in [5], we define a new unconstrained control variable \(\nu\) by replacing the control constraint with a smooth and monotonically increasing saturation function as \(u=\phi(\nu)\) where

\[\phi\left(\nu\right)=u_{max}-\frac{u_{max}-u_{min}}{1+\exp\left(s\nu\right)} \quad with\quad s=\frac{c}{u_{max}-u_{min}} \tag{27}\]

in which \(c\) is a constant parameter. Since the control variable is changed, we need to consider the following 4 items to define the new unconstrained optimal control problem;

* Adding a regularization term to the cost function \(J\) defined in \(OCP_{c}\) by considering a regularization parameter \(\mu\). Therefore the new cost \(\tilde{J}\) is defined as \[\tilde{J}=J+\mu\int_{t_{0}}^{t_{f}}\left\|\nu\right\|^{2}dt\] (28) As it is explained in details in the optimization by indirect methods, [6], the closer the value of \(\mu\) gets to zero, the more the solution of the new \(OCP_{u}\) approaches the solution of the original \(OCP_{c}\).
* Introducing an additional multiplier \(\varphi\) for taking the equality constraints into account. Hence, the new Pontryagin Hamiltonian is \[\tilde{\mathcal{H}}=\mathcal{H}+\mu\left\|\nu\right\|^{2}+\varphi\left(u- \phi\left(\nu\right)\right)\] (29)
* Considering an additional optimality condition for the new control variable by maximizing new Pontryagin Hamiltonian with respect to \(\nu\).
* Adding the constraint equation \[u-\phi(\nu)=0\] (30) to the boundary value problem.

Now, the new \(OCP_{u}\) is well-defined. Therefore, the new cost functional is expressed by

\[\tilde{J}=\Gamma t_{f}+\eta\int_{t_{0}}^{t_{f}}u^{2}\left(t\right)\,dt+\mu \int_{t_{0}}^{t_{f}}\left\|\nu\right\|^{2}dt \tag{31}\]

and the Pontryagin Hamiltonian is formulated as

\[\begin{array}{c}\tilde{\mathcal{H}}(\left|\tilde{\psi}\left(t\right)\right\rangle,u(t),\lambda(t),t)=\\ \left|\lambda\left(t\right)\right\rangle^{T}\tilde{H}\left(u\left(t\right) \right)\left|\tilde{\psi}\left(t\right)\right\rangle+\eta u^{2}\left(t\right) +\mu\nu^{2}+\varphi\left(u-\phi\left(\nu\right)\right)\end{array} \tag{32}\]

We now apply the maximum principle to determine the form of the optimal control by

\[\frac{\partial\tilde{\mathcal{H}}}{\partial u}=\left|\lambda\left(t\right) \right\rangle^{T}\tilde{H}_{u}\left|\tilde{\psi}\left(t\right)\right\rangle+2 \eta u\left(t\right)+\varphi=0 \tag{33}\]

where \(\tilde{H}_{u}=\frac{\partial\tilde{H}\left(u(t)\right)}{\partial u(t)}\), and also we have

\[\frac{\partial\tilde{\mathcal{H}}}{\partial\nu}=2\mu\nu-\varphi\phi^{\prime} \left(\nu\right)=0 \tag{34}\]

Moreover, we need to apply the first-order necessary conditions for the state and adjoint, so

\[\left|\hat{\psi}\right\rangle=\frac{\partial\tilde{\mathcal{H}}}{\partial \left|\lambda\right\rangle}=\tilde{H}\left(u\left(t\right)\right)\left|\tilde{ \psi}\left(t\right)\right\rangle,\quad\left|\tilde{\psi}\left(t_{0}\right) \right\rangle=\left|\psi_{0}\right\rangle \tag{35}\]

\[\left|\hat{\lambda}\right\rangle^{T}=-\frac{\partial\tilde{\mathcal{H}}}{ \partial\left|\tilde{\psi}\right\rangle}=-\left|\lambda\left(t\right)\right\rangle ^{T}\tilde{H}\left(u\left(t\right)\right) \tag{36}\]

since the implemented quantum-mechanical Hamiltonian is skew symmetric, we can rewrite (36) as

\[\left|\hat{\lambda}\right\rangle=\tilde{H}\left(u\left(t\right)\right)\left| \lambda\left(t\right)\right\rangle,\quad\left|\lambda\left(t_{f}\right)\right\rangle =\mathbf{0} \tag{37}\]

Notice that since the Lagrangian in the cost functional is not dependent on the state, the adjoint equation satisfies the same dynamics as the system state, and, therefore, \(\left|\hat{\psi}\right\rangle\) and \(\left|\hat{\lambda}\right\rangle\) are only coupled by means of the control field. Since the system dynamics is not explicitly dependent on time, the Pontryagin Hamiltonian has to be constant. From the transversality condition \(\tilde{\mathcal{H}}\left(t_{f}\right)=-\Gamma\).

The presented optimal control problem is solved through the X-TFC framework. To do so, the state and adjoint are approximated using the constrained expressions, hence,

\[\left|\tilde{\psi}\right\rangle\left(z,\xi\right)=\left(h_{\psi} \left(z\right)-\Omega_{1}\left(z\right)h_{\psi}\left(z_{0}\right)-\Omega_{2} \left(z\right)h_{\psi}\left(z_{f}\right)\right)^{T}\xi_{\psi}\] \[+\Omega_{1}\left(z\right)\left|\psi_{0}\right\rangle+\Omega_{2} \left(z\right)\left|\psi_{f}\right\rangle \tag{38}\] \[\left|\lambda\left(z\right),\xi\right\rangle=\left(h_{2}\left(z \right)-\Omega_{2}\left(z\right)h_{\lambda}\left(z_{f}\right)\right)^{T}\xi_{ \lambda}+\Omega_{2}\left(z\right)\left|\lambda_{f}\right\rangle \tag{39}\]
where \(\Omega_{1}\) and \(\Omega_{2}\) are switching functions, [11], which in the general domain of z for initial and final values are respectively expressed as the following:

\[\Omega_{1}\left(z\right)=1+\frac{2\left(z-z_{0}\right)^{3}}{\left(z_{f}-z_{0} \right)^{3}}-\frac{3\left(z-z_{0}\right)^{2}}{\left(z_{f}-z_{0}\right)^{2}} \tag{40}\]

\[\Omega_{2}\left(z\right)=-\frac{2\left(z-z_{0}\right)^{3}}{\left(z_{f}-z_{0} \right)^{3}}+\frac{3\left(z-z_{0}\right)^{2}}{\left(z_{f}-z_{0}\right)^{2}} \tag{41}\]

The derivatives of (38) and (39) are, then,

\[\left|\hat{\psi}\right\rangle\left(z,\xi\right)=c\left(h_{\psi}^{ \prime}\left(z\right)-\Omega_{1}^{\prime}\left(z\right)h_{\psi}\left(z_{0} \right)-\Omega_{2}^{\prime}\left(z\right)h_{\psi}\left(z_{f}\right)\right)^{T }\xi_{\psi}\] \[+\Omega_{1}^{\prime}\left(z\right)\left|\psi_{0}\right\rangle+ \Omega_{2}^{\prime}\left(z\right)\left|\psi_{f}\right\rangle \tag{42}\]

\[\left|\hat{\lambda}\right\rangle\left(z,\xi\right)=c\left(h_{\lambda}^{ \prime}\left(z\right)-\Omega_{2}^{\prime}\left(z\right)h_{\lambda}\left(z_{f} \right)\right)^{T}\xi_{\lambda}+\Omega_{2}^{\prime}\left(z\right)\left|\hat{ \lambda}_{f}\right\rangle \tag{43}\]

Regarding the control variables, the following constrained expressions can be introduced

\[u\left(z,\xi\right)=h_{u}^{T}\left(z\right)\xi_{u} \tag{44}\]

\[\nu\left(z,\xi\right)=h_{\nu}^{T}\left(z\right)\xi_{\nu} \tag{45}\]

and the multiplier \(\varphi\) is expanded as

\[\varphi\left(z,\xi\right)=h_{\varphi}^{T}\left(z\right)\xi_{\varphi} \tag{46}\]

Actually, the consideration for \(\varphi\) can also be done for the control variable \(\nu\). Hence, the vector of PoNN's unknown parameters to be learned is made up of

\[\xi=\left\{\xi_{\psi}\quad\xi_{\lambda}\quad\xi_{\omega}\quad\xi_{\upsilon} \quad\xi_{\varphi}\quad c\right\}^{T} \tag{47}\]

and the loss functions to be minimized are

\[\mathcal{L}_{\psi}=\left|\hat{\psi}\right\rangle-\tilde{H}\left(u\left(t \right)\right)\left|\tilde{\psi}\left(t\right)\right\rangle \tag{48}\]

\[\mathcal{L}_{\lambda}=\left|\hat{\lambda}\right\rangle-\tilde{H}\left(u \left(t\right)\right)\left|\lambda\left(t\right)\right\rangle \tag{49}\]

\[\mathcal{L}_{u}=\left|\lambda\left(t\right)\right\rangle^{T}\tilde{H}_{u} \left|\tilde{\psi}\left(t\right)\right\rangle+2\eta u\left(t\right)+\varphi \tag{50}\]

\[\mathcal{L}_{\nu}=2\mu\nu-\varphi\phi^{\prime}\left(\nu\right) \tag{51}\]

\[\mathcal{L}_{\phi}=u-\phi\left(\nu\right) \tag{52}\]

and the loss function being computed at the final time is

\[\mathcal{L}_{\tilde{\mathcal{H}}}=\tilde{\mathcal{H}}\left(t_{f}\right)+\Gamma \tag{53}\]

Now, we have to impose the valid solution of the augmented loss function as a \(N\times\tilde{N}\) dimensional zero matrix, and solve it by means of a numerical minimization scheme.

## V Simulation Results

We consider a three-level system being controlled through a single control field \(u(t)\) on the orthonormal basis \(\left|a\right\rangle=\left[\begin{matrix}1&0&0\end{matrix}\right]^{T}\), \(\left|b\right\rangle=\left[\begin{matrix}0&1&0\end{matrix}\right]^{T}\), and \(\left|c\right\rangle=\left[\begin{matrix}0&0&1\end{matrix}\right]^{T}\). The drift and control Hamiltonians for such system are expressed as, [14],

\[H_{d}=\left(\begin{matrix}0.5&0&0\\ 0&0.4&0\\ 0&0&0.6\end{matrix}\right),\quad H_{C}\left(t\right)=u\left(t\right)\left( \begin{matrix}0&1&0\\ 1&0&1\\ 0&1&0\end{matrix}\right) \tag{54}\]

The convergence tolerance is considered on \(10^{-16}\), \(N=40\), \(\eta=0.1\), and \(\Gamma=0.01\). Moreover we use the Chebyshev orthogonal polynomials as the basis for tfc implementation. However, different basis or number of discretization points can be experimented. Let consider the transition of the initial state \(\left|\psi_{t}\right\rangle=\left|a\right\rangle\) to the target \(\left|\psi_{d}\right\rangle=\left|c\right\rangle\), for the case that \(-1\leq u(t)\leq 1\). The population evolution is shown in Fig 1. As it can be seen from the graph, the population of the initial state decays exponentially, while the population of target increases by time.

Figure 2 shows the state trajectories in Cartesian coordinates, which is learnt by the PoNN during the computation time.

To better understand the trajectory, we also considered the quantum state evolution on the Bloch

Fig. 1: Population dynamics under quantum dynamics

Fig. 2: State trajectories in Cartesian coordinates
sphere with the spherical coordinates in Fig 3. Finally, in order to check the security level of reaching the target, we have to calculate the transition probability known as the quantum fidelity, which for two pure quantum states is computed by, [12],

\[\mathcal{F}(|\psi(t)\rangle,|\psi_{f}\rangle)=|\langle\psi(t)|\psi_{f}\rangle|^{2} \tag{55}\]

Since the system studied in this paper is a closed quantum system, we expect to reach the fidelity of 1, as well shown in Fig 4.

## VI Conclusions

In this paper, we have exploited the newly introduced method called the physics informed theory of functional connections. Through this method, PoNNs are used to learn optimal control actions for an input constrained optimal control problem. We used the scheme to solve the boundary value problem arising from the application of the indirect optimal control method to a quantum state to state transition problem under control constraint at the cost of compromising between the goal of attaining optimal time and, simultaneously, keeping the energy of the field relatively small. For the studied quantum control system, we considered a pure state, evolving through Schrodinger equation. The same procedure can also be applied for considering the dynamics of the evolution operator. Future challenges first consist in a detailed comparison and illustration the superiority of PoNN method over the state of the art quantum control methods, and also exploiting the versatility of the optimal control paradigm further by considering an open quantum system, for which the dynamics is explained through, e.g., Markovian or stochastic master equations, and also considering additional constraints, e.g., state constraints, to tackle with more complicated quantum optimal control problems.

## Acknowledgment

The authors acknowledge the support of FCT for the grant 2021.07608.BD, the ARISE Associated Laboratory, Ref. LA/P/0112/2020, and the R&D Unit SYSTEC-Base, Ref. UIDB/00147/2020, and Programmatic, Ref. UIDP/00147/2020 funds, and also the support of projects SNAP, Ref. NORTE-01-0145-FEDER-000085, and RELIBABLE (PTDC/EEI-AUT/3522/2020) funded by national funds through FCT/MCTES. The work has been done in the honor and memory of Professor Fernando Lobo Pereira.
