of magnitude more intense than that required for resonant schemes [@ref:Reim_NatPhot10] for the same optical depth $d$ and hence the same efficiency.

A gradient ascent algorithm simply starts with a trial solution and proceeds to the optimal solution by moving along the gradient of the quantity to be maximized. At each step in the algorithm, the gradient is determined and the control pulse is updated. Mathematically, this replacement rule is $$\Omega(\tau) \rightarrow \Omega(\tau)+\lambda \frac{\delta J}{\delta \Omega(\tau)},$$ where $\lambda$ is the step size parameter and $J$ is the quantity to be maximized. In the case of photon storage, we want to maximize the storage efficiency subject to the constraint that all of the dynamical variables fulfill the equations of motion (Eq. \[eqn:3LEoME\]-\[eqn:3LEoMS\]). Thus, $J$ takes the form $$\begin{aligned}
J &=\int_0^1 d\tilde{z}\,S(\tilde{z},T)S^*(\tilde{z},T) \nonumber \\
&+\int_0^T d\tau \int_0^1 d\tilde{z}\,\left\{ \bar{\mathcal{E}}^* \left[ -\partial_{\tilde{z}} \mathcal{E} + i \tilde{\mu}_{1g}\sqrt{d \gamma}P_1 \right] +c.c.\right\} \nonumber \\
&+\int_0^T d\tau \int_0^1 d\tilde{z}\, \Big\{ \bar{P}_1^*\Big[ \left(-\partial_{\tau}+i \delta_g-\gamma \right) P_1+i \tilde{\mu}_{1s} \Omega(\tau) S  \nonumber \\
&+ i \tilde{\mu}_{1g} \sqrt{d \gamma} \mathcal{E} \Big] +c.c. \Big\} \nonumber \\
&+\int_0^T d\tau \int_0^1 d\tilde{z}\,\Big\{ \bar{S}^*\Big[-\partial_{\tau}S+ i \left(\delta_g - \delta_s \right) S \nonumber \\
&+ i \tilde{\mu}_{1s}\Omega^*(\tau)P_1  \Big] +c.c. \Big\}, \label{eqn:3LJ}\end{aligned}$$ where the first term is $\eta_s$ 