  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.
