RCWA vs FDTD
Prerequisites
RCWA Explained -> FDTD Explained -> this page
COMPASS supports both RCWA and FDTD solvers. This page helps you understand the trade-offs and choose the right solver for your simulation.
Side-by-side comparison
| Feature | RCWA | FDTD |
|---|---|---|
| Domain | Frequency (one wavelength per run) | Time (broadband in one run) |
| Geometry | Strictly periodic (infinite array) | Arbitrary (periodic, finite, isolated) |
| Discretization | Fourier harmonics (lateral), exact layers (vertical) | Uniform spatial grid in all directions |
| Thin films | Exact -- no spatial discretization needed | Must resolve each film with grid points |
| Curved surfaces | Staircase approximation of microlenses | Staircase or sub-pixel smoothing |
| Memory | Scales with | Scales with |
| Speed (single wavelength) | Very fast (seconds on GPU) | Slower (must time-step to steady state) |
| Speed (wavelength sweep) | Proportional to number of wavelengths | One broadband run covers all wavelengths |
| Numerical stability | Eigenvalue issues at high orders | CFL-limited but generally robust |
| Accuracy | Exponential convergence in Fourier order | Second-order in grid spacing |
Accuracy regimes
RCWA excels when
- The pixel pitch is 1-10 wavelengths (typical for image sensors).
- The structure is genuinely periodic (2x2 unit cell repeats infinitely).
- You need high accuracy at specific wavelengths (e.g., for peak QE).
- Anti-reflection coating design requires exact thin-film treatment.
FDTD excels when
- The structure has isolated or aperiodic features.
- You need broadband data and want to avoid looping over wavelengths.
- Time-domain effects (pulse propagation, transient behavior) are of interest.
- The geometry is complex and does not decompose into uniform layers.
Practical guidance for image sensors
For a standard BSI pixel simulation in COMPASS:
Use RCWA (default) for:
- QE spectrum computation
- Convergence studies (Fourier order sweep)
- BARL optimization
- Color filter material selection
- Parameter sweeps (thickness, pitch, angle)
Use FDTD for:
- Validating RCWA results at selected wavelengths
- Studying near-field effects in silicon
- Visualizing field propagation through the pixel
- Structures that break periodicity
Cross-validation workflow
A recommended workflow is to use RCWA for fast iteration and FDTD for validation:
COMPASS provides a built-in comparison runner:
# configs/experiment/solver_comparison.yaml
defaults:
- pixel: default_bsi_1um
- source: wavelength_sweep
solvers:
- name: torcwa
type: rcwa
- name: fdtd_flaport
type: fdtdAnd the SolverComparison analysis class computes QE differences, relative errors, and runtime ratios between any pair of solver results.
Matching RCWA and FDTD convergence
RCWA and FDTD agreement is meaningful only when both methods solve the same physical problem with independently converged numerical parameters. Matching raw settings is not enough.
Normalize the physics first
Start with a one-dimensional stack where TMM is available. At normal incidence, zero-order RCWA should match TMM to numerical precision. FDTD should then match the same TMM reference after its grid spacing, monitor separation, source bandwidth, and runtime are refined. This isolates source normalization and material-loss handling before patterned geometry is introduced.
Compare equivalent observables
Use R/T/A for solver-to-solver comparisons. Pixel-local quantities such as photodiode collection and crosstalk are useful, but they depend on source placement, integration windows, and transient decay. They should be reported as visual convergence proxies unless a full-vector FDTD backend and identical periodic source definition are used.
Scale FDTD time with grid refinement
FDTD is CFL-limited. When dx, dy, and dz shrink, the time step shrinks too. A finer grid with the same number of steps covers less physical time, so it can look less converged even though the spatial grid is better. Compare physical runtime (c*time) and the final energy-tail change, not only --fdtd-steps.
Report the ladder
COMPASS keeps the practical convergence workflow in the Convergence Study:
- TMM vs zero-order RCWA vs 1D FDTD.
- Shared 2D periodic FDTI/BDTI trench geometry.
- Full 2x2 Bayer pixel visual convergence and crosstalk proxies.
Performance benchmarks
Typical numbers for a 2x2 Bayer unit cell at 1 um pitch, single wavelength:
| Metric | RCWA (order 9, GPU) | FDTD (5 nm grid, GPU) |
|---|---|---|
| Runtime | 0.3 s | 45 s |
| Memory | 200 MB | 2 GB |
| QE accuracy | < 0.5% error at order 15+ | < 1% error at 5 nm grid |
For a 41-wavelength sweep (380-780 nm, 10 nm step):
| Metric | RCWA | FDTD |
|---|---|---|
| Runtime | 12 s (41 sequential) | 45 s (one broadband run) |
| Total wall time | 12 s | 45 s |
RCWA wins for narrow-band or moderate sweeps; FDTD can be competitive for very wide-band studies.
RCWA vs FDTD Solver Comparison
Compare simulated quantum efficiency (QE) curves from RCWA and FDTD solvers. Adjust pixel pitch and solver parameters to see how results and performance change.
Combining results
When both solvers produce results for the same configuration, use the SolverComparison class:
from compass.analysis.solver_comparison import SolverComparison
comparison = SolverComparison(
results=[rcwa_result, fdtd_result],
labels=["torcwa", "fdtd_flaport"],
)
summary = comparison.summary()
print(f"Max QE difference: {summary['max_qe_diff']}")
print(f"Runtime ratio: {summary['runtimes_seconds']}")