Quantum Pontryagin Neural Networks in Gamkrelidze Form Subjected to the
  Purity of Quantum Channels
We investigate a time and energy minimization optimal control problem for
open quantum systems, whose dynamics is governed through the Lindblad (or
Gorini-Kossakowski-Sudarshan-Lindblad) master equation. The dissipation is
Markovian time-independent, and the control is governed by the Hamiltonian of a
quantum-mechanical system. We are specifically interested to study the purity
in a dissipative system constrained by state and control inputs. The idea for
solving this problem is by the combination of two following techniques. We deal
with the state constraints through Gamkrelidze revisited method, while handling
control constraints through the idea of saturation functions and system
extensions. This is the first time that quantum purity conservation is
formulated in such framework. We obtain the necessary conditions of optimality
through the Pontryagin Minimum Principle. Finally, the resulted boundary value
problem is solved by a Physics-Informed Neural Network (PINN) approach. The
exploited Pontryagin PINN technique is also new in quantum control context. We
show that these PINNs play an effective role in learning optimal control
actions.
Nahid Binandeh Dehaghani, A. Pedro Aguiar, Rafal Wisniewski
# Quantum Pontryagin Neural Networks in Gamkrelidze Form Subjected to the Purity of Quantum Channels

###### Abstract

We investigate a time and energy minimization optimal control problem for open quantum systems, whose dynamics is governed through the Lindblad (or Gorini-Kossakowski-Sudarshan-Lindblad) master equation. The dissipation is Markovian time-independent, and the control is governed by the Hamiltonian of a quantum-mechanical system. We are specifically interested to study the purity in a dissipative system constrained by state and control inputs. The idea for solving this problem is by the combination of two following techniques. We deal with the state constraints through Gamkrelidze revisited method, while handling control constraints through the idea of saturation functions and system extensions. This is the first time that quantum purity conservation is formulated in such framework. We obtain the necessary conditions of optimality through the Pontryagin Minimum Principle. Finally, the resulted boundary value problem is solved by a Physics-Informed Neural Network (PINN) approach. The exploited Pontryagin PINN technique is also new in quantum control context. We show that these PINNs play an effective role in learning optimal control actions.

## I Introduction

During the last few decades, control of quantum systems has been extensively investigated. Recently, dissipative quantum systems have attracted much more attention in comparison with the quantum conservative systems, which are normally described by the time-dependent Schrodinger equation, for pure states captured by a wave function, or Liouville-von Neumann equation (LVNE), for both pure and mixed states described by the density operator rather than the wavefunction. The dynamics of open quantum systems is governed through the extension of LVNE by considering dissipative processes, known as the so-called Lindblad master equation. Due to the vast application of dissipative systems in various areas of knowledge such as quantum physics, chemistry and also quantum computation and information processing, the control of such systems is of high interest. Control of open quantum systems ranges from the control of dissipation resulted from molecular collisions to the fabrication of quantum computers.

Amongst quantum control tools, optimal control theory (OCT) has been applied to an increasingly extensive number of problems. Although OCT has been very well exploited for closed quantum systems, the control of dissipative quantum systems is still open to new ideas. Important examples of what may be thought of as the optimal control of dissipative quantum systems are the analytic solution for cooling the three-level \(\Lambda\) systems, [3], optimal control of quantum purity for dissipative two-Level open quantum systems, [4], and quantum optimal control problem with state constrained preserving coherence, [5]. In optimal control theory and particularly for state-to-state population transition problem, it is possible to find the best achievable control to take a dynamical system from one initial state to predefined target state, especially in the presence of state or control constraints by exploiting Pontryagin's Maximum Principle. In [5], we addressed the problem of maximizing fidelity in a quantum state transition process such that the coherence is preserved within some bounds. We formulated the quantum optimal control problem in the presence of state constraints and obtained optimality conditions of Pontryagin's Maximum Principle in Gamkrelidze's form for the first time in quantum control context.

In this work, we consider an optimal control problem of quantum dissipative dynamics, in which the dissipation is Markovian time-independent. This means that the memory effects are neglected and the dynamics of the quantum system under study is only dependent on the current state not the past history. Therefore, we can describe the density operator evolution by the Lindblad master equation. In such dynamics, there is an interaction of the controllable part of the system, the Hamiltonian (or conservative) term, and the uncontrollable part, the non-Hamiltonian (or dissipative) term. Under most conditions, dissipation leads to an increase in entropy (or a decrease in purity) of the system. However, proposing an strategy to control the Hamiltonian term of the system evolution with the intent that the non-Hamiltonian term causes an increase in purity rather than decrease is a matter of debate. In this regard, we consider two types of constraint, namely state and control constraints, and preserve the quantum purity in a state transition problem. We then exploit the newly developed Pontryagin Physics-Informed Neural Networks (PINN) method derived from the Theory of Functional Connection (TFC), [6, 9], to learn the optimal control actions and solve the Boundary Value Problem (BVP) associated with the necessary optimality conditions resulted
from the indirect application of Pontryagin Minimum Principle (PMP) in Gamkrelidze form.

### _Main Contributions:_

We investigate the optimal control problem of minimum-time and minimum-energy for dissipative quantum systems interacting with the environment, whose dynamics is governed by the Lindblad equation. Our contributions are itemized as follows

* We consider the purity of quantum channels as state constraints, such that the purity is preserved within some bounds. The technique to deal with this problem leans upon Gamkrelidze revisited method, which is novel in quantum control context. (We have shown the feasibility of this method for coherence preservation in a different framework in one of our recent works, [5].)
* We also consider control constraints, such that the value of control function remains in a defined interval. We handle control constraints through the idea of saturation functions and system extensions. This technique is also new in quantum control problems.
* We derive the necessary optimality PMP conditions, show under which the necessary conditions are also sufficient conditions for (local) optimality, and finally solve the boundary value problem resulted from the PMP. To do so, we use and adapt a recently developed neural network approach known as the Pontryagin neural networks. The application of this method is new in quantum control problems, where we solve the state constrained PMP in Gamkrelidze form by means of Pontryagin Neural Networks (PoNNs).

Overall, the combination of these two techniques is new for an optimal control problem. Moreover, this is for the first time that purity preservation is formulated and solved in such framework. We also study the fidelity criteria in terms of purity, and see the effects of state constraints of purity preservation on fidelity.

The structure of the work is as follows: In Section II, we introduce the Lindblad master equation and provide a linear isomorphism such that the transformed system is linear in the state and real. Section III formulates the optimal control problem of minimum time and energy, and in the next section we present the Pontryagin's Minimum Principle in Gamkrelidze form with saturation functions. We solve the resulted BVP through a physics-informed neural network approach, explained in section V. The simulation results have been shown for the quantum state transfer problem in a two-level system in section VI. The paper ends with conclusion 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 a vector) we use the superscript \(T\), and we use \(\dagger\) to show the conjugate transpose of a matrix (or vector). 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}\). In addition, the notation \(\left|\rho\right.\left\rangle\right\rangle\) indicates the vectorized form of the density operator in the Fock-Liouville space, and the vectorization operator is shown by _vec_. For writing partial differential equations, 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. The sign \(\otimes\) indicates the tensor product. Finally, the notation \(\left[\cdot,\cdot\right]\) represent a commutator and \(\left\{\cdot,\cdot\right\}\) is a Poisson bracket. Throughout the paper, the imaginary unit is \(i=\sqrt{-1}\).

## II The Lindbladian dynamics equation

The general mathematical tool to describe our knowledge of the state of an n-level quantum system is through the density operator \(\rho\), which is a Hermitian positive semi-definite operator of trace one acting on the Hilbert space \(\mathbb{H}\) of the system. In quantum mechanics, the evolution along time \(t\) of density operator through the Lindblad (or Gorini-Kossakowski-Sudarshan-Lindblad) master equation represents the most extensive generator of Markovian dynamics which takes the form, [11],

\[\dot{\rho}\left(t\right)=-i\left[H\left(u(t)\right),\rho\left(t\right)\right] +\sum\limits_{k}\lambda_{k}\left[L_{k}\rho L_{k}^{\dagger}-\frac{1}{2}\left\{L _{k}^{\dagger}L_{k},\rho\right\}\right] \tag{1}\]

in which the first term represents the unitary evolution of the quantum system, where \(H\left(u(t)\right)\) is a Hermitian operator called the quantum-mechanical Hamiltonian defined as

\[H\left(u(t)\right)=\underbrace{diag(E_{1},E_{2},\cdots,E_{n})}_{H_{d}}+ \underbrace{\sum\limits_{l=1}^{m}u_{l}(t)H_{l}}_{H_{C}}\]

where \(H_{d}\) is diagonal implying that the basis corresponds to the eigenvectors, and \(E_{i}\) represents a real number concerning the energy level. The control \(u_{l}(t)\in\mathbb{R}\) demonstrates a set of external functions coupled to the quantum system via time independent interaction Hamiltonians \(H_{l}\). The second term of (1) represents the dissipative part of the state evolution, where \(L_{k}\) indicates the sequence of arbitrary Lindblad operators, and \(\gamma_{k}\geq 0\) is the damping rate. Master equations can be botherson due to the commutation term and the Poisson bracket. Since convex combination gives the preservation of the trace and positive definiteness, it is possible to create a Hilbert space of density operators via defining a scalar product. The next result provides a linear space of density operators, called Fock-Liouville space, through which we present a solution of the master equation via vectorization such that the resulting Liouvillian superoperator is governed by a linear system.

**Proposition 1**: _Consider the Lindbladian dynamical system (1). There exists a linear isomorphism, coordinate transformation, such that the transformed system is linear in the states and real._
Proof:: The result is proved by providing a coordinate transformation given by the following composition of 3 linear isomorphisms (whose notation is defined in the sequel): i) \(\mathcal{L}:\ \rho\mapsto\mathcal{L}\rho,\ \ \ \text{ii)}\ \left|\cdot\right\rangle\right\rangle:\ \rho\mapsto\left|\rho\ \right\rangle\)),

\(\text{iii)}\ \tilde{\tau}:\ v\mapsto\tilde{v}:=\left[\text{Re}(v)\ \ \ \text{Im}(v)\right]\)

and finally \(\mathcal{L}=\tilde{\tau}\circ\left|\cdot\right\rangle\right)\circ\mathcal{L} \circ\left|\cdot\right\rangle\right)^{-1}\circ\tilde{\tau}^{-1}\). To obtain \(\mathrm{i}\), we apply the Choi-Jamiolkowski isomorphism for vectorization through the mapping \(\left|\cdot\right\rangle\right\rangle:\ \left|i\right\rangle\left\langle j \right|\mapsto\left|j\right\rangle\otimes\left|i\right\rangle\), to (1) obtaining the Liouville superoperator acting on the Hilbert space of density operator as \(\left|\hat{\rho}\ \right\rangle=\mathcal{L}\left|\rho\ \right\rangle\)) where

\[\mathcal{L}= -i\left(I\otimes H-H^{T}\otimes I\right)\] \[+\sum_{k}\gamma_{k}\left[L_{k}^{*}\otimes L_{k}-\frac{1}{2}I \otimes L_{k}^{\dagger}L_{k}-\frac{1}{2}\left(L_{k}^{\dagger}L_{k}\right)^{T }\otimes I\right] \tag{2}\]

in which \(I\) is the identity matrix. To show \(\mathrm{ii}\), note that, for an arbitrary density operator \(\rho=\sum\limits_{i,j}\rho_{i,j}\left|i\right\rangle\left\langle j\right|\), its vectorized form is given by \(\left|\rho\ \right\rangle=\sum\limits_{i,j}\rho_{i,j}\left|j\right\rangle \otimes\left|i\right\rangle\). Finally to get \(\mathrm{iii}\), we implement the system state and superoperator as

\[\left|\hat{\rho}\right\rangle\rangle=\begin{bmatrix}\text{Re}\left(\left| \rho\right\rangle\right)\\ \text{Im}\left(\left|\rho\right\rangle\right)\end{bmatrix},\quad\tilde{ \mathcal{L}}:=\begin{pmatrix}\text{Re}\left(\mathcal{L}\right)&-\text{Im} \left(\mathcal{L}\right)\\ \text{Im}\left(\mathcal{L}\right)&\text{Re}\left(\mathcal{L}\right)\end{pmatrix}\]

so that we obtain

\[\left|\dot{\rho}\ \right\rangle=\tilde{\mathcal{L}}\left|\rho\ \right\rangle\rangle \tag{3}\]

We consider (3) as the system dynamics in the rest of paper.

## III Optimal Control Formulation

This section describes the problem formulation. To this end, we have first to describe the state constraint that arises from the concept of quantum purity.

### _Quantum purity_

Quantum purity is a fundamental property of a quantum state. For pure states, the purity \(P=1\), while \(P<1\) shows that the quantum state is mixed. In dissipative quantum systems, a state may be initialized as pure, i.e., \(\rho=\left|\psi\right\rangle\left\langle\psi\right|\), and then due to the interaction with the environment and through a channel \(\chi\) is decohered and mapped to a mixed state. A quantum channel \(\chi\) over the space \(\mathbb{H}\) represents a completely positive trace-preserving quantum map, i.e., \(\chi\in CPTP(\mathbb{H})\). Hence, the purity of the channel \(\chi\) is considered as just the purity of the state \(\rho\). Therefore, one can write

\[P(\rho)=tr\left(\chi(\rho)^{2}\right)=tr\left(\rho^{2}\right)=\big{(}vec\left( \rho^{\dagger}\right)\big{)}^{\dagger}vec\left(\rho\right)\]

which leads to \(\tilde{P}(\rho)=\left\langle\left\langle\hat{\rho}^{\dagger}\left|\tilde{ \rho}\ \right\rangle\right\rangle\). Preservation or maximization of the purity of a state transmitted through a quantum channel, i.e., a dissipative quantum system, is an important objective in quantum information processing. To do so, several decoherence-reduction techniques, such as quantum error correcting codes, and decoherence-free subspaces have been developed. In this work, we keep quantum purity above some predefined level by imposing the constraint as

\[\alpha P_{0}\leq\tilde{P}(\rho)\leq P_{0},\quad 0<\alpha<1\]

where \(P_{0}=P(\rho_{0})\) is the purity of the initial state.

### _Problem Formulation_

Quantum operations such as quantum state transition need to be done in the shortest possible time. However, due to the inverse relation between control time and amplitude, a fast operation may cause a very large control amplitude, which is practically impossible. The methods to design the quantum optimal controller vary according to the choice of the cost functional, the construction of the Pontryagin-Hamiltonian function, and the computation scheme to solve the PMP optimality conditions. Here, we deal with a time- and energy minimization state constrained optimal control problem (\(P\)) with bounded control aiming to transfer the initial state \(\left|\tilde{\rho}(t_{0})\right\rangle\rangle=\rho_{0}\) to a desired target state \(\left|\tilde{\rho}(t_{f})\right\rangle\right\rangle=\rho_{f}\). The problem casts as the following:

\[(P)\left\{\begin{aligned} &\min_{u,f_{f}}\left\{J=\Gamma t_{f}+\eta \int_{t_{0}}^{t_{f}}u^{2}\left(t\right)\,dt\right\}\\ &\text{subject to}\\ &\left|\tilde{\rho}(t)\right\rangle\right\rangle=\tilde{\mathcal{L}} \left|\tilde{\rho}\ \right\rangle\ \text{a.e.}\ t\in\left[t_{0},t_{f}\right]\\ &\left|\tilde{\rho}(t_{0})\right\rangle\right\rangle=\rho_{0}\in \mathbb{R}^{4n}\\ & 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]\ \text{a.e.}\ t\in\left[t_{0},t_{f}\right]\\ & h\left(\left|\tilde{\rho}(t)\right\rangle\right)\right\rangle \leq 0\ \text{for all}\ t\in\left[t_{0},t_{f}\right]\end{aligned}\]

where \(\Gamma\) and \(\eta\) in the performance index \(J\) are positive coefficients, and \(t_{f}\) shows 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]\). The control is represented as a measurable bounded function. The inequality \(h\left(\left|\tilde{\rho}(t)\right\rangle\right)\leq 0\) defines the state constraints for the density operator - see the specific example in (6). In this setup, we assume that all the sets are Lebesgue measurable and the functions are Lebesgue measurable and Lebesgue integrable. The goal is to obtain a pair \(\left(\rho^{*},u^{*}\right)\) which is optimal in the sense that the value of cost functional is the minimum over the set of all feasible solutions.

**Remark 1**: _It is important to assert the existence of a solution to Problem (P) in the class of measurable controls. Following the Filippov's theorem, [12], since the right-hand side of the dynamical system is linear with respect to the control, and the set of control values is convex and compact, then one can conclude that there exists a feasible control process to this problem._

## IV Pontryagin's Minimum Principle in Gamkrelidze's form with saturation functions

To deal with the indicated problem, one can identify two Lagrangian multipliers: \(\mu\), and \(\lambda\), where

* \(\mu\) is bounded variation, non-increasing \(\mu:\left[t_{0},t_{f}\right]\rightarrow\mathbb{R}^{2}\), such that \(\mu(t)\) is constant on the time interval in which the state constraint is inactive.
* \(\left|\lambda\right\rangle\rangle:\left[t_{0},t_{f}\right]\rightarrow\mathbb{R}^{4n}\) is the time-varying Lagrange multiplier vector, whose elements are called the costates of the system.
We handle control constraints with saturation functions, [1], such that the indicated inequality-constraint for control is transformed into a new equality-constraint. To do so, we define a new unconstrained control variable \(\nu(t)\), and substitute the control constraint with a smooth and monotonically increasing saturation function \(\phi:\mathbb{R}\rightarrow(u_{\min},u_{\max})\) such that

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

in which \(c>0\) is a constant parameter, useful for modifying the slope of \(\phi(\nu)=0\). The advantage of using a saturation function is that it is defined within the range of \(\Omega\), and asymptotically approaches the saturation limits for \(\nu\rightarrow\pm\infty\). The next steps are the following:

* We add a regularization term to the cost functional \(J\) via a regularization parameter \(\alpha\), and define the new cost functional as \(\bar{J}=J+\alpha\int_{0}^{f_{J}}\nu^{2}(t)dt\), and solve the optimal control problem successively by decreasing \(\alpha_{k}\). We use the result that if \(u_{k+1}\) and \(u_{k}\) are the optimal control inputs for \(\alpha_{k+1}<\alpha_{k}\), then with \(\lim\limits_{k\rightarrow\infty}\alpha_{k}=0\), \(\bar{J}(u_{k},\alpha_{k})\) converges to a non-increasing optimal cost, [1]. In other words, by bringing \(\alpha\) closer to \(0\), we approach to the original problem.
* We consider an additional optimality condition for the new control variable by minimizing the Pontryagin-Hamilton function with respect to \(\nu\). Moreover, we need to consider the constraint equation \[u(t)-\phi(\nu)=0\] (4) for the boundary value problem.
* We introduce a multiplier \(\beta:\left[t_{0},t_{f}\right]\rightarrow\mathbb{R}\) to take the equality constraint into account.

In this new setup, we will now obtain the optimality conditions. To this end, we first construct the Pontryagin Hamiltonian \(\mathcal{H}\) defined for all \(t\in\left[t_{0},t_{f}\right]\) by

\[\mathcal{H}(\rho,\lambda,u,\nu,\delta,\alpha,\beta,t) =\left(\left|\lambda\left(t\right)\right\rangle\right)-2\delta(t) \left|\beta(t)\right\rangle\rangle)^{T}\tilde{\mathcal{L}}\left|\beta(t) \right\rangle\rangle\] \[+\eta u^{2}\left(t\right)+\alpha\nu^{2}(t)+\beta(t)\left(u(t)- \phi\left(\nu\right)\right) \tag{5}\]

where \(\delta\left(t\right)=\left[\left.1\right.-1\right]\mu(t)\).

**Proposition 2**: _Consider the optimal control problem (P1) that is similar to (P), but with cost function \(\bar{J}\), and the additional constraint (4). Let \(u^{\star}(t)\) be an optimal control and \(\tilde{\rho}^{\star}(t)\) the corresponding state trajectory response. Then, there exist the multiplier \(\lambda^{\star}(t)\) that together with \(\delta,\beta:\left[t_{0},t_{f}\right]\rightarrow\mathbb{R}\) satisfy the PMP necessary conditions. More precisely,_

\[\mathcal{H}(\rho^{\star},\lambda^{\star},u^{\star},\nu,\mu,\alpha,\beta,t) \leq\mathcal{H}(\rho^{\star},\lambda^{\star},u,\nu,\mu,\alpha,\beta,t)\]

_for all \(t\in\left[t_{0},t_{f}\right]\), and all feasible controls \(u\in\Omega\). Moreover,_

\[\frac{\partial\mathcal{H}}{\partial u} =(\left|\lambda^{\star}\right\rangle)-2\delta\left|\tilde{\rho}^ {\star}\right\rangle)^{T}\tilde{\mathcal{L}}_{u}\left|\tilde{\rho}^{\star} \right\rangle)+2\eta u^{\star}+\beta=0\] \[\frac{\partial\mathcal{H}}{\partial\nu} =2\alpha\nu-\beta\frac{\partial\phi\left(\nu\right)}{\partial \nu}=0\]

_The remaining first-order necessary conditions for the state and costate variables are given as_

\[\left|\hat{\rho}^{\star}\right\rangle\right\rangle =\frac{\partial\mathcal{H}}{\partial\left|\lambda\right\rangle} =\tilde{\mathcal{L}}\left|\tilde{\rho}^{\star}\right\rangle)\,,\quad\left| \tilde{\rho}^{\star}\left(t_{0}\right)\right\rangle)=\rho_{0}\] \[\left|\lambda^{\star}\right\rangle\right\rangle^{T} =\frac{-\partial\mathcal{H}}{\partial\left|\tilde{\rho}\right\rangle }=\tilde{\mathcal{L}}^{T}\left|\lambda^{\star}\right\rangle)-4\delta\tilde{ \mathcal{L}}\left|\rho^{\star}\right\rangle)\,,\left|\lambda^{\star}\left(t_{f} \right)\right\rangle\right\rangle=\lambda_{f}=\mathbf{0}\]

In addition, the transversality condition imposes that

\[\mathcal{H}\left(t_{f}\right)+\Gamma=0\]

For the indicated set of conditions, the extended Hamilton-Pontryagin function is

\[\mathcal{H}(\rho,\lambda,u,\nu,\mu,\alpha,\beta,t)=(\left|\lambda \left(t\right)\right\rangle)-\mu^{T}(t)\nabla_{\rho}h\left(\left|\beta(t) \right\rangle)\right)^{T}\] \[\tilde{\mathcal{L}}\left|\tilde{\rho}\left(t\right)\right\rangle \rangle+\eta u^{2}\left(t\right)+\alpha\nu(t)^{2}+\beta(t)\left(u(t)-\phi \left(\nu\right)\right)\]

in which the state constraint \(h\left(\left|\beta(t)\right\rangle\right\rangle\right)\) and its multiplier \(\mu(t)\) are expressed as

\[h\left(\left|\beta(t)\right\rangle\right))=\left(\begin{smallmatrix}\mathcal{P} \left[\chi(\rho)\right]-P_{0}\\ \alpha P_{0}-\mathcal{P}\left[\chi(\rho)\right]\end{smallmatrix}\right)\leq 0, \quad\mu(t)=\begin{smallmatrix}\mu_{1}(t)\\ \mu_{2}(t)\end{smallmatrix} \tag{6}\]

Therefore, \(\nabla_{\rho}h\left(\left|\beta(t)\right\rangle\right))=\left(\nabla_{\rho} \tilde{P}[\chi(\rho)]\quad-\nabla_{\rho}\tilde{P}[\chi(\rho)]\right)^{T}\), where \(\nabla_{\rho}\tilde{P}[\chi(\rho)]=2\left|\tilde{\rho}(t)\right\rangle)\). Then, the Pontryagin Hamiltonian forms as written in (5) from which the necessary conditions according to the PMP have been indicated.

**Proposition 3**: _Let \(\rho^{\star}(t)\), \(u^{\star}(t)\), \(\lambda^{\star}(t)\) be an optimal trajectory of (P1). Then, \(\rho^{\star}(t)\), \(u^{\star}(t)\), \(\lambda^{\star}(t)\) is a local minimizer of the Pontryagin Hamiltonian (5) as long as \(\alpha\) satisfies the condition_

\[\alpha>\frac{\beta}{2}\varepsilon, \tag{7}\]

_where \(\varepsilon=\max_{\nu\in\mathbb{R}}\left|\frac{\partial^{2}\phi(\nu)}{\partial y ^{2}}\right|\) is a finite bound._

Consider the control input \(\tilde{u}=(u,\nu)\). According to the second-order sufficient condition for local optimality, if the Pontryagin Hamiltonian has a positive definite Hessian with respect to \(\tilde{u}\), then it is guaranteed that \(u^{\star}(t)\) is the local minimizer of the Hessian, i.e., the generalized Legendre-Clebsch (L-C) condition guarantees that over a singular arc, the Pontryagin Hamiltonian is minimized. In this case, the Hessian is given by

\[\mathcal{H}_{\tilde{u}\tilde{u}}=\begin{pmatrix}2\eta&0\\ 0&2\alpha-\beta\frac{\partial^{2}\phi}{\partial y^{2}}\end{pmatrix}>0.\]

Clearly, it is positive definite since \(\eta\) is positive, \(\frac{\partial^{2}\phi}{\partial y^{2}}\) is bounded and \(\alpha\) satisfies (7).

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

In this section, we exploit the newly developed Pontryagin PINN method derived from the theory of functional connection, [6], [9]. We give a short overview on how physics-informed neural networks derived from TFC can be used to solve BVPs. Consider a generic differential equation that needs to be solved to obtain the dynamic vector \(y(t)\in\mathbb{R}^{n}\), being the solution of the system, as follows

\[F\left(t,y\left(t\right),\dot{y}\left(t\right)\right)=0,\quad y\left(t_{k}\right) =y_{k},\quad k\in\left\{\emptyset,1,2,\ldots\right\}\cdot\]

Note that the set in \(k\) can be empty. Table I describes (an adaptation of) the main steps of the application of TFC method developed in [6], [9]. In (8), the function \(g\left(\tau\right):\mathbb{R}\rightarrow\mathbb{R}^{n}\) indicates a user-specified function, and \(\Omega\) is the so-called
switching function. The free function \(g\left(\tau\right)\), as developed in [7] based on the theory of extreme learning machine (ELM), can be modeled by a single hidden layer feedforward neural network, where the summation is over all \(L\) hidden neurons, and \(\sigma(\cdot)\) is the activation function. The output weight \(\alpha_{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. The bias of the \(l\)th hidden node is shown by \(b_{l}\). Now, let proceed with the solution of the two point BVP resulted from the necessary optimality conditions for (\(P_{1}\)) that must be satisfied simultaneously. Taking into account the procedure indicated in Table I, we approximate the state and costate as

\[\begin{split}\left|\,\tilde{p}\right\rangle\left\rangle\,\left( \tau,\xi_{\rho}\right)&=\left(\sigma_{\tilde{p}}\left(\tau \right)-\Omega_{1}\left(\tau\right)\sigma_{\tilde{p}}\left(\tau_{0}\right)- \Omega_{2}\left(\tau\right)\sigma_{\tilde{p}}\left(\tau_{f}\right)\right)^{T} \xi_{\tilde{p}}\\ &\quad+\Omega_{1}\left(\tau\right)\rho_{0}+\Omega_{2}\left(\tau \right)\rho_{f}\\ \left|\,\lambda\right\rangle\left)\left(\tau,\xi_{\lambda}\right)& =\left(\sigma_{\lambda}\left(\tau\right)-\Omega_{2}\left(\tau \right)\sigma_{\lambda}\left(\tau_{f}\right)\right)^{T}\xi_{\lambda}+\Omega_{ 2}\left(\tau\right)\lambda_{f}\end{split}\]

where \(\Omega_{1}\) and \(\Omega_{2}\) are switching functions expressed by, [8],

\[\Omega_{1}\left(\tau\right)=1+\frac{2\left(\tau-\tau_{0}\right)^{ 3}}{\left(\tau_{f}-\tau_{0}\right)^{3}}-\frac{3\left(\tau-\tau_{0}\right)^{2}} {\left(\tau_{f}-\tau_{0}\right)^{2}}\] \[\Omega_{2}\left(\tau\right)=-\frac{2\left(\tau-\tau_{0}\right)^{ 3}}{\left(\tau_{f}-\tau_{0}\right)^{3}}+\frac{3\left(\tau-\tau_{0}\right)^{2}} {\left(\tau_{f}-\tau_{0}\right)^{2}}\]

By taking the derivatives of the approximated expressions of state and costate equation we obtain

\[\begin{split}\left|\,\tilde{p}\right\rangle\left\rangle\,\left( \tau,\xi_{\rho}\right)&=c\left(\sigma_{\rho}^{\prime}\left(\tau \right)-\Omega_{1}^{\prime}\left(\tau\right)\sigma_{\rho}\left(\tau_{0}\right) -\Omega_{2}^{\prime}\left(\tau\right)\sigma_{\tilde{p}}\left(\tau_{f}\right) \right)^{T}\xi_{\rho}\\ &\quad+\Omega_{1}^{\prime}\left(\tau\right)\rho_{0}+\Omega_{2}^{ \prime}\left(\tau\right)\rho_{f}\\ \left|\,\lambda\right\rangle\left)\left(\tau,\xi_{\lambda} \right)&=c\left(\sigma_{\lambda}^{\prime}\left(\tau\right)-\Omega_{ 2}^{\prime}\left(\tau\right)\sigma_{\lambda}\left(\tau_{f}\right)\right)^{T} \xi_{\lambda}+\Omega_{2}^{\prime}\left(\tau\right)\lambda_{f}\end{split}\]

Regarding the control variables, the following functional approximation are introduced

\[u\left(\tau,\xi\right)=\sigma_{u}^{T}\left(\tau\right)\xi_{u},\quad\nu\left( \tau,\xi\right)=\sigma_{\nu}^{T}\left(\tau\right)\xi_{\nu}\]

We also expand the equality constraint multiplier \(\beta\left(\tau,\xi\right)=\sigma_{\beta}^{T}\left(\tau\right)\xi_{\beta}\). In addition, the state constraint multipliers are

\[\mu_{1}\left(\tau,\xi\right)=\sigma_{\mu_{1}}^{T}\left(\tau\right)\xi_{\mu_{1} },\quad\mu_{2}\left(\tau,\xi\right)=\sigma_{\mu_{2}}^{T}\left(\tau\right)\xi_ {\mu_{2}}\]

In line with the ELM algorithm, [7], for the free final time problems, the vector of PoNNs' parameters to be learned is constructed as \(\xi=\left\{\,\xi_{\tilde{p}}\,\,\xi_{\tilde{x}}\,\,\xi_{\tilde{p}}\,\,\xi_{ \tilde{p}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\, \xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\xi_{ \tilde{u}}\,\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\, \,\xi_{\tilde{u}}\,\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{ \tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{ \tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\, \xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\, \xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\, \xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\, \xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\, \xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\, \xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{ \tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\tilde{u}}\,\xi_{\
which is mapped to the extended superoperator \(\mathcal{\hat{Z}}\). We represent the results of (3) to show the element wise time behaviour of the density operator. For all results, the state is initiated as \(\rho_{11}=1\), with no coherence between different states. First, we neglect the dissipation part, so the solution reduces to the resolution of the Liouville-von Neumann equation, see Fig 1(a). As the next case, we consider the dissipation while there is no coherent driving. The population of the excited state experiences an exponential decay, see Fig 1(b). Afterward, it becomes feasible to compute the behavior of a dissipative quantum system that undergoes both coherent driving and decay. In such cases, oscillations and decay co-occur as both behaviors exist simultaneously, see Fig 1(c). In the following, we plot the state evolution under the action of optimal control. We initiate by the pure state \(\rho_{11}=1\) and target to \(\rho_{00}=1\), while following the constraints on purity preservation. The population evolution is shown in Fig 1(d). According to the data depicted in the graph, there is a clear trend of exponential decay in the population of the initial state, while there is a corresponding upward trend in the population of the target as time passes. In order to check the security level of reaching the target, we have to calculate the transition probability known as the quantum fidelity. The term fidelity refers to the degree of similarity between two quantum states, typically the system state \(\rho(t)\) and target \(\sigma\). We study fidelity in terms of state purity computed by \(\mathcal{F}\left(\rho,\sigma\right)=\frac{\left(tr(\rho\sigma)\right)^{2}}{P( \rho)P(\sigma)}\), [10]. Since our target \(\sigma\) is a pure state, i.e., \(\sigma=\left|\psi\right\rangle\left\langle\psi\right|\), fidelity can simply be assessed as \(\mathcal{F}\left(\rho,\sigma\right)=\frac{\left\langle\psi\rho\left|\psi \right\rangle\right\rangle}{P(\rho)}\). Figure 2 shows the effects of purity preservation on fidelity.

## VII Conclusions

In this study, we proposed a framework for preserving quantum purity during a quantum state transition problem. Specifically, we aim to minimize both the time and energy required for the transition, while adhering to the Lindblad master equation, which governs the system dynamics. To achieve this goal, we employed a combination of two techniques, namely the Gamkrelidze revisited method and the concept of saturation functions and system extensions. The resulting boundary value problem is then solved using Pontryagin neural networks, which are well-suited for this type of problem formulation. Our approach allows us to preserve the purity of the quantum state during the transition while minimizing the resources required. Furthermore, we analyze the effects of state constraints on the evolution of quantum fidelity, providing a numerical example for a two-level system. As future work, we intend to extend our approach to higher-order dimensional systems, which could yield valuable insights and applications in various fields, including quantum computing and quantum communication. Our results have important implications for the practical implementation of quantum state transitions.
