## 3 Algorithms  
The polarization vector due to the Kerr effect at the time \(t=\Delta_{t}\Big{(}s-\frac{1}{2}\Big{)}\) can be written as \(\vec{P}^{s-\frac{1}{2}}_{Kerr}=\alpha\epsilon_{0}\chi_{0}^{(3)}|\vec{E}^{s- \frac{1}{2}}|^{2}\vec{E}^{s-\frac{1}{2}}\); however, afterwards, at the instant \(\Delta_{t}\Big{(}s+\frac{1}{2}\Big{)}\), in order to define a full explicit approach, we have to make the approximation \(\int_{0}^{\big{(}s+\frac{1}{2}\big{)}\Delta_{t}}\delta(t-\tau)|\vec{E}(\vec{r },\tau)|d\tau\simeq\int_{0}^{\big{(}s-\frac{1}{2}\big{)}\Delta_{t}}\delta(t- \tau)|\vec{E}(\vec{r},\tau)|d\tau\). This approximation was demonstrated in [3] and leads to:  
\[\vec{P}^{s+\frac{1}{2}}_{[PERSON]}\simeq\alpha\epsilon_{0}\chi_{0}^{(3)}\vec{E}^{ s+\frac{1}{2}}\int_{0}^{\big{(}s-\frac{1}{2}\big{)}\Delta_{t}}\delta(t-\tau)| \vec{E}(\vec{r},\tau)|d\tau\]  
This approximation \(\vec{P}^{s+\frac{1}{2}}_{[PERSON]}\simeq\alpha\epsilon_{0}\chi_{0}^{(3)}|\vec{E} ^{s-\frac{1}{2}}|^{2}\vec{E}^{s+\frac{1}{2}}\) is valid under particular physical conditions explained in Section 4. To compute the nonlinear Raman effect, we make an analogous approximation. Considering that in this case there is no instantaneous cause-effect relationship, it is evident that the approximation is justified [18]. Therefore, by defining the scalar magnitude \(|\vec{Q}_{a}(\vec{r},t)|\) that is defined from the vector \(\vec{Q}_{a}(\vec{r},t)\), which could be considered as an instantaneous anisotropic Raman conductivity, we can discretize the Raman polarization vectors at the instants \(\Delta_{t}\Big{(}s-\frac{1}{2}\Big{)}\) and \(\Delta_{t}\Big{(}s+\frac{1}{2}\Big{)}\) as follows: \(\vec{P}^{s-\frac{1}{2}}_{[PERSON]}=|\vec{Q}_{a}^{s-\frac{1}{2}}|\vec{E}^{s-\frac {1}{2}}\) and \(\vec{P}^{s+\frac{1}{2}}_{[PERSON]}=|\vec{Q}_{a}^{s-\frac{1}{2}}|\vec{E}^{s+\frac{ 1}{2}}\). Where \(|\vec{Q}_{a}^{s+\frac{1}{2}}|\) is updated from \(|\vec{Q}_{a}^{s-\frac{1}{2}}|\) by means of:  
\[|\vec{Q}_{a}^{s+\frac{1}{2}}|=|\vec{Q}_{a}^{s-\frac{1}{2}}|+\overline{\vec{S}} \big{(}(s-nt(k))\Delta_{t}\big{)}|\vec{E}^{s-\frac{1}{2}}|^{2}\]  
where the Raman response function for a particular medium is modeled by \(\overline{\vec{g}}(t)=\Psi e^{-\frac{t}{2}}\sin\Big{(}\frac{t}{\tau_{1}}\Big{)}u (t)\) and the time delay \(nt(k)=nt_{0}-\frac{H_{c}(k-k_{0})\Delta_{t}n_{medium}}{c_{0}\Delta t}\), being \(nt_{0}=\frac{H_{c}}{c_{0}\Delta t}\sum\limits_{i=1}^{N}\ell_{i}n_{i}\), depends on the refractive index of the media \(n_{i}\) as well as the location of the electromagnetic field in the media (Figure 1). Here \(u(t)\) is the Heaviside step function:  
\[u(t)= \begin{cases}0&\text{if }t\leq 0\\ 1&\text{if }t>0\end{cases} \]In this way, we obtain the Raman current density and the Kerr current density:  
\[\vec{J}^{n}_{[PERSON]}=\frac{\vec{P}^{n+\frac{1}{2}}_{[PERSON]}-\vec{P}^{s-\frac{1}{2}}_{ [PERSON]}}{\Delta_{t}}=\frac{\alpha\epsilon_{0}\chi_{0}^{(3)}|\vec{E}^{s-\frac{1}{2}}| ^{2}}{\Delta_{t}}\Big{(}\vec{E}^{s+\frac{1}{2}}-\vec{E}^{s-\frac{1}{2}}\Big{)}\]  
\[\vec{J}^{n}_{Raman}=\frac{\vec{P}^{s+\frac{1}{2}}_{Raman}-\vec{P}^{s-\frac{1 }{2}}_{Raman}}{\Delta_{t}}=\frac{|\vec{Q}^{s-\frac{1}{2}}_{a}|}{\Delta_{t}} \Big{(}\vec{E}^{s+\frac{1}{2}}-\vec{E}^{s-\frac{1}{2}}\Big{)}\]  
The current density updating associated to the metal is given by the equation:  
\[\vec{J}^{s+\frac{1}{2}}_{Metal}=g_{a}\vec{J}^{s-\frac{1}{2}}_{Metal}+g_{b} \Big{(}\vec{E}^{s+\frac{1}{2}}-\vec{E}^{s-\frac{1}{2}}\Big{)}\]  
where \(g_{a}=\mathcal{R}\Big{[}\frac{2-b\Delta_{t}}{2+b\Delta_{t}}\Big{]}\) and \(g_{b}=\mathcal{R}\Big{[}\frac{\alpha\epsilon_{0}}{2+b\Delta_{t}}\Big{]}\). The operator \(\mathcal{R}[]\) calculates the real part of these complex numbers.