Dynamic dielectric metasurfaces via control of surface lattice resonances in non-homogeneous environment

Dynamic control of metamaterials and metasurfaces is crucial for many photonic technologies, such as flat lenses, displays, augmented reality devices, and beam steering, to name a few. The dynamic response is typically achieved by controlling the phase and/or amplitude of individual meta-atom resonances using electro-optic, phase-change or nonlinear effects. Here, we propose and demonstrate a new practical strategy for the dynamic control of the resonant interaction of light with dielectric metasurfaces, exploiting the dependence of the interaction between meta-atoms in the array on the inhomogeneity of the surrounding medium. The revealed tuning mechanisms are based on the concept of the surface lattice resonance (SLR), the development of which strongly depends on the difference between permittivities of superstrate and substrate materials. We experimentally demonstrate surface lattice resonances in dielectric (Si) metasurfaces, and reveal two tuning mechanisms corresponding to shifting or damping of the SLR in optofluidic environment. The demonstrated dynamic tuning effect with the observed vivid colour changes may provide a dynamic metasurface approach with high spectral selectivity and enhanced sensitivity for sensors, as well as high-resolution for small pixel size displays.

Dynamic control of metamaterials and metasurfaces is crucial for many photonic technologies, such as flat lenses, displays, augmented reality devices, and beam steering, to name a few.The dynamic response is typically achieved by controlling the phase and/or amplitude of individual meta-atom resonances using electro-optic, phase-change or nonlinear effects.Here, we propose and demonstrate a new practical strategy for the dynamic control of the resonant interaction of light with dielectric metasurfaces, exploiting the dependence of the interaction between meta-atoms in the array on the inhomogeneity of the surrounding medium.The revealed tuning mechanisms are based on the concept of the surface lattice resonance (SLR), the development of which strongly depends on the difference between permittivities of superstrate and substrate materials.We experimentally demonstrate surface lattice resonances in dielectric (Si) metasurfaces, and reveal two tuning mechanisms corresponding to shifting or damping of the SLR in optofluidic environment.The demonstrated dynamic tuning effect with the observed vivid colour changes may provide a dynamic metasurface approach with high spectral selectivity and enhanced sensitivity for sensors, as well as high-resolution for small pixel size displays.
The ultimate goal of nanophotonic metasurfaces is to achieve a dynamically tuneable optical response required to enable applications in beam steering, adaptive lenses, augmented reality, optical switches, and displays [1].Tuneability of metasurfaces has been demonstrated using carrier accumulation/depletion via voltage gating, liquid crystals, mechanical actuation, chemical reactions, phase change materials, nonlinear effects in time-varying materials, liquid injection through microfluidic channels [2][3][4], and immersion in liquid [5,6].In all these cases, primarily the optical resonances of the individual plasmonic or dielectric meta-atoms are affected, influencing the amplitude, phase or direction of the transmitted or reflected light.
Collective effects in periodic 2D arrays of nanoparticles, such as surface lattice resonances (SLRs), have been investigated to achieve optical response typically not obtainable with single particles, such as resonances with high quality factor [7].An SLR occurs if the first diffraction order of a periodic array becomes an evanescent wave propagating in the plane of the array, the so-called Rayleigh anomaly (RA).The sensitivity of the SLR to the refractive index of the environment and, as a consequence, the modification of the SLR spectral position and its quality factor, makes this collective effect very attractive in sensing applications [8][9][10][11][12].
In most of the above-mentioned works on SLRs, the approximation of a homogeneous environment was used for ease of simulations.However, the presence of a substrate can significantly modify the optical properties of a metasurface.This is especially true for SLRs, which can be completely suppressed when the metasurface is in a non-homogeneous medium [25,26].Nevertheless, the presence of the substrate can be an advantage, providing opportunities to control the SLR excitation with the superstrate/substrate dielectric contrast in order to enable tuneability and dynamic control of the optical response.
In this paper, we describe and demonstrate this dynamic tuning principle on the example of a silicon metasurface on a glass substrate, and introduce an optofluidic platform using a variable water level as a strategy arXiv:2304.01820v1[physics.optics]4 Apr 2023 to control the refractive index of the superstrate.Although SLRs in dielectric metasurfaces have not been reported experimentally until now, the choice of dielectric metasurfaces is motivated by negligible material losses compared to plasmonic metasurfaces and the possible future extensions of the approach to other Mie-type multipoles.The use of water makes the tuning mechanism reversible because, contrary to oil, water can be totally removed from the metasurface.Liquid environments provide flexibility in using microfluidic control [2], electrowetting effect [27] or simply through thermal evaporation/condensation, and can be extended to a variety of liquids beyond water.Furthermore, the switching speed of the metasurface can be regulated by adopting an appropriate microfluidic control technique.
Numerical, theoretical and experimental investigations show that there are two mechanisms to control the optical response of dielectric metasurfaces via SLRs: one providing suppression of the resonance transmission/reflection and another resulting in the spectral shift of the resonance.Both revealed mechanisms provide vivid changes in the colouring of the metasurfaces with the change of the water environment.The results demonstrate new practical possibilities for tuning light-matter interaction at the subwavelength scale, which can find application in dynamic generation of colours for ultra-high resolution displays, high sensitivity refractive index sensors and anticounterfeiting protection.

Numerical simulations
We consider an infinite metasurface composed of Si nanodisks of diameter D and height H placed on a semiinfinite glass substrate with a square lattice of period P , and illuminated by a linearly polarized plane wave at normal incidence (Fig. 1a).The simulated reflectance of the metasurface strongly depends on both the period and the water level h WL above the substrate (Fig. 1(b)).The strongest reflectance is observed near the long wavelength side of the RA related to the glass substrate (RA glass), when the SLR appears.In fact, SLRs can only exist in the diffractionless regime, and we will refer to the spectral range on the right of the substrate RA as the SLR region.At the same time, in the range on the left of the substrate RA, SLRs are absent due to the diffraction scattering into the superstrate and/or substrate [25,26].
Depending on the period of the metasurface, one can distinguish two scenarios for the development of a resonant response, as highlighted by the two horizontal dashed lines in Fig. 1b, which are separately plotted in Figs.1c,d.For longer periods, e.g., P =550 nm (Fig. 1c), there is no resonance when the metasurface is in air (h WL = 0).The sharp resonance starts emerging only by adding water above a certain threshold level, approximately h WL ≥ H = 100 nm, i.e., disks are fully sur-rounded by water.The quality factor and spectral position of the resonance are indicative of an SLR excitation.For shorter periods, e.g., P =450 nm (Fig. 1d), the resonance already exists with air as a superstrate and increasing the water level leads to a red-shift of the resonance.In both cases, increasing the water level above h WL ≥ 400 nm does not change significantly the shape and position of the resonances, and the superstrate can be assumed as a homogeneous water environment (h WL = ∞).Although a finite water level may introduce Fabry-Pérot resonances [18], they would appear on the left side of the substrate RA, and become significant only when the water level is comparable with the wavelength.This is not a regime under investigation in this work.In the next section, based on an analytical model, we explain how these two different regimes of the dynamic response emerge from the SLR excitation and evolve with the refractive index of the superstrate.

Analytical model
Silicon disks forming a metasurface (Fig. 1a) exhibit mainly electric and magnetic dipole responses in the considered spectral range, regardless of the illumination and surroundings (Figs.S1-S5 in Supplementary Information).Therefore, the coupled-dipole model [28][29][30] can be used for the analytical investigation of the emergence of the metasurface collective resonances observed numerically in Fig. 1b.Since the electric dipole coupling dominates over the magnetic one for the metasurface in a homogeneous surrounding (see Section 2 of Supplementary Information), and the presence of a glass substrate provides only a very weak coupling between electric and magnetic dipoles [31], we will consider only coupling between electric dipoles of the Si disks.
Due to the in-plane translation symmetry and the normal illumination condition (Fig. 1a), every particle of an infinite metasurface will have the same electric dipole moment p = (p x , 0, 0) defined as [22,32] where ε 0 , ε d and ε s are the vacuum permittivity, and superstrate and substrate relative permittivities, respectively, αp xx is the electric dipole polarizability of a single disk near a substrate, Ẽx is the incident electric field at the geometrical disk centre (in the absence of the disk and in the presence of the substrate), and S is the dipole lattice sum in the presence of a substrate and associated with the electromagnetic interaction (coupling) between dipolar particles of the metasurface.
This dipolar system is in resonance when the denominator of Eq. (1) vanishes.In the presence of damping associated with material and radiative losses, the condi-FIG.1. Optical response of a metasurface with a dynamic superstrate.(a) Schematic of a metasurface: Si nanodisks of diameter D and height H are arranged in a square array on a glass substrate with periodicity P along the x and y directions.The optical response of the system is controlled by the level of water hWL on top of a metasurface.The metasurface is illuminated at normal incidence, with x-linearly polarized light and reflection or transmission is observed.(b) Dependence of reflectance spectra of an infinite array of Si nanodisks with D=200 nm and H=100 nm on a period P for different water levels hWL.The red (blue) and white dashed lines display the RA conditions for the air (water) superstrate and glass substrate, respectively.(c,d) Reflectance spectra of the metasurfaces with (c) P =550 nm and (d) P =450 nm, cross-sections of Fig. 1b (white horizontal dashed lines in Fig. 1b), illustrating two mechanisms for switching at the limiting values of hWL: suppression of resonance in (c) and a spectral shift of resonance in (d).
tions for the SLR excitation are These conditions include the properties of individual particles via their polarizability and the properties of the array via the dipole lattice sum, which does not depend on the particle properties [12].The conditions in Eq. ( 2) can only be satisfied in the SLR region (λ > λ RA s ).A moderate (air/glass or water/glass) dielectric contrast between a substrate and a superstrate ∆ε = (ε s − ε d ) does not significantly affect a broad resonance of αp xx , causing only its red-shift (Fig. S5).Therefore, the appearance of narrow resonances in the optical response of a metasurface with the changes of a water level (Fig. 1b) are related to the effect of ∆ε on the lattice sum S (i.e., on the interparticle interaction).
For a homogeneous glass environment (∆ε = 0), the lattice sum S has a divergent singularity at the RA (Figs. 2a,b), due to radiative (far-field) coupling between nanoparticles in the array (Fig. S6).Therefore, the resonant conditions in Eq. ( 2) are satisfied and the SLR In the presence of a substrate, the lattice sum S becomes finite and depends on the dielectric contrast ∆ε and the array periodicity.In this case, in addition to S, the lattice sum also includes a contribution that takes into account the reflection from the substrate S R , so that S = S + S R .
For both S and S, the divergence of the lattice sum only depends on the far-field contribution.The part SFF corresponding to the far-field inter-particle coupling in the metasurface on a substrate can be evaluated as (see Section 3 of Supplementary Information) where S FF l is the l-th far-field lattice term in the homogeneous environment (superstrate) and r (s) l is the reflection coefficient for the s-polarized wave generated by the electric dipole located at a lattice l-th node and propagating to a node with l = 0 (the distance between these points is R l ).The reflection coefficient is then where R = z p ε d /|∆ε| is the effective distance determined by the dielectric contrast ∆ε with z p being the distance from a nanodisk centre to the substrate.The value of R can be used to estimate the role of the long-range (far-field) interaction between nanoparticles in metasurfaces located on a substrate.Importantly, for the metasurfaces considered in Fig. 1, R is much smaller than the metasurface periods, i.e., R l >> R. Therefore, from Eq. ( 4) one obtains that the reflection coefficient r (s) l −1 and the far-field sum Eq. ( 3) will be determined by only a finite number of terms due to the suppression of the far-field coupling between the nanoparticles.As a result, the lattice sum in the presence of a substrate does not diverge, having a finite value at the substrate RA [26].However, as shown in (Figs.2c,d), the maximum value of the real part of the lattice sum is still obtained at the substrate RA (λ RA s ) and decreases with the increase of the dielectric contrast ∆ε.
On one hand, a decreasing lattice sum can lead to Re( S) < Re(1/α p xx ) at the substrate RA, where the conditions in Eq. ( 2) can not be satisfied, and the SLR is not excited.On the other hand, if the lattice sum is large enough to obtain Re( S) > Re(1/α p xx ) at the substrate RA, then the conditions in Eq. ( 2) are satisfied and the lattice resonance can exist in the SLR region.This is due to the fact that Re( S) monotonically decreases and Re(1/α p xx ) monotonically increases with the wavelength in the SLR region.Such behaviour is observed in Fig. 2c, where the condition Eq. (2)a is satisfied only for the metasurface with a small dielectric contrast (water/glass) and period P =550 nm.The second condition Eq. ( 2)b is illustrated in Fig. 2e and is satisfied in the SLR region for both superstrates.As a result, the reflection spectrum for the water superstrate has a narrow resonant peak with a theoretical quality factor of over 100 (Fig. 2g) corresponding to the full circle in Fig. 2c.We note that the quality factor of the system can be increased by an order of magnitude by further optimization of the structure (e.g., period, superstrate material).At the same time, outside of the SLR region, the SLR conditions are not fully satisfied; the condition Eq. ( 2)a is fulfilled (Fig. 2c) while the condition Eq. (2)b is not met due to high losses (Fig. 2e).
For the metasurface with a smaller period P =450 nm, the lattice sum is larger than the inverse polarizability at the substrate RA for both superstrates.As a result, the conditions for the SLRs are satisfied in the SLR region for both air/glass and water/glass configurations (Figs.2d,f) and the SLRs are excited with a spectral shift of the resonance depending on the dielectric contrast ∆ε (Fig. 2h).
For the practical implementation of these two scenarios and their use for dynamic control of metasurface response, the following strategy can be followed.First of all, we need that for a given ∆ε, Re( S) > Re(1/α p xx ) at the substrate RA, so that the SLR is excited in the SLR region.Second we can have: (i) On/off switching.If we increase ∆ε enough to reach the condition Re( S) < Re(1/α p xx ) at the substrate RA, then the SLR is switched off.(ii) Resonance shift.If we decrease ∆ε, the SLR remains excited but with a red shift.These switching and shifting effects, which may result in colour tuning, are shown in Fig. 2g and Fig. 2h, respectively, for changing the superstrate from air to water.

Static optical response
To experimentally illustrate the switching and shifting scenarios of lattice resonances, metasurfaces consisting of H=100 nm thick polycrystalline silicon nanodisks on a glass substrate were fabricated using electron beam lithography (see Methods for the details of fabrication and geometrical parameters).Several diameters and periods of the nanodisks (see Table I in Methods with a selection of four metasurfaces, M1-M4) were considered in order to investigate tuneability in both switching and shifting scenarios.Transmission and reflection spectra as well as CCD images of the metasurface were recorded to demonstrate the dependence of the optical properties on the superstrate refractive index (see Methods for the details of the experimental set-up).
For the metasurface M1 (Fig. 3a), the reflectance spectrum of the metasurface in air does not feature any resonances since lattice resonance is absent due to the large air/glass dielectric contrast (Fig. 3c).Immersing the metasurface in water, therefore reducing the dielectric contrast (water/glass system), leads to the strong switching of the lattice resonance around a wavelength of 730 nm and a strong reflection peak.Similar switching behaviour is observed in transmission (Fig. 3e); note that the transmission spectra show also additional resonances due to the absorption of silicon at shorter wavelengths.Measured spectra are in overall good agreement with the modelling.Simulated transmittance and reflectance spectra were also converted to their colour appearance by using CIE 1931 XYZ colour space [33] and the simulated visual appearance can be directly compared to the experimental colours (see insets in Figs.3c,d,e,f).While absorption in silicon in the visible range prevents us from obtaining a rich gamut of colours, this can be improved by using other materials, such as for example silicon nitride.The smaller magnitude of the resonances observed in the experiments as well as the slight shift of the resonances compared to the model spectra could be due to the non-perfect nature of the fabrication process, slight variations in the geometrical parameters of the nanodisks, and the finite size of the fabricated metasurface.Note that R + T < 1 in Fig. 3 since in the experimental measurements the collection angle is < 180 • .In simulations, the fraction of reflectance or transmittance within this collection angle is considered for fair comparison.
The second type of optical response tuning is demonstrated with a metasurface M2 (Fig. 3b), for which the change in surrounding refractive index between air and water leads to a red shift of the lattice resonance from λ=680 nm in air to λ=700 nm in water (Figs.3b,d).Again, a very good agreement between experimental and theoretical results is observed.The equivalent of Fig. 3 with the static optical response of the metasurfaces M3 and M4 is reported in Fig. S10.

Dynamic tuneability
The sensitivity of the optical response related to the SLR to the thickness of the water layer on top of the metasurface can be used to achieve dynamic tuneabil- ity and real-time control of optical spectra and associated colouring of metasurfaces.To demonstrate this, the evaporation of a water droplet deposited on top of the metasurface was monitored by recording the evolution of the transmittance and reflectance spectra every 100 ms until the droplet completely evaporated (Figs.4a,b,e,f).These experiments were conducted for the same meta-surfaces described in the previous section, showing a gradual change of the spectral shape for both reflectance and transmittance.In particular, the time evolution of the reflectance spectra shows a gradual disappearance (metasurface M1, Fig. 4a) and shift (metasurface M2, Fig. 4b) of the lattice resonance as a function of time and related changes of the apparent colours.Simulated spectra for decreasing water levels show a similar trend as the dynamic evolution of the experimental spectra.(Figs.4c,d,g,h).The equivalent of Fig. 4 for the dynamic tunability of the metasurfaces M3 and M4 is reported in Fig. S11.Although the precise control of the water level was not investigated here, these results confirm that such control can provide dynamic tuning of metasurfaces' optical response.
Snapshots of the metasurfaces during the evaporation of water reveal that the evaporation process happens by forming a clear and curved front between air and water regions, showing a difference in colour (see Supplementary Movies) for real-time dynamic colour modification upon water evaporation.It is worth mentioning that in our experimental conditions (ambient temperature), water-to-air transition takes place over a few seconds (Supplementary Movies and Fig. S12a,b of Supplementary Information).The process can be accelerated by controlling the temperature of the metasurface.The reflectance and transmittance simulations for water levels between 0 and 400 nm (Fig. S12c,d of Supplementary Information) show that changes in the reflectance and transmittance spectral features are very sensitive to the water level (Fig. S13 of Supplementary Information).These experiments, therefore, demonstrate the possibility of inferring water levels down to the nanometre scale based on the optical response of the metasurfaces.Furthermore, the uniformity of the colour across the metasurface confirms that the resonance condition does not involve long-range (far-field) contributions as already predicted in the theoretical derivations.This means that SLRs can develop in finite size metasurfaces, which may be beneficial for pixels in high-resolution displays.

DISCUSSION
We have proposed and demonstrated a practical and general strategy to dynamically control the optical response of an all-dielectric metasurface on a substrate by modifying its superstrate.In our case, this is done by varying the level of water on top of a metasurface, which makes our tuning approach completely reversible.In general, the SLR exists at the wavelength where the equality between the lattice sum and the inverse of the single particle polarizability is satisfied.In a homogeneous medium, the divergence of the lattice sum guarantees that this equality is always satisfied.However, when the metasurface is in an inhomogeneous medium, the lattice sum is finite and decreases with increasing the superstrate/substrate dielectric contrast due to the suppression of long-range (far-field) contributions on the lattice sum.This effectively decreases the number of nanoparticles participating in the SLR as the dielectric contrast increases, and opens possibilities for the realization and control of SLRs in finite size metasurfaces.
In the case of a metasurface with a static superstrate, the air and water cases considered in this paper open two options: (1) the SLR exists for both superstrates, and (2) the SLR exists only for one superstrate.In case (1), we demonstrated spectral shifting of the SLR, while in case (2) the SLR exhibits on/off switch.In both circumstances, the presence of the substrate plays a major role to achieve optical control.
In the case of a metasurface with a dynamic superstrate, the variation of the water level enables tunability of the optical response.The experimental demonstration not only reveals drastic colour changes induced by the dynamic variation of the superstrate but also indicates the possibility of measuring water levels down to the nanometre scale by monitoring the optical response of the metasurface.Dielectric metasurfaces based on the tuning principles presented in this paper exhibit designed spectral selectivity and dynamic control of spectral response which may find application in colouring with small size pixels, high-resolution displays, sensors, wavelengthselective tuneable filters and mirrors, augmented reality and anticounterfeiting.

Analytical methods
The behaviour of single particle resonances and individual multipole contributions for different excitation and environment conditions are discussed in Supplementary Information Section 1.A comprehensive theoretical description of the response of a metasurface in a homogeneous surrounding environment within the coupleddipole method is presented in Supplementary Information Section 2. Supplementary Information Section 3 contains the detailed derivation of the lattice sum in presence of substrate in the far-field approximation (Eq.( 3)).

Numerical simulations
The refractive index of air, water and glass used in the simulations are n=1, n=1.33 and n=1.45, respectively.The refractive index of Si can be found in Fig. S1.
Individual multipole contributions (multipole decomposition) of the single particle resonances are calculated in Ansys Lumerical using the expressions for the multipole moments presented in Ref. [34].
The scattering efficiency of a single particle, as well as the reflectance and transmittance of the array are obtained numerically using full-wave finite-difference timedomain (FDTD) simulations in Ansys Lumerical.For the single particle, a perfectly matched layer (PML) boundary condition is used for all boundaries.In the case of the array, periodic boundary conditions are used along the in-plane x-and y-directions.The fraction of reflectance and transmittance to each grating order is calculated by using the "Grating order transmission" analysis group object of Ansys Lumerical.Full dipole sum S in presence of a substrate is numerically calculated as follows.First, we place an x-polarized dipole point source (with a default dipole moment p x set by the software, Ansys Lumerical) at r 0 = (0, 0, z p ) and apply periodic boundary conditions along the in-plane x and y-directions with a periodicity P (i.e., symmetrically respect to r 0 at x = y = ±P/2) and PML boundary condition in the z-direction.We then calculate the x-component of the total electric field E M x at r 0 .To exclude the central dipole (l=0) contribution, we repeat the above calculation with the PML boundary conditions in all Cartesian directions and subtract the electric field of the single dipole E 1 x from the first simulation result E M x .Finally, we calculate the full dipolar sum as

Sample design and fabrication
The metasurfaces are fabricated by electron beam lithography on a 100 nm thick polycrystalline silicon film deposited on a glass substrate.Four different arrays of nanodisks with varying diameters and periods were considered (Table I).The square array size for each structure is 100 µm×100 µm.

Optical measurements
Transmittance and reflectance measurements at normal incidence were performed by illuminating the sample using a tungsten-halogen white light source.The beam, polarised along the x-axis of the array of nanodisks, is weakly focused onto the sample using a microscope objective with numerical aperture 0.1.In the case of reflectance measurements, the reflected light is collected by the same objective while for transmittance measurements, the transmitted light is collected using a microscope objective with numerical aperture 0.25.The collected light is then coupled to a spectrometer via an optical fibre.The size of the collection area is ∼75 µm 2 .In both cases, a non-polarising beamsplitter is used to divert a fraction of the collected light onto a CCD camera to record images or movies of the sample (Fig. S14).The spectral response of the nanostructures in water is measured by drop casting 50 µL of deionised water onto the nanostructure, fully immersing it.In order to capture the spectral response of the sample while the water level is changing in between the nanodisks, spectra are recorded every 100 ms until the water droplet has fully dried.Movies of the drying process of water on the nanostructures were simultaneously recorded.

I. SINGLE PARTICLE RESPONSE
In this section, we investigate the response of a single particle, which is used as the building block of the metasurface considered in the main text (Fig. 1a); polycrystalline Si is used in simulations (Fig. 1b).
A Si nanodisk with D=100 nm in a homogeneous medium exhibits mainly electric and magnetic dipolar response for different (top, side) angles of incidence and in different surroundings (air, glass) relevant to this work (Fig. 2).
For the side and top excitation configurations, the corresponding dipole polarizabilities are similar (Fig. 3), therefore, the dependence of the dipolar polarizabilities on the excitation conditions, i.e, nonlocal effects, can be neglected [1].
Similarly, the presence of a substrate does not significantly modify the nature of the response, which is again dominated by a dipolar response (Fig. 4).Hence, the coupled-dipole method can be applied for the analytical description of the metasurface in a homogeneous environment and in the presence of a glass substrate.In Fig. 4, only direct contribution of the electric and magnetic dipoles are considered, i.e., interference between multipoles occurring due to the reflection from the substrate is neglected [2].
Since the influence of a substrate on the dipole polarizabilities of Si nanodisks are weak (Fig. 5), within the near-field approach, we can approximate a disk as an oblate ellipsoid with the polarizability αp xx near the substrate as [3] αp xx ≈ where z p is the distance between the substrate surface and the disk center, and α p xx is the polarizability in a homogeneous environment with permittivity ε d , while ε s is the permittivity of the substrate.As it is shown in Fig. 5, the maximum relative difference between αp xx (dashed lines) and α p xx (solid lines) is ≤15% [for the disk with D=200 nm and H=100 nm (z p =H/2)] in air superstrate and on the glass substrate (thick dashed lines).It becomes even smaller (less than 5%) for the water superstrate (thin dashed lines).Hence, we can assume and indeed see later in the main text that the conditions of the lattice resonances for the arrays near the substrate are affected by the lattice sum S.

II. COUPLED-DIPOLE MODEL FOR A METASURFACE IN A HOMOGENEOUS ENVIRONMENT
For a homogeneous environment with a relative permittivity ε d and illumination/polarisation conditions as in Fig. 1a, the equations for electric p = (p x , 0, 0) and magnetic m = (0, m y , 0) dipole moments of a disk in a metasurface (with a square unit cell of period P ) can be written as [4,5] where ε 0 is the vacuum permittivity, α p1 xx (α p2 xx ) and α m1 yy (α m2 yy ) are the corresponding diagonal components of the electric and magnetic dipole polarizability tensors of a single disk for normal/top (lateral/side) incidence of external waves, respectively, S xx and S yy are the diagonal elements of the lattice dipole sum, E x and H y are the electric and magnetic fields of the incident wave at the geometric center of the disk located at the origin of the coordinate system.Note, here, we take into account that the components of the polarizability tensors can in general depend on the illumination direction.We consider a square elementary cell with P x = P y = P , therefore, S xx = S yy = S. From the solutions of Eq. ( 2) where k d is the wave number in a homogeneous environment with ε d , A is the unit cell area.
Disk polarizabilities α p xx = p x /(ε 0 ε d E x ) and α m yy = m y /H y can be determined numerically considering a single disk response (Fig. 3).Note, if the nonlocal effects of the disk response [1] are negligible, α p1 xx = α p2 xx and α m1 yy = α m2 yy .Indeed, for the disks considered in Fig. 2, the electric and magnetic polarizabilities are similar for both top and side excitation conditions as in Fig. 3.
The lattice dipole sum S for a homogeneous medium can be written as a sum of the individual far-S FF , middle-S MF and near-S NF field contributions [6]: with where the summation goes over all lattice nodes, excluding the node located at the origin of the coordinate system (l = 0), R l is the distance between the node with number l and the origin of the coordinate system, x l is the x-coordinate of the l-th node.
By comparing these three contributions with the total lattice sum (Fig. 6) for the xpolarized dipoles located in glass with a period of P =550 nm, one can identify that only the Let us apply the model to predict and calculate the resonances of an infinite array of Si nanodisks with D=200 nm and P =550 nm placed in air or glass homogeneous surroundings (Fig. 7).In the former case, for the considered wavelength range, the diffractionless regime is realised.and around 650 nm for the magnetic dipole.Indeed, from the reflectance calculations in Fig. 7(e), we clearly see the individual electric (green) and magnetic (red) dipole resonances at those positions.The intensity of the magnetic dipole resonance is lower than the electric one.This is because for the magnetic dipole, the difference between the imaginary parts (red lines) of the dipole sum and inverse polarizability is larger than the electric dipole case.Furthermore, the total reflectance within the coupled-dipole approximation [Eq.( 5), black dashed line] has an excellent agreement with the full numerical (black solid line) calculation.
In the case of a glass environment, there are three resonant conditions in Fig. 7b, d  difference in the imaginary parts.Note that the magnetic resonance (at ∼800 nm) quality factor is higher than the electric one (at ∼825 nm).This is because its spectral position is closer to λ RA d .However, as in the case of air surrounding, the magnetic dipole resonances are much weaker than the electric ones.Very good agreement between the coupled-dipole model and the full numerical simulations is observed.

III. DERIVATION OF S IN THE FAR-FIELD APPROXIMATION
The lattice sum, which is essentially a Green's function, of a layered system can be semianalytically calculated in the Fourier space [7][8][9].Here, it is convenient to work in the real space.The lattice sum S in presence of a substrate can be presented as a sum of homogeneous S [see Eq. ( 6)] and additional sum S R accounting for the reflection from the substrate.In the far-field approximation, S R can be calculated analytically if one considers the electric far-field radiated along the surface of a flat substrate by an electric dipole moment p x placed near this surface at the point r 0 .Using Eqs.(B1) and (B2) as well as Eqs.(B5) and (B6) from Ref. [10], we obtain the x-component of the electric far field E x at the point with spherical coordinates (r, θ, ϕ) radiated by p x placed at r 0 = (0, 0, z p ), as a sum of the electric far field E 0 x of the wave directly propagating in the superstrate and the electric far field E R x of the wave reflected from the substrate with the reflection coefficients for s-and p-polarized waves where one considers that r >> |r 0 |, and k 0 and k d are the vacuum and superstrate wave numbers, respectively, and n = r/r = (sin θ cos ϕ, sin θ sin ϕ, cos θ) is the unit vector directed to the observation point.
From the reciprocity principle, one can show that the electric field at the point r created by the dipole point source located at r 0 is equivalent to the electric field at r 0 created by the same dipole located at r, i.e., p(r 0 , ω) • E(r, ω) = p(r, ω) • E(r 0 , ω).Using Eqs. ( 8) and ( 9), we can obtain the analytical estimation of the far-field part SFF of S = S + S R .Considering SFF = S FF + S R,FF , we have of the terms with large R l is negligible and SFF has to be finite for the total lattice sum S not to diverge.Hence, the far-field interparticle interaction is negligible and near-and middle-field interactions dominate.Thus, the value of S and SLR can be controlled by a choice of ∆ε.This also means that a metasurface can be relatively compact, which makes such systems even more attractive.
Notice that S (which is calculated numerically, see Methods) is higher than SFF (which is calculated analytically via Eq. 3) due to the non-negligible contribution of near-and medium-field terms (Fig. 9).

FIG. 2 .
FIG. 2. Resonant condition analysis.(a,b) Spectra of the inverse electric dipole polarizability 1/α p xx and the full lattice sum S for a metasurface in a homogeneous glass environment: (black) real and (red) imaginary parts.(c,d) Spectra of 1/ αp xx and S for a metasurface on a glass substrate with (red) air or (black) water superstrate (only the real part is shown).(e,f) Spectra of the difference of 1/ αp xx and S for a metasurface in the case of (red) air/glass and (black) water/glass superstrate/substrate combinations (only the imaginary part is shown).(g,h) Reflectance spectra of a metasurface for (red) air/glass and (black) water/glass cases.(a,c,e,g) correspond to P =550 nm and (b,d,f,h) correspond to P =450 nm; in all panels D=200 nm and H=100 nm; the superstrate and substrate are considered to be semi-infinite.The vertical black dashed line λ RA s indicates the position of the RA in the glass substrate.Filled circles in (a,b,c,d) indicate the spectral position of SLRs.

FIG. 3 .
FIG. 3. Transmission and reflection of the metasurface with different superstrates.(a,b) Scanning electron microscope (SEM) images of the fabricated metasurfaces: (a) M1 with D=185 nm and P =490 nm and (b) M2 with D=220 nm and P =440 nm.(c,d) Reflectance and (e,f) transmittance of metasurfaces (c,e) M1 and (d,f) M2 for (red) air and (black) water superstrates: (solid lines) experiment, (dashed lines) simulations.The vertical dashed lines correspond to the spectral position of the RAs of a glass substrate λ RA s .Insets show the colour representation of the corresponding spectra.

FIG. 4 .
FIG. 4. Dynamic tuning of the transmission and reflection of the metasurface via superstrate control.(a-d) Reflectance and (e-h) transmittance of metasurfaces (a,c,e,g) M1 and (b,d,f,h) M2 while dynamically changing the superstrate between air and water: (a,b,e,f) experimental spectra measured every 100 ms (snapshot of the Supplementary Movies M1R, M2R, M1T, and M2T, respectively), (c,d,g,f) simulated spectra for different levels of water.The insets show a particular frame of the recorded evaporation process of a water droplet from Supplementary Movies M1R, M2R, M1T, and M2T.The white circles in the frames indicate the collection area of reflected/transmitted light in the experiment.

FIG. 1 .FIG. 2 .
FIG. 1. Unit cell of a metasurface and refractive index of silicon.(a) Sketch of the unit cell of a metasurface: Si nanodisk of diameter D and height H are placed on a glass substrate.The particle is excited at normal incidence, with x-linearly polarized light.(b) Real (n, blue) and imaginary (k, red) parts of the refractive index of polycrystalline silicon used in the simulations.

FIG. 3 .
FIG. 3. Dipolar polarizabilities for different excitation conditions in a homogeneous environment.Real (blue) and imaginary (red) parts of the electric dipole polarizabilities [panels (a) and (b)] of Si nanodisk with D=200 nm located in (a) air and (b) glass surrounding condition.Solid lines are for linearly-polarized plane wave excitation from the top (E x and k z ) of the nanodisk, while dashed lines are for the side (E x and k y ) excitation.Panels (c) and (d) show the same plots for the magnetic dipole polarizabilities in air and glass surrounding conditions, respectively.

FIG. 4 .FIG. 5 .
FIG. 4. Single particle resonances under normal incidence illumination and in an inhomogeneous environment.Scattering efficiency (Q = 4σD −2 /π) spectrum of a single Si nanodisk with D=200 nm placed in (a) air and (b) water superstrate and on glass substrate.The Si nanodisk is irradiated with a linearly-polarized plane wave from the top of the nanodisk.The scattering efficiency (black line) is decomposed into individual electric (ED, green line) and magnetic (MD, red line) dipole contributions.

2 ,
the spectral positions of the metasurface resonances are determined by Re 1/α p1 xx − α p2 xx S/α p1 xx = Re 1/α p,eff xx α p,eff xx and α m,eff yy are the effective electric and magnetic dipole polarizabilities, respectively.It should be noted that the imaginary part of the denominator of Eqs.(3) defines the quality factor of a resonance.If it is not sufficiently small, one may not see a distinct resonance even though the conditions Eqs. (4) are fulfilled.Within the coupled-dipole approximation, the reflectance R and transmittance T of a metasurfaces can be written as [5] R = ik d 2A α p,eff xx − α m,eff yy 2 and T = 1 − ik d 2A α p,eff xx + α m,eff yy far-field contribution (red line) diverges at the Rayleigh anomaly wavelength (λ RA = P n d , where n d is the refractive index of surrounding medium) in contrast to the middle-(green dashed line) and near-(blue line) field parts.The divergent nature of S FF ensures that Eq. (4) has a solution.
Figures 7a and 7c visualize the roots of Eqs.(4a-b), which define the spectral position of the electric and magnetic lattice resonances, respectively.The metasurface's predicted resonances (the crossing point of blue lines) are around 625 nm for the electric dipole

FIG. 6 .
FIG. 6. Far-, middle-and near-field parts of the lattice dipole sum S. (a) Real and (b) imaginary parts of the far-(red), middle-(green dashed) and near-field (blue) contributions of S as a function of wavelength for the x-polarized dipoles located in glass.The vertical black dashed lines indicate the position of the Rayleigh anomaly λ RA d .Diameter and period of disks are D=200 nm and P =550 nm, respectively.
: one at the Rayleigh anomaly position λ RA d (vertical dashed line) and one on each sides of it.Because of the diffraction scattering into the homogeneous surrounding, resonances are not excited or strongly damped (large differences in the imaginary parts) in λ ≤ λ RA d region.In λ > λ RA d region, we see sharp electric and magnetic resonances (Fig. 7f) due to the minimal

FIG. 7 .
FIG. 7. Resonant conditions and spectra of the metasurface in homogeneous air and glass environments.(a,b) Spectra of 1/α p1 xx and S p = α p1 xx S/α p2 xx .(c,d) Spectra of 1/α m1 yy and S m = α m1 yy S/α m2 yy .(e,f) The reflectance spectra of the metasurface calculated via the full-wave numerical simulations and the coupled dipole approximation with individual electric and magnetic dipole contributions.the metasurafce is in (a,c,e) air and (b,d,h) glass surroundings.The vertical black dashed line λ RA d indicates the spectral position of the Rayleigh anomaly in glass.The disk parameters are D=200 nm, H=100 nm and P =550 nm, respectively.

FIG. 9 .FIG. 11 .FIG. 12 .
FIG. 9. Dipole lattice sum and resonance condition analysis in presence of a substrate.Spectra of (a) real and (b) imaginary parts of the numerically calculated full lattice sum S (solid lines) and its far-field part SFF (dashed lines) for the air (red) and water (black) superstrate.The lattice period is P =550 nm.

TABLE I .
Geometrical parameters of the fabricated metasurfaces.Nanodisks height is H=100 nm for all metasurfaces.