title: Perfectly matched layer
text: # Perfectly matched layer
  
  A perfectly matched layer (PML) is an artificial absorbing layer for wave equations, commonly used to truncate computational regions in numerical methods to simulate problems with open boundaries, especially in the FDTD and FE methods. The key property of a PML that distinguishes it from an ordinary absorbing material is that it is designed so that waves incident upon the PML from a non-PML medium do not reflect at the interface—this property allows the PML to strongly absorb outgoing waves from the interior of a computational region without reflecting them back into the interior.
  
  PML was originally formulated by Berenger in 1994 for use with Maxwell's equations, and since that time there have been several related reformulations of PML for both Maxwell's equations and for other wave-type equations, such as elastodynamics, the linearized Euler equations, Helmholtz equations, and poroelasticity. Berenger's original formulation is called a split-field PML, because it splits the electromagnetic fields into two unphysical fields in the PML region. A later formulation that has become more popular because of its simplicity and efficiency is called uniaxial PML or UPML, in which the PML is described as an artificial anisotropic absorbing material. Although both Berenger's formulation and UPML were initially derived by manually constructing the conditions under which incident plane waves do not reflect from the PML interface from a homogeneous medium, both formulations were later shown to be equivalent to a much more elegant and general approach: stretched-coordinate PML. In particular, PMLs were shown to correspond to a coordinate transformation in which one (or more) coordinates are mapped to complex numbers; more technically, this is actually an analytic continuation of the wave equation into complex coordinates, replacing propagating (oscillating) waves by exponentially decaying waves. This viewpoint allows PMLs to be derived for inhomogeneous media such as waveguides, as well as for other coordinate systems and wave equations.
  
  ## Technical description
  
  Specifically, for a PML designed to absorb waves propagating in the x direction, the following transformation is included in the wave equation. Wherever an x derivative $\partial /\partial x$ appears in the wave equation, it is replaced by:
  
      ${\frac {\partial }{\partial x}}\to {\frac {1}{1+{\frac {i\sigma (x)}{\omega }}}}{\frac {\partial }{\partial x}}$
  
  where Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "http://localhost:6011/en.wikipedia.org/v1/":): \omega is the angular frequency and $\sigma$ is some function of x. Wherever $\sigma$ is positive, propagating waves are attenuated because:
  
      $e^{i(kx-\omega t)}\to e^{i(kx-\omega t)-{\frac {k}{\omega }}\int ^{x}\sigma (x')dx'},$
  
  where we have taken a planewave propagating in the +x direction (for $k>0$) and applied the transformation (analytic continuation) to complex coordinates: $x\to x+{\frac {i}{\omega }}\int ^{x}\sigma (x')dx'$, or equivalently $dx\to dx(1+i\sigma /\omega )$. The same coordinate transformation causes waves to attenuate whenever their x dependence is in the form $e^{ikx}$ for some propagation constant k: this includes planewaves propagating at some angle with the x axis and also transverse modes of a waveguide.
  
  The above coordinate transformation can be left as-is in the transformed wave equations, or can be combined with the material description (e.g. the permittivity and permeability in Maxwell's equations) to form a UPML description. The coefficient σ/ω depends upon frequency—this is so the attenuation rate is proportional to k/ω, which is independent of frequency in a homogeneous material (not including material dispersion, e.g. for vacuum) because of the dispersion relation between ω and k. However, this frequency-dependence means that a time domain implementation of PML, e.g. in the FDTD method, is more complicated than for a frequency-independent absorber, and involves the auxiliary differential equation (ADE) approach (equivalently, i/ω appears as an integral or convolution in time domain).
  
  Perfectly matched layers, in their original form, only attenuate propagating waves; purely evanescent waves (exponentially decaying fields) oscillate in the PML but do not decay more quickly. However, the attenuation of evanescent waves can also be accelerated by including a real coordinate stretching in the PML: this corresponds to making σ in the above expression a complex number, where the imaginary part yields a real coordinate stretching that causes evanescent waves to decay more quickly.
  
  ## Limitations of perfectly matched layers
  
  PML is widely used and has become the absorbing boundary technique of choice in much of computational electromagnetism. Although it works well in most cases, there are a few important cases in which it breaks down, suffering from unavoidable reflections or even exponential growth.
  
  One caveat with perfectly matched layers is that they are only reflectionless for the exact, continuous wave equation. Once the wave equation is discretized for simulation on a computer, some small numerical reflections appear (which vanish with increasing resolution). For this reason, the PML absorption coefficient σ is typically turned on gradually from zero (e.g. quadratically) over a short distance on the scale of the wavelength of the wave. In general, any absorber, whether PML or not, is reflectionless in the limit where it turns on sufficiently gradually (and the absorbing layer becomes thicker), but in a discretized system the benefit of PML is to reduce the finite-thickness "transition" reflection by many orders of magnitude compared to a simple isotropic absorption coefficient.
  
  In certain materials, there are "backward-wave" solutions in which group and phase velocity are opposite to one another. This occurs in "left-handed" negative index metamaterials for electromagnetism and also for acoustic waves in certain solid materials, and in these cases the standard PML formulation is unstable: it leads to exponential growth rather than decay, simply because the sign of k is flipped in the analysis above. Fortunately, there is a simple solution in a left-handed medium (for which all waves are backwards): merely flip the sign of σ. A complication, however, is that physical left-handed materials are dispersive: they are only left-handed within a certain frequency range, and therefore the σ coefficient must be made frequency-dependent. Unfortunately, even without exotic materials, one can design certain waveguiding structures (such as a hollow metal tube with a high-index cylinder in its center) that exhibit both backwards- and forwards-wave solutions at the same frequency, such that any sign choice for σ will lead to exponential growth, and in such cases PML appears to be irrecoverably unstable.
  
  Another important limitation of PML is that it requires that the medium be invariant in the direction orthogonal to the boundary, in order to support the analytic continuation of the solution to complex coordinates (the complex "coordinate stretching"). As a consequence, the PML approach is no longer valid (no longer reflectionless at infinite resolution) in the case of periodic media (e.g. photonic crystals or phononic crystals) or even simply a waveguide that enters the boundary at an oblique angle.
  
  