Fig. 1: Universal flat-optics approximators: general idea.

a Problem setup composed of a flat optical surface constituted by resonant nanostructures: b with input si and output so scattered waves. (i) Dependency of the number of resonances on the dimensions of a nanostructure. c Block diagram of the input–output transfer function \({\mathbf{H}}\left( \omega \right) = \frac{{{\mathbf{s}}_{\mathrm{o}}\left( \omega \right)}}{{{\mathbf{s}}_{\mathrm{i}}\left( \omega \right)}}\). d Equivalent representation of (c) with a feedforward single hidden layer neural network modelling the effects of the resonances. e–h Demonstration of the universal representation behaviour of (d): an arbitrarily defined system response (e, f, red markers) is obtained by tuning the resonances Ω of the network for given initial weights β, couplings Κ and damping Γ. The problem is solved by minimizing a cost function (g) by using an increasing number of resonances M, which defines the size of Ω. h Network configuration that represents the desired response (e, f, solid lines). The general demonstration of this result for an arbitrary structure is carried out in Supplementary Note II