Skip to content

RCWA Explained

Prerequisites

Electromagnetic Waves -> Diffraction -> this page. If RCWA is new to you, start with the solver selection guide.

RCWA (Rigorous Coupled-Wave Analysis), also called the Fourier Modal Method (FMM), solves Maxwell's equations in the frequency domain for structures that are periodic in the lateral directions and layered in the vertical direction. That is exactly the shape of many image-sensor simulation cells: a repeated Bayer or Quad Bayer unit cell in x-y, sliced into air, microlens, planarization, color filter, BARL, and silicon layers along z.

The practical idea is:

  1. Represent each x-y layer pattern as Fourier harmonics.
  2. Solve the coupled electromagnetic modes inside that layer.
  3. Connect all layers with stable scattering matrices.
  4. Convert reflected, transmitted, and absorbed power into QE and crosstalk metrics.

RCWA is not a ray model and not a scalar diffraction approximation. It keeps the vector nature of the fields, material loss, oblique incidence, polarization, evanescent orders, and near-field interference. The tradeoff is that convergence depends strongly on Fourier order and on how discontinuous material boundaries are factorized.

What problem RCWA solves

RCWA assumes a time-harmonic field at one wavelength:

E(r,t)=Re[E(r)eiωt]

The material pattern is periodic in x and y:

ε(x+Λx,y,z)=ε(x,y,z),ε(x,y+Λy,z)=ε(x,y,z)

For image sensors, Λx and Λy are the simulation domain dimensions:

Λx=pitch×unit_cell.cols,Λy=pitch×unit_cell.rows

Each z layer is laterally patterned but vertically uniform within that slice. Curved or tapered structures, such as microlenses or protruding color filters, are represented as a staircase of thin slices.

Why this matches BSI pixels

BSI pixels are naturally multilayer periodic structures. RCWA is efficient because it does not simulate one isolated finite sensor pixel; it solves one periodic unit cell and includes all diffraction orders that couple between neighboring periods.

Mental model

Think of RCWA as a basis change:

  • In real space, a pixel has material boundaries, DTI trenches, metal grids, color-filter cells, and microlens shapes.
  • In Fourier space, those patterns become a set of spatial frequencies.
  • Maxwell's equations become matrix equations that describe how those spatial frequencies exchange energy as light propagates through z.

Low Fourier order sees only the coarse shape. Higher Fourier order resolves sharper features such as metal-grid edges and DTI walls.

From pixel stack to RCWA layers

COMPASS turns a PixelStack into layer slices:

Physical featureRCWA representationConvergence consequence
Air, planarization, BARL sublayersUniform layersFast, diagonal material matrices
Bayer color filterPatterned x-y permittivity gridNeeds enough Fourier order for color-cell boundaries
Metal gridHigh-contrast patterned gridNeeds Li factorization and higher order
MicrolensStaircase slices from a height mapNeeds enough z slices and x-y sampling
Protruding/tapered color filterz-aware color-filter slicesMore slices, but closer to SEM-like geometry
Silicon with DTIPatterned silicon slicesStrong index contrast; check energy balance

The RCWA backend only sees a stack of 2D permittivity arrays, one per z slice. That is why geometry verification is as important as solver settings.

Step-by-step algorithm

1. Choose diffraction orders

For a 2D periodic structure, the reciprocal lattice vectors are:

Gpx=2πpΛx,Gqy=2πqΛy

The in-plane wavevector of order (p,q) is:

kx,p=kx,0+Gpx,ky,q=ky,0+Gqy

where (kx,0,ky,0) is set by the incident angle and azimuth. COMPASS truncates the infinite set to:

NxpNx,NyqNy

so the number of harmonics is:

M=(2Nx+1)(2Ny+1)

Example:

yaml
solver:
  name: torcwa
  params:
    fourier_order: [9, 9]   # 19 x 19 = 361 harmonics

Increasing order improves accuracy but quickly increases cost because dense eigensolves and matrix products scale steeply with M.

2. Fourier-expand the material

Within a slice, the relative permittivity is expanded as:

ε(x,y)=p,qε^pqei(Gpxx+Gqyy)

In matrix form, multiplication by ε(x,y) becomes a convolution matrix. This is the core RCWA operation: real-space multiplication becomes Fourier-space convolution.

For smooth layers, the Fourier coefficients decay quickly. For discontinuous boundaries, such as tungsten grid to polymer color filter, Fourier coefficients decay slowly and Gibbs-like ringing appears. This is why high-contrast sensor structures are harder than smooth dielectric films.

3. Solve the layer eigenmodes

After Fourier expansion, Maxwell's curl equations become a coupled first-order system along z. A common form is:

ddz[sxsy]=ik0A[sxsy]

where sx and sy collect tangential field Fourier coefficients. Solving this system gives eigenmodes:

Avm=γmvm

Each eigenvalue γm is a z propagation constant. Each eigenvector is a Fourier-space field profile. In a uniform layer, these modes reduce to independent plane waves; in a patterned layer, the modes are mixtures of many diffraction orders.

4. Match boundaries

At every layer interface, Maxwell boundary conditions require continuity of tangential fields:

Ex,Ey,Hx,Hycontinuous across the interface

RCWA enforces these conditions in the truncated Fourier basis. The result is a relation between forward and backward modal amplitudes in adjacent layers.

5. Cascade layers with an S-matrix

Naively multiplying transfer matrices can become unstable because evanescent modes include exponentially growing and decaying factors. Stable RCWA implementations cascade scattering matrices instead. This avoids carrying very large and very small numbers in the same matrix product.

For two adjacent blocks A and B, the combined scattering matrix is written with the Redheffer star product:

SAB=SASB

Conceptually, the S-matrix maps incoming waves to outgoing waves:

[btopbbottom]=[S11S12S21S22][atopabottom]

For a normally illuminated pixel stack, atop contains the incident plane wave and abottom=0.

6. Compute power and absorption

After solving the global S-matrix, RCWA obtains reflected and transmitted diffraction orders. For propagating order m:

RmRe(kz,mr)|rm|2,TmRe(kz,mt)|tm|2

Absorption follows from energy conservation or from field integration in lossy regions:

A=1RT

For image sensors, COMPASS maps absorption into silicon/photodiode regions and reports per-pixel QE or crosstalk metrics.

Fourier factorization

Fourier factorization is one of the most important RCWA details. If a product such as εE is discontinuous, taking the Fourier transform of each factor and multiplying truncated series is not equivalent to truncating the Fourier transform of the product. This causes slow or wrong convergence, especially for TM-like fields at metal or high-index boundaries.

Li's factorization rules explain when to use:

  • Direct/Laurent rule: use the Fourier matrix of ε.
  • Inverse rule: use the inverse of the Fourier matrix of 1/ε.
  • Normal-vector methods: decompose fields into components normal/tangential to discontinuity surfaces.

In COMPASS:

yaml
solver:
  stability:
    fourier_factorization: "li_inverse"  # recommended default for sensor pixels

Use the naive rule only for smooth or low-contrast patterns. Metal grids, DTI, and color-filter boundaries generally need inverse or normal-vector treatment.

Convergence workflow

RCWA convergence should be measured, not assumed.

RCWA Convergence Demo

See how increasing the Fourier order N improves the accuracy of permittivity reconstruction and RCWA reflectance/transmittance convergence for a binary grating.

Total Harmonics:11
Matrix Size:11×11 = 121
Computational Cost (O(M³)):~1.3K
Gibbs Overshoot:9.4%
Permittivity Profile Reconstruction
14710120L/2LεPosition in unit cellOriginalFourier (N=5)
R, T Convergence vs Fourier Order
0%10%20%30%40%50%15101520Fourier Order NR (reflectance)T (transmittance)

Recommended workflow:

  1. Start with a small order, such as [5, 5].
  2. Sweep to [9, 9], [13, 13], [17, 17], and higher if needed.
  3. Watch target metrics: average QE, per-color QE, crosstalk, and energy balance.
  4. Check whether convergence is monotonic or oscillatory.
  5. Increase x-y sampling if the geometry itself is under-resolved.
  6. Increase z slices for curved microlenses or tapered color filters.
bash
# Sweep the Fourier order and watch QE saturate:
PYTHONPATH=. python scripts/convergence_study.py --sweep fourier_order_torcwa

What usually needs more order

FeatureWhy it is hard
Narrow metal gridHigh contrast and sharp corners
DTI trenchesHigh index contrast in silicon
Very small pitchMore features per wavelength
Oblique CRAMore asymmetric diffraction orders
Blue wavelengthShorter wavelength, more spatial detail
Tapered color filter reliefNeeds z slicing plus Fourier resolution

For a simple 1 um Bayer pixel, order 9 may be enough for qualitative trends. For sign-off-style results with metal grid and DTI, order 15-25 is more realistic. The right number is the one where your metric stops moving.

Common failure modes

Energy is not conserved

If R+T+A is far from 1, check:

  • Material loss signs and wavelength units.
  • Fourier factorization setting.
  • Whether too few harmonics truncate important diffracted orders.
  • Whether the layer stack contains zero-thickness or duplicated layers.

Results change strongly with order

This is usually not a bug. It means the Fourier basis is not large enough, or the real-space permittivity grid is too coarse.

Metallic grids converge slowly

Metals combine high contrast and loss. Use inverse factorization, rounded grid corners when physically justified, and convergence sweeps by wavelength.

Microlens shape looks too blocky

RCWA sees a staircase. Increase n_lens_slices or verify the microlens height map.

RCWA vs TMM vs FDTD

MethodBest atWeak at
TMM1D thin films, BARL intuitionNo lateral diffraction or crosstalk
RCWAPeriodic layered pixels, spectra, parameter sweepsAperiodic finite layouts, very sharp 3D objects
FDTDGeneral time-domain fields and finite featuresExpensive fine grids, long convergence runs

Use RCWA as the default for periodic unit-cell image-sensor optics. Use FDTD when periodicity breaks down, when time-domain behavior matters, or when the geometry cannot be represented well as z-sliced periodic layers.

COMPASS RCWA solvers

COMPASS wraps several RCWA/FMM-style backends:

SolverLibraryGPU supportNotes
torcwatorcwaCUDA (PyTorch)Default for GPU-accelerated sweeps.
grcwagrcwaCUDA/JAX depending installUseful cross-check backend.
meentmeentCPU/CUDA depending installAlternative RCWA implementation.
fmmaxfmmaxJAX acceleratorsVector FMM with selectable formulations.

All implement the same SolverBase interface, so the first cross-check is often as simple as changing solver.name.

Practical setup for image sensors

yaml
solver:
  name: torcwa
  type: rcwa
  params:
    fourier_order: [13, 13]
    dtype: complex64
  stability:
    precision_strategy: mixed
    fourier_factorization: li_inverse
    energy_check:
      enabled: true
      tolerance: 0.02

For final comparisons, rerun at a higher order and, if possible, with a second backend. Solver agreement is not proof of physical truth, but disagreement is a strong signal to inspect geometry, factorization, and convergence.

Further reading