  Resonances are essential for understanding the interactions between light and
matter in photonic systems. The real frequency response of the non-Hermitian
systems depends on the complex-valued resonance frequencies, which are the
poles of electromagnetic response functions. The zeros of the response
functions are often used for designing devices, since the zeros can be located
close to the real axis, where they have significant impact on scattering
properties. While methods are available to determine the locations of the
poles, there is a lack of appropriate approaches to find the zeros in photonic
systems. We present an approach to compute poles and zeros based on contour
integration of electromagnetic quantities. This also allows to extract
sensitivities with respect to geometrical or other parameters enabling
efficient device design. The approach is applied to a topical example in
nanophotonics, an illuminated metasurface, where the emergence of reflection
zeros due to the underlying resonance poles is explored using residue-based
modal expansions. The generality and simplicity of the theory allows
straightforward transfer to other areas of physics. We expect that easy access
to zeros will enable new computer-aided design methods in photonics and other
fields.
