Isospectral open cavities and gratings

Open cavities are often an essential component in the design of ultra-thin subwavelength metasurfaces and a typical requirement is that cavities have precise, often low frequency, resonances while simultaneously being physically compact. To aid this design challenge, we develop a methodology to allow isospectral twinning of reference cavities with either smaller or larger ones, enforcing their spectra to coincide so that open resonators are identical in terms of their complex eigenfrequencies. For open systems, the spectrum is not purely discrete and real, and we pay special attention to the accurate twinning of leaky modes associated with complex-valued eigenfrequencies with an imaginary part orders of magnitude lower than the real part. We further consider twinning of two-dimensional gratings, and model these with Floquet–Bloch conditions along one direction and perfectly matched layers in the other one; complex eigenfrequencies of special interest are located in the vicinity of the positive real line and further depend upon the Bloch wavenumber. The isospectral behaviour is illustrated, and quantified, throughout by numerical simulation using finite-element analysis.


Introduction
Acoustic metasurfaces, which have subwavelength thickness often constructed from local resonating structures, have found wide application to sound absorbing surfaces and surfaces that manipulate sound in often remarkable ways [1,2]; the performance of these surfaces is due to the resonators embedded in the surfaces and the resonance frequencies are directly connected to the geometry and volume of the resonant cavity with low frequencies requiring large volume.Many approaches have been taken to ensure metasurfaces remain ultra thin, even at low frequencies and approaches such as spiral or labyrinthine resonators are popular to save space and give added functionality [3].An approach, explored here, is to design smaller cavities that have matching wave frequency spectrum to larger reference cavities by designing the material properties within the resonator accordingly.We show that one can go further than simply match a single resonant frequency and one can match (i.e.twin) the entire wave frequency spectrum and hence match the entire behaviour of the cavities at all frequencies.Cavities with this perfect matching are called isospectral cavities and in a mathematical sense are defined as cavities with different shapes that exhibit identical eigenfrequencies, and their design presents an intriguing challenge in the field of wave physics.The ability to design such twinned cavities opens up new possibilities across various disciplines, including acoustics, electromagnetism, or water waves.By achieving isospectrality, two distinct resonators can exhibit indistinguishable wave behaviour, enabling applications such as creating rooms or auditoria with different geometries that possess identical sound characteristics or engineering elastic components with shared vibrational eigenfrequencies.
The history of isospectral problems can be traced back to the question famously posed by Mark Kac regarding whether one can hear the shape of a drum [4].The investigation of isospectral drums, where the Laplacian operator within closed domains with Dirichlet boundary conditions yields identical spectra for distinct regions sharing the same area, has produced significant results for specific cases and subsets of the problem [5].These isospectral problems in bounded domains are closely linked to inverse problems in open space [6], forming a rich area of research in the past.Furthermore, there has been a recent interest in the study of isospectral or quasi-isospectral potentials inspired by supersymmetric transformations as applied to electromagnetism [7].We proceed to utilise Transformation Acoustics (TA), which has been extensively applied for manipulating wave propagation in diverse physical fields sharing the same analytical structure, like electromagnetism [8], acoustics [9], elasticity [10,11,12], and many others fields [13].Perhaps the most striking and well-studied effect enabled by TA is cloaking, allowing perfect concealment of an arbitrary object using a singular transformation.However, another strategy proposed in the work by Li et al. [14], the so-called carpet cloak, requires non-singular transformations, making this route more suited for the practical implementation of the equivalent properties.Twinning closed cavities through TA has been recently developed by Lenz et al. in [15], where the discrete spectrum of a closed domain with Dirichlet boundary conditions is successfully matched.Here we consider unbounded open domains; this is not straightforward as spectral problems for open cavities allow for the leakage of energy into the unbounded medium, have complex eigenspectra and further complications for both theoretical and numerical aspects; we are unaware of attempts to achieve isospectral domains in open systems in wave physics and this opens the way to, for instance, twinning optical waveguides.
In primis, the eigenvalue problem of an unbounded open domain gives rise to complex valued eigenfrequencies ω, whose real part gives the resonant frequency and imaginary part describes the radiation losses through the unbounded region.One can distinguish eigenmodes in two categories: on one hand, the ones linked to a localised resonance within the cavity are called trapped modes and they are characterised by a high quality factor Q = ℜ(ω)/2|ℑ(ω)|.On the other hand, the so-called leaky modes or quasi-normal modes [16] exhibit higher damping in time, which gives rise to an exponential divergence in space, making them more challenging to compute numerically [17].In practice, it is not clear how sensitive the matching of such modes can be in terms of both real and imaginary part, particularly when those are of different magnitude.Moreover, the eigenspectra of open cavities show both continuous and discrete branches [18,19] and a non-singular transformation is required so that their topology is preserved [20,21].
Finally, from a numerical standpoint, the computation of resonances in open systems is complicated by the reflection of the leaky waves at the necessarily finite-grid boundaries.To tackle this issue, we use Perfectly Matched Layers (PML), whose analysis and performance for spectral problems have been extensively documented in the literature, see, e.g., [22,23,24,25,26].
The manuscript is organised as follows: Section 2 briefly outlines the main transformation acoustics tools and the notation adopted.In order to highlight the main effects and underlying ideas of the twinning process in a simple setting, we then give the closed form solution for two one-dimensional domains.In Section 3, we study the spectrum of an open cavity whose geometry allows both leaky and resonant modes.The transformed region is then further discretised using a layered medium that approximates the required anisotropic properties to demonstrate that conceptually one can use simpler building blocks to achieve the desired effects.Section 4 extends the method to the periodic case: we show that a saw-tooth grating can be matched by a flat, thinner metasurface by comparing the dispersion diagrams for the original and transformed elementary cell.Finally, in Section 5 we draw some conclusions and discuss potential extensions of the present work.

Twinning through transformation
We take a domain filled with an acoustic fluid supporting a pressure field, for time-harmonic waves, that satisfies Helmholtz's equation, where the filling fluid is characterised by a density ρ 0 and a bulk modulus κ 0 .The same procedure can be extended to other areas of wave physics sharing the same analytical structure i.e. anti-plane shear waves in elasticity and polarised waves in electromagnetism; we choose to use the setting of pressure acoustics without loss of generality.Transformation Acoustics [8,10,9] shows how to project a subdomain Σ c into a deformed subdomain σ c using the map χ : X → x while preserving the acoustic behaviour in the remaining subdomains, if particular properties are chosen inside σ c , and we follow this approach here.We indicate with capital letters X, P , and Ω the set of coordinates, the pressure field, and the frequencies respectively, defined on the undeformed (or material) domain Σ; lowercase letters x, p, and ω that refer to the deformed (or spatial) domain σ.
The generalised eigenvalue problem written with respect to the material domain Σ, is equivalent to that describes the pressure p with respect to the spatial domain σ.Here, ρ c is a tensor describing the equivalent anisotropic density and κ c is the equivalent bulk modulus after transformation.They are defined as where J := ∂ X χ(X) is the Jacobian matrix associated with the transformation (a push-forward) that describes the local deformation of the geometry.In the following we use a non-singular transformation to define two open cavities with different shapes but sharing the same spectrum.

1D analytical example: twinning a semi-infinite pipe
We outline the implications of this approach by considering a simple one dimensional problem that admits a closed form solution.
Let us consider the 1D semi-infinite spaces Σ and σ as shown in Figure 1a, they contain either one or two slabs of fluids different from the matrix.Namely, fluid i is characterised by a density ρ i ∈ R and bulk modulus κ i ∈ R, and it is contained in the geometric interval Σ i (or σ i ), for i = {0, 1, 2}.Note that a domain with only one slab can be easily handled as the special case of two slabs having the same properties.As a consequence, we can solve the eigenvalue problem for the most general configuration with two slabs and then readily analyse the pipe with only one slab.Note that this configuration is of interest because the slabs, having acoustic properties different from the matrix, behave like a cavity: this similarity leads to eigenmodes that are partially trapped inside the slab and that leak energy through the unbounded matrix.Let us consider the domain σ in Figure 1a.The eigenvalue problem describing the complex valued pressure p(x) : R → C on the three acoustic domains reads as: where we introduce the sound speed c i = κ i /ρ i , and the intervals σ 0 := [−a, −δ), σ 1 := [−δ, 0) and σ 2 := [0, +∞), for i = {1, 2, 3}.The boundary value problem is completed by the rigid boundary condition on the left end and the Sommerfeld condition at infinity where we have adopted the time-harmonic convention e jωt , being j the imaginary unit, i.e. j 2 = −1.
Moreover, the equilibrium and compatibility conditions hold on the interfaces at x = −δ and x = 0 By considering the dispersion relations ω = k i c i , i = {0, 1, 2} and choosing the ansatz that account for the resonances trapped in the slabs and p 2 (x) = A 2 e −jk2x + B 2 e +jk2x for the leakage through the matrix, the eigenvalue problem is solved if the boundary conditions are applied.We thus obtain the following equalities: If ρ 0 = ρ 1 and κ 0 = κ 1 , the two slabs merge together and the domain Σ shown in Figure 1a can be considered.In that case, equalities (7) simplify to This defines the set of eigenvalues where In the field of optics, this corresponds to Fabry-Perot resonances [27,28] at which light exhibits constructive interference after one round trip, with the imaginary part giving the the lifetime of a photon inside the cavity τ n = 2π/ℑΩ (n) .The corresponding eigenmodes are given by Note that, since the one slab configuration is referred as the material frame, capital letters are adopted.Figure 1b shows the shape of the first four eigenmodes, where one can remark the exponential growth which is an evidence of the leakage.
In the following, two twins of the pipe are obtained first by compressing a portion of the slab 1 and then by folding the space at the extremity of the pipe; both approaches give rise to a second slab of fluid, referred to with the index 0. We then compute the properties of the fluid filling the transformed domain σ such that the cavities share the same eigenvalues and eigenvectors.
Let us choose a linear map χ : In this case, the deformation gradient J = ∂ X x = a−δ b−δ is a scalar, so we obtain the following transformed properties by usage of the formulae (3).The resulting acoustic system is the one of a shorter pipe having two slabs of homogeneous properties, depicted in Figure 1a.Its eigenmodes are readily computed through equalities (7): where k 1 , and the eigenvalues ω (n) = Ω (n) are the same of the original cavity given by Eq. ( 9).Note that the eigenmodes are such that p(n As just illustrated, it is possible to transform the space and obtain a shorter or a longer twin cavity.However, as highlighted by Eq. ( 12), the properties change proportionally to the geometric stretch: if ρ is increased, κ should decrease accordingly.In general, a material with such properties  is not readily attainable, so in the following we define a slightly different strategy for twinning a cavity relying on space folding.
It is well known that space folding transformations [29] lead to Negative Index Materials (NIM) [30,31,32,33,34,35], whose effective properties are the consequence of localised resonances.Hence, we can leverage this mathematical abstraction to unlock alternative transformations and create another route for the design of isospectral open cavities.Let us consider the schematic on top of Figure 2a, the space [−c, −b) beyond the rigid extremity of the pipe is considered as the overlap of two complementary materials [32] whose acoustic behaviours annihilate each other.Through the transformation χ, such that they are unfolded onto a straight line and, like the negative of a photograph, their properties are equal but with opposite signs: ρ 0 = −ρ 1 , κ 0 = −κ 1 (doubly negative acoustic parameters can be achieved in practice with single resonance metamaterials [36], that constrains twinning to a small portion of the spectrum).This arrangement is highlighted in Figure 2 using complementary colours.Note that we chose c = (b+d)/2 such that only unitary (positive or negative) stretches arise, however different choices are possible.By applying once again the equalities (7), the closed form of the twin cavity eigenvalues is achieved: where the wavenumbers k (n) i are obtained using the dispersion relation ω i c i , and the eigenvalues are the same as Eq. ( 9); thus the cavity is a twin.
These trivial 1D cases share many features with several practical applications, for instance a duct where pressure waves propagate, or a string under tension sustaining transverse waves, etc.One can therefore substitute a portion of the domain with a shorter/longer one with equivalent parameters whilst keeping the same eigenfrequencies and alter the eigenmodes inside the transformed region only.

Manipulating a Helmholtz resonator
We now consider a 2D open cavity and cross-validate computations of its spectrum against numerical simulations of an ideal anisotropic fluid and also against an effective medium using layers [37], each having constant material properties, which illustrates an approach towards experimental realization.
Let us consider the geometry depicted in Figure 3a, the cavity is assumed to have sound hard boundary Γ and it communicates with the exterior medium through a small aperture; an artificial boundary is introduced to truncate the computational domain and it is surrounded by a Perfectly Matched Layer (PML) that mimics an infinite domain, see, e.g., [22].The cavity is large compared to the aperture such that trapped modes are encouraged to arise, while the small aperture allows energy to leak out from the system.The cavity is filled by a fluid of density ρ 0 = 1 kg m −3 and bulk modulus κ 0 = 1 Pa; the computational domain Σ ⊂ R 2 is partitioned in two non-overlapping sets Σ f and Σ c such that Σ = Σ f ∪ Σ c .The Helmholtz's equation is supplied with Neumann boundary conditions: where P (X) is the complex valued pressure defined on the material domain Σ.Note that the eigenvalue problem is obtained considering time-harmonic solutions of the form P (X, t) = ℜ(P (X)e jωt ).
A smaller twin cavity is defined by applying Transformation Acoustics, see Section 2, and defining a portion of anisotropic fluid, similar to a carpet cloak [14].Note that a smaller cavity simply filled with the ambient fluid would have higher resonance frequencies.Figure 3a-3(b) illustrates the geometry we consider and the result of the transformation χ : Σ → σ that maps the cavity geometry into a smaller one.In particular, the circular annulus Σ c of radii δ and b is mapped to a smaller one of radii δ and a < b, referred as the deformed domain σ c .The transformation is the identity inside the remaining domain Σ f , that is simply mapped into σ f ≡ Σ f .Also note that the boundary Γ is smoothly mapped onto γ. Figure 3c shows the transformed medium with the anisotropic fluid replaced by an effective medium made from layers of homogeneous material.
Since the cavity is semi-circular, it is convenient to transform the geometry adopting a polar reference system centred in O and described by the set of coordinates (R, Θ).Then χ : (R, Θ) → (r, θ) is such that where the only requirement is that f (a) = b and f (δ) = δ.We emphasise here that f (r) does not have to be monotonic, meaning situations implying space folding are encapsulated by the present method.This would require Negative Index Materials (NIM) [30,31,34] whose properties can be approximated by locally resonant material.For the sake of clarity, the effect of such a choice is discussed at the end of this section.The transformation gradient J := ∇ X x is Note that the mixed tensor J is expressed with respect to the canonical contravariant base (e r , e θ ) and covariant base (E R , E Θ ).Note also that no rotation is implied by the transformation, hence the deformation gradient is symmetric.This turns out to be useful if, for instance, the anisotropic transformed fluid is attained through a pentamode material, the reader is referred to [9] for a complete discussion.

Twinning via monotonic transform
For simplicity, we choose the linear function so the bulk modulus κ c and the tensor density ρ c of the transformed domain σ c are computed according to formulae (3) and, because of the axisymmetric geometry, these properties depend on the radial coordinate only.
In view of a real implementation of the anisotropic fluid through a metamaterial, it is fundamental to discuss how it affects the spectrum of the cavity.The stretch of the geometry induces an anisotropic density whose principal components are aligned with the radial and the tangential directions of the cavity, similarly to the invisibility cloak for axisymmetric obstacles see, e.g., [38].This situation lends itself to the use of a layered arrangement of two homogeneous and isotropic fluids for achieving the effective properties we need.The following analytical relations hold [38] for the effective properties: For our illustration, the anisotropic fluid is discretised by 10 layers of the same thickness δ r = (a − δ)/10 each one composed by two materials A and B of thickness ε = δ r /2, such that they approximate the anisotropic medium if homogenised two by two.A schematic of such arrangement is shown in Figure 3c.
We set r i := (2i + 1)ε, i ∈ {0, . . ., 9} the discrete radii pointing in the middle of each layer and κ i := κ c (r i ), ρ i r := ρ r (r i ), and ρ i θ := ρ θ (r i ) the transformed properties evaluated at r i .The two materials A and B in the i th layer are chosen to have the same bulk modulus such that while the densities are chosen as one can easily verify that Table 1 describes the properties of each layer used in the discretized version of the twinned cavity.

Twinning via non-monotonic transform
Lastly, we briefly consider the transformation enforced by a non-monotonous function f (r) that, as anticipated Section 2, leads to space folding.To show that the spectrum is matched, let us consider the annular region beyond the curved boundary of the cavity as an overlapped portion of space that can be unfolded into a plane space filled with complementary materials.As suggested by [34], the function is a natural choice for this circular geometry since it leads to an isotropic yet inhomogeneous medium, whose properties are ρ θ = ρ r = −ρ 0 and κ c = −r 4 /c 4 .Where c = √ bd and d = 2a describe the depth of the twin cavity equipped with a NIM layer, as for the 1D arrangement of section 2.1.

Twinning efficiency via modal assurance criterion
We now turn to a quantitative comparison of the spectrum of the reference cavity with the three configurations just defined (ideal, layer and NIM) and these are all modelled using a finite element method (COMSOL Multiphysics ® ).To ensure a fair comparison between the cases, the mesh characteristic size is set to h < δ r /4 in order to account for the spatially varying properties in the transformed domain and pressure fluctuations, for higher order modes in particular.In addition, Mode The first 20 computed eigenfrequencies are displayed; the first column being the reference cavity, the second column is the ideal transformation and these agree very closely.The final two columns show small discrepancies; the third because of the layer discretization, and the fourth due to fictitious damping that mainly affects the imaginary parts.The frequency highlighted in red is related to a PML resonance.
the finite element problems share the same mesh in order to minimise the numerical errors due to the discretization.The accuracy of the matching between the eigenfrequencies is expected to deteriorate for increasing frequencies, thus the 20 eigenvalues with real part larger than and closer to c 0 /5l = 0.2 Hz are computed in order to show this trend.Table 2 shows their values and highlights the good agreement between the reference and the ideal cases, and a strong match with the layered and NIM configurations.Please note that, in order to improve the numerical convergence for the NIM cavity, a small fictitious damping has been added to the negative material properties such that ρ c → (1 + i 1 × 10 −4 )ρ c and κ c → (1 + i 1 × 10 −4 )κ c ; this inherently leads to small differences in the solution of the eigenvalue problem for that case.
As an example, some eigenmodes are displayed in Figure 4 and notably we do not show the ideal case as the eigenvalues are identical to the reference case, in so far as digits shown, and the eigenfields are visually indistinguishable from each other.Since the precise comparison of the fields is not straightforward, a measure of the twinning is given by applying the so-called Modal Assurance Criterion (MAC) [39] which allows us to compare two eigenmodes by computing the following matrix:   where Σ f ≡ σ f is the portion of the geometry that does not undergo any transformation, p * is the complex conjugate of p, and the subscripts ref , ideal, layer, and N IM indicate respectively the reference cavity, the ideally twinned cavity, and the two cavities equipped with the layered and the NIM gratings.The indexes i and j specify the eigenmodes under comparison.Note that the MAC matrix is real valued and it assumes unitary values if and only if the two fields under comparison are identical inside σ f , except for an arbitrary scaling factor.So one can state that the twinning is satisfactory for all eigenmodes if the main diagonal terms of the M AC matrix are close to the unity.Thus the ideal, the layer, and the NIM twin cavities are compared to the reference one., and 1 − M AC N IM ij using a logarithmic colour scale, such that good twinning is highlighted by values close to 0. Figure 5a, relative to the ideal twin, shows a complete agreement for each and every mode, except the 19 th .This mode is very localized in the transformed region σ c , so the agreement cannot be captured by comparing σ f only.Figure 5b proves that the layered arrangement approximates the ideal behaviour because most of the modes show excellent agreement with the reference ones.Lastly, Figure 5c shows a weaker match, due to the fictitious damping.Some of the off-diagonal terms are close to 0 even if the corresponding modes have very different frequencies.Indeed, those modes have a similar shape inside the test region σ f , but since they are far in frequency, they can be easily disregarded.
Finally, the spectra of the four cavities are compared by computing the first 100 eigenfrequencies.Figure 6a shows that they superpose in the complex plane and the relative errors in Figure 6b are small: below 1 × 10 −5 for the ideal twin, below 1 × 10 −2 for the layered twin, and below 5 × 10 −2 for the NIM twin.Thus we obtain, numerically, that the spectrum is matched for both real and imaginary parts and hence that our design methodology is validated for open systems.

Flattening a blazed grating
We now illustrate our approach for twinning open cavities by considering a class of diffraction gratings.Structured surfaces, such as the saw-tooth one depicted in Figure 7, usually called blazed or echelette gratings, are widely used in electromagnetism, for instance in high-resolution spectroscopy and spectrometers [40,41], for their ability to diffract incident light into a given direction [42].We  now create a metasurface having the same behaviour as the echelette grating, but characterised by a completely flat profile, and use the formalism of acoustics.
Each unit cell of the echelette is considered as an open cavity, and a twinned cell is defined to enable us to build a flat metasurface thinner than the reference grating.Finally, we test the twinning showing a complete agreement between the dispersion diagrams of the grating and the flat metasurface.Using the periodicity along the horizontal direction the acoustic behaviour of the metasurface, displayed in Figure 7, is analysed by considering a single unit cell of width l and imposing the Floquet-Bloch periodicity on the two vertical cell boundaries.We now focus on the transformation applied to the geometry of each cell such that the saw-tooth metasurface is mapped into a flat one.
As in section 4, the elementary cell Σ (filled with a fluid having ρ 0 = 1 kg/m 3 and κ = 1 Pa) is partitioned into two domains: Σ c subjected to the transformation and Σ f kept unaltered.The transformation we use involves the entire triangular cavity and an arbitrary portion of the fluid outside which is necessary in order to avoid singularities.The rigid boundary Γ is continuously mapped onto a flat boundary; thus, for example, the point C cannot be mapped on B or D, but is mapped to a point between them.The transformation we choose projects the point C on the line BD along the bisector of the angle BCD, as shown in Figure 7.
This transformation is not unique and one can transform by stretching the domain in many different ways, controlling the amount of stretch imposed to the geometry or even imposing a space folding.This flexibility is potentially valuable in practical terms as according to the precice choice, the transformed properties can scale towards values smaller or greater than those of the fluid, and can be influenced by the availability of materials for implementation.
For the transformation we take the orthonormal rotated reference systems XOY ≡ xOy displayed in Figure 7, where one axis is parallel to the bisector of the angle BCD; this simplifies the analytical expression of the transformation.Following [15] we define three curves Y 0 (X), Y 1 (X) and Y 2 (X) that correspond to the lines ACD, ABD, and AED respectively.The transformation χ is such that the points between Y 0 and Y 2 are linearly mapped to points between Y 1 and Y 2 .That is: where α(X) . The deformation gradient is then given by: and the transformed properties ρ c and κ c are computed according to Eq. ( 3).The tensor ρ c is related to the rotated reference system xOy, thus it has been rotated such that its components are referred to the original Cartesian system; the plots of Figure 8a show the properties obtained on a colour scale.Numerical simulations are performed to find the dispersion curves, i.e. the eigenspectra, that relate frequency to Bloch wavenumber, k, and these use the original and transformed unit cells in the finite element simulations that are augmented with a cartesian PML that truncates the semi-infinite medium.From periodicity the dispersion diagrams only require variation of the wavenumber k in the first Brillouin zone [0, π/l].Figure 9 compares the dispersion diagrams of the twinned cavities: both real and imaginary parts of the frequency show a very good agreement, indicating the ability to twin all the dispersion properties for these periodic structures.We note that a similar approach was implemented in [43] to quantify the cloaking efficiency of carpet cloaks.However, dispersion diagrams were an aside in a study addressing scattering problems.
Turning now to creating an effective medium approximation using discrete elements made from materials with homogeneous properties.Noting that significant inhomogeneity can arise in the transformed medium, so the layered arrangement adopted in Section 3 is not possible due to the rapid spatial variations, we introduce an intermediate discretization: a graded metamaterial, constructed from simple components, is designed by dividing the transformed domain into small cells with homogeneous properties, such that each cell can be constructed using, e.g., a layered medium with     different orientations with anisotropic effective properties.
To evaluate this discretized approach, the transformed domain is divided into square cells of size l/10 and the properties are considered piecewise constant such that each pixel has the values given by ρ c (x) and κ c (x) evaluated in its centre.The discretized arrangement is showed in Figure 8b.Numerical simulations enable us to evaluate the twinning numerically and we show results for the Floquet-Bloch ansatz with k = 0 rad m −1 and the eigenmodes and the eigenfrequencies of the twins are compared through the MAC and the errors shown in Figure 10.In particular, Figure 10a highlights that eigenmodes corresponding to higher frequencies are more affected by the discretization than the low frequency modes; higher frequencies are associated with shorter wavelengths that are more sensitive to a discrete arrangement with similar lengthscales.Figure 10b shows the errors introduced on the eigenmodes by the ideal and the discrete twinning; while the former comes from numerical approximations only, the latter mainly suffers from the coarse discretization used.

Conclusions
The scheme validated through this work suggests a viable way to design the shape of twin open cavities, i.e. those cavities intended to resonate with the same spectrum of a reference cavity, but having a different geometry.We have chosen examples to display the versatility of the approach, i.e. a resonant Helmholtz cavity, which is a good test of the approach having both trapped and leaky modes to reproduce and then a case from periodic systems, which is non-resonant but now has sharp corners.The upshot is that one could take designs from the literature that use constant parameter acoustic fluids as the reference and then transform then to other more convenient geometries.The resultant cavity/surface would have some region with anisotropic fluid within it but, as demonstrated, this could be replaced by layered or discrete homogeneous media as effective replacements.
We show that unbounded domains can be twinned by applying transformation theory: this reveals multiple ways of resizing an open cavity, for instance, the inner wall of a small cavity is covered with an ad hoc layered medium so that it has a spectrum identical to a larger one (or a smaller one for a space folding transform).Both the discrete and the continuous branches of the complex valued spectrum are restored within very good tolerance regardless of the quality factor of the eigenmodes.We also chose a more challenging case consisting in flattening a blazed grating, and the method is shown to be robust even with strong inhomogeneities.The accuracy of the twinning remains within a good tolerance even when a coarse discretization oriented to realise the metasurface is taken into account.Via the Floquet-Bloch theorem, the assessment is performed comparing the dispersion diagrams of the grating and its twins.
In the context of metasurfaces based around resonators we anticipate that the mathematical approach taken here will allow thinner surfaces to be designed that have low frequency resonators taking up less space.The twinning works almost perfectly for an ideal anisotropic fluid and still provides isospectrality even when an effective medium, made of homogeneous layers, is used to mimic the anisotropic fluid.Our theoretical and numerical results hold in the context of anti-plane shear elasticity and transverse electromagnetism.This provides confidence that such twinned cavities could be fabricated and motivates further experimental work.

Figure 1 :
Figure 1: (a) A schematic of the reference leaky resonant cavity (top) with domain Σ and the transformed (bottom) domain σ.(b) A plot of the real part of the first four eigenmodes: (top) the reference configuration, (bottom) the transformed one.The modes inside [−b, −δ] of the reference configuration are compressed into [−a, −δ] for the transformed domain whilst they match for [−δ, +∞).

Figure 2 :
Figure 2: (a) A schematic of the reference leaky resonant cavity (top) and the transformed (bottom) domain.(b) The plot of the real part of the first four eigenmodes: (top) the reference configuration, and (bottom) the transformed one.The modes inside [−d, −b] of the transformed configuration are symmetric with respect to the point −c and, if folded into [−c, −b], they annihilate each other; the eigenmodes are preserved in the half space [−b, +∞).

Figure 3 :
Figure 3: (a) Virtual geometry of the reference cavity, both Σ f and Σ c are filled with a homogeneous fluid; (b) ideally twinned cavity, σ f is filled with a homogeneous fluid while σ c is filled with the anisotropic fluid; (c) the anisotropic fluid is approximated by a graded layered metamaterial.The geometry is defined by h = l = 1 m, t = 1.2l, a = 3l, b = 1.5a and δ = 0.5a.

Figure 4 :
Figure 4: The three columns show the absolute value of the pressure for three eigenmodes of the original cavity (left), the cavity cloaked with a layered metamaterial (centre), and the enlarged cavity equipped with a layer of NIM (right).(a), (b) and (c) show the twinning of a mode mainly characterized by leakage; (d), (e) and (f) show a trapped resonance with some leakage; (g), (h) and (i) show a pure trapped mode inside the cavity.The dashed blue lines highlights the PML, the undeformed domain, and the metamaterial layers.

Figure 5 :
Figure 5: The computed eigenmodes of the original cavity are compared with (a) the ideal,(b) the layer, and the (c) NIM twin cavities.We use a logarithmic scale to allow the twinning to be more easily seen; more accurate twinning corresponds to smaller values.
Figure 5 displays the matrices 1 − M AC ideal ij , 1 − M AC layer ij

Figure 6 :
Figure 6: The first 100 eigenfrequencies of the four cavities are compared in (a) and the relative errors with respect to the reference are shown in (b).On the complex plane, we can distinguish an oblique straight line collecting the resonances induced by the PML and a cloud of points close to the real axis that contains the trapped cavity resonances.

Figure 7 :
Figure 7: Sketch of the metasurface and transformation.Left: the saw-tooth grating described by its depth h and period l; middle: a portion of the domain Σ c is transformed to a rectangle called σ c using a projection with respect to the rotated reference systems XOY = xOy; right: flattened metasurface having the same acoustic behaviour as the saw-tooth grating.l = 1 m, h = l/2, t = 2l.

Figure 8 :
Figure 8: Transformed properties normalised with respect to the fluid properties κ 0 and ρ 0 .The transformation changes the material properties according to the stretch imposed.Values are displayed in colour scale, for the ideal (a) and discretized (b) twins.Note that the transformation keeps the properties unaltered in a triangle close to the upper left vertex since the curves Y 0 and Y 1 are superimposed along AB.

Figure 9 :
Figure 9: The two dispersion diagrams of the metasurface and its ideal twin superimposed; (a) real and (b) imaginary parts of the frequency.

Figure 10 :
Figure 10: (a) MAC comparing the discretized twin against the reference echelette; (b) errors of the complex valued eigenfrequencies for the ideal and the discrete twins.

Table 1 :
Bulk moduli and densities of each layer composing the metamaterial inside the cavity.