6.1 Introduction

Simulations are instrumental in the field of nanophotonics, helping to shed light on light-matter interaction at the nanoscale, providing a critical complement to experimental investigations of complex systems, e.g., systems involving irregular shapes, exotic materials, or many interacting devices. Such simulations are important for many purposes, including for device design and optimization, for understanding device operation, for explaining experiments, and for discovering and predicting new phenomena. More cost effective than running multiple experiments, one can quantitatively investigate the effects of changing materials, geometries, physical effects, etc, one by one, but also gain insight through powerful visualization and movies.

Since the seminal paper on FDTD [2], the method has been applied to many areas of electromagnetism. Over the past decade, the FDTD method has become the most largely used computational technique in nanophotonics [3, 4]. A Google Scholar search of “FDTD and nanophotonics” confirms this, with double the number of hits than the next most used method, FEM (finite element method). FDTD is popular because it is relatively simple to implement, and it is extremely versatile, capable of modelling dispersive materials, nonlinearity, nonlocality, and almost any physical system that can be modeled via a macroscopic polarization field. Due to its near-linear scaling in parallel processing, it can be applied to ever larger problems, as larger and larger computational resources become available.

This paper follows the set of three lectures on simulations in nanophotonics, presented at the Quantum Nano-Photonics summer school in Erice Italy in the summer of 2017. Focusing on FDTD, the first lecture consisted of a pedagogical overview (complemented by class exercises) of the basics of the Yee algorithm and its inherent numerical dispersion and stability condition; these are reviewed for the novice in Sect. 6.2.

The next lecture focused on putting this into practice, by first discussing other ingredients needed for a successful simulation, including sources of excitation, boundary conditions, material models, and data collection/monitors in both the time and frequency domains. This was followed in the third lecture by a class exercise, in which students set up and ran an FDTD simulation on the fly, thanks to Lumerical Solutions Inc [5], which provided each participant with temporary licenses to their FDTD commercial software. This in-class example (scattering from a gold nanosphere) will be briefly described below in Sect. 6.3.

Advanced topics were introduced, such as grid limitations and convergence issues, high performance computing and scalability, advanced radiation sources such as tightly focused beams, and advanced material models (dispersive and nonlinear materials, plasmonic materials, nonlocal plasma models); a selection of material models is presented in Sect. 6.4. Examples from our own work that illustrate why simulations can be so powerful are presented in Section 5. These include understanding why colour is generated from laser-irradiated metallic surfaces, where nonlinear emission originates in hybrid dielectric/metallic nanoantennas, and the design of a plasmonic metasurface for generating structured nonlinear light.

6.2 FDTD Basics

6.2.1 Algorithm

FDTD uses finite differencing to solve the macroscopic Maxwell’s equations in the time domain. They are (in SI units):

$$\displaystyle \begin{aligned} \frac{\partial\mathbf{D}(\mathbf{r},t)}{\partial t}=\mathbf{\nabla}\times\mathbf{H}(\mathbf{r},t)-{\mathbf{J}}_{free}(\mathbf{r},t), {} \end{aligned} $$
(6.1)
$$\displaystyle \begin{aligned} \frac{\partial\mathbf{B}(\mathbf{r},t)}{\partial t}=-\mathbf{\nabla}\times\mathbf{E}(\mathbf{r},t), {} \end{aligned} $$
(6.2)
$$\displaystyle \begin{aligned} \mathbf{\nabla}\cdot\mathbf{D}(\mathbf{r},t)=\rho_{free}(\mathbf{r},t), {} \end{aligned} $$
(6.3)
$$\displaystyle \begin{aligned} \mathbf{\nabla}\cdot\mathbf{B}(\mathbf{r},t)=0, {} \end{aligned} $$
(6.4)

where E is the electric field, B the magnetic field, D the displacement field, H the magnetizing fields, J free is the free current density, and ρ free the free charge density, with constitutive relations to relate E and B to D, H and J free

$$\displaystyle \begin{aligned} \mathbf{D}(\mathbf{r},t)=\varepsilon_0\mathbf{E}(\mathbf{r},t)+\mathbf{P}(\mathbf{r},t), {} \end{aligned} $$
(6.5)
$$\displaystyle \begin{aligned} \mathbf{H}(\mathbf{r},t)=\frac{1}{\mu_0}\mathbf{B}(\mathbf{r},t)+\mathbf{M}(\mathbf{r},t), {} \end{aligned} $$
(6.6)

where M and P are the magnetization and polarization, defined by microscopic bound charges and currents, respectively. For example, linear optical response can be written in its most general form as

(6.7)

where is the linear susceptibility tensor.

These relations are not necessarily simple, depending on the system under study. FDTD advances the electric and magnetic fields in time by finite differencing all the derivatives in Eqs. (6.1) and (6.2) via a central difference, in order to keep second-order numerical accuracy, i.e.,

$$\displaystyle \begin{aligned} \frac{df}{dx}=\frac{f(x+h/2)-f(x-h/2)}{h}+O(h^2). \end{aligned} $$
(6.8)

From Eqs. (6.1) and (6.2), we see that central differencing forces the electric and magnetic fields to be evaluated at different times (i.e., leap frog in time). For example, considering Eq. (6.2) evaluated at time t and discretized in time with time step Δt, for the LHS we have

$$\displaystyle \begin{aligned} \frac{\partial\mathbf{B}(\mathbf{r},t)}{\partial t}\approx\frac{{\mathbf{B}}^{t+\varDelta t/2}-{\mathbf{B}}^{t-\varDelta t/2}}{\varDelta t}. \end{aligned} $$
(6.9)

The RHS must also be evaluated at time t, which means that all the E fields are needed at time t, unlike the B fields which are at t ± Δt∕2, then we get an update equation for B from quantities at earlier times, i.e.,

$$\displaystyle \begin{aligned} {\mathbf{B}}^{t+\varDelta t/2}={\mathbf{B}}^{t-\varDelta t/2}-\varDelta t(\mathbf{\nabla}\times\mathbf{E})^t. \end{aligned} $$
(6.10)

If we now evaluate Eq. (6.1) at time t + Δt∕2 in a similar way, we then get

$$\displaystyle \begin{aligned} {\mathbf{D}}^{t+\varDelta t}={\mathbf{D}}^{t}+\varDelta t(\mathbf{\nabla}\times\mathbf{H})^{t+\varDelta t/2}-\varDelta t{\mathbf{J}}^{t+\varDelta t/2}, \end{aligned} $$
(6.11)

thus again, D at t + Δt is updated using previous values of time. The algorithm thus proceeds as a leap frog in time, as depicted in Fig. 6.1.

Fig. 6.1
figure 1

Leap frog scheme for the temporal update of the fields

Thus far we have considered the time derivatives, what about the spatial derivatives contained within the curl operator? We start with the update equation for B x in continuous spatial coordinates

$$\displaystyle \begin{aligned} B_x^{t+\varDelta t/2}=B_x^{t-\varDelta t/2}-\varDelta t\Bigg(\frac{\partial E_z^t}{\partial y}-\frac{\partial E_y^t}{\partial z}\Bigg), \end{aligned} $$
(6.12)

and by applying the central differencing to both spatial derivatives we obtain:

$$\displaystyle \begin{aligned} \begin{aligned} B_x^{x,y,z,t+\varDelta t/2}=B_x^{x,y,z,t-\varDelta t/2}-\frac{\varDelta t}{\varDelta y}\left(E_z^{x,y+\varDelta y/2,z,t}-E_z^{x,y-\varDelta y/2,z,t}\right)+\\+\frac{\varDelta t}{\varDelta z}\left(E_y^{x,y,z+\varDelta z/2,t}-E_y^{x,y,z-\varDelta z/2,t}\right). \end{aligned} \end{aligned} $$
(6.13)

We see that E z and E y need to be evaluated in “leapfrogged” spatial positions with respect to each other, and to B x. This is depicted in Fig. 6.2, where we see that all field components are at the same x, however they are displaced from each other in y and z. This absence of colocation in space is a direct consequence of requiring the algorithm to be of 2nd order accuracy.

Fig. 6.2
figure 2

Curl scheme for the update of one field component

The computational grid cell with these field components staggered from each other was first introduced by Yee in the 1960s [2], and it is called the Yee cell. Only locally known fields are required for updating the field values on the Yee cell via the FDTD algorithm, which makes the algorithm suitable for parallelization via domain decomposition [1].

6.2.2 Numerical Dispersion and Stability

The Yee algorithm implementation discussed above is on a rectangular grid, which causes an inherent directionality. Thus the update equations cause a non-physical dispersion that depends on propagation direction. They also require that strict conditions be met to ensure numerical stability. This provides fundamental limits on how large the discretization can be for a physically and numerically valid solution, and is the reason that FDTD solutions can require large computational resources to execute.

To illustrate these points, we consider the simplest case, light propagation in vacuum. The free-space dispersion relation for a plane wave of frequency ω and wavevector (k x, k y, k z) is given by

$$\displaystyle \begin{aligned} \frac{\omega ^2}{c^2}=k_x^2+k_y^2+k_z^2. \end{aligned} $$
(6.14)

Now considering a plane monochromatic wave trial solution for the field components, and substituting these into the FDTD update equations yields [6]

$$\displaystyle \begin{aligned} \begin{array}{rcl} \frac{\omega ^2}{c^2} \Bigg(\frac{\sin{}(\omega \varDelta t /2)}{\omega \varDelta t /2}\Bigg)^2 &\displaystyle = &\displaystyle k_x^2 \Bigg(\frac{\sin{}(k_x \varDelta x /2)}{k_x \varDelta x /2}\Bigg)^2 +\\ &\displaystyle &\displaystyle k_y^2 \Bigg(\frac{\sin{}(k_y \varDelta y /2)}{k_y \varDelta y /2}\Bigg)^2 +\\ &\displaystyle &\displaystyle k_z^2 \Bigg(\frac{\sin{}(k_z \varDelta z /2)}{k_z \varDelta z /2}\Bigg)^2, \end{array} \end{aligned} $$

where in the limit of infinitely small time and space steps, we retrieve the ideal dispersion relation.

It is illustrative to neglect for the moment the discreteness in time, and consider only propagation along the x direction, with k = k x. Then we obtain for the phase velocity

$$\displaystyle \begin{aligned} v_p = \frac{\omega}{k_x} = c \Big(\frac{\sin{}(k_x \varDelta x /2)}{k_x \varDelta x /2}\Big). \end{aligned} $$
(6.15)

This places restrictions on how large Δx may be for a given propagation constant, and thus a given wavelength. For example, if one chooses Δx = λ∕10, then we obtain a phase velocity of 0.984c. This value of Δx is often used as the maximum tolerable spatial discretization.

Now consider a propagation direction that is 45 degrees in the xy plane (assuming a uniform grid) with a propagation vector of \((k/\sqrt {2}, k/\sqrt {2}, 0)\). Then the grid discretization of Δx = Δy = λ∕10 yields a phase velocity of 0.992c, which is not the same as propagation along x only, hence leading to numerical dispersion that is direction dependent, imposed by the rectangular grid.

To examine numerical stability of the Yee algorithm we extend the dispersion relation for the update equations above to the complex frequency plane, setting ω to have a real (ω R) and imaginary (ω I) component. Whenever there is a non-zero ω I, there is the possibility for exponentially growing solutions, so we need to impose ω I = 0. This provides a condition on the discretization of time, such that the maximum allowed Δt is given by the Courant stability condition [6]

$$\displaystyle \begin{aligned} \varDelta t \le =\frac{1}{c \sqrt{1/(\varDelta x)^2+1/(\varDelta y)^2+1/(\varDelta z)^2 }}. \end{aligned} $$
(6.16)

While this condition ensures the numerical stability of solutions, it does not guarantee physical solutions. In lecture, the following question was posed to the students: using this condition, with what speed does information travel from one side of a grid cell to the other assuming a uniform 3D grid? The answer is \(v=\varDelta x / \varDelta t = \sqrt {3} c\), faster that the speed of light! Taflove and Hagness illustrate the effects of superluminal propagation of a square pulse in one dimension [6]. While this is drastically reduced for a smooth pulse, it still does exist, though in practice is a very small error. In the example presented in lecture, these components were eight orders of magnitude smaller than the peak of the pulse.

While we discussed here the numerical dispersion and stability conditions for propagation in free space, in practice one would need the equivalent conditions for the materials being investigated. One would need to repeat the analysis on the update equations relevant for that material to obtain the new conditions, and these have been done by various authors for different materials, including plasmonic materials where one may choose \(\varDelta t \leq \varDelta x/(\sqrt {3}c_{\infty })\) [7], where \(c_{\infty }=c/\sqrt {\varepsilon _{\infty }}\) and ε is the infinite frequency permittivity.

6.3 In-Class Simulation: Scattering from a Gold Nanosphere

The FDTD algorithm as discussed in the previous section, on its own is not enough for a useful simulation. One needs to add some kind of material for light to interact with, boundary conditions to terminate the simulation domain [8], a source of radiation either internal or external to the simulation, as well as monitors for data collection [1]. These topics were all touched upon in the lectures, and were put into practice in an in-class exercise: simulating the scattering of a plane wave by a gold nanosphere, and calculating its extinction cross section spectrum. Each participant in the summer school was given access to Lumerical Solutions FDTD software [5], and together we set up and performed this simulation, step by step.

This particular example was chosen for several reasons. The first is that it is important when developing and/or testing a numerical technique to begin with a simple system for verification. In the case of a single isolated sphere irradiated by a plane wave, an analytical solution exists, derived for the first time by Gustav Mie in 1908 [9, 10]. Though over a century old, this theory is still of prime importance in nanophotonics – including for example recent corrections to it for plasmonics [11] and recent interest in multipolar excitations [12]. By comparing their numerical results with the analytical model, students were able to ascertain the quality of their simulation.

In our in-class simulation, students were able to test the influence of computational parameters, such as grid size. The simulation of a sphere illustrates one fundamental drawback of FDTD: its rectangular grid. While such a grid allows relatively simple algorithms and wide applicability, it is also limiting in that there can be numerical artifacts arising from the boundaries of non-rectangular shaped objects, such as spheres. There are several work-arounds that are possible, such as: larger computational resources for smaller grid sizes [1], graded meshes where the grid size can vary along each of the three spatial dimensions if there are smaller areas that require a smaller mesh; and sub-gridding where grid cells can be divided into daughter grid cells which is much more complex to implement and may have stability issues for long runs [13].

6.4 Advanced Topics

6.4.1 High Performance Computing

High performance computing is one the best allies of computational nanophotonics because problems involving plasmonics require a fine discretization to get convergent results and this sets the need for large computational resources [1]. The FDTD method is straightforward to parallelize because the algorithm only requires the adjacent field values to run. The overall domain is decomposed into subdomains which run on different processes, and each subdomain communicates with the adjacent ones through the message passage interface (MPI) protocol [14]. Nearly linear scalability has been demonstrated, which is limited only by communication between processes. Load balancing strategies can also be implemented when some subdomains have a higher computational load which could represent a bottleneck for the overall simulation time. All the simulations we present in this paper are conducted by using an in-house parallel 3D-FDTD software [1].

6.4.2 Advanced Material Models

The FDTD method is well suited to model material properties, such as dispersion. Our group has also developed and implemented methods for materials containing nonlinearity and nonlocality which are not standard techniques, particularly the latter where almost no prior work exists.. We review here a selection of our computational approaches.

6.4.2.1 Dispersion

A dispersive material is one that exhibits a frequency dependent susceptibility, i.e.,

$$\displaystyle \begin{aligned} \mathbf{P}(\omega)=\varepsilon_0\chi^{(1)}(\omega)\mathbf{E}(\omega). {} \end{aligned} $$
(6.17)

Since FDTD is solved in the time domain a convolution is required:

$$\displaystyle \begin{aligned} \mathbf{P}(t)=\varepsilon_0\int_0^t\chi^{(1)}(t-\tau)\mathbf{E}(\tau)d\tau. \end{aligned} $$
(6.18)

Implementing a χ (1)(ω) model in FDTD is possible by introducing an auxiliary differential equation (ADE) in the leap frog scheme for the P field [15, 16]. If we consider Eqs. (6.1) and (6.5) for J free = 0, i.e.,

$$\displaystyle \begin{aligned} \mathbf{\nabla}\times\mathbf{H}=\varepsilon_0\frac{\partial \mathbf{E}}{\partial t}+\frac{\partial \mathbf{P}}{\partial t}, \end{aligned} $$
(6.19)

and we discretize it, we obtain

$$\displaystyle \begin{aligned} \mathbf{\nabla}\times{\mathbf{H}}^{t+\varDelta t/2}=\varepsilon_0\frac{{\mathbf{E}}^{t+\varDelta t}-{\mathbf{E}}^t}{\varDelta t}+\frac{{\mathbf{P}}^{t+\varDelta t}-{\mathbf{P}}^t}{\varDelta t}, \end{aligned} $$
(6.20)

from which we can derive E t+Δt as a function of E t, P t+Δt, P t and H t+Δt∕2. In the leap frog scheme, we need to solve for P t+Δt before we can calculate E t+Δt.

Models for simulating complex permittivities are available, such as the Drude with two critical points (Drude+2CP) model [17] to account for the optical response of both bound and free electrons. We report as an example the case of a Drude material, for which we have

$$\displaystyle \begin{aligned} \chi^{(1)}(\omega)=-\frac{\omega_D^2}{\omega(\omega+i\gamma)}, {} \end{aligned} $$
(6.21)

where ω D is the plasma frequency and γ is the damping coefficient. Using Eqs. (6.17) and (6.21), this becomes differential form

$$\displaystyle \begin{aligned} \frac{\partial^2\mathbf{P}}{\partial t^2}+\gamma\frac{\partial \mathbf{P}}{\partial t}=\varepsilon_0\omega_D^2\mathbf{E}, \end{aligned} $$
(6.22)

which can be discretized as

$$\displaystyle \begin{aligned} \frac{{\mathbf{P}}^{t+\varDelta t}-2{\mathbf{P}}^{t}+{\mathbf{P}}^{t-\varDelta t}}{\varDelta t^2}+\gamma\frac{{\mathbf{P}}^{t+\varDelta t}-{\mathbf{P}}^{t-\varDelta t}}{2\varDelta t}=\varepsilon_0\omega_D^2\mathbf{E^{t}}, \end{aligned} $$
(6.23)

From this we finally obtain P t+Δt as a function of E t, P t and P tΔt. The scheme for the FDTD updating algorithm is in sequence

$$\displaystyle \begin{aligned} \begin{aligned} {\mathbf{H}}^{t+\varDelta t/2}=f({\mathbf{H}}^{t-\varDelta t/2},{\mathbf{E}}^t), \\ {\mathbf{P}}^{t+\varDelta t}=f({\mathbf{E}}^t, {\mathbf{P}}^{t},{\mathbf{P}}^{t-\varDelta t}), \\ {\mathbf{E}}^{t+\varDelta t}=f({\mathbf{E}}^t, {\mathbf{P}}^{t+\varDelta t}, {\mathbf{P}}^t,{\mathbf{H}}^{t+\varDelta t/2}). \end{aligned} \end{aligned} $$
(6.24)

6.4.2.2 Nonlinearity

The FDTD method is well suited for nonlinear simulations because it is a time-domain method. We show here how to implement second harmonic generation (SHG) for a dispersionless medium (ε r is constant). We start from Eqs. (6.1) and (6.5) adapted for the nonlinear case and for one Cartesian field component

$$\displaystyle \begin{aligned} \mathbf{\nabla}\times H^{t+\varDelta t/2}=\varepsilon_0\varepsilon_r\frac{E^{t+\varDelta t}-E^t}{\varDelta t}+\frac{P_{NL}^{t+\varDelta t}-P_{NL}^t}{\varDelta t}, \end{aligned} $$
(6.25)

with the nonlinear polarization P NL = ε 0χ (2)E 2. In discretized form we have

$$\displaystyle \begin{aligned} \frac{\varDelta t}{\varepsilon_0}\mathbf{\nabla}\times H^{t+\varDelta t/2}=\varepsilon_r(E^{t+\varDelta t}-E^t)+\chi^{(2)}(E^{t+\varDelta t})^2-\chi^{(2)}(E^t)^2. \end{aligned} $$
(6.26)

In order to find E t+Δt we need to solve a second-order equation, and the solution, for \(\varepsilon _r^2+4\chi ^{(2)}b>0\), is

$$\displaystyle \begin{aligned} E^{t+\varDelta t}=\frac{-\varepsilon_r\pm\sqrt{\varepsilon_r^2+4\chi^{(2)}b}}{2\chi^{(2)}}, \end{aligned} $$
(6.27)

where

$$\displaystyle \begin{aligned} b=\frac{\varDelta t}{\varepsilon_0}\mathbf{\nabla}\times H^{t+\varDelta t/2}+\varepsilon_r E^t +\chi^{(2)}(E^t)^2. \end{aligned} $$
(6.28)

The auxiliary differential equation approach is very well suited for nonlinear simulations because it allows us to add extra terms in the polarization field [18]. We have implemented it by using a linear dispersive material and adding an extra term to the polarization field, which we show for one Cartesian component, i.e.,

$$\displaystyle \begin{aligned} P_x^t = \chi^{(3)}E_x^t|E^t|{}^2, \end{aligned} $$
(6.29)

where \(|E^t|{ }^2=(E_x^t)^2+(E_y^t)^2+(E_z^t)^2\), and we assume isotropic dispersionless nonlinearity.

6.4.2.3 Nonlocality

When describing the interaction between light and matter it is common to use the electric displacement field D(r, ω) which is defined by

$$\displaystyle \begin{aligned} \mathbf{D}(\mathbf{r},\omega) = \varepsilon_0\int d\mathbf{r'}\varepsilon(\mathbf{r},\mathbf{r}',\omega)\mathbf{E}(\mathbf{r}',\omega). \end{aligned} $$
(6.30)

For particles larger than 10 nm it is valid to use the local approximation, ε(r, r , ω) = ε(ω)δ(r −r ). This states that the electric displacement field at a given point in space depends only on the electric field in that location and the dielectric function. For systems smaller than 10 nm, the local approximation can no longer be used. We therefore must include the effects of spatial nonlocality. To do so, we model the interaction between electrons and light using a hydrodynamic plasma model [19]:

$$\displaystyle \begin{aligned} nm\Big(\frac{\partial}{\partial t} + (\mathbf{u}\cdot\boldsymbol{\varDelta}) + \gamma\Big)\mathbf{u} = ne(\mathbf{E}+\mathbf{u}\times\mathbf{B})-\boldsymbol{\varDelta} p. \end{aligned} $$
(6.31)

This is the Euler Fluid equation with damping where the force is defined by the Lorentz force. Here u represents the velocity field, γ is the damping, n is the electron density, m is the electron mass, and p is the electron pressure. To use this equation for nonlocality, we need to first remove the nonlinear terms which are negligible for low field intensities [20], leaving us with

$$\displaystyle \begin{aligned} nm\frac{\partial}{\partial t}\mathbf{u} = -ne\mathbf{E} - nm\gamma\mathbf{u}- \boldsymbol{\varDelta} p. \end{aligned} $$
(6.32)

For the pressure, we use the electron degeneracy pressure for p, which is

$$\displaystyle \begin{aligned} p=p_0\Big(\frac{n}{n_0}\Big)^{5/3}, \end{aligned} $$
(6.33)

where p 0 is proportional to the Fermi energy, and n 0 is the equilibrium electron density. Using the continuity equation, \(\frac {\partial n}{\partial t} = - \boldsymbol {\varDelta }\cdot (n\mathbf {u})\), the fact that J = −en 0u =  P∂t, and only keeping the only linear terms we end up with our linear nonlocality model:

$$\displaystyle \begin{aligned} \frac{\partial^{2}\mathbf{P}}{\partial t^{2}} + \gamma\frac{\partial\mathbf{P}}{\partial t} - \beta^{2}\boldsymbol{\varDelta}(\boldsymbol{\varDelta}\cdot\mathbf{P}) = \varepsilon_0\omega_D^{2}\mathbf{E}, \end{aligned} $$
(6.34)

where β is a constant proportional to the Fermi velocity. Notice that this is simply the aforementioned Drude material model with a spatially nonlocal term which is negligible everywhere but near the interface between the nanoparticle and the surrounding media. This is because the pressure gradient is dependent on the electron density fluctuation which disappears in the bulk [21]. This explains why the nonlocal correction term is only required when modelling small particles, as the surface to volume ratio becomes larger.

We have devised a method to implement this model in a similar fashion to the Drude model. We show this spatial discretization of the nonlocal term is shown for the x-direction where we use the second order central-difference scheme to obtain

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle &\displaystyle \boldsymbol{\varDelta}(\boldsymbol{\varDelta}\cdot\mathbf{P})_x^{x+\varDelta x/2,y,z,t} = \Bigg(\frac{\partial^2P_x}{\partial x^2} + \frac{\partial^2P_y}{\partial x\partial y} + \frac{\partial^2P_z}{\partial x\partial z}\Bigg)^{x+\varDelta x/2,y,z,t} \\ &\displaystyle &\displaystyle \qquad \qquad \quad \ = \frac{P_x^{t,x+3\varDelta x/2,y,z} - 2P_x^{t,x+\varDelta x/2,y,z} + P_x^{t,x-\varDelta x/2,y,z}}{\varDelta x^2} \\ &\displaystyle &\displaystyle \quad + \frac{P_y^{t,x+\varDelta x,y+\varDelta y/2,z} - P_y^{t,x,y+\varDelta y/2,z} - P_y^{t,x+\varDelta x,y-\varDelta y/2,z} + P_y^{t,x,y-\varDelta y/2,z}}{\varDelta x\varDelta y} \\ &\displaystyle &\displaystyle \quad + \frac{P_z^{t,x+\varDelta x,y,z+\varDelta z/2} - P_z^{t,x,y,z+\varDelta z/2} - P_z^{t,x+\varDelta x,y,z-\varDelta z/2} + P_z^{t,x,y,z-\varDelta z/2}}{\varDelta x\varDelta z}. \end{array} \end{aligned} $$
(6.35)

To test our FDTD implementation we simulated the scattering from a silver nanosphere and compared our simulation results with those calculated using the nonlocal Mie theory [22]. To show the agreement between the nonlocal Mie theory and our nonlocal implementation for FDTD, we plot the extinction spectra for three silver nanosphere sizes, 1 nm, 2 nm and 5 nm in Fig. 6.3. Here we used the Drude+2CP model [16] for silver and replaced the Drude term with Eq. (6.34) for the free electrons. From the figure we see that the FDTD implementation is in agreement with Mie Theory. Also notice that there is a blue shift between the 5 nm, 2 nm and 1 nm resonances. This is a trend that can be seen experimentally but is not present in the local approximation [23].

Fig. 6.3
figure 3

Extinction cross sections for 5 nm (red), 2 nm (blue), and 1 nm (green) silver spheres. The dots are for the FDTD simulations and the lines for the Mie theory

6.5 Application to Plasmonic Metasurfaces

To illustrate the usefulness of simulations in nanophotonics, we describe here a few examples of our work on plasmonic metasurfaces. The basic element used to create a metasurface (optical surface) is called meta-atom, and it can be a nanoparticle or a more complex nanostructure. We describe here two types of optical surfaces, random and deterministic surfaces, depending on the way the meta-atoms are arranged.

6.5.1 Plasmonic Coloring

Random surfaces have been exploited for coloring coins at the Royal Canadian Mint. These surfaces are realized via a laser writing technique which is responsible for the creation of nanoparticles of different sizes and randomly distributed on an irregular surface. Understanding the color formation in such a messy configuration could not be realized without the help of a simulation. Through large-scale electrodynamics simulations we were able to qualitatively reproduce the palette of colors obtained via direct laser writing on silver [24]. More details on the simulation approach are reported in chapter “Modelling of Coloured Metal Surfaces by Plasmonics Nanoparticles” in this volume.

6.5.2 Nonlinear Plasmonics

Recently, hybrid nanostructures have been proposed to boost the nonlinear signal production at the third harmonic. These nanostructures consist of a metallic dimer nanoantenna with a highly nonlinear material in the gap (where the linear field enhancement takes place). Separating the nonlinear contributions from the metal and from the gap material in the far-field is experimentally challenging. Simulations in this case, due to the possibility of turning on and off the nonlinear emission from each part of the hybrid nanostructure, were able to identify the role each component plays in the far-field radiation [25].

Simulations also allow optimizing the design of the hybrid nanoantenna to control the phase and polarization of nonlinear optical signal generation. This led to the design of the so called “butterfly nanoantenna”, as described in more detail in chapter “Plasmonic Metasurfaces for Nonlinear Structured Light” in this volume.

In this case, large-scale simulations were key to the design and simulation of an optical surface containing up to ∼3600 butterfly nanoantennas to generate a third harmonic far-field beam carrying an orbital angular momentum of 41. This large metasurface for its complexity could not be conceived in other ways. In Fig. 6.4 we show a snapshot extracted from the FDTD simulation for the full metasurface excited by left circular polarization.

Fig. 6.4
figure 4

Time frame of the FDTD simulation performed for a full metasurface of butterfly nanoantennas