Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Chapter 3 notebook: a validated dielectric unit-cell library

Topic ID: ms-07-unit-cell. This notebook runs a full-wave, frequency-domain Maxwell calculation for a one-dimensional, lossless, nonmagnetic dielectric ridge grating under TE illumination (EyE_y, ky=0k_y=0). It uses the original course module simulations/unit_cell_te.py, NumPy, SciPy, and Matplotlib. Download the Chapter 3 source bundle or clone the repository to retain that module.

Predict first: will changing only the ridge width provide every transmission phase while keeping high transmission? The computed library will answer for this particular idealized geometry. It does not represent cylindrical pillars, material dispersion, fabrication, a finite array, or arbitrary polarization.

Convention: e−iωte^{-i\omega t}, eik⋅re^{i\mathbf{k}\cdot\mathbf{r}}; incidence from z<0z<0; centered ridge ∣x∣<w/2|x|<w/2, 0<z<h0<z<h. Lengths are in micrometers. The incident EyE_y is one at z=0z=0; rmr_m is at z=0z=0 and tmt_m at z=hz=h. The routine publishing build displays these saved outputs and does not run a solver.

Python 3.12.1 | NumPy 2.4.6 | SciPy 1.18.1 | Matplotlib 3.11.1
Solver: te-ridge-1.0 | harmonics: 49 checked against 65
Loading...

1. Validate an answer that is known independently

At h=0h=0, the structure becomes a flat interface and r=(qi−qt)/(qi+qt)r=(q_i-q_t)/(q_i+q_t), t=2qi/(qi+qt)t=2q_i/(q_i+q_t). At w=0w=0 or w=Λw=\Lambda, the layer is a uniform film. The independent scalar Fabry-Perot formula provides complex amplitudes, not only R+TR+T. Check both endpoint films at three angles and three heights. These limits test references and signs; they do not by themselves validate a patterned ridge. Order convergence and a separate implementation comparison are needed later.

18 uniform-film/interface checks passed; maximum complex-amplitude error: 8.865462800015876e-15
Normal flat interface: r= (-0.20000000000000007+1.2004609669086259e-17j) t= (0.7999999999999999+1.2004609669086259e-17j) R= 0.04000000000000003 T= 0.9599999999999999
Loading...

2. A small power residual is not convergence

The TE Fourier eigenproblem is [ϵm−n−αm2δmn]W=WQ2[\epsilon_{m-n}-\alpha_m^2\delta_{mn}]W=WQ^2, with αm=nisin⁡θi+mλ0/Λ\alpha_m=n_i\sin\theta_i+m\lambda_0/\Lambda. The rectangle has exact coefficients ϵℓ=ng2δℓ0+(nr2−ng2)f sinc(ℓf)\epsilon_\ell=n_g^2\delta_{\ell0}+(n_r^2-n_g^2)f\,\mathrm{sinc}(\ell f), where f=w/Λf=w/\Lambda and sinc(u)=sin⁡(πu)/(πu)\mathrm{sinc}(u)=\sin(\pi u)/(\pi u). Both fields and their normal derivatives are matched at each face.

Compare retained half-orders MM against M=48M=48 at w=0.325w=0.325 um. The power residual can already be small at M=0M=0 while complex transmission is still inaccurate. The library below checks every width at M=24M=24 and 32.

Loading...

3. See the field that produces the response

The modal coefficients reconstruct the incident, reflected, internal, and transmitted fields. The black outlines mark the periodic ridges and substrate boundary. ∣Ey/Einc∣2|E_y/E_{\rm inc}|^2 is a squared field amplitude, not transmitted power or electromagnetic energy density. Closed harmonics contribute near the ridge even though they carry no outgoing far-field power in the exterior.

<Figure size 1375x562.5 with 4 Axes>

4. Build the library and preserve its evidence

At this period and wavelength only m=0m=0 propagates in either exterior medium. For this TE field convention, Rm=Re(qi,m)∣rm∣2/qi,0R_m=\mathrm{Re}(q_{i,m})|r_m|^2/q_{i,0} and Tm=Re(qt,m)∣tm∣2/qi,0T_m=\mathrm{Re}(q_{t,m})|t_m|^2/q_{i,0}. The spectral roots are positive real or positive imaginary.

Each row stores complex amplitudes as real/imaginary parts, powers, numerical residuals, and the change when increasing MM. The metadata records geometry, conventions, phase reference planes, source hash, environment, thresholds, and validity domain. The JSON and CSV are regenerated by this cell. Only rows passing the stated checks are accepted. These are convergence tests between finite truncations, not rigorous error bounds.

50 / 50 widths passed. Continuous sampled phase span: 132.042 degrees.
Worst width-wise changes: complex t 6.5843872823157e-06 ; power 1.122202837988695e-06 ; phase (deg) 0.0004712439155618459
Loading...
<Figure size 1500x475 with 3 Axes>

5. Check the spectral neighborhood

The exported library is valid at one wavelength and incidence angle. This separate sweep evaluates three widths over 1.35-1.75 um to show why phase and transmission should be retained together. It is not an extension of the exported library’s validated domain. A new library requires new row-wise convergence checks at its own wavelengths and angles. The constant material indices here deliberately exclude material dispersion.

<Figure size 1250x462.5 with 2 Axes>

6. Select a design, and report an unattainable request honestly

For desired phase ϕ⋆\phi_\star, use the circular error Δϕ=arg⁡(te−iϕ⋆)\Delta\phi=\arg(t e^{-i\phi_\star}). First retain only accepted rows with T≥0.8T\geq0.8, then minimize ∣Δϕ∣|\Delta\phi|. The proposal is feasible only if the residual is within 5∘5^\circ. A nearest row always exists in a nonempty library; a satisfactory design may not. This is discrete selection, not a full metasurface optimization.

Loading...

7. A monitor shift changes phase without changing a device

A monitor in the incident medium sits at z=−Liz=-L_i and an output monitor at z=h+Ltz=h+L_t. Ratios referenced to incident field at the first monitor obey rmon=re2ik0qiLir_{\rm mon}=r e^{2ik_0q_iL_i} and tmon=teik0(qiLi+qtLt)t_{\rm mon}=t e^{ik_0(q_iL_i+q_tL_t)}. The next cell synthesizes these monitor shifts from the computed amplitudes and removes them. This is an algebraic phase-reference test; RCWA itself matches directly at the interfaces and does not use displaced monitors.

Loading...

8. Optional Jupyter controls

Set ENABLE_WIDGETS=True in the parameter cell and rerun to inspect the computed library in Jupyter. These controls select already calculated rows; they do not solve a new electromagnetic problem. The published lab also has a browser explorer for these data, without a Python installation.

Saved reference: optional Jupyter widgets disabled; use the browser library explorer or enable them locally.

What this run establishes, and what remains open

The saved run executes a full-wave TE ridge calculation, independent analytical film checks, width-wise harmonic refinements, field reconstruction, and a reusable library with explicit phase references. scripts/validate_chapter03.py adds multiorder and mirror checks, a higher-order spot audit, and an optional comparison with the separately developed grcwa implementation. The published data/chapter-03/validation.json records that audit and its environment.

Exercise 1: explain why ∣t∣2|t|^2 and TT differ when ni≠ntn_i\ne n_t. Exercise 2: compare the M=0M=0 power residual and complex-response error. Exercise 3: rerun a different height and reassess phase coverage and feasibility. Exercise 4: change incidence, identify all open orders, and repeat convergence. Exercise 5: create a small supercell with differing neighbors using another appropriate solver and assess the local-periodicity assumption; no such supercell result is claimed here. Exercise 6: define train/test geometry groups before extending this dataset for Chapter 10.

References: Moharam and Gaylord (1981), grcwa usage and conventions, and Meep mode decomposition, phase references, and grating examples. The course solver is an original restricted TE implementation, not the grcwa package. Agreement between two RCWA implementations does not constitute an independent FDTD/FEM comparison or experimental validation.

References
  1. Moharam, M. G., & Gaylord, T. K. (1981). Rigorous coupled-wave analysis of planar-grating diffraction. Journal of the Optical Society of America, 71(7), 811–818. 10.1364/JOSA.71.000811