\sqrt{d \gamma} \bar{\mathcal{E}} \label{eqn:4LEoMbP2}\\
\partial_{\tau}\bar{S} &= i \left(\delta_g - \delta_s \right) \bar{S} + i\Omega^*(\tau)\left( \tilde{\mu}_{1s}\bar{P}_1+\tilde{\mu}_{2s}\bar{P}_2 \right)\label{eqn:4LEoMbS}\end{aligned}$$ for the Lagrange multipliers and their boundary conditions ($\bar{S}(\tilde{z},T) = S(\tilde{z},T)$ and $\bar{\mathcal{E}}(1,\tau)=\bar{P}_1(\tilde{z},T)=\bar{P}_2(\tilde{z},T)=0$). The gradient along $\Omega(\tau)$ is now modified to $$\begin{aligned}
\frac{\delta J}{\delta \Omega(\tau)} &= -2 \int_0^1 d\tilde{z}\, \mathrm{Im}\Big[\bar{S}^*\left(\tilde{\mu}_{1s} P_1+\tilde{\mu}_{2s} P_2 \right) \nonumber \\ &-\left(\tilde{\mu}_{1s}\bar{P}_1+\tilde{\mu}_{2s}\bar{P}_2 \right) S^* \Big]. \label{eqn:4Lgrad}\end{aligned}$$

It is clear that if $\tilde{\mu}_{2g}=\tilde{\mu}_{2s}=0$, all of the expressions from Sec. \[sec:3L\] are recovered. In the limit where $\Delta_e \gg \Omega_m,\sqrt{d \gamma/T_1}$, then $P_2$ can be adiabatically eliminated and the results of Sec. \[sec:3L\] are again recovered. Thus, the extension to a four level system reproduces the results of the three level case in the appropriate limits.

![(Color online) Optimal control pulses for quantum dot photon storage in a three level system (short-dotted green), the 4L+ four level scenario (solid blue), and the 4L- four level scenario (long-dotted, red).[]{data-label="fig:fig6"}](fig_6.eps){width="0.95\columnwidth"}

To gain some insight into the ramifications of including a fourth level in an intermediate regime of $\Delta_e$, we directly compare the results of the gradient ascent algorithm applied to the three level case to that for two scenarios of the four level case. For all calculations, we again store a resonant quantum dot 