RCWA Explained
RCWA (Rigorous Coupled-Wave Analysis) is one of the two main solver types in COMPASS. Think of it as a method that breaks down the pixel structure into its spatial frequency components (Fourier series), then solves Maxwell's equations for each component. It's particularly fast for periodic structures like pixel arrays.
Rigorous Coupled-Wave Analysis (RCWA) is the primary solver method in COMPASS. It solves Maxwell's equations in the frequency domain for periodic structures by expanding fields in Fourier harmonics.
Core idea
RCWA decomposes the problem into two parts:
- Lateral (xy): The periodic permittivity and fields are expanded in a truncated Fourier series.
- Vertical (z): Within each layer, the Fourier coefficients satisfy a system of coupled ODEs that can be solved by eigendecomposition.
The layers are then connected using scattering-matrix (S-matrix) recursion to enforce boundary conditions at every interface.
Step-by-step algorithm
1. Fourier expansion of permittivity
For a 2D periodic structure with periods
where
In COMPASS, the Fourier order is set in the solver config:
solver:
name: torcwa
params:
fourier_order: [9, 9] # Nx=Ny=9 -> 19x19 = 361 harmonics2. Eigenvalue problem
Within each layer, substituting the Fourier expansion into Maxwell's equations yields an eigenvalue problem of dimension
The matrix
For a uniform layer,
3. S-matrix recursion
Individual layer S-matrices are combined using the Redheffer star product, which avoids the numerical instability of transfer-matrix (T-matrix) cascading:
The star product formula for combining
where
4. Field computation
Once the global S-matrix is known, the reflected and transmitted diffraction orders are obtained directly:
where
Fourier factorization
The convergence of RCWA depends critically on how the permittivity Fourier coefficients are computed. For structures with sharp material boundaries (e.g., metal grids), the standard approach converges slowly for TM polarization.
Li's inverse rule dramatically improves convergence by using
| Factorization | When to use | COMPASS setting |
|---|---|---|
| Naive (Laurent rule) | Continuous permittivity profiles | fourier_factorization: "naive" |
| Li inverse rule | Discontinuous boundaries (metal grids, DTI) | fourier_factorization: "li_inverse" |
| Normal vector method | Complex 2D patterns | fourier_factorization: "normal_vector" |
Convergence
The accuracy of RCWA improves as the Fourier order increases, but so does the computational cost (the eigenvalue problem scales as fourier_order from 3 to 25 and plots QE vs order:
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.
solver:
convergence:
auto_converge: true
order_range: [5, 25]
qe_tolerance: 0.01For a 1 um pitch pixel with a simple color filter pattern, order 9 is usually sufficient. For finer features (metal grids, DTI), order 15-21 may be needed.
RCWA solvers in COMPASS
COMPASS wraps three RCWA libraries:
| Solver | Library | GPU support | Notes |
|---|---|---|---|
torcwa | torcwa | CUDA (PyTorch) | Default. Best for GPU-accelerated sweeps. |
grcwa | grcwa | CUDA (JAX/PyTorch) | Alternative GPU backend. |
meent | meent | CUDA/CPU | Supports analytic eigendecomposition. |
All three implement the same SolverBase interface, so switching between them requires only changing solver.name in the config.