= Solution
A <quantum optimal control> problem specifies a terminal task, admissible fields and resource costs. Pure-state transfer can minimize $1-|\langle\psi_d|\psi(T)\rangle|^2$; mixed-state transfer on an accessible spectral orbit can minimize $\|\rho(T)-\rho_d\|_{\mathrm{HS}}^2/2$; preparing an observable value can minimize $-\operatorname{Tr}(O\rho(T))$. A gate task can minimize $1-|\operatorname{Tr}(U_d^\dagger U(T))|^2/n^2$ for an $n$-dimensional <Hilbert space>, which is insensitive to an overall phase. These different terminal functions encode different tasks even when the dynamics are the same. Fluence penalties, amplitude bounds, bandwidth limits, or the total duration can be added to express experimental requirements.
For example, minimize
$$
J[f]=\Phi(\rho(T))+\frac12\sum_m\lambda_m\int_0^T f_m(t)^2\,dt,\qquad \lambda_m>0,
$$
subject to $\dot\rho=\mathcal L_f(\rho)$ and a specified $\rho(0)$. For a closed system, $\mathcal L_f(\rho)=-i[H_0+\sum_mf_mH_m,\rho]$; for an open system add the known <Lindblad equation> dissipator. Introducing a Hermitian <costate> $\Lambda$ and taking the <Hilbert-Schmidt inner product> gives the forward and backward equations and functional gradient
$$
\dot\rho=\mathcal L_f(\rho),\qquad \dot\Lambda=-\mathcal L_f^\dagger(\Lambda),\qquad \Lambda(T)=\nabla_\rho\Phi(\rho(T)),
$$
$$
\boxed{\frac{\delta J}{\delta f_m(t)}=\lambda_mf_m(t)+\operatorname{Tr}\left(\Lambda(t)\frac{\partial\mathcal L_f}{\partial f_m}(\rho(t))\right)}.
$$
For Hamiltonian controls the second term is $\operatorname{Tr}(\Lambda[-iH_m,\rho])$. The adjoint is defined by the <Hilbert-Schmidt inner product>; in particular, the closed-system costate equation is $\dot\Lambda=-i[H,\Lambda]$, integrated backward from its terminal condition. An unconstrained interior optimum has zero gradient; amplitude constraints replace this by the corresponding constrained first-order conditions.
Numerically, represent the fields by piecewise constant amplitudes $f_{m,j}$ on slices, or by a finite basis $f_m(t)=\sum_j a_{mj}b_j(t)$ such as splines or Fourier modes. For piecewise constant closed-system dynamics, $U_j=e^{-iH_j\Delta t}$ and $U(T)=U_K\cdots U_1$. Forward products and backward costates provide all slice derivatives in one pair of propagations. In <gradient ascent pulse engineering>, update these amplitudes to improve the chosen objective, with projection onto amplitude bounds if needed. The exact slice derivative is the <derivative of the matrix exponential>
$$
\frac{\partial U_j}{\partial f_{m,j}}=-i\int_0^{\Delta t}e^{-iH_j(\Delta t-\tau)}H_m e^{-iH_j\tau}\,d\tau.
$$
Replacing it by $-i\Delta t H_mU_j$ is only a short-slice approximation when $H_j$ and $H_m$ do not commute. Other <gradient descent> or <nonlinear optimization> methods can optimize the same finite parameter set; <direct-adjoint looping> avoids a separate dynamical simulation for each control coefficient.
A pulse is accepted after propagation with the actual constrained waveform confirms its terminal error and resource use. Sampling model uncertainties in the objective can favor robust pulses. Nonconvexity means a numerical stationary point need not be a global optimum, so initial guesses, convergence tolerances and a sufficiently resolved time grid matter.
Back to article page