Validation & Accuracy¶
Or: how do you know Ikarus is telling the truth?
A solver is only as good as the answers you can trust. Ikarus is checked two ways, and this page shows both — with the receipts:
- Against exact analytic solutions, where a closed-form answer exists.
- Against independent, separately-implemented RCWA solvers on the hard cases — and, just as importantly, we show where several popular tools quietly give the wrong answer.
Everything below is a committed, runnable test (reproduce it yourself), and every "true value" is an independent number, not ours.
Exact where an exact answer exists¶
For a stack of uniform layers there is a closed-form answer — the Fresnel / transfer-matrix solution. It is the easiest possible sanity check, and Ikarus should nail it to machine precision. It does:
The hard part: high index contrast¶
The interesting physics — and the interesting failures — live at sharp, high-index-contrast boundaries: silicon, TiO₂ or GaP structures in air or on a low-index substrate. Exactly the regime of modern metasurfaces.
Here RCWA hides a famous trap. To build its equations the method must Fourier-transform products like ε(x)·E(x). The naive approach — multiply the two Fourier series directly (the "direct" or Laurent rule) — converges painfully slowly for TM polarization across a high-index step. The fix (Li; Lalanne & Morris; Granet & Guizal, all 1996) is to apply the inverse rule along the boundary normal. Ikarus does this by default (its normal-vector / Fast-Fourier-Factorization method). Several widely used open-source RCWA packages still use the direct rule — and it shows.
Faithful vs. direct: the convergence test¶
The canonical stress test: a freestanding n = 3.5 lamellar grating, TM
polarization. We sweep the number of Fourier orders M and watch the reflectance
converge. The dashed line is the true value — from FMMax (an independent solver)
at high truncation, not from Ikarus.
laurent mode and torcwa,
which sit exactly on top of each other — crawls in from above and is still
25 % too high at M = 30.Plot the error instead, on log–log axes, and the two behaviours separate cleanly:
Why this is dangerous, not just slow
Throughout that entire crawl, energy is perfectly conserved — R + T = 1 to
machine precision at every single M. A direct-rule tool therefore looks
converged and self-consistent while being 60 % wrong. Energy balance is not a
convergence check (see Core Concepts); Ikarus judges
convergence on the complex coefficients themselves, which is why it catches this.
Curved boundaries (the 2-D case)¶
Real meta-atoms are round, not lamellar. On a curved boundary the normal-vector
method pulls ahead of even Li's separable inverse rule — this is the whole reason
it exists. On a high-contrast cylinder, Ikarus's default matches FMMax's independent
NORMAL implementation to 2.5 × 10⁻³ and is converged by M ≈ 8, while the plain
inverse rule is still climbing:
The bottom line¶
At a truncation a user would actually pick, here is what each solver reports for that n = 3.5 TM grating:
| Solver | Factorization rule | Reflectance | Error vs. truth |
|---|---|---|---|
FMMax (NORMAL) |
faithful (FFF) | 10.0 % | reference |
| Ikarus (default) | faithful (normal-vector) | 10.0 % | < 0.3 % |
Ikarus (li) |
faithful (inverse rule) | 10.0 % | < 0.3 % |
Ikarus (laurent) |
direct (Laurent) | 16.3 % | +63 % |
| torcwa | direct (Laurent) | 16.3 % | +63 % |
| grcwa (nG = 400) | direct (Laurent) | 17.5 % | +75 % |
Ikarus is a superset, so switching costs nothing
Notice that Ikarus's own laurent mode reproduces torcwa to ~2 × 10⁻⁴ — same
rule, same numbers. Ikarus can do exactly what the direct-rule tools do, and it
adds the faithful mode they lack. Moving to Ikarus loses nothing and gains
correctness on the cases that matter.
Reproduce it yourself¶
None of this is a static claim — it is a live test suite:
pip install "ikarus-rcwa[all]" fmmax grcwa torcwa
pytest ikarus/tests/validation/test_crosscode.py -v
python scripts/gen_validation_figures.py # regenerates every figure above
The cross-check solvers (fmmax, grcwa, torcwa) are optional — they are not
Ikarus dependencies, so the tests skip automatically when they are absent. Each
reference harness is itself validated against analytic Fresnel to < 10⁻⁶ before it
is trusted on a grating, so the agreements above are genuine cross-code results, not
coincidences of convention.
What this means for you¶
If your work involves high-index-contrast structures — silicon, TiO₂, GaP, GaN meta-atoms in air or on a low-index substrate — Fourier factorization is not a footnote. It is the difference between a design that behaves as simulated and one that quietly doesn't. Ikarus defaults to the faithful method, tells you honestly when you are not yet converged, and — as shown above — agrees with the most trusted independent solver on exactly the cases where the convenient tools fail.
Working on something in this regime? That is precisely the kind of problem we build for — reach out.
References¶
Cross-check solvers. The independent, separately-implemented RCWA codes Ikarus is validated against on this page. If you use them, please cite their authors:
- FMMax — M. F. Schubert and A. M. Hammond, "Fourier modal method for inverse design of metasurface-enhanced micro-LEDs," Optics Express 31, 42945 (2023). arXiv:2308.08573 · github.com/invrs-io/fmmax
- grcwa — W. Jin, W. Li, M. Orenstein, and S. Fan, "Inverse design of lightweight broadband reflector for relativistic lightsail propulsion," ACS Photonics 7, 2350 (2020). github.com/weiliangjinca/grcwa
- torcwa — C. Kim and B. Lee, "TORCWA: GPU-accelerated Fourier modal method and gradient-based optimization for metasurface design," Computer Physics Communications 282, 108552 (2023). doi:10.1016/j.cpc.2022.108552 · github.com/kch3782/torcwa
Fourier factorization. The theory behind the convergence behaviour shown above:
- L. Li, "Use of Fourier series in the analysis of discontinuous periodic structures," J. Opt. Soc. Am. A 13, 1870 (1996).
- P. Lalanne and G. M. Morris, "Highly improved convergence of the coupled-wave method for TM polarization," J. Opt. Soc. Am. A 13, 779 (1996).
- G. Granet and B. Guizal, "Efficient implementation of the coupled-wave method for metallic lamellar gratings in TM polarization," J. Opt. Soc. Am. A 13, 1019 (1996).
- T. Schuster et al., "Normal vector method for convergence improvement using the RCWA for crossed gratings," J. Opt. Soc. Am. A 24, 2880 (2007) — the normal-vector method Ikarus uses by default.
To cite Ikarus itself, see Citation.