This simulation models a 1D photonic crystal — an alternating stack of high- and low-refractive-index quarter-wave layers — using the exact Transfer Matrix Method (TMM). Each period pairs a high-index layer (n₁) with a low-index layer (n₂), both sized to a quarter-wavelength at the design wavelength λcenter so their reflections add constructively. The tool computes the full transmission spectrum from 300–1200 nm, locates the resulting photonic bandgap (the stop-band where transmission drops below 5%), and animates how a probe wave either propagates through the stack or decays evanescently when its wavelength falls inside the gap.
A multilayer dielectric stack of N periods, each period built from a high-index layer and a low-index layer with thicknesses fixed by the quarter-wave condition d = λcenter/(4n). The transfer-matrix solver multiplies each layer's 2×2 characteristic matrix to get the exact reflection and transmission for every wavelength, revealing a photonic bandgap — a band of wavelengths that cannot propagate through the crystal and are almost fully reflected.
Adjust Periods N, the high- and low-index values n₁/n₂, the design wavelength λcenter, and the layer Fill ratio to reshape the stack, then switch between TE (s) and TM (p) polarization to see how the gap shifts. Drag the Probe Wavelength slider to send a single-wavelength wave through the crystal and watch it either transmit or reflect in the wave-animation panel, or load a GaAs/AlAs, TiO₂/SiO₂, Si/Air or UV Stack preset for realistic material pairs.
Because both layers are quarter-wave thick at the same design wavelength, the weak reflection from every single interface arrives back in phase and adds up coherently. With only 8–10 periods a photonic crystal can reflect over 99% of light in its bandgap — the same principle used in dielectric mirrors, DVD/Blu-ray coatings, and the iridescent colours of butterfly wings and opals.
A photonic bandgap is a range of wavelengths that cannot propagate through a periodic dielectric structure because they are almost completely reflected by the constructive interference of reflections from every layer interface. In this simulation it appears as the region where the computed transmission drops below 5%, shown as a shaded band on the spectrum plot and reported as the gap center and gap width in the stats panel.
Each layer is represented by a 2×2 characteristic matrix built from its refractive index, thickness and the wavelength, using cos δ and sin δ terms where δ is the phase thickness of the layer. The matrices for every layer in the stack are multiplied together in order, and the resulting total matrix is combined with the optical admittances of the incident medium and substrate to give an exact transmission coefficient — no approximation is made, so the method is accurate for any number of periods.
Each layer's thickness is set to d = λcenter/(4n), the classic quarter-wave stack condition. At this thickness, the light reflected from the top and bottom of each layer, and from every layer boundary in the stack, returns to the front of the crystal in phase with the incident wave at λcenter. That coherent constructive interference is what produces a strong, sharply defined photonic bandgap centred near λcenter.
Periods N sets how many high/low layer pairs are stacked; more periods make the bandgap deeper and its edges sharper, without changing its centre wavelength. The index values n₁ and n₂ set the refractive-index contrast between layers — a bigger contrast (bigger n₁ − n₂) widens the bandgap and increases peak reflectivity. The Fill ratio rescales the relative thickness of the high- and low-index layers away from the ideal 50/50 quarter-wave split, which detunes the stack and narrows or shifts the gap.
When the Probe Wavelength slider is set inside the bandgap, the wave animation shows the field decaying exponentially as it enters the crystal instead of propagating through it — this is an evanescent wave, and almost none of it reaches the far side, matching the near-zero transmission value shown for T at that wavelength. Outside the bandgap the wave passes through the stack at nearly full amplitude, and the transmitted wave on the right reappears with an amplitude set by the transmission coefficient T.