# Predictive Modeling of Light-Matter Interaction in One Dimension: A Dynamic Deep Learning Approach
## 2 Methods
### Numerical Discretization  
The numerical discretization is carried out in 1D space, considering the case of a single transition based on two-level electron dynamics, using the FDTD method. The discretization for the three-level case is similar and straightforward. Here the electric field and the associated polarization density are discretized in space and time, whereas the electron populations are discretized only in time as it is assumed that the interaction medium is homogenous in density over space. The FDTD discretization of Equations (1)-(4) is carried out as follows [5]:  
\(x:\)_Spatial coordinate, \(t:\)_ Time, \(E(x,t)=E(i\Delta x,j\Delta t)\to E(i,j),\quad i=1,2,\ldots,M_{i}\), \(j=1,2,\ldots,M_{j}\)  
\(E(x+\Delta x,t)-E(x,t)\to E(i+1,j)-E(i,j)\), \(E(x,t+\Delta t)-E(x,t)\to E(i,j+1)-E(i,j)\)  
\(\frac{\partial E}{\partial x}=\frac{E(i+1,j)-E(i-1,j)}{2\Delta x}\), \(  
Discretization of the wave equation:  
\[ \begin{split} E(i,j+1)=E(i&+1,j)\left\{\frac{2\Delta t^ {2}}{0\Delta x^{2}(\sigma\Delta t+2\kappa_{0}(i,j))}\right\}+E(i,j)\left\{\frac{4 \omega_{2}\omega_{3}(i,j)\Delta x^{2}-2\Delta t^{2}}{0\Delta x^{2}(\sigma \Delta t+2\kappa_{0}(i,j))}\right\}\\ &+E(i-1,j)\left\{\frac{2\Delta t^{2}}{0\Delta x^{2}(\sigma \Delta t+2\kappa_{0}(i,j))}\right\}\\ &+E(i,j-1)\left\{\frac{(\sigma\Delta t-2\kappa_{0}(i,j))}{(\sigma \Delta t+2\kappa_{0}(i,j))}\right\}\\ &-\frac{2}{(\sigma\Delta t+2\kappa_{0}(i,j))}\{P(i,j+1)-2P(i,j) +P(i,j-1)\}\end{split}  \tag{12}\]  
Discretization of the Lorentz dispersion equation:  
\[ \begin{split} P(i,j+1)=P(i,j-1)\left\{\frac{(\Gamma\Delta t-2)}{ (\Gamma\Delta t+2)}\right\}+\frac{2(N_{1}(j)-N_{2}(j))e^{2}\Delta t^{2}E(i,j) }{(\Gamma\Delta t+2)m}\\ +\frac{2}{(\Gamma\Delta t+2)}\left\{2P(i,j)-\omega_{0}{}^{2} \Delta t^{2}P(i,j)+\frac{\omega_{0}{}^{2}\Delta t^{2}P^{2}(i,j)}{(N_{1}(j)-N_ {2}(j))cd}\right.\\ \left.-\frac{\omega_{2}{}^{2}\Delta t^{2}P^{3}(i,j)}{(N_{1}(j)-N_ {2}(j))^{2}e^{2}d^{2}}\right\}\end{split}  \tag{13}\]  
Discretization of the rate equations:  
\[N_{1}(j+1)=N_{1}(j-1)+2\Delta t\left(-\Gamma(j)N_{1}(j)+\frac{N_{2}(j)}{\tau_ {21}}\right)-\frac{2}{h\omega_{R}}E(j)(P(j+1)-P(j-1)) \tag{14}\]  
\[N_{2}(j+1)=N_{2}(j-1)+2\Delta t\left(\Gamma(j)N_{1}(j)-\frac{N_{2}(j)}{\tau_{ 21}}\right)+\frac{2}{h\omega_{R}}E(j)(P(j+1)-P(j-1)) \tag{15}\]  
These discretized equations are solved together with the initial and boundary conditions of a given problem, which will be stated in the analyzed cases in Section 3. For the stability of the numerical solutions, the time step \(\Delta t\) must be chosen to be smaller than the spatial step divided by the speed of light in free space (\(\Delta t<\Delta x/c\)), which is known as the Courant condition [5]. Multilayer-Perceptron-Based Neural Networks for Modeling 1D Light-Matter Interaction under the Slowly Varying Envelope Approximation  
The FDTD simulations generate an output dataset for each input dataset given by the user. To process these input/output datasets for modeling the underlying system, we consider the simplest neural network that can be mathematically expressed through plain matrix multiplication between the network weights and the input data. In matrix notation, the output data \(y\) of a single-layer neural network are expressed in terms of the given input data x (we use brackets for representing network weights and parenthesis for input/output data). \[ \begin{bmatrix}y(1)\\.\\ y(n)\end{bmatrix} =L_{1}\left\{ \begin{bmatrix}w_{1}[1;1]&\cdots&w_{1}[1;K_{1}] \\ \vdots&\ddots&\vdots\\ w_{1}[n;1]&\cdots&w_{1}[n;K_{1}]\end{bmatrix}\begin{bmatrix}x(1)\\.\\ x(K_{1})\end{bmatrix}