Skip to content

Layer-Stack Builder

Build a coherent stack of uniform layers. Select a layer to edit its thickness and material, change layer order, or save the complete structure. This coherent, isotropic calculation uses planar electromagnetic boundary conditions.

Building a stack one layer at a time

A stack is a list of uniform layers between two semi-infinite media. Each layer has a material and a thickness, and each neighbouring pair meets at a flat interface. The thin-film page treats one layer; the Bragg mirror and cavity pages treat repeated ones. Here the layers can be anything, in any order, including absorbing materials from the material library. The editor below computes reflection, transmission and absorption, the field at every depth, and sweeps over wavelength, angle or the first layer's thickness.

A new layer changes everything in front of it

Number the media from the incident side, j=0j=0, to the exit medium, j=Nj=N. Each interface has a single-interface amplitude rj,j+1=(Yj−Yj+1)/(Yj+Yj+1)r_{j,j+1}=(Y_j-Y_{j+1})/(Y_j+Y_{j+1}), with the admittance YY from the calculation section, and each finite layer a propagation factor pj=exp⁡(iqj 2πdj/λ)p_j=\exp(iq_j\,2\pi d_j/\lambda), where djd_j is its thickness and the normal wave number qjq_j is also defined in that section. The solver starts in the exit medium, where nothing comes back (ρN=0\rho_N=0), and works towards the light:

ρj=rj,j+1+ρj+1 pj+121+rj,j+1 ρj+1 pj+12r=ρ0\begin{aligned}\rho_j&=\frac{r_{j,j+1}+\rho_{j+1}\,p_{j+1}^2}{1+r_{j,j+1}\,\rho_{j+1}\,p_{j+1}^2}\\ r&=\rho_0\end{aligned}

ρj\rho_j is the reflection amplitude seen from inside medium jj, looking at its back face. The factor pj+12p_{j+1}^2 carries ρj+1\rho_{j+1} through layer j+1j+1 and back—a round trip. For the exit medium, pN=1p_N=1.

With one layer this is the thin-film formula. With more, each step treats everything behind an interface as one effective mirror, ρj+1pj+12\rho_{j+1}p_{j+1}^2: the reflection of the rest of the stack, delayed and attenuated by one round trip through layer j+1j+1. Change any layer and every ρ\rho on its incident side changes with it. A layer has no fixed contribution that you could add up separately; its effect depends on what surrounds it.

Fields inside the stack

Inside layer jj, which starts at depth zjz_j, the tangential electric field is a forward and a backward wave. With k0=2π/λk_0=2\pi/\lambda, uj=eik0qj(z−zj)u_j=e^{ik_0q_j(z-z_j)} and vj=eik0qj(zj+dj−z)v_j=e^{ik_0q_j(z_j+d_j-z)},

Et=Fjuj+BjvjHt∝Yj (Fjuj−Bjvj)\begin{aligned}E_t&=F_ju_j+B_jv_j\\ H_t&\propto Y_j\,(F_ju_j-B_jv_j)\end{aligned}

The forward amplitude is anchored at the layer's entrance and the backward one at its exit, so in an absorbing layer both exponentials only decay. Tangential EE and HH are continuous at every interface, which fixes all the amplitudes once the incident wave is given. The Depth profile tab plots ∣E∣2/∣Einc∣2|E|^2/|E_\text{inc}|^2 from this solution. Both use the full field vector, and EincE_\text{inc} is the field of the incident wave alone, which sets the normalization; the chart labels it Eref.

Where the light is absorbed

The power summary gives absorption as A=1−R−TA=1-R-T. That does not say which layer took the light. The field does: absorption goes as Im⁡ε ∣E∣2\operatorname{Im}\varepsilon\,|E|^2. Normalized to the incident power,

Aj=k0n0cos⁡θ∫zjzj+djIm⁡εj ∣E∣2∣Einc∣2 dzA_j=\frac{k_0}{n_0\cos\theta}\int_{z_j}^{z_j+d_j}\operatorname{Im}\varepsilon_j\,\frac{|E|^2}{|E_\text{inc}|^2}\,dz

Here ∣E∣2|E|^2 includes the normal component EzE_z in TM, as ∣Einc∣2|E_\text{inc}|^2 does. The page does not evaluate this integral, but integrated over the gold in the examples below it matches AA from the power summary in both polarizations. Byrnes (section 4.5) derives the absorption profile from the decrease of the Poynting vector with depth; the expression above is the equivalent form from Poynting's theorem. The practical consequence: the same absorbing layer takes more light where the standing wave is strong and less near a node.

Derivation from Maxwell's equations

Start from the macroscopic Maxwell equations for a linear, isotropic, nonmagnetic medium with no free charge. Fields vary as exp⁡(−iωt)\exp(-i\omega t), units are SI, ε(ω)\varepsilon(\omega) is the relative permittivity, k0=ω/ck_0=\omega/c is the vacuum wave number and ε0/μ0\sqrt{\varepsilon_0/\mu_0} is the vacuum admittance, always written out.

∇×E=iωμ0H,∇⋅(εE)=0,∇×H=−iωε0εE,∇⋅H=0.\begin{aligned}\nabla\times\mathbf E&=i\omega\mu_0\mathbf H, & \nabla\cdot(\varepsilon\mathbf E)&=0,\\ \nabla\times\mathbf H&=-i\omega\varepsilon_0\varepsilon\mathbf E, & \nabla\cdot\mathbf H&=0.\end{aligned}

In a uniform region ε\varepsilon is constant, so ∇⋅E=0\nabla\cdot\mathbf E=0. Taking the curl of Faraday's law, substituting the Ampère–Maxwell law and using ∇×∇×E=∇(∇⋅E)−∇2E\nabla\times\nabla\times\mathbf E=\nabla(\nabla\cdot\mathbf E)-\nabla^2\mathbf E gives the Helmholtz equation, with n2=εn^2=\varepsilon:

∇2E+εk02E=0\nabla^2\mathbf E+\varepsilon k_0^2\mathbf E=0

The interface page derives from it the conserved kx=n0sin⁡θk_x=n_0\sin\theta (in units of k0k_0), the normal wave number qq, the optical admittance YY and the single-interface rr; the thin-film page does one layer. Subscript 0 labels the incident medium: Y0Y_0 is its optical admittance and n0n_0 its index, while ε0\varepsilon_0 and μ0\mu_0 keep their vacuum meaning.

1. Fields in a layer. Every field carries the common factor eik0kxxe^{ik_0k_xx}. In layer jj, from zjz_j to zj+1=zj+djz_{j+1}=z_j+d_j, the tangential amplitude (EyE_y in TE, ExE_x in TM) and the tangential magnetic field are, with uj=eik0qj(z−zj)u_j=e^{ik_0q_j(z-z_j)} and vj=eik0qj(zj+1−z)v_j=e^{ik_0q_j(z_{j+1}-z)} as in the lecture,

Et=Fjuj+BjvjHt=±ε0/μ0  Yj (Fjuj−Bjvj)\begin{aligned}E_t&=F_ju_j+B_jv_j\\ H_t&=\pm\sqrt{\varepsilon_0/\mu_0}\;Y_j\,(F_ju_j-B_jv_j)\end{aligned}

with the plus sign for TM (HyH_y) and the minus sign for TE (HxH_x); the sign is common to every term and cancels. With Im⁡qj≥0\operatorname{Im}q_j\ge0 neither exponential grows across the layer. In the incident medium, the forward amplitude F0=1F_0=1 and the backward amplitude are both referred to z=0z=0, so p0=1p_0=1. In the exit medium, the forward amplitude is referred to the back surface and there is no backward wave.

2. The recursion. Define ρj=Bj/(Fjpj)\rho_j=B_j/(F_jp_j): backward over forward amplitude at the exit face of layer jj, where the forward wave has become FjpjF_jp_j. At the entrance face of layer j+1j+1 the same ratio is Bj+1pj+1/Fj+1=ρj+1pj+12≡LjB_{j+1}p_{j+1}/F_{j+1}=\rho_{j+1}p_{j+1}^2\equiv L_j. Continuity of EtE_t and HtH_t at zj+1z_{j+1} gives

Fjpj(1+ρj)=Fj+1(1+Lj)YjFjpj(1−ρj)=Yj+1Fj+1(1−Lj)\begin{aligned}F_jp_j(1+\rho_j)&=F_{j+1}(1+L_j)\\ Y_jF_jp_j(1-\rho_j)&=Y_{j+1}F_{j+1}(1-L_j)\end{aligned}

Dividing the second equation by the first removes both amplitudes. Solving for ρj\rho_j and dividing numerator and denominator by Yj+Yj+1Y_j+Y_{j+1}:

Yj1−ρj1+ρj=Yj+11−Lj1+Ljρj=Yj(1+Lj)−Yj+1(1−Lj)Yj(1+Lj)+Yj+1(1−Lj)=rj,j+1+Lj1+rj,j+1Lj\begin{gathered}Y_j\frac{1-\rho_j}{1+\rho_j}=Y_{j+1}\frac{1-L_j}{1+L_j}\\ \begin{aligned}\rho_j&=\frac{Y_j(1+L_j)-Y_{j+1}(1-L_j)}{Y_j(1+L_j)+Y_{j+1}(1-L_j)}\\ &=\frac{r_{j,j+1}+L_j}{1+r_{j,j+1}L_j}\end{aligned}\end{gathered}

The right-hand side of the first expression is the admittance of everything behind the interface. Nothing returns from the exit medium, so ρN=0\rho_N=0. At z=0z=0 the backward-to-forward ratio in the incident medium is the reflected amplitude, so r=ρ0r=\rho_0.

3. Forward amplitudes. The continuity of EtE_t gives the next forward amplitude, using the recursion for 1+ρj1+\rho_j:

1+ρj=(1+rj,j+1)(1+Lj)1+rj,j+1LjFj+1=Fjpj (1+rj,j+1)1+rj,j+1LjBj=ρjFjpj,t=FNT=Re⁡YNY0 ∣t∣2\begin{aligned}1+\rho_j&=\frac{(1+r_{j,j+1})(1+L_j)}{1+r_{j,j+1}L_j}\\ F_{j+1}&=\frac{F_jp_j\,(1+r_{j,j+1})}{1+r_{j,j+1}L_j}\\ B_j&=\rho_jF_jp_j,\quad t=F_N\\ T&=\frac{\operatorname{Re}Y_N}{Y_0}\,|t|^2\end{aligned}

The solver runs the recursion from the back, then this step from the front, starting at F0=1F_0=1.

4. Absorption. In TE the field is EyE_y alone. In TM the zz component of ∇×H=−iωε0εE\nabla\times\mathbf H=-i\omega\varepsilon_0\varepsilon\mathbf E adds Ez=−kxHy/(ε0/μ0 ε)E_z=-k_xH_y/(\sqrt{\varepsilon_0/\mu_0}\,\varepsilon). With ⟨S⟩=12Re⁡(E×H∗)\langle\mathbf S\rangle=\tfrac12\operatorname{Re}(\mathbf E\times\mathbf H^*), Poynting's theorem for time-harmonic fields and the xx-independence of the flux give

−d⟨Sz⟩dz=12ωε0Im⁡ε ∣E∣2⟨Sz⟩inc=12ε0/μ0  n0cos⁡θ ∣Einc∣2\begin{aligned}-\frac{d\langle S_z\rangle}{dz}&=\tfrac12\omega\varepsilon_0\operatorname{Im}\varepsilon\,|\mathbf E|^2\\ \langle S_z\rangle_\text{inc}&=\tfrac12\sqrt{\varepsilon_0/\mu_0}\;n_0\cos\theta\,|\mathbf E_\text{inc}|^2\end{aligned}

The incident flux has this form in both polarizations; in TM the unit ExE_x comes with Ez=−tan⁡θE_z=-\tan\theta, so ∣Einc∣2=1/cos⁡2θ|\mathbf E_\text{inc}|^2=1/\cos^2\theta. Integrating over layer jj and dividing by the incident flux, with ωε0/ε0/μ0=k0\omega\varepsilon_0/\sqrt{\varepsilon_0/\mu_0}=k_0, gives the absorption formula above. Tangential EE and HH are continuous, so ⟨Sz⟩\langle S_z\rangle is too, and the layer integrals telescope. Just in front of the stack the normalized flux is 1−R1-R (the incident medium is lossless, so its interference terms carry no net flux); behind it, TT. Hence

R+T+∑j=1N−1Aj=1R+T+\sum_{j=1}^{N-1}A_j=1

The solver takes A=1−R−TA=1-R-T; the integral is an independent way to reach the same number and to split it between layers.

5. Reciprocity. For reciprocal ε\varepsilon, as for every material here, TT is unchanged when the stack is lit from the other side at the same kxk_x, provided both exterior media carry propagating waves at that kxk_x; RR and the AjA_j need not be.

Three things to try

Add a layer. The page opens on a 250 nm free-standing film with n=1.5n=1.5, at 30° in TE. Press Add layer. The new 100 nm layer uses the first layer's material, so there is no new interface: optically it is a 350 nm film. The reflection zero moves from 707 to 495 nm and the 20.7% peak from 471 to 660 nm. The zeros sit where one round trip in the film is a whole number of wavelengths, λ=2ndcos⁡θt/m\lambda=2nd\cos\theta_t/m, with θt\theta_t the angle inside the film and mm a positive integer: 707 nm for 250 nm, and 990 and 495 nm for 350 nm. The 990 nm zero lies outside the 400–900 nm sweep. Now set Layer material to TiO₂ · Zhukovsky. That is a real interface, and the largest reflection in the 400–900 nm sweep rises to 54.5%, near 774 nm.

Swap an absorbing layer. Choose Gold · Johnson–Christy for the added layer and set its thickness to 20 nm. Open Power summary. At the 550 nm operating wavelength it shows R = 11.9%, T = 54.2% and A = 34.0%. Press Move layer up, so the gold faces the light. Now R = 27.5% and A = 18.3%; T is still 54.2%. With n=1n=1 on both sides, swapping two layers is the same as lighting the stack from the other side. For reciprocal materials like these, T is the same in both directions; R and A need not be once something absorbs. With three layers, swapping two neighbours is no longer a reversal, and T generally changes too.

Look inside. Open Depth profile, which plots ∣E∣2/∣Einc∣2|E|^2/|E_\text{inc}|^2. With the gold in front, that ratio at its surface (z=0z=0) is about 0.38. Press Move layer down: at the gold's surface—now z=250z=250 nm—it is about 0.77. The film absorbs nothing, so A is the gold's absorption, and it roughly doubles with the field. Then set Sweep parameter to First layer thickness (nm) and open Parameter dependence: A in the gold swings between about 20% and 34% as the film thickness moves the standing wave on and off the metal, repeating about every 195 nm, λ/(2ncos⁡θt)\lambda/(2n\cos\theta_t). The sweep varies only the first layer in the list, nearest the incident medium.

UNIFORM LAYERS

Layer-Stack Builder

Loading 3D…

Loading geometry…

Physical scale
Drag to orbit · click a region to inspect

Stable scattering solution · revision 0

Calculation and evidence

Time dependence is exp⁡(−iωt)\exp(-i\omega t). Amplitudes are tangential EyE_y (TE) or ExE_x (TM), with

q=ε−n02sin⁡2θY={qTEε/qTM\begin{aligned}q&=\sqrt{\varepsilon-n_0^2\sin^2\theta}\\ Y&=\begin{cases}q & \text{TE}\\ \varepsilon/q & \text{TM}\end{cases}\end{aligned}

Interfaces use Fresnel amplitudes; propagation uses exp⁡(iq 2πd/λ)\exp(iq\,2\pi d/\lambda). Reflection recursion composes scattering responses using only decaying exponentials in passive finite layers. TM amplitudes use tangential ExE_x, so rTMr_\text{TM} has the opposite sign to Byrnes's rpr_p convention; reflectances are unaffected.

The exterior media must be transparent and positive-index. Internal layers can be passive and absorbing. All layers are coherent, uniform, isotropic and nonmagnetic. An exact zero normal wave number is reported as a singular amplitude basis; nearby angles remain calculable. No roughness, incoherent thick-layer approximation or beam envelope is included.

Independent fixtures use Steven Byrnes’s tmm 0.2.0 for oblique TE/TM, absorbing films, evanescent layers and multilayers. Powers agree within 10−810^{-8} in the fixtures. Checks also cover boundary fields, antireflection and zero-thickness limits. The Python fixture generator is retained with the source.

History of the method

Multilayer calculations are older than computers. According to Angus Macleod's history of optical coatings, Pierre Rouard's 1936 Paris thesis already included an iterative technique for optical multilayer calculations. After the Second World War the Journal of the Optical Society of America carried a good number of theoretical papers on calculating the properties of coatings. Most were iterative; Walter Welford, publishing as W. Weinstein, put his method into matrix form. Florin Abelès's doctoral thesis, published in 1950, laid the theoretical foundation of the characteristic-matrix technique still in general use; that line is on the matrix-methods page.

Multilayer filters date from the late 1930s. Walter Geffcken at Schott in Jena produced the first narrowband interference filters, and most of that early work was kept secret. After the war, German coating results reached the United States. In 1946 Howard Tanner and Luther Lockhart described a German three-layer antireflection coating: a quarter-wave of intermediate index next to the glass, a half-wave of high index, then a quarter-wave of low index. Macleod notes that the half-wave layer, which broadens the antireflection band, has since appeared in coating after coating. In the 1950s Peter Berning and Arthur Francis Turner introduced the concept of potential transmission and devised the induced-transmission filter; their 1957 paper applies induced transmission in absorbing films to band-pass filter design.

For a long time the arithmetic was the obstacle. Macleod describes the volume of calculation as the great barrier of the 1950s: Smith charts were adapted to thin films, approximations were popular, and coatings were tuned by trial and error in the coating machine. In 1958 Philip Baumeister described designing a filter by successive approximations on an IBM 650, which Macleod treats as the beginning of computer-aided coating design. The same field calculation is now used well outside coatings. As one example, Pettersson, Roman and Inganäs calculated the optical field inside organic solar cells from measured complex indices and layer thicknesses, and used it to model photocurrent spectra and optimize the layer structure.

References

Steven J. Byrnes, Multilayer optical calculations, 2016, revision 5 (2020): field conventions, transfer matrices, flux and absorption. The browser implementation uses scattering recursion for numerical stability; the Python implementation supplies independent fixtures.

Angus Macleod, History of Optical Coatings and OSA before 1960, in OSA Century of Optics, ed. Paul Kelley, Govind Agrawal, Mike Bass, Jeff Hecht and Carlos Stroud (The Optical Society), pp. 68–75. A historical review, read in full; it is the source for the Rouard, Geffcken, Weinstein, Abelès, Tanner–Lockhart, Berning–Turner and Baumeister statements above.

Pierre Rouard, Études des propriétés optiques des lames métalliques très minces, Annales de Physique, 11th series, 7, 291–384 (1937); thesis presented to the Faculté des Sciences de Paris on 19 November 1936. Cited from metadata and Macleod's review; the thesis was not consulted.

W. Weinstein (W. T. Welford), The reflectivity and transmissivity of multiple thin coatings, Journal of the Optical Society of America 37(7), 576–581 (1947). Not consulted.

Howard A. Tanner and Luther B. Lockhart, German reflection reducing coatings for glass, Journal of the Optical Society of America 36(12), 701 (1946). Not consulted; the coating description follows Macleod.

Peter H. Berning and A. F. Turner, Induced transmission in absorbing films applied to band pass filter design, Journal of the Optical Society of America 47(3), 230–239 (1957). Not consulted.

Philip Baumeister, Design of multilayer filters by successive approximations, Journal of the Optical Society of America 48(12), 955–958 (1958). Not consulted.

Leif A. A. Pettersson, Lucimara S. Roman and Olle Inganäs, Modeling photocurrent action spectra of photovoltaic devices based on organic thin films, Journal of Applied Physics 86(1), 487–496 (1999). Only the abstract was read.

Return to a single interface →

Calculation source code · Implementation and validation notes