# Optimized Computation of Tight Focusing of Short Pulses Using Mapping to Periodic Space
## 2 Materials and Methods
### Mapping to and from the Computational Subregion
In order to set the initial conditions we need to perform the following mapping \(\mathbf{T}(\mathbf{R})\): the field state of each point \((\tilde{x},\tilde{y},z)\) of the simulated subregion is assigned to that of point \((x,y,z)\) of the original unlimited space, for which the problem is stated:  
\[(\tilde{x},\tilde{y},\tilde{z})=\mathbf{T}(\mathbf{R})=\left(x_{min}+D\left\{ \frac{x-x_{min}}{D}\right\},y,z\right). \tag{13}\]  
Here \(\{\cdot\}\) is the fractional part of an argument. Unfortunately, there is no reverse mapping. However, by considering the geometrical propagation of the pulse, we can \"cut out\" the primary pulse from the periodic space. We do so in the following way: for each point \(\mathbf{R}\) of the original space the field state \(\mathbf{u}=(\mathbf{E},\mathbf{B})\) is assigned using the field state \(\tilde{\mathbf{u}}(\mathbf{T}(\mathbf{R}))\) within the simulated region according to:  
Figure 3: Schematic illustration of the proposed method in 3D space (**a**) and the cross-section in the \(x\)-\(y\) plane at \(z=0\) (**b**). The restriction given by Equation (12) is derived from requiring that the initial (red) and replicated (blue) pulses do not overlap. The shaded region is the subregion where the simulation is performed. \[\mathbf{u}(\mathbf{R},t)=\tilde{\mathbf{u}}(\mathbf{T}(\mathbf{R}))\cdot I_{S(t)}( \mathbf{R}) \tag{14}\]  
\[I_{S(t)}(\mathbf{R})= \begin{cases}0,&(r(t)<0)\text{ and }((R\geq-l(t))\text{ or }(R<-r(t))\text{ or }(x>0))\\ 0,&(l(t)\leq 0)\text{ and }(r(t)\geq 0)\text{ and }(x<0)\text{ and }(R>L)\\ 0,&(l(t)\leq 0)\text{ and }(r(t)\geq 0)\text{ and }(x\geq 0)\text{ and }(R>l(t))\\ 0,&(l(t)>0)\text{ and }((R\leq l(t))\text{ or }(R>r(t))\text{ or }(x<0))\\ 1,&\text{in other cases}\end{cases}  \tag{15}\]  
\[l(t)=-R_{max}+ct,\ r(t)=-R_{min}+ct,\ \mathbf{R}=(x,y,z),\ R=||\mathbf{R}|| \tag{16}\]  
The described method for cutting out a single pulse from the periodic sequence is shown in Figure 2 using black contours. This method does not always provide an ideal cut-off of secondary pulses, which can still fall into the region \(S(t)\) denoted by Equations (15) and (16), if \(D\) is not large enough. However, in practice, it is usually sufficient to take the parameter \(D\) equal to \(3L-4L\) in order to avoid notable presence of the secondary pulses. However, depending on the shape of the transverse component of the spherical wave, the fringes may show up in the obtained results and indicate the necessity of choosing larger value of \(D\). The choice of the parameter \(D\) is described in more detail in Section 3.1. We would like to conclude this section by making a few general remarks. Firstly, the choice of \(R_{0}\) in many cases is determined by the transition from the geometrical to wave optics. If the deviations from the spherical shape of the phase front are sufficiently minor, one can combine the proposed method with the computation of the earlier field evolution within geometrical optics. This implies advancing the pulse along the rays pointing to the geometrical center in combination with the adjustment of the field amplitude inverse proportionally to the distance to the center. Note that the effect of imperfect phase front can be also estimated and taken into consideration. Anyway, in many cases it should be possible to compute the pulse at the entrance to the near-field zone, which our method is designed for. Secondly, our method makes use of the solver periodicity along the main direction of propagation (\(x\) axis) and effectively reduces the computation in a cube to the computation in a thin layer that spans to a large distance along the transverse directions (\(y\) and \(z\) axes) only. Using this as a basis, one can further duplicate the pulse several times along the transverse directions, making use of the solver periodicity in these directions and of the linearity of the Maxwell's equations. In the considered case the effective speedup scales as \(R_{0}\), whereas the described follow-up development would yield a speedup that scales as \(R_{0}^{3}\).