Skip to content

Independent · 2026

A Maxwell solver, from scratch.

CELERIS — rigorous coupled-wave analysis and a complete metalens design pipeline, in C++23 and CUDA.

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:

  • RCWA against the transfer-matrix method to 1×10−6
  • Multilayer scattering-matrix agreement to 1×10−15
  • 2D → 1D degenerate reduction to 5×10−12
  • Σ(diffraction efficiency) = 1.000000
  • Diffraction-limited designed focal spots at FWHM = λf/D

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.

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

Verified.

A solver you wrote yourself is only worth as much as the things you checked it against.

10−15

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

Two independent solvers, one closed-form limit, and conservation of energy all agree with it.

Validation — CELERIS