Skip to content

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

FeatureRCWAFDTD
DomainFrequency (one wavelength per run)Time (broadband in one run)
GeometryStrictly periodic (infinite array)Arbitrary (periodic, finite, isolated)
DiscretizationFourier harmonics (lateral), exact layers (vertical)Uniform spatial grid in all directions
Thin filmsExact -- no spatial discretization neededMust resolve each film with grid points
Curved surfacesStaircase approximation of microlensesStaircase or sub-pixel smoothing
MemoryScales with (2N+1)2 harmonicsScales with Nx×Ny×Nz grid
Speed (single wavelength)Very fast (seconds on GPU)Slower (must time-step to steady state)
Speed (wavelength sweep)Proportional to number of wavelengthsOne broadband run covers all wavelengths
Numerical stabilityEigenvalue issues at high ordersCFL-limited but generally robust
AccuracyExponential convergence in Fourier orderSecond-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:

yaml
# configs/experiment/solver_comparison.yaml
defaults:
  - pixel: default_bsi_1um
  - source: wavelength_sweep

solvers:
  - name: torcwa
    type: rcwa
  - name: fdtd_flaport
    type: fdtd

And 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:

  1. TMM vs zero-order RCWA vs 1D FDTD.
  2. Shared 2D periodic FDTI/BDTI trench geometry.
  3. 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:

MetricRCWA (order 9, GPU)FDTD (5 nm grid, GPU)
Runtime0.3 s45 s
Memory200 MB2 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):

MetricRCWAFDTD
Runtime12 s (41 sequential)45 s (one broadband run)
Total wall time12 s45 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.

RCWA (Fourier order = 9)
0%20%40%60%80%100%400500600700Wavelength (nm)QE (%)RedGreenBlue
FDTD (grid = 20 nm)
0%20%40%60%80%100%400500600700Wavelength (nm)QE (%)RedGreenBlue
RCWA
Time estimate:137 ms
Memory:6 MB
Periodic structures:Yes
Arbitrary geometry:Limited
FDTD
Time estimate:188 ms
Memory:3 MB
Periodic structures:Yes
Arbitrary geometry:Yes
Agreement
Max |Delta QE|:2.2%
Avg |Delta QE|:0.9%
Status:Good agreement

Combining results

When both solvers produce results for the same configuration, use the SolverComparison class:

python
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']}")