{'fraction_non_alphanumeric': 0.027048996524274022, 'fraction_numerical': 0.009277945958067049, 'mean_word_length': 4.849647483193967, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Interaction of microwave photons with nanostructured magnetic metasurfaces

A theoretical formalism for the description of the interaction of microwave photons with a thin (compared to the photon wavelength) magnetic metasurface comprised of dipolarly interacting nano-scale magnetic elements is developed. A scattering matrix describing the processes of photon transmission and reflection at the metasurface boundary is derived. As an example of the use of the developed formalism, it is demonstrated, that the introduction of a magnetic metasurface inside a microstrip electromagnetic waveguide quantitatively changes the dispersion relation of the fundamental waveguide mode, opening a non-propagation frequency band gap in the waveguide spectrum. The frequency position and the width of the band gap are dependent on the waveguide thickness, and can be controlled dynamically by switching the magnetic ground state of the metasurface. For sufficiently thin waveguides the position of the band gap is shifted from the resonance absorption frequency of the metasurface. In such a case, the magnetic metasurface inside a waveguide works as an efficient reflector, as the energy absorption in the metasurface is small, and most of the electromagnetic energy inside the non-propagation band gap is reflected.


I. INTRODUCTION
The traditional approach to the development of tunable microwave devices is to use in them magnetic materials magnetized externally by a variable bias magnetic field created by a combination of permanent magnets and electromagnets 1,2 . The presence of bulky and heavy magnets, that also bring a significant dependence of the bias magnetic field on the temperature, limits the applications of the magnetically biased and tunable devices in modern microwave electronics.
On the other hand, the paradigm of reconfigurable metamaterials 3 and the idea of transformation optics 4 introduced a possibility of a precise control of electromagnetic waves. The reconfigurable metamaterials have been demonstrated experimentally using, for example, micro-mechanical properties [5][6][7][8] , electrostatic forces 9,10 and temperature 11 .
However, it is highly desirable to have a reconfigurable metamaterial with ultra-short switching times, capable of working without mechanical changes in structure and without a bias magnetic field. To address this problem a new concept of nano-structured magnetic metamaterials based on the dipolarly coupled arrays of single-domain magnetic nanoelements has been introduced 12,13 . The elements in these arrays are sufficiently small to be monodomain and have sufficient shape or crystallographic anisotropy to keep a definite direction of their static magnetization in the absence of an external bias magnetic field. If the anisotropy of the array element is uniaxialeach element is bi-stable, and can exist in quasi-stable states with two opposite directions of its static magnetization. The collective static magnetization state of an array of dipolarly coupled magnetic elements depends on the structure of the 2D periodic lattice of the ar-ray, and, also, on the magnetization "prehistory", and can be switched by the application of short (less than 100 ns) pulses of an external bias magnetic field 14,15 . Obviously, when the static magnetization state of an array is changed-the microwave absorption properties of the array are changed also, and the difference of the microwave absorption frequencies of the same array existing in two different static magnetization states may exceed several linewidths of the array's absorption line 12,14 . Between the switches the bias magnetic field is not necessary for the functioning of the array as a passive microwave device.
The possibility to dynamically control the microwave properties of the nano-structured magnetic metamaterials and to use them without a permanent bias magnetic field creates significant advantages for the devices based on these metamaterials compared to the traditional devices based on continuous magnetic films and multilayers 16,17 . However, the amount of magnetic material in the magnetic nanowire arrays is so small, that the microwave absorption in them is too small for most practical applications.
In this paper we continue to study interaction of microwave electromagnetic fields with magnetic metasurfaces, and introduce a scattering matrix formalism (similar to the formalism described in [26]) describing the scat-tering of microwave photons at magnetic metasurfaces. In the framework of this formalism the electromagnetic field is represented as a superposition of photons with two opposite circular polarizations, and the central result of this work is the derivation of a photon scattering matrix S of the nanostructured magnetic metasurface. Having an explicit expression for the photon scattering matrix, it is straightforward to calculate the photon transmission, reflection and/or change of spin at the interface of a magnetic metasurface.
To illustrate the application of our formalism to the solution of a practical electrodynamic problem, we present below the calculation of the dispersion equation of the main electromagnetic waveguide mode propagating in a parallel-plate microstrip waveguide containing an array of magnetic nanowires oriented parallel to the conductive plates of the waveguide. It is important to stress, that the solution of such an electrodynamic problem is highly non-trivial, as this problem has drastically different spatial scales: the scale of the monodomain magnetic nano-element of the metasurface (nm), and the wavelength of the main electrodynamic mode of the waveguide (cm or mm). This difference in spatial scales makes the problem extremely difficult for the standard finitedifference methods. The direct numerical modeling of such a system is prohibitively time-consuming. Also, due to the fact that the dynamics of magnetization in magnetic nano-elements comprising the magnetic metasurface is governed by the Landau-Lifshitz-Gilbert (LLG) equations, we have an additional complication related to the necessity to solve the Maxwell equations simultaneously with the LLG equation 27,28 .
The other possible approaches to this problem include the "effective medium" approach and the multiplescattering theory 29 . However, a simple Maxwell-Garnett scheme can not be directly applied to the ferromagnetic elements 30 , because the magnetic permeability of a ferromagnetic element depends on the internal magnetic field, which is created by all the other ferromagnetic elements in the metasurface 31 . A rigorous Clausius-Mossotti model, also, can be applied to the derivation of the effective medium constants for a magnetic metasurface 24,25 , but it requires the solution of a highly nontrivial problem of an electromagnetic wave scattering on a nano-scale magnetic scatterer of an arbitrary shape. To escape these complications, below we propose to use a standard spin-wave theory to find spectra of collective spin wave excitations of a magnetic metasurface comprised of interacting magnetic elements of an arbitrary shape 12 .
We demonstrate below that using the developed formalism of the photon scattering matrix this problem can be solved analytically. In this solution we show, that the multiple reflections of the electromagnetic wave from the magnetic metasurface substantially increase the efficiency of the interaction between the propagating wave and the metasurface. The introduction of even a very thin magnetic metasurface (7 × 10 −4 times thin-ner than the free-space wavelength of the electromagnetic wave) into a waveguide leads to the appearance of a non-propagation bandgap in the dispersion law of the main mode of the waveguide. The frequency position of the bandgap can be changed by switching the magnetic ground state of the magnetic dot array comprising the metasurface. It is also important to note, that this band gap is associated with the reflection of the propagating waveguide mode from the magnetic metasurface, rather than with the mode absorption in this metasurface. This strong reflection is caused by the transformation of the electromagnetic field inside the waveguide caused by the necessity to fulfill the boundary conditions for electric and magnetic fields at the upper and lower surfaces of the magnetic metasurface. We also demonstrate below, that for a sufficiently thin waveguide it is possible to choose the parameters of the metasurface and the waveguide in such a way, that the dissipation of the electromagnetic wave at the frequencies situated inside the band gap is minimized, and the waveguide containing a metasurface acts as an almost ideal reflector of electromagnetic waves.
The paper has the following structure. In Sec. II we derive a photon scattering matrix formalism for magnetic metasurfaces. In Sec. III we apply the developed formalism to a problem of a wave propagation in a parallel-plate waveguide containing a magnetic metasurface. In Sec. IV we present numerical (but not micromagnetic) results for the dispersion of a fundamental mode in a waveguide containing magnetic metasurface. The conclusions are given in Sec. V.

A. Boundary conditions
We consider a microwave electromagnetic field of the frequency ω in a free space containing a nanostructured magnetic metasurface, see Fig 1. The thickness d of the metasurface is assumed to be much smaller than the wavelength d ≪ 2πc 0 /ω of the propagating waveguide mode, where c 0 is the speed of light. It is also assumed, that the profile of static magnetization is uniform along the length of the nanowires comprising a metasurface.
For the further consideration we introduce an orthonormal coordinate system (Ü, Ý, Þ). Here, Þ is a unit vector perpendicular the metasurface, Ü lays along the intersection of the metasurface and the plane of incidence of the microwave photons (see below) , and Ý = Þ × Ü (see Fig. 1. We also assume that the metasurface is located at z = 0. At the metasurface the microwave electric (e) and magnetic (h) fields satisfy the following boundary conditions 18,[23][24][25] : where, e ± = e(z = ±0), h ± = h(z = ±0),χ is the external susceptibility tensor of a magnetic metasurface 18 , ∇ ρ = Ü ∂/∂x + Ý ∂/∂y is the in-plane differential operator, ⊗ denotes the direct vector product, and h = h + + h − ) /2 is an average magnetic field acting on the metasurface.
The electrodynamic boundary conditions at a metasurface that are very similar to (1) were used previously [23][24][25] to calculate the transmission of electromagnetic waves through a metasurface using a Clausius-Mossotti-like model. The model of a metasurface presented in 23-25 is very general, and can be applied to metasurfaces of different types.
However, the Clausius-Mossotti procedure is rather complicated technically for the metasurfaces comprised of strongly interacting magnetic elements that we are describing in our current work. In our approach, this procedure is not necessary, because the external susceptibility tensor chi, which we use in our boundary conditions (1)), is calculated using the spectra of collective spinwave excitations of the nanostructured magnetic metasurface (see Sec. IV and [18] for details). These spectra are dependent on the shapes, magnetic parameters and the lattice structure of an array of magnetic nanoelements comprising the magnetic metasurface, thus giving a simple, but qualitatively correct description of the collective dynamic magnetic properties of the metasurface.

B. Photon representation
To solve electrodynamic problems involving magnetic metasurfaces one, typically, needs to find a solution of Maxwell equations with the boundary conditions (1) and other boundary conditions defining a particular problem. The direct solution of such a system of equations in terms of the components of vectors e and h describing dynamical electric and magnetic fields is usually difficult, because the boundary conditions (1) themselves satisfy the Maxwell equations, thus making the system of equations overdetermined and degenerate. Of course, in each particular case it is possible to find a projection of the equations to avoid the degeneracy, but this difficulty has to be dealt with on a case-by-case basis.
Our way out of this difficulty will be to use a conventional scattering matrix formalism 26 , where we operate with the complex amplitudes of photons, which are the elementary excitations of an electromagnetic field that satisfy the Maxwell equations. This approach simplifies the calculations considerably, and provides a general framework, that could be used to solve a variety of electrodynamic problems involving magnetic metasurfaces based on the arrays of interacting magnetic nanoelements.
First, we write a six-dimensional electromagnetic field vector comprised of the components of the threedimensional vectors e and h in the form: This representation looks natural, but is not convenient, since only four components of the vector f are linearly independent, because the electric and magnetic fields are connected by the Maxwell equations. Thus, below we will make several formal steps to transfer the problem from the six-dimensional space, involving projections of the variable electric and magnetic fields, to a fourdimensional space, involving photon amplitudes, thus removing the degeneracy of the boundary conditions (1). The electromagnetic field can be represented as a superposition of photons. The photons with the frequency ω have wavevectors k 0 with |k 0 | = k 0 = ω/c 0 . Since we are interested in the interaction of photons with a metasurface lying in the (Ü, Ý) plane, we consider here only the photons having equal projections of their wave vectors onto the (Ü, Ý) plane. Of course, there is a possibility of an alternative representation of the electromagnetic field as a superposition of the s-and p-polarized plane waves 23 . However, in such a case the s-and pwaves have different projections on the direction of the magnetic field at the metasurface, and are not completely equivalent. In contrast, when the basis of circularly polarized waves (photons) is used, the photons having left and right circular polarizations are absolutely equivalent.
There are four types of such photons distinguished by their direction of propagation σ = sign(Þ · k 0 ) = ±1, namely propagating along and counter the positive direction of the axis Þ, and their chirality s = ±1, associated with the photon spin. Without loss of generality we can assume that the wavevector k 0 lies in the (Ü, Þ) plane, which allows us to define the propagation angle as: and −π/2 < θ < π/2, see Fig. 1.
For each of the four above introduced photon modes we can define a six-dimensional vector of the electromagnetic fieldf s σ . These six-dimensional "photon mode" vectors will be used below as a four-dimensional basis in the sixdimensional space to represent the electromagnetic fields: where σ = −σÜ cos θ + Þ sin θ. Each of the photon modes carries a spin of 32 : where for the electric field of in thef s σ mode. By the definition |s s σ | = and the direction of s s σ is collinear with k 0 . The projection of spin s s σ of each of the photon modes on the axis Þ is: and does not depend on the direction of propagation. From the definition, it is seen, that the sign of the projection is connected with the photon chirality. It is also convenient to introduce a dual vector basisǧ s σ to the vectorsf s σ , the elements of which we will call projectors and define it as: One can easily check that the vectors forming the basis of the "photon modes" (4) and the basis of "projectors" (7) satisfy the following orthogonality relation: where δ is the Kronecker symbol. Using the basis of the "photon modes" (4) one can represent the dynamical electromagnetic field as a superposition of photons traveling in the directions along and counter to the positive direction of the Þ axis and having the wavevectors k 0 and k ′ 0 = k 0 − 2Þ(Þ · k 0 ): where q s σ are the complex amplitudes of the "photon modes", and σ = Þ · k 0 /|Þ · k 0 |. The modulus of the complex amplitude has a physical meaning of the photon density, while the argument of this amplitude defines the phase of a particular mode.

C. Scattering matrix
The metasurface plane divides the space into two subspaces. In each sub-space there are two classes of photons: the photons traveling towards and the photons traveling from the metasurface. We shall name the photons of the first class incident photons, while the photon of the second class scattered photons. Fixing some vector k 0 and using the representation (9) we can express the electromagnetic fields at the both sides of the metasurface in the following form: where 1 stands for −1 and ρ is a vector lying in the (x, y) plane. Here a s σ is the complex amplitude of the incident photon, while b s σ is the complex amplitude of the scattered photon. Substituting these decompositions for electromagnetic fields in the boundary conditions (1) and regrouping terms we get: where:B and0 is the 3x3 zero matrix. Multiplying Eq. (11) by the projectorsǧ s σ we obtain four scalar equations, which can be written in a matrix form as follows: whereã = a 1 1 a 1 1 a 1 1 a are the 4-dimensional vectors consisting of the amplitudes of the incident and scattered photons,Î is the four-dimensional identity matrix andÛ is the 4 x 4 matrix, the elements of which are calculated as follows: The four-dimensional matrixÛ is the projection of the six-dimensional boundary operatorB into the fourdimensional space, and the explicit expressions for the matrix elements ofÛ are presented in the Appendix.
Using these matrix elements we can, finally, write a simple expression relating the amplitudes of the scattered photons to the amplitudes of the incident photons via the scattering matrixŜ:b Eq. (17) is the representation of the the boundary conditions (1) in the "photon basis". It is clear, that in this four-dimensional photon basis the boundary condition have a simple and compact form. This representation of the boundary conditions at the sides of a magnetic metasurface is the central result of this paper. The developed formalism of the "photon amplitudes", similarly to the formalism of "second quantization" in quantum mechanics, is coordinate-independent, making it convenient to use this formalism in a wide class of electrodynamic problems. When the explicit form of the scattering ma-trixŜ is known, it is possible to solve almost any electrodynamic problem involving a magnetic metasurface characterized by the external susceptibility tensorχ as a standard problem in a linear scattering formalism. We note, that a similar scattering matrixŜ was obtained using the basis of plane linearly polarized waves in 23,24 .
Since the linearly independent basis of our problem is four-dimensional, the symmetry properties of the 4x4 ma-trixÛ determine all the symmetry properties of the scattering process of an electromagnetic wave from a magnetic metasurface. For example, if the 3x3 external susceptibility tensor of a metasurface is Hermitianχ =χ † , the 4x4 scattering matrixÛ of this metasurface is also HermitianÛ =Û † , and the scattering matrixŜ ·Ŝ † =Î is unitary, meaning that there is no dissipation in the process of transmission and reflection of electromagnetic waves at this metasurface.

III. ELECTROMAGNETIC WAVEGUIDE CONTAINING A MAGNETIC METASURFACE
To demonstrate an application of our theoretical formalism to a particular electrodynamic problem we consider below the scattering of an electromagnetic wave propagating in a parallel-plate strip-line microwave waveguide of the thickness L = 2l from a magnetic metasurface placed inside the waveguide at the distance l from the bottom conductive plate of the waveguide, parallel to this plate (see Fig. 2(a)). The thickness of the metasurface is d, and it is assumed to be small d ≪ l.
The electromagnetic field in the waveguide must satisfy the Maxwell equations, the boundary conditions (1) on the metasurface and the Leontovich boundary conditions 33 at the conductive plates. Instead, of facing this complex system of equations we use the developed formalism of the scattering matrices to find the influence of the magnetic metasurface on the dispersion properties of the elextromagnetic wave propagating on a waveguide.
The electromagnetic field of any particular mode traveling in the waveguide and having the wavenumber k can be represented as a set of photons 34 reflecting between the plates with some complex propagation angle θ with respect to the axis Þ, see Fig. 2(b). The photons are scattered by the metasurface, travel to the plates, than are reflected by the conductive plates, and, finally, travel back to the metasurface. Reflection from a conductive plate reverses the photon's propagation direction σ and changes its amplitude, and after the reflection from the plates the photons return to the metasurface ( see Fig. 2(b)). The amplitudes c of these "new" incident photons can be related to the amplitudes b of the scattered photons by the expression: where p 1 = r 1 + r 2 , p 2 = 1 + r 1 − r 2 , and the coefficients r 1 and r 2 are found from the Leontovich boundary conditions 33 : where ζ = (1 − i) ωρ/(2µ 0 c 2 0 ) is the relative impedance of the conductive surface and ρ is the resistivity of the metal forming this surface. In a stationary regime the new incident photons must be identical to the initial photonsã =c. This condition leads us to the following equation: The non-trivial solutions of (21) exist if and only if: This condition yields a secular equation for the waveguide modes. Finding roots θ j of the secular equation for a given frequency, one can obtain a dispersion relation for the j-th mode of a waveguide: Even in the case when there is no loss of energy in the metasurface (χ is Hermitian) and in the conductive plates (ρ = 0), the solution of the secular equation (23) can be complex. The complex angle θ j stands for the evanescent waves in the waveguide, and the wave number of the propagating wave in this case also becomes complex. For the lossless case all boundary conditions are conservative, and those evanescent waves are associated not with the damping, but with the fact, that propagating electromagnetic waves can not simultaneously satisfy all the boundary conditions. This effect is, in a way, similar to the total internal reflection in dielectrics 35 . If the waveguide is sufficiently wide to support several modes 34 the secular equation (23) has multiple real solutions. From the computational point of view the secular equation (23) is an equation for a single complex variable, and it can be solved numerically in practically all cases.
Having calculated the propagation angle θ j for the jth waveguide mode, one can substitute it back into the matrixD(ω, θ j ) and calculate the vectorã kj which is a non-trivial solution of this homogeneous equation. Substituting the found vectorã kj forã into (17) one can find the amplitudes of the scattered photonsb kj . Then a distribution of the electric and magnetic fields in the waveguide can be calculated from (9): (25) where σ = sign z. Thus, we have shown, that the developed theoretical formalism of photon scattering matrices allows one to solve analytically the problem of electromagnetic wave propagation in a parallel-plate waveguide containing a magnetic metasurface and having plates of a finite conductivity. The magnetic metasurface could have an arbitrary susceptibility tensorχ, meaning an arbitrary complex magnetic ground state and an arbitrary direction of the static magnetization 12,13,18 . We provided a method to compute the dispersion relation for the waveguide modes (24) and the field distribution of each of these modes (25). It is important to note, that the developed formalism allows one to treat electrodynamic problem involving arbitrarily complex magnetic metasurfaces in a way, that is very similar to the solution of well-known problems, like photon scattering from a conductive surface 33 .
Below, we briefly discuss the conditions of applicability of the proposed model. The boundary conditions (1) were obtained in the magnetostatic approximation. In this approximation it is assumed, that the spin-waves in the array travel much slower than the electromagnetic waves, i.e. v sw ≪ c 0 . For the parameters of a typical array of magnetic nano-elements the spin-waves are rather slow 36 v sw ≈ 1 km/ s, so this condition is fulfilled naturally. Another important assumption was made concerning the array's thickness. The external electromagnetic field acting on the array (see [18] for details) was assumed to be uniform across the array, meaning that all the other geometric parameters of the problem should be larger than the array's thickness. This condition requires that the distance between the waveguide plates is much larger than the array's thickness. These approximations considerably simplify the employed mathematical formalism. A similar problem, where some of the above limitations are relaxed, can be solved using a more rigorous approach of Clausius-Mossotti 23,25 , but at a cost of much more complicated computations.

IV. RESULTS
In our numerical example, we considered a magnetic metasurface, created by an array of magnetic nanowires, oriented perpendicularly to the plane of the array. The array is placed in the middle of a parallel-plate waveguide. The waveguide plates are assumed to be made of copper with the electrical resistivity ρ = 1.68×10 −8 Ω·m. The nanowires 37 are assumed to be made of made of Permalloy, to have the height d = 10 µm and radius r = 60 nm, and to be arranged into a square lattice with the lattice constant A = 220 nm. The array can exist in two ground states, namely, the ferromagnetic (FM)state, when all the magnetic moments are orientated in the same direction, and the chessboard antiferromangetic (CAFM)state, when the nearest neighbors have their magnetic moments oriented in the opposite directions 12 .
For these two (FM and CAFM) ground states the external susceptibility tensors are found to have the following forms: where, for our parameters of the array, ω FMR /2π ≈ 4.06 GHz is the frequency of the ferromagnetic resonance (FMR), ω AFMR /2π ≈ 12.1 GHz is the frequency of the antiferromagnetic resonance (AFMR), f = πr 2 /A 2 ≈ 0.23 is the magnetic material filling fraction, ω M /2π ≈ 28 GHz for the Permalloy, Γ FM = α G ω FMR , Γ AFM = α G ω AFMR , α G ≈ 0.01 is the Gilbert constant and ζ ≈ 1.2 is a numerically evaluated constant, which depends on the shape of the nanowires and on the lattice symmetry 13 . The switching between the magnetic ground states of a metasurface based on an array of identical magnetic nanoelements can be done, for example, by applying short pulses of an in-plane bias magnetic field 14 . In the case when the array contains two types of slightly different magnetic elements the switching can be performed quasi-statically by application of a perpendicular magnetic field 38,39 The dispersion relation for the considered parameters of the array and the waveguide thickness L = 0.5 mm is plotted in Fig. 3 for the cases of the FM (lower part of the curve) and CAFM (upper part of the curve) ground states of the array. The thickness of the waveguide is chosen to be sufficiently small to guarantee that the cut-off frequencies for the higher modes are larger than ω AFMR . The dispersion relation of the fundamental mode of the waveguide is practically unaffected by the presence of the magnetic dot array in the frequency regions that are far from the resonance frequencies of the FM and CAFM ground states. At the same time, near the resonance frequencies, namely, ω FMR and ω AFMR , the dispersion relation changes drastically. The introduction of the array opens substantial band gaps in the spectrum of the fundamental waveguide mode near the resonance frequencies even in the case when the magnetic dot array is extremely thin: ωd/(2πc 0 ) ≈ 7.1 × 10 −4 .
The band gap in the fundamental mode spectrum arises not from the losses incurred inside the array. To illustrate this we plot the dependence of the band gap width on the waveguide thickness L for the FM ground state in Fig. 4(a), with the dashed lines defining the frequency of the FMR. The band gap width grows with the decrease of the waveguide width, and, which is rather remarkable, the central frequency of the band gap deviates from the FMR frequency of the array for thinner waveguides.
This metasurface, having a large and almost totally reactive impedance, requires a propagating waveguide mode to have an in-plane component of the electric field at the metasurface boundary to satisfy the boundary conditions (1). As a result of this, the propagation angle θ of the waveguide mode deviates from its "normal" value of π/2, the wave slows down, and the bandgap in the mode spectrum is formed. Qualitatively, the appearance of the band gap can be understood in terms of the "method of virtual images" 35 . Being very good mirrors, the conductive plates of the waveguide create a virtual "photonic crystal" for the photons of the main mode propagating inside the waveguide, thus forming a band gap in its frequency spectrum 40 . With the decrease of the waveguide thickness, the "reactive" metasurface sheet produces a progressively strong ("virtual" metasurfaces become closer) effect and opens a larger frequency band gap (see Fig. 4(a)).
The shift of the bandgap central frequency away from the FMR frequency, seen at small waveguide thicknesses, is a characteristic feature of the ferromagnetic ground state of the array, and is absent for an array existing in the AFM state. This shift is connected with the gyrotropic properties of the tensorχ FM (26) and the boundary conditions (1), which require the presence of non-zero Ý components of the electric field and a nonzero Þ-component of the magnetic field at the location of the array. In Fig. 4(b) we show the distribution of the Þ component of the magnetic field across the waveguide for a waveguide with thickness L = 0.1 mm. Near the conductive plates the magnetic field component is almost zero, while at the position of the metasurface (magnetic array) it is increased substantially. Interestingly, the quasi-TEM mode has no Ý-component in the electric field and no Þ-component in the magnetic field, even for the propagation angle that deviates from π/2. In terms of the waveguide modes the obtained mode for the waveguide with a metasurface in the FM state can be explained as a quasi-TEM mode coupled with one of the higher evanescent TM modes, that have the necessary field components. The frequencies of the TM modes are higher that the frequency for the TEM mode, so the frequency of the coupled mode is also increased, and the band gap deviates from the frequency of the FMR.
For the frequencies lying inside the band gap, the waveguide mode becomes evanescent. This means, that if one places a magnetic metasurface inside a waveguide and excites an electromagnetic wave outside the area where the metasurface is placed, this wave will be mostly reflected and some of its energy will be dissipated. The complete problem of the excitation of such a composite waveguide falls out of the scope of this paper. However, we can estimate a quality factor Q of the waveguide containing a magnetic metasurface in the form of a magnetic nanowire array as follows 33,35 : where W (ω) is the total stored electromagnetic energy: P m (ω) is the power dissipated by the magnetic metasurface 12,31 : and P e is the energy dissipated by the conductive plates 33 : In Fig. 4(c) the frequency dependence of the quality factor is plotted for the case of the waveguide thickness L = 0.1 mm. The maximum absorption and the minimum of Q, obviously, coincides with the frequency of the FMR. However, for such a thin waveguide the central frequency of the band gap deviates from the frequency of the FMR, and in the band gap region the value the magnetic losses is much lower than at the FMR. At the same time, for the frequencies inside the band gap the penetration depth is low, and the wave amplitude vanishes inside the waveguide very quickly (maximum 15 dB/cm) on the scale of a free space wavelength (equal to10 cm in our example), see Fig. 4(c). In such a case one can expect, that the wave mode propagating in the waveguide will be mostly reflected with practically no dissipation caused by the magnetic metasurface (nanowire array). The variation of the structural parameters of a magnetic dot array on the frequencies of the FMR and AFMR has been studied previously 12 . In our case, this variation shifts the position of the spectral band gap. The interaction of the incident photons with a magnetic metasurface, leading to the photon reflection, is determined by the properties of the collective spin-wave excitations (magnons) of the metasurface. The magnon damping plays a negative role in this interaction, in a sense, that the increase of damping (characterized by the parameter alpha G ) leads to the decoupling between the magnon and photon systems, and, therefore, to the increase of the penetration depth for the photons. A disorder in the magnetic ground state of the array (or inhomogeneity of the array's geometrical parameters) can also lead to the additional effective damping (inhomogeneous broadening) 15 . One possible way of reducing the number of defects in the magnetic state of an array by "programming" the element's shape has been recently proposed in 38 .
In our calculations we placed the metasurface in the middle of the waveguide in order to make the analytical formalism (and, in particular, (22)) simpler. At the same time, our numerical calculations did not demonstrate any significant influence on the metasurface position inside the waveguide of the dispersion of the fundamental mode shown in Fig. 3.

V. CONCLUSIONS
In conclusion, we developed an analytical formalism capable of describing both qualitatively and quantita-tively the interaction of electromagnetic waves (photons) with thin magnetic metasurfaces. The formalism is based on the scattering matrix method, and allows one to solve a wide variety of electrodynamic problems involving magnetic metasurfaces.
As an example of an application of our formalism we investigated the behavior of electromagnetic waves in a parallel-plate waveguide with conducting plates containing a magnetic metasurface formed by an array of magnetic nanowires. We found that even a rather thin magnetic metasurface introduced into the waveguide causes qualitative changes in the dispersion of the fundamental mode of the waveguide, opening a band gap near the magnetic resonance frequency of the metasurface. The position of the band gap depends on the magnetic ground state of the array. We showed also, that for sufficiently thin waveguides the central frequency of the band gap deviates from the frequency of the magnetic resonance. In this case, the waveguide can reflect electromagnetic waves with virtually no dissipation caused by the metasurface placed inside the waveguide.

ACKNOWLEDGMENTS
This work was supported in part by the Grant ECCS-1305586 from the National Science Foundation of the USA, by the contract from the US Army TARDEC, RDECOM, by the DARPA grant "Coherent Information Transduction between Photons, Magnons, and Electric Charge Carriers" and by the Center for NanoFerroic Devices (CNFD) and the Nanoelectronics Research Initiative (NRI). I.L. and S.N. acknowledge the Russian Scientific Foundation, Grant #14-19-00760 for financial support.