polynomials are used for the Laplace equation. One can refer, for example, to papers by Melenk, Hiptmair, Moiola, Perugia *et al.* cited above, to the references in these papers, and to Perrey-Debain’s paper [@Perrey-Debain-PW-convergence2006]. Much less attention has been paid to the inhomogeneous case [@Melenk95 Chapter IV], [@Melenk99 Section 3], [@Laghrouche-jumps2005; @Imbert-Gerard-interp-PW2015], which is substantially more complicated but at the same time more rewarding in practice.

For illustration, in Sections \[sec:Trefftz-homogenization\] and \[sec:FLAME-slab\] we consider two application examples where Trefftz approximations prove to be effective for two different variations of the generic setup shown in [Fig. \[fig:test-waves\]]{}. The first example is non-asymptotic and nonlocal two-scale homogenization. Instead of a single scatterer, in this case one deals with a periodic structure; Trefftz functions on the fine scale are Bloch waves traveling in different directions, and on the coarse scale – the corresponding plane waves.

The second example involves a common setup in metasurface and nanophotonics research: a patterned finite-thickness slab. This problem is especially challenging computationally when the pattern is non-periodic and the slab is geometrically large relative to the vacuum wavelength. One possible simulation procedure relies on high-order Trefftz difference schemes (FLAME). The Trefftz bases are computed “locally,” i.e. over 