CELERIS — a Maxwell solver, from scratch

Independent · 2026

A metalens focuses light with a dense array of subwavelength nanopillars rather than a curved surface. Designing one means solving Maxwell's equations in periodic subwavelength structures, over and over, for every candidate geometry. CELERIS is my own solver for that problem, written from the ground up rather than wrapped around an existing kernel.

The solver

Rigorous coupled-wave analysis via the Fourier modal method: 1D TE/TM multilayer gratings with Li and Liu–Fan inverse-rule factorisation, the full 2D-vectorial P·Q formulation for biperiodic nanopillar arrays, and stable Redheffer scattering-matrix layer recursion.

Validation

Every layer of the stack is checked against closed-form physics, an independent method, or energy conservation:

Independently cross-validated against the grcwa and Stanford S4 solvers to roughly 1×10−7, and it reproduces canonical published metalenses (Khorasaninejad et al., Science 2016; Chen et al., Nat. Nanotechnol. 2018).

Design and analysis

The physical capability standalone RCWA kernels lack: Sellmeier and tabulated n,k dispersion; meta-atom library sweeps with automatic etch-depth selection for full 2π phase coverage; gradient-based (Adam) inverse design; and Pancharatnam–Berry geometric-phase and polarisation-multiplexed lenses exploiting form birefringence, reporting per-polarisation RMS phase and focal isolation in dB. Analysis covers Strehl ratio, Zernike wavefront, MTF, chromatic focal shift, through-focus caustic, and fabrication-tolerance Monte Carlo — with fabrication-ready GDSII export.

Performance

Rayleigh–Sommerfeld far-field propagation is implemented as a CUDA kernel and benchmarked against the project's own optimised 16-core CPU path: 4.8–5.8× faster at 92,000 pillars, agreeing to machine precision, with automatic CPU fallback. The speedup declines as the grid grows, which is what identified the kernel as memory-bound rather than compute-bound.

Numbers

10⁻¹⁵

Multilayer scattering-matrix agreement.

1.000000

Sum of diffraction efficiencies.

5.8×

CUDA speedup over the optimized 16-core CPU path.

92k

Pillars in the benchmark aperture.

C++23 and CUDA, with Python bindings and a native desktop GUI. Sole-author manuscript in preparation for Computer Physics Communications.