The material structure in Maxwell's equations is determined by the relative permittivity ε(r) and permeability μ(r).
However, ε is not only a function of position. In general, it also depends on frequency (material dispersion) and on the electric field E itself (nonlinearity). It may also depend on the orientation of the field (anisotropy). Material dispersion, in turn, is generally associated with absorption loss in the material, or possibly gain. All of these effects can be simulated in Meep, with certain restrictions.
Similarly for the relative permeability μ(r), for which dispersion, nonlinearity, and anisotropy are all supported as well.
In this section, we describe the form of the equations and material properties that Meep can simulate. The actual user interface where these properties are specified in the simulation is described in Python User Interface.
Physically, material dispersion arises because the polarization of the material does not respond instantaneously to an applied field E, and this is essentially the way that it is implemented in FDTD. In particular, is expanded to:
where ε, which must be positive, is the instantaneous dielectric function (the infinite-frequency response) and P is the remaining frequency-dependent polarization density in the material. P, in turn, has its own time-evolution equation, and the exact form of this equation determines the frequency-dependence ε(ω).
Note: Meep's definition of ω uses a sign convention for the time dependence; ε formulas in engineering papers that use the opposite sign convention for will have a sign flip in all the imaginary terms below. If you are using parameters from the literature, you should use positive values of γ and ω as-is for loss; don't be confused by the difference in ω sign convention and flip the sign of the parameters.
Meep supports a Lorentzian susceptibility profile which consists of a sum of harmonic resonances plus a term for the frequency-independent electric conductivity:
where σ is the electric conductivity, ω and γ are user-specified constants. Actually, the numbers that one specifies are f = ω/2π and γ/2π. The σ is a user-specified function of position giving the strength of the n-th resonance. The σ parameters can be anisotropic (real-symmetric) tensors, while the frequency-independent term ε can be an arbitrary real-symmetric tensor as well. This corresponds to evolving P via the equations:
That is, we must store and evolve a set of auxiliary fields along with the electric field in order to keep track of the polarization P. Essentially any ε(ω) could be modeled by including enough of these polarization fields — Meep allows you to specify any number of these, limited only by computer memory and time which increases with the number of polarization terms you require.
Note that the conductivity σ corresponds to an imaginary part of ε given by . This does not include the harmonic-resonance terms. When you specify frequency in Meep units, however, you are specifying f without the 2π, so the imaginary part of ε is .
Meep also supports polarizations of the Drude form, typically used for metals:
which corresponds to a term of the following form in ε's n summation:
which is equivalent to the Lorentzian model except that the term has been omitted from the denominator, and asymptotes to a conductivity as . In this case, ω is just a dimensional scale factor and has no interpretation as a resonance frequency.
In some cases, you may need to reduce the
Courant parameter of the simulation, which relates the size of the time step to the spatial discretization: . By default, but in general you must have , where is the minimum refractive index (usually 1), so if your refractive indices are ever <1 you may need a smaller .
If a Lorentzian resonance at ω is specified at too high a frequency relative to the time discretization , the simulation becomes unstable. Essentially, the problem is that oscillates too fast compared with the time discretization for the discretization to work properly. If this happens, there are three workarounds: (1) increase the resolution which increases the resolution in both space and time, (2) decrease the Courant factor which decreases compared to , or (3) use a different model function for your dielectric response.
Roughly speaking, the equation becomes unstable for . Note that, in Meep frequency units, you specify , so this quantity should be less than .
Finally, overlapping dispersive materials with perfectly-matched layer (PML) absorbing boundaries may produce instabilities. A workaround is to replace the PML with an absorber.
Loss and Gain
If γ above is nonzero, then the dielectric function ε(ω) becomes complex, where the imaginary part is associated with absorption loss in the material if it is positive, or gain if it is negative. Alternatively, a dissipation loss or gain may be added by a positive or negative conductivity, respectively — this is often convenient if you only care about the imaginary part of ε in a narrow bandwidth, and is described in detail below.
If you look at Maxwell's equations, then plays exactly the same role as a current . Just as is the rate of change of mechanical energy (the power expended by the electric field on moving the currents), therefore, the rate at which energy is lost to absorption is given by:
Meep can keep track of this energy for the Lorentzian polarizability terms but not for the conductivity terms. For gain, this gives the amount of energy expended in amplifying the field.
Conductivity and Complex ε
Often, you only care about the absorption loss in a narrow bandwidth, where you just want to set the imaginary part of ε (or μ) to some known experimental value, in the same way that you often just care about setting a dispersionless real ε that is the correct value in your bandwidth of interest.
One approach to this problem would be allowing you to specify a constant, frequency-independent, imaginary part of ε, but this has the disadvantage of requiring the simulation to employ complex fields which double the memory and time requirements, and also tends to be numerically unstable. Instead, the approach in Meep is for you to set the conductivity (or for an imaginary part of μ), chosen so that is the correct value at your frequency ω of interest. Note that, in Meep, you specify instead of μ for the frequency, however, so you need to include the factor of 2π when computing the corresponding imaginary part of ε. Conductivities can be implemented with purely real fields, so they are not nearly as expensive as implementing a frequency-independent complex ε or μ.
For example, suppose you want to simulate a medium with at a frequency 0.42 (in your Meep units), and you only care about the material in a narrow bandwidth around this frequency (i.e. you don't need to simulate the full experimental frequency-dependent permittivity). Then, in Meep, you could use
meep.Medium(epsilon=3.4, D_conductivity=2*math.pi*0.42*0.101/3.4) in Python or
(make medium (epsilon 3.4) (D-conductivity (* 2 pi 0.42 0.101 (/ 3.4)))) in Scheme; i.e. and .
Note: the "conductivity" in Meep is slightly different from the conductivity you might find in a textbook, because for computational convenience it appears as in our Maxwell equations rather than the more-conventional ; this just means that our definition is different from the usual electric conductivity by a factor of ε. Also, just as Meep uses the dimensionless relative permittivity for ε, it uses nondimensionalized units of 1/a (where a is your unit of distance) for the conductivities . If you have the electric conductivity in SI units and want to convert to in Meep units, you can simply use the formula: where a is your unit of distance in meters, c is the vacuum speed of light in m/s, is the SI vacuum permittivity, and is the real relative permittivity.
In general, ε can be changed anisotropically by the E field itself, with:
where the ij is the index of the change in the 33 ε tensor and the terms are the nonlinear susceptibilities. The sum is the Pockels effect and the sum is the Kerr effect. If the above expansion is frequency-independent, then the nonlinearity is instantaneous; more generally, would depend on some average of the fields at previous times.
Meep supports instantaneous, isotropic Pockels and Kerr nonlinearities, corresponding to a frequency-independent and , respectively. Thus,
Here, "diag(E)" indicates the diagonal 33 matrix with the components of E along the diagonal.
Normally, for nonlinear systems you will want to use real fields E. This is the default. However, Meep uses complex fields if you have Bloch-periodic boundary conditions with a non-zero Bloch wavevector k, or in cylindrical coordinates with . In the C++ interface, real fields must be explicitly specified.
For complex fields in nonlinear systems, the physical interpretration of the above equations is unclear because one cannot simply obtain the physical solution by taking the real part any more. In particular, Meep simply defines the meaning of the nonlinearity for complex fields as follows: the real and imaginary parts of the fields do not interact nonlinearly. That is, the above equation should be taken to hold for the real and imaginary parts (of E and D) separately: e.g., |E|2 is the squared magnitude of the real part of E for when computing the real part of D, and conversely for the imaginary part.
For a discussion of how to relate in Meep to experimental Kerr coefficients, see Units and Nonlinearity.
Magnetic Permeability μ
All of the above features that are supported for the electric permittivity ε are also supported for the magnetic permeability μ. That is, Meep supports μ with dispersion from magnetic conductivity and Lorentzian resonances, as well as magnetic and nonlinearities. The description of these is exactly the same as above, so we won't repeat it here — just take the above descriptions and replace ε, E, D, and σD by μ, H, B, and σB, respectively.
A materials library is available for Python and Scheme containing crystalline silicon, amorphous silicon (including hydrogenated), silicon dioxide (SiO2), indium tin oxide (ITO), alumina (Al2O3), gallium arsenide (GaAs), aluminum arsenide (AlAs), aluminum nitride (AlN), borosilicate glass (BK7), fused quartz, silicon nitride (Si3N4), germanium (Ge), indium phosphide (InP), poly(methyl methacrylate), polycarbonate, polystyrene, cellulose, as well as 11 elemental metals: silver (Ag), gold (Au), copper (Cu), aluminum (Al), berylium (Be), chromium (Cr), nickel (Ni), palladium (Pd), platinum (Pt), titanium (Ti), and tungsten (W).
Experimental values of the complex refractive index are fit to a Drude-Lorentz susceptibility profile over various wavelength ranges. For example, the fit for crystalline silicon is based on Progress in Photovoltaics, Vol. 3, pp. 189-92, 1995 for the wavelength range of 0.4 to 1.0 µm as described in J. Optical Society of America A, Vol. 28, pp. 770-77, 2011. The fit for the elemental metals is over the range of 0.2 to 12.4 μm and is described in Applied Optics, Vol. 37, pp. 5271-83, 1998.
Fitting parameters for all materials are defined for a unit distance of 1 µm. For simulations which use a different value for the unit distance, the predefined variable
um_scale (Python) or
um-scale (Scheme) must be scaled by multiplying by whatever the unit distance is, in units of µm. For example, if the unit distance is 100 nm, this would require adding the line
um_scale = 0.1*um_scale after the line where
um_scale is defined. This change must be made directly to the materials library file.
As an example, to import aluminum from the library into a Python script requires adding the following lines:
from meep.materials import Al
Then, the material can be simply used as
geometry = [meep.Cylinder(material=Al, ...].
In Scheme, the materials library is already included when meep is run, so you can use it without any initialization:
(set! geometry (list (make cylinder (material Al) ...)))
Note: for narrowband calculations, some of the Lorentzian susceptibility terms may be unnecessary and will contribute to consuming more computational resources than are required (due to the additional storage and time stepping of the polarization fields). Computational efficiency can be improved (without significantly affecting accuracy) by removing from the material definitions those Lorentzian suspeptibility terms which are far outside the spectral region of interest.