1 Introduction

Computational science can be considered a “third pillar” of science alongside theory and experiment. In nanophotonics, there are only a handful of problems for which analytical solutions exist. Thus simulations play a critical role both in facilitating and understanding underlying physical mechanisms, as well as acting as a stand-in for experiments, especially for device design. Indeed, many advances in nanoscience and nanofabrication would not be possible without the development of sophisticated simulation tools. Computational electromagnetics methods [1], which were originally developed for radio- and microwave simulations, have been adapted to the optical regime, and are used widely in nanophotonics. Computational nanophotonics identifies the set of computer-aided techniques for the simulation of light-matter interaction at the nanoscale [2] with the finite-difference time-domain (FDTD) method [3,4,5] the most popular. FDTD is relatively easy to implement while having very broad applicability. Indeed, it is capable of simulating light interaction with materials possessing complex properties and/or geometries (see, e.g., our recent work in Refs. [6,7,8]). Being a time-domain method, FDTD naturally allows the generation of movies, providing a unique tool to access and visualize physical processes at the nanoscale. As FDTD is well-suited to parallelization via domain decomposition, it can run in parallel on massive supercomputers with nearly linear scalability [9], allowing the simulation of optically large devices and mitigating limitations imposed by the strict requirements regarding grid cell size and time step.

This chapter is based upon the “Workshop in Computational Nanophotonics”, presented in 2019 at the NATO Advanced Study Institute on “Light-Matter Interactions Towards the Nanoscale” in Erice, Italy. The lectures focussed on the FDTD method as applied to nanophotonics, and began with a pedagogical introduction to the basics of the Yee algorithm, including the discretization of Maxwell’s equations via central differencing, and the resultant numerical dispersion and stability criteria. Beyond the basics, the other “ingredients” needed for an FDTD simulation were also discussed, including: sources of light, material models, boundary conditions, and time- and frequency-domain monitors for the efficient collection of data. Further, advanced topics such as meshing strategies and high-performance computing [9] were also highlighted in lecture. These topics are not presented here, as they can be found elsewhere [4, 5, 10].

We present here a detailed discussion of the three in-class labs that comprised the active component of the workshop. Participants applied the knowledge they gained in the introductory lectures by performing the following three exercises:

Lab I :

calculate the scattering, absorption and extinction coefficients for a spherical gold nanoparticle, comparing simulation results with Mie theory in order to validate the software and explore computational parameters such as grid cell size;

Lab II :

calculate the transmittance of an array of plasmonic gap nanoantennas on a substrate, as a practical example of how one might use such simulations for metasurface device design; and

Lab III :

determine the nonlinear generation efficiency for a hybrid metal/dielectric metasurface, as a demonstration of how to perform nonlinear FDTD simulations, and how these differ from linear simulations.

Participants first had the task of determining which “ingredients” were needed for the three simulations. These were then implemented using Lumerical Solutions FDTD software (www.lumerical.com), for which each participant received a temporary licence, generously provided by Lumerical. The ingredients and specific set-up for these three labs are described in detail in Sects. 3.23.4, respectively, where the ingredients needed to progress from Lab I to Lab II, and from Lab II to Lab III, are highlighted.

Finally, in Sect. 3.5, we describe not only how to implement nonlinear optical processes directly within FDTD (as in Lab III), but, as a complement, we also describe an alternate method of obtaining nonlinear generation efficiencies based on the postprocessing of two or more linear simulations via nonlinear scattering theory [11].

2 Lab I: Scattering from a Gold Nanosphere

The first lab consists of calculating the scattering, absorption and extinction coefficients (also referred to as efficiencies) as a function of wavelength for a gold nanosphere of radius 60 nm. This example is chosen to highlight that when one starts using a new numerical/computational technique, it is highly advisable to assess the quality of the simulation by comparing the computed results against an analytical solution. Here such a solution exists, the so-called “Mie theory” that presents a rigorous solution of Maxwell’s equations for the interaction of a plane wave with a sphere in a homogeneous medium [12, 13]. Though over a century old, this theory is still of prime importance in nanophotonics, including, for example, recent interest in multipole decomposition for applications in linear and nonlinear metasurfaces [14, 15].

In order to build the simulation illustrated in Fig. 3.1, here are step-by-step instructions. For convenience, the units have been set to nm (Settings → Length units → nm).

  1. 1.

    Check the material models that are implemented for gold, to be sure that the experimental data and its fitting are as expected. First, select the dispersive model for the linear susceptibility of gold (Check → Material Explorer), e.g., as obtained from Johnson and Christie data. Then, click “fit and plot” to see the data that is used, as well as the fit to the data that will be implemented in the simulation. Adjust the fit as necessary for your requirements. We consider vacuum as the background material (this is the default setting: Edit FDTD simulation → background material index set to 1).

    Fig. 3.1
    figure 1

    Lab I: Schematic of the simulation setup comprising a gold nanosphere in a simulation domain that includes PML boundaries and TF/SF regions

  2. 2.

    Insert the object, which is a gold sphere with radius 60 nm (Structures → Sphere). Assign to it the material identified in the previous step.

  3. 3.

    Insert the FDTD simulation domain (Simulation → Region) and adjust its parameters. We set its size large enough to contain the object as well as the near fields around the object. We force a uniform mesh in order to see more clearly the effect of step size on accuracy, though Lumerical’s other mesh settings can also be used and would likely lead to more efficient calculations. Finally, as we would like to simulate the scattered fields going to infinity, we surround the simulation domain with absorbing boundary conditions on all sides. The instructions are:

    1. (a)

      Geometry tab: insert a 300 nm FDTD domain box to contain the sphere (see Fig. 3.1). Note that the simulation will ignore anything placed outside of this domain.

    2. (b)

      Mesh settings tab: choose the mesh type as staircase, and the space-step as Δx = 5 nm for initial quick simulations; this can be decreased later for higher accuracy. Note the “dt stability factor” satisfying the stability condition, i.e., \(c \varDelta t=0.99 \varDelta x /\sqrt {3}\), where c is the speed of light, and Δt is the time-step.

    3. (c)

      Boundary conditions tab: insert perfectly matched layer (PML) absorbing boundary conditions on all sides.

  4. 4.

    Insert the source, which we choose to be a total-field/scattered-field (TF/SF) plane wave source (Sources → Total-field/Scattered-field). This will create a “total-field” region within the simulation domain that contains the incoming plane wave and all the scattered fields, and a “scattered-field” region between the total-field region and the PML boundary, where the incoming plane wave is removed and thus contains only scattered fields. The separation into these two regions prevents the incoming plane wave from touching the boundaries, enabling the employment of PML boundary conditions. It also makes convenient the calculation of the scattering, absorption and extinction coefficients, as we will see. We choose a broadband pulse in time, which allows us to obtain frequency domain information over a large frequency range in a single time-domain run. The software determines the pulse shape automatically, but shape does not affect the frequency domain results of a linear simulation, as it is effectively divided out. The instructions are:

    1. (a)

      Geometry tab: insert a 280 nm box inside the simulation domain for the TF/SF boundary (see Fig. 3.1). Note that this must be smaller than the simulation domain.

    2. (b)

      General tab: set polarization and direction of propagation of the incident plane wave. Note that the value of the amplitude does not matter for linear simulations, and can be set to 1.

    3. (c)

      Frequency/Wavelength tab: set wavelength range from 400 to 1000 nm to run a broadband simulation.

  5. 5.

    Insert a refractive index monitor (Monitors → Refractive index) so that the actual simulated object may be examined after the simulation is run. This will clearly show, for example, the staircasing effect on the sphere.

  6. 6.

    Insert a time-domain monitor (Monitors → Movie) in a 2D plane to generate a movie of the simulation.

  7. 7.

    Insert frequency-domain monitors (Monitors → Frequency-domain field and power) in 2D planes to visualize the frequency-domain fields at different wavelengths of interest, to be chosen here in advance. These frequency-domain electric field distributions are obtained with a discrete Fourier transform (DFT)

    $$\displaystyle \begin{aligned} \vec{E}(\vec{r},\omega) = \sum_{n=0}^{N_{steps}}\vec{E}(\vec{r},n\varDelta t) e^{-i\omega n\varDelta t}\varDelta t, {} \end{aligned} $$
    (3.1)

    where N steps is the total number of time steps and ω the frequency of interest. At each spatial position in the monitor, and for each frequency of interest, this is calculated “on the fly” as the code runs via

    $$\displaystyle \begin{aligned} \vec{E}(\vec{r},\omega)\ {+}{=}\ \vec{E}(\vec{r},n\varDelta t)e^{-i\omega n\varDelta t}\varDelta t. {} \end{aligned} $$
    (3.2)

    At the end of the simulation, the DFTs are normalized with respect to the DFT of the incident plane wave. This explains why the amplitude and shape of the incident field do not matter in a linear simulation.

  8. 8.

    Insert power monitors in the total-field and scattered-field regions to calculate the absorption and scattered coefficients, respectively. (Object library → Analysis → Optical power → Cross sections). This is done internally by integrating the outgoing Poynting vector over closed boxes in the total-field and scattered-field regions. As we indicate in Fig. 3.1, 270 nm and 290 nm boxes are chosen, respectively.

  9. 9.

    Check simulation setup and run (Check → Check simulation and memory requirements, and then click Run).

  10. 10.

    Inspect simulations results by examining the structure, movie and DFT near fields via the monitors, to visualize if there were any obvious problems with the simulation.

  11. 11.

    Compare results to Mie Theory. Calculate the extinction, scattering and absorption coefficients via the power monitor data (see formulas described in Ref. [9]) and compare with Mie theory. A script file for this is available on the Lumerical website (see “Mie scattering (FDTD)” (www.lumerical.com)).

The extinction coefficient for the simulation as detailed above is plotted versus wavelength in Fig. 3.2. One can clearly see that 5 nm is not a sufficiently small step size; in fact, for uniform staircasing a much smaller step size is required (below 1 nm for less than 2% error [16]). After this first simulation is completed and verified, one can alter the mesh size and mesh type, material fitting, and simulation domain size to get the desired accuracy in the minimum compute time. To get a feel for the underlying physics, one can then run additional simulations, for example, changing the size of the sphere to understand when scattering dominates, and when absorption dominates, changing the background index from vacuum to see its effect on resonance, changing the material of the sphere, choosing other metals or dielectrics, and changing the shape.

Fig. 3.2
figure 2

Lab I: Extinction coefficient of a 60 nm radius gold nanosphere versus wavelength calculated via FDTD and Mie theory for a step size of 5 nm

3 Lab II: Transmittance from a Plasmonic Metasurface

The second lab consists of calculating the transmittance of a plasmonic metasurface. In the last decade, the interest in metasurfaces has grown exponentially as they offer a platform for realizing flat optical components [17, 18], including with tunable optical properties [19]. Lab II introduces the foundations for the simulation of metasurfaces. In particular, it demonstrates how to find the resonance frequency of a nanostructure within a unit cell (meta-atom) of an array; this frequency generally corresponds to the frequency of operation of the metasurface.

In Fig. 3.3, we show a schematic drawing of the unit cell of the metasurface we consider for Lab II, consisting of a silver dipole (gap) nanoantenna on a glass substrate. The actual device to be simulated is an array of such meta-atoms with lattice spacing A and B. The size C is such that the R and T planes are in the far-field of the meta-atom. To simulate this metasurface under plane wave excitation, we only need to simulate one unit cell of the array and apply periodic boundary conditions; overview of how to simulate a unit cell is illustrated in Fig. 3.4. This is a different setup than for Lab I, where we were interested in the optical response of a single nanoparticle. We now detail how to build the simulation by describing the differing and/or extra steps with respect to the setup of Lab I:

  1. 1.

    Insert the object. Using the pre-defined structures contained within Lumerical, build the meta-atom composed of two silver nanoantenna branches on a glass substrate, as described in the caption of Fig. 3.3. A linear susceptibility for Ag (e.g., Palik, 0–2 μm) and need to be selected, for the branches and substrate, respectively.

    Fig. 3.3
    figure 3

    Lab II: Schematic of the nanostructure to simulate, consisting of a Ag nanoantenna containing a gap between two branches (L = 400 nm, g = 20 nm, t = 40 nm, w = 40 nm) on a substrate; above the metasurface is vacuum. The unit cell dimensions are A = 600 nm and B = 300 nm

    Fig. 3.4
    figure 4

    Lab II: Generic schematic of a unit cell of a metasurface. Note that for the simulation of Lab II, the nanoantenna depicted in the centre would be replaced by that detailed in Fig. 3.3

  2. 2.

    Insert the FDTD simulation domain with size A = 600 nm along z, B = 300 nm along x, and C = 600 nm along y. Apply periodic boundary conditions (PBCs) to the unit cell along the x and z directions, and apply PML boundary conditions along the y direction, as in Fig. 3.4.

  3. 3.

    Insert the source, which in this case is a plane wave (Sources → Plane wave). We do not need the TF/SF source, which operates over the six faces of the simulation domain box, as the PBCs are compatible with plane wave propagation; note that a TF/SF boundary at the plane wave source injection plane is automatically applied by Lumerical. We inject the plane wave at a plane in front of the meta-atom (i.e., incident from vacuum; see plane (3) in Fig. 3.4). The instructions are:

    1. (a)

      Geometry tab: the location of the plane wave injection separates scattered-field and total-field regions, as illustrated in Fig. 3.4. Set this plane at 40 nm from the edge of the simulation domain along y.

    2. (b)

      General tab: set the plane wave to be polarized in z, so that it is aligned with the axis of the dipole nanoantenna, and to propagate along y.

    3. (c)

      Frequency/Wavelength tab: set the wavelength range from 600 to 1600 nm for broadband analysis.

  4. 4.

    Insert power monitors in the frequency domain to obtain the transmittance and reflectance (Monitors → Frequency-domain field and power). The transmittance is calculated from a power monitor inserted in the total-field region of the substrate, behind the metasurface (see plane (4) in Fig. 3.4); Lumerical’s “T” function automatically calculates the transmittance from the data collected by this transmittance monitor. The reflectance is calculated from a power monitor inserted in the scattered-field region in vacuum, in front of the metasurface (see plane (2) in Fig. 3.4). Note that Lumerical always calculates the Poynting vector as the energy flux flowing into the simulation domain. Thus, to obtain the reflectance, we need to reverse the sign of “T” from the reflectance monitor.

We plot in Fig. 3.5 the transmittance and reflectance versus wavelength, and from inspection we can see the transmittance exhibits a minimum (and the reflectance a maximum) at λ res ∼ 1050 nm, which gives an indication of the resonance frequency of the nanostructure array. It is also instructive to examine the near fields in the DFT monitors, particularly within the gap, to see how they change for frequencies close to and away from the resonance frequency. One can perform follow-up simulations to determine how the fields and resonance condition changes for different materials, different nanostructure geometries, and different array periodicities, and to optimize the structure for a desired resonance wavelength and other attributes of interest.

Fig. 3.5
figure 5

Lab II: Transmittance and reflectance for the simulation of Lab II

4 Lab III: Nonlinear Efficiency of Hybrid Metasurfaces

Nonlinear metasurfaces allow us to perform nonlinear optics over nanometric thicknesses, thus avoiding cumbersome phase matching requirements. The nonlinear generation can be boosted at the nanoscale by exploiting the linear field enhancement due to resonances in metallic and dielectric nanostructures [20]. Furthermore, these resonances can be used to control the phase, amplitude and polarization of nonlinear emission [21, 22]. Numerical tools for simulating nonlinear processes are not nearly as established as for the linear regime, and particular care is required during the setup of a nonlinear simulation, even (and perhaps especially) in commercial software.

In the simulation exercise of Lab III, we use a direct nonlinear simulation approach (described in more detail in Sect. 3.5) to calculate the third harmonic generation (THG) from a nonlinear material placed in the gap of the nanoantenna introduced in Lab II, as shown in Fig. 3.6. Our goal is to calculate the nonlinear efficiency of the metasurface. We begin with the Lab II simulation file, needing to perform the following additional steps to achieve the nonlinear simulation:

  1. 1.

    Create a nonlinear material (Materials → add → Chi3/Chi2). We assume the material has an instantaneous, isotropic third order susceptibility and choose χ (3) = 1 ⋅ 10−18 m2/V2, which has a value similar to that of, e.g., ITO. Note that leaving χ (1) = 0 implies we are choosing a linear refractive index of 1 for this material. We do this here for convenience only, so that the linear resonance wavelength of the gap nanoantenna analysed in Lab II does not change (λ res = 1050 nm). However, this is not realistic, and can be changed later.

    Fig. 3.6
    figure 6

    Lab III: Schematic of the hybrid nanostructure to simulate, a gap nanoantenna with a nonlinear material within the gap

  2. 2.

    Insert a nonlinear element in the gap of the silver nanoantenna (Structures → Rectangle), and choose its material to be that created in step 1.

  3. 3.

    Remove CW normalization (Setting → Normalization state → No normalization). Because this is a nonlinear simulation, it is nonsensical to normalize all simulation data with respect to the Fourier transform of the exciting signal. However, the units of the electric field in frequency domain are not V/m, but rather Vs/m. This translates to all other data, including powers and Poynting vectors.

  4. 4.

    Update simulation domain. We cannot use an arbitrary broadband pulse for nonlinear simulations, as the actual amplitude of each frequency component matters. There are two approaches we can take. Either we need to use the actual pulse we would use in an experiment, or we need to use a narrowband pulse which is effectively CW (and thus requires a much longer simulation time). Here, we do the latter. The instructions are:

    1. (a)

      General tab: change simulation time to 3000 fs.

    2. (b)

      Mesh settings tab: decrease mesh accuracy to 3 to reduce simulation time. This can be changed later to a higher number.

    3. (c)

      Advanced options tabset simulation bandwidth: choose min =  300 nm, max =  1200 nm, as we need a spectral range that includes the wavelength of the nonlinear signal at 350 nm.

  5. 5.

    Update the plane wave source to be narrowband, centred at the resonant wavelength λ res = 1050 nm, and with an amplitude that is realistic. This ensures that the fields at 3ω (350 nm) are due to the nonlinear generation process, rather than to the presence of spectral components at 3ω in the input signal. The instructions are:

    1. (a)

      General tab: set amplitude to 1 ⋅ 107 V/m.

    2. (b)

      Frequency/Wavelength tab: click “set time domain”, then set frequency = 285.517 THz, pulse length = 500 nm, offset = 1500 nm. Unclick “optimize for short pulse”.

  6. 6.

    Update global monitor settings. We want to make sure we collect data at both 350 nm (third harmonic) and 1050 nm (pump), so we need to change the global monitor settings in one of the monitors. This change will automatically apply to all monitors.

  7. 7.

    Insert a new power monitor right after the plane wave source (see plane (5), i.e., Inj +, in Fig. 3.4). This is necessary as a consequence of the non-normalized units discussed in step 3. This monitor allows us to calculate the incident power (in those units) at the pump wavelength of 1050 nm, so that we can correctly calculate the nonlinear conversion efficiency. The incident power P inc(ω) (in those units) is obtained by calculating the power flow through the Inj +(ω) plane, and by adding to it what was lost due to reflection, which we obtain from the reflectance monitor, i.e., R(ω).

  8. 8.

    Calculate conversion efficiency. To get the outgoing power at 3ω, we need its forward signal (transmittance T(3ω)), plus its backward signal (reflectance R(3ω)). The conversion efficiency is then calculated via

    $$\displaystyle \begin{aligned} \eta_{THG} = \frac{T(3\omega)+R(3\omega)}{P_{inc}(\omega)}, \end{aligned} $$
    (3.3)

    giving a value, for this simulation setup, of η THG = 8.5 ⋅ 10−6.

It is instructive to examine the near and far field distributions at the pump and nonlinear wavelengths, and investigate increasing the incoming field strength to see the change in efficiency and the effect on convergence. Further exercises could include changing the gap material properties to see the effect on nonlinear generation, and the linear permittivity; the latter would change the linear resonance frequency, so Lab II would need to be repeated to identify the dip in the transmission curve for the new structure. Finally, one could try performing this calculation using the nonlinear scattering theory described in the next section, by running two linear simulations rather than one nonlinear simulation.

5 Nonlinear Simulations Methods

We summarize in this section two different strategies for simulating perturbative nonlinear optical processes: (i) nonlinear scattering theory, that is based on postprocessing the results of two or more linear simulations [23, 24], and (ii) the direct calculation of the nonlinear generation within FDTD [7, 25] which was used “under the hood” in Lab III.

Nonlinear scattering theory is derived from the Lorentz reciprocity theorem [11] that relates the electric field \(\vec {E}_1\) resulting from one current source \(\vec {J}_1\), to the electric field \(\vec {E}_2\) resulting from a second current source \(\vec {J}_2\), for the same physical system via

$$\displaystyle \begin{aligned} \iiint\vec{J}_2(\vec{r},\omega)\cdot \vec{E}_1(\vec{r},\omega)dV=\iiint\vec{J}_1(\vec{r}',\omega)\cdot \vec{E}_2(\vec{r}',\omega)dV'. {} \end{aligned} $$
(3.4)

While reciprocity does not hold in general for nonlinear optical processes, we may calculate the generation of nonlinear optical fields by applying Eq. (3.4) only to the nonlinear frequency of interest, ω NL, under the undepleted pump approximation. For an undepleted pump, it is straightforward to obtain the nonlinear polarization at ω NL within the nonlinear material, \(\vec {P}_{NL}(\vec {r},\omega _{NL})\), from a linear simulation of the input field(s). Setting our first current source as \(\vec {J}_1 (\vec {r},\omega _{NL})=i\omega _{NL} \vec {P}_{NL}(\vec {r},\omega _{NL})\), the electric field \(\vec {E}_1(\vec {r},\omega _{NL})\) generated from this nonlinear polarization is the field we seek.

To calculate nonlinear generation efficiency, we need \(\vec {E}_1\) at some point in the far field, say at the location of a distant detector, \(\vec {r}_{detector}\); this is illustrated in the upper half of Fig. 3.7. If we set \(\vec {J}_2\) to be a dipole current at \(\vec {r}_{detector}\) oscillating at ω NL, then it will contain a delta function that will pull out \(\vec {E}_1 (\vec {r}_{detector},\omega _{NL})\) from the integral on the left hand side of Eq. (3.4), which is exactly the field required.

Fig. 3.7
figure 7

Illustration of the nonlinear scattering theory by using the Lorentz reciprocity theorem

To complete the theory, we need to obtain the field generated by \(\vec {J}_2\), that is, \(\vec {E}_2(\vec {r},\omega _{NL})\), for \(\vec {r}\) within the nonlinear material (i.e., the volume that contains \(\vec {J}_1\)). As we purposely set \(\vec {r}_{detector}\) far from the nanostructure, the field radiated by \(\vec {J}_2\) will be effectively a plane wave by the time it reaches the nanostructure; this is illustrated in the lower half of Fig. 3.7. Thus, \(\vec {E}_2(\vec {r},\omega _{NL})\) can be found from calculating—via a linear simulation—the field within the nanostructure upon plane wave excitation at ω NL.

With these considerations, Eq. (3.4) becomes

$$\displaystyle \begin{aligned} \vec{E}_1(\vec{r}_{detector},\omega_{NL})=\iiint i\omega\vec{P}_{NL}(\vec{r}',\omega_{NL})\cdot \vec{E}_2(\vec{r}',\omega_{NL})dV'. {} \end{aligned} $$
(3.5)

As an example, this approach was used to calculate the second harmonic generation from a gold split ring resonator in [24], and in that case, Eq. (3.5) becomes:

$$\displaystyle \begin{aligned} E_{nl}(2\omega) \propto \iint \chi_{nnn}E_n^2(\omega)\cdot E_n(2\omega)dS, \end{aligned} $$
(3.6)

where E nl(2ω) is the desired nonlinear emission, χ nnn is the dominant second order surface nonlinear susceptibility component, and E n(ω) and E n(2ω) are the field distributions of the fundamental mode and the mode at the second harmonic frequency, respectively, as obtained via linear simulations.

Direct nonlinear simulation within FDTD requires the derivation of a time-domain update equation via the discretization of the Ampère-Maxwell equation with a nonlinear polarization \(\vec {P}_{NL}\),

$$\displaystyle \begin{aligned} \epsilon_0\frac{\partial\vec{E}}{\partial t}=\nabla\times\vec{H}-\frac{\partial\vec{P}_L}{\partial t}-\frac{\partial\vec{P}_{NL}}{\partial t}. \end{aligned} $$
(3.7)

The linear polarization, \(\vec {P}_{L}\), is commonly updated by solving an auxiliary differential equation. As an example, consider a linear dispersive material with a Lorentz susceptibility given by

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

where ω 0 is the resonance frequency, and γ a damping coefficient. In this case, the linear polarization \(\vec {P}_L=\epsilon _0\chi ^{(1)}(\omega )\vec {E}\) is updated in the time-domain via

$$\displaystyle \begin{aligned} \frac{\partial^2\vec{P}_L}{\partial t^2}+\gamma\frac{\partial\vec{P}_L}{\partial t}+\omega_0^2\vec{P}_L=\omega_0^2\epsilon_0\vec{E}. {} \end{aligned} $$
(3.9)

The nonlinear polarization is often assumed to be given by an instantaneous nonlinear process in the perturbative nonlinear regime. In this case, one can write

$$\displaystyle \begin{aligned} \vec{P}_{NL}(t) = \epsilon_0\chi^{(2)}\vec{E}^2(t)+\epsilon_0\chi^{(3)}\vec{E}^3(t)+\ldots , \end{aligned} $$
(3.10)

where in general the nonlinear susceptibilities χ (n) of order n are tensorial. This is already a time domain equation, and one may use it directly to update \(\vec {P}_{NL}\), where iteration is often required to solve an implicit updating equation [4]. An explicit updating equation for \(\vec {P}=\vec {P}_L+\vec {P}_{NL}\), which takes into account both linear and nonlinear contributions, is given by the nonlinear generalization of the Lorentz dispersion model of Eq. (3.9):

$$\displaystyle \begin{aligned} \frac{\partial^2\vec{P}}{\partial t^2}+\gamma\frac{\partial\vec{P}}{\partial t}+\omega_0^2\vec{P}=\omega_0^2\epsilon_0\big(\chi^{(1)}\vec{E}+\chi^{(2)}\vec{E}^2+\chi^{(3)}\vec{E}^3+\ldots \big), \end{aligned} $$
(3.11)

where this expression has been derived from the quantum mechanical two-level atom model in the under-resonant, adiabatic-following, and weak-field limit [25].

6 Conclusions

We presented a detailed overview of the in-class labs presented at the “Workshop in Computational Nanophotonics” presented in 2019 at the NATO Advanced Study Institute on “Light-Matter Interactions Towards the Nanoscale” in Erice, Italy.