I Introduction
The WignerSmith (WS) time delay matrix
(1) 
was introduced by Felix Smith to characterize a particle’s dwell time in a quantum system with scattering matrix [19]. Today, the WS time delay matrix is used in acoustics, optics, and electromagnetics to characterize group delays of wave packets [12], to synthesize modes that travel through systems with minimal dispersion [4], to shape waves traveling through disordered media [7, 2], and to determine frequency sensitivities of antenna input impedances [17, 18]. More recent applications can be found in [11, 3, 13, 1, 9, 20, 8, 5].
Patel and Michielssen recently developed techniques to directly compute for 3D electromagnetic systems excited by propagating modes using volume integrals of energylike field quantities [17, 18]. Their methods allow for the finiteelement or integral equationbased evaluation of and its subsequent diagonalization to construct WS modes that exhibit welldefined group delays. Knowledge of and also allows for the computation of the frequency derivative of , which in turn may advance the state of the art in fast frequencysweep methods.
Unfortunately, the methods in [17, 18] do not apply to systems excited by mixtures of propagating and evanescent modes. This limits their applicability to realworld problems involving structures with large multimode apertures that reside near structural discontinuities and/or material inhomogeneities.
The restrictions of the methods in [17, 18] at times can be sidestepped by shifting ports so they no longer contain evanescent fields. Unfortunately, this fix artificially enlarges the system, increasing the cost of computing .
The restrictions of the methods in [17, 18] also limit their application to the closedloop design of composite systems with prescribed timedelays. Such systems oftentimes consist of multiple components/subsystems that require iterative refinement. The straightforward computation of the composite system’s requires usually is prohibitively expensive, especially if the refinement only involves a small set of subsystems. A better strategy is to compute of each component and combine them to obtain the of the composite system. Using this approach only ’s of the components being modified require updating. This approach however requires that the system can be flexibly partitioned, oftentimes introducing ports that support evanescent modes.
This paper extends the methods of [17] to systems excited by mixtures of propagating and evanescent modes. Its contributions are fivefold manner:

It generalizes WS relationship (1), valid for systems excited by propagating waves, to one applicable to systems fed by mixtures of propagating and evanescent waves; both guiding and periodic systems are considered.

It demonstrates that the generalized WS relationship allows the frequency sensitivities of scattering parameters to be evaluated without inverting the scattering matrix.

It illustrates that the generalized WS relationship permits the identification of socalled WS modes that experience welldefined time delays when interacting with the system. These WS modes are constructed by diagonalizing the portion of the WS time delay matrix modeling propagating modes.

It shows that the generalized WS time delay matrix of a composite system can be computed from the WS time delay matrices of its subsystems.

It numerically demonstrates the applicability of the generalized WS scheme to guiding and periodic structures with ports supporting evanescent modes.
The above contributions remove all the aforementioned restrictions of the methods in [17, 18]. Contributions 14 and 5 are detailed in Sections II and III below. Throughout this paper, denotes frequency and denotes angular frequency. In addition, denotes , and , , and denote conjugate, transpose, and conjugate transpose operations.
Ii WS Relationship Including Evanescent Modes
Iia Generalized WS Relationship for Guiding Systems
This section generalizes WS relationship (1) to systems fed by mixtures of propagating and evanescent waves. The elements of the generalized WS time delay matrix are shown to consist of volume integrals of energylike densities plus correction terms that account for the propagating/evanescent character of the system modes.
Consider a guiding system composed of perfect electrically conducting (PEC) cavities and waveguides that occupy volume (Fig. 1). Let denote the union of all physical waveguide ports. Assume the vicinity of
is parameterized by a locally Cartesian coordinate system
with exterior to . Assume that is filled with a nondispersive and lossless material with permittivity and permeability , which are constant for near . Under these conditions, fields that enter and exit can be expanded into modes with real and frequencyindependent transverse profiles , propagation constants , and impedances , (see Appendix A in [17]). In contrast to the assumptions underlying the study of WS methods in [17], some of these modes may be evanescent. For propagating (evanescent) modes, and are purely real (imaginary). The mode profiles satisfy the orthonormality condition(2) 
where is the Kronecker delta.
Assume the system is excited by the unitpower incoming wave with transverse field components near given by
(3a)  
(3b) 
where . In what follows, spatial and frequency dependencies are omitted when possible. The outgoing transverse fields near in response to this excitation are
(4a)  
(4b) 
where is the scattering coefficient expressing coupling from mode to mode . For near , the total transverse fields are
(5a)  
(5b) 
Let {} denote total fields excited by mode for all . Taking the frequency derivative of Maxwell’s equations for {} while conjugating those for {} yields
(6a)  
(6b)  
(6c)  
(6d) 
The dot product of Eq. (6b) and plus the dot product of Eq. (6d) and reads
(7) 
Similarly, the dot product of Eq. (6a) and plus the dot product of Eq. (6c) and reads
(8) 
Subtracting Eq. (8) from Eq. (7) produces
(9) 
Next, integrating the left and righthand side (LHS and RHS) of Eq. (9) over and applying the divergence theorem yields
(10) 
where use was made of the fact that surface integrals involving electric fields tangential to the system’s PEC walls vanish. A lengthy but straightforward evaluation of the LHS of Eq. (10) using Eqs. (3a)–(5b) yields
Upon defining
(11) 
(12) 
and
(13) 
Eq. (10) simplifies to
(14) 
To compactly express Eq. (14) in matrix form, let and denote diagonal matrices with elements
(15)  
(16) 
Substituting Eqs. (15)–(16) into Eq. (14) yields
(17) 
where
(18) 
Eqs. (17) and (18) constitute the sought generalized WS relationship involving both propagating and evanescent modes. Eq. (17) is therefore a generalization of Eq. (1).
IiB Generalized WS Relationship for Periodic Systems
This section extends the formulation of Section II.A to doubly periodic systems subject to propagating and evanescent Floquet mode excitations.
Consider a doubly periodic system with a unit cell that occupies the volume (Fig. 2). Let denote the interfaces of to the medium surrounding the system. Once again, assume the vicinity of is parameterized by a locally Cartesian coordinate system with exterior to . Assume that measures and let and denote the interfaces of to neighboring cells. Finally, suppose that is filled with a nondispersive and lossless material with permittivity and permeability , both of which are constant near . Fields near can be expressed in terms of Floquet modes with frequency independent and complexvalued mode profiles (Appendix A), propagation constants , and impedances , . Just as in the preceding section, some of these modes may be evanescent. The mode profiles satisfy the orthonormality condition
(22) 
With this setup, the treatment of the previous section can be repeated wholesale, provided that the intercell boundaries and are properly accounted for. Specifically, The transverse components of incoming, outgoing, and total fields still can be expanded in terms of Floquet modes as in Eqs. (3a) to (5b), and manipulating Maxwell’s equations still produces Eq. (9). That said, integrating the LHS and RHS of Eq. (9) over and applying the divergence theorem now yields
(23) 
To evaluate the LHS of Eq. (23), note that the total fields on boundaries and satisfy the periodic boundary conditions, i.e., and . Similar conditions hold for the magnetic fields. It is clear that and this also holds for the boundaries .
It follows that the surface integrals over the periodic boundaries , in Eq. (23) cancel, and that only those over the Floquet ports remains. Eq. (23) hence reverts back to Eq. (10) and the remainder of the derivation for guiding systems again carries over to periodic ones. The generalized WS relationships Eqs. (17) and (18), derived earlier for guiding systems with PEC walls, therefore also apply to periodic systems as well.
IiC Computing from and without Matrix Inversion
In the absence of evanescent modes, the scattering matrix is unitary () and Eq. (1) can be used to characterize ’s frequency sensitivity without matrix inversion as . This section shows that in the presence of evanescent modes, Eq. (17) still allows for the computation of without relying on matrix inversion.
To demonstrate this useful factoid, let denote
(24) 
For notational convenience, the indices of the propagating modes (P) are assumed smaller than those of the evanescent ones (E), and matrices , , and are partitioned as
(25) 
(26) 
(27) 
(28) 
Adding Eqs. (26) and (27), and multiplying the result by Eq. (24) produces
(29) 
Finally, solving Eq. (29) for yields
(30) 
where use was made of the fact that is unitary () in accordance with the lossless nature of the system. It immediately follows that can be computed via
(31) 
without performing any matrix inversion.
IiD Time Delay Interpretation of the Generalized WS Relationship and WS Modes
In the abscence of evanescent modes, can be diagonalized as where the columns of and the diagonal elements of describe socalled WS modes and their time delays, viz. group delays experienced by narrowband wave packets that interact with the system [17]. In the presence of evanescent modes, this property of , now defined via Eq. (17), needs to be reexamined. This section shows that the generalized WS time delay matrix still allows for the construction of modes with well defined time delays by diagonalizing the block of the WS time delay matrix that accounts for interactions between propagating modes, properly modified to account for the presence of evanescent ones.
To demonstrate this concept, Eq. (17) is expressed in block form, leveraging notation introduced in the preceding section:
(32)  
(33)  
(34)  
(35) 
Here and . Eq. (32) describes how , the submatrix of corresponding to only propagating modes, relates to submatrices and . Compared to the exposition in Eq. (32) [17], now includes an additional term that accounts for interactions between propagating and evanescent modes.
The matrices and in satisfy three important properties:

is Hermitian; this fact follows directly from its defining Eq. (32);

is unitary due to the lossless nature of the system;

is symmetric due to the reciprocal nature of the system.
These properties allow the relationship to be interpreted using the techniques presented in [17]. Specifically, it follows that the matrices , and can be simultaneously diagonalized using
’s eigenvector matrix
as(36)  
(37)  
(38) 
where , and are diagonal matrices. comprises
’s eigenvalues, which can be interpreted as time/group delays experienced by WS modes obtained by weighing waveguide modes by the entries of the columns of
. The WS modes are fully decoupled and exhibit minimal dispersion upon interacting with the system [17].For periodic systems, the mode profiles are complex, the orthogonality condition (22) involves conjugation, and becomes asymmetric. That said, it can be trivially shown that becomes symmetric upon row permutation. Specifically, the matrix where
(39) 
where and are the indices of modes and in , and is the index that satisfies , is symmetric. Upon reexpressing Eq. (32) as , it follows that the simultaneous diagonalization in Eqs. (36)–(38) can proceed upon replacing and by and , respectively.
Finally, note that whereas allows for the construction of WS with well defined time delays, ’s other submatrices , and appear to have no direct physical interpretation.
IiE Evaluating the WS Time Delay Matrix of Compound Systems From Those of Its Subsystems
This section demonstrates that the WS time delay matrix of a composite system can be easily obtained from those of its subsystems.
Consider a composite system obtained by cascading several subsystems through interfaces that support evanescent fields. This section demonstrates that the WS time delay matrix of the composite systems can be obtained from those of the subsystems. Only the case of two subsystems is considered as additional subsystems can be accounted for through recursion.
Eq. (18) shows that the WS time delay matrix consists of a computationally expensive volumeintegral component as well as easily computed correction terms that relate to port impedances and their corresponding elements in the scattering matrix. Our objective therefore is to compute of the composite system from those of its subsystems, since the correction terms are trivially accounted for.
Consider a system C obtained by cascading two subsystems A and B. In what follows, the mode indices of systems A and B are arranged and their scattering matrices partitioned in accordance with the labeling of waves in Fig. 3, as
(40) 
(41) 
and
(42) 
Similar decompositions exist for , , .
Using methods for computing from and described in [6, 16], it is easy to show that the amplitudes of waves traveling in between systems A and B can be expressed as
(43)  
(44) 
where
(45)  
(46)  
(47)  
(48) 
Let denote the electric field in system () when excited by mode (). It follows from Eqs. (43) and (44) that the electric field in composite system can be expressed in terms of those in subsystems and as
(49) 
for , or
(50) 
for . Here and denote matrix elements corresponding to the th and th modes, instead of the th row and th column. Magnetic fields in composite system can be obtained similarly.
Iii Numerical Examples
This section includes three numerical examples that validates the WS techniques in Section II. First the generalized WS relationships are verified for a waveguide containing a scatterer within close proximity of its port, necessitating the incorporation of evanescent modes into the scattering matrix. Next, the cascade formulation is validated via its application to two coupled cavities. Finally, the generalized WS relationships are verified for a periodic photonic crystal slab containing throughwaveguides. All guiding systems are simulated using an FEM leveraging mode expansions [14], while periodic systems are simulated by a finiteelement boundaryintegral (FEBI) method using periodic Green’s functions [10].
Iiia PECTerminated Waveguide with Object Near Its Port
Consider the airfilled and PECterminated waveguide shown in Fig. 4 that contains a PEC cylinder located a small distance from its port. At Hz the waveguide supports 9 propagating TE modes.
First, the accuracy of generalized WS relationship (17) is verified for different choices of and , the number of evanescent modes. Fig. 5 shows that the accuracy of the WS relationship improves as and/or increase.
Next, assume mm and . The relative error in (defined in the caption of Fig. 5) is on the order of . The matrix in Eq. (32) is diagonalized as ; the columns of and diagonal elements of describe WS modes and their time delays, respectively. Fig. 6 shows the WS modes’ “spatial shifts”, obtained by multiplying time delays by the freespace speed of light. Fig. 7 depicts several WS modes.

WS mode #1 experiences the smallest time delay, corresponding to a spatial shift of roughly , as it describes a localized port excitation that exits the system after traveling to the cylinder and back (Fig. (a)a).

WS mode #4 experiences a time delay corresponding to a spatial shift that is slightly larger than two roundtrips between the port and the waveguide termination owing to the fact that it travels at a small angle w.r.t. the waveguide axis while avoiding interacting with the cylinder (Fig. (b)b).

WS mode #6 is very similar to mode #4 except that it travels at a much larger angle w.r.t. the waveguide axis. The mode bounces not just off the waveguide termination, but also between its top and bottom walls, resulting in a much larger time delay. Interaction with the cylinder is avoided, however.

WS mode #9 has the largest time delay because the wave not only reflects off the PEC walls but also interacts with the cylinder. It is trapped inside the waveguide for a significantly longer time than the other modes and exhibits semiresonant behavior.
IiiB Cascaded System
Consider the two airfilled guiding systems A and B shown in Fig. 8. Guiding system C is obtained by cascading systems A and B via port #2. At Hz, ports #1 and #3 both support 4 propagating TE modes while port #2 supports 3 propagating TE modes.
and for system C are computed in two ways: (i) directly using the formulation of Section IIA resulting in and , and (ii) indirectly using the cascading procedure in Section IIE resulting in and . Fig. 9 shows that and converge to and as the number of evanescent modes accounted for in port #2 increases.
The WS modes of a composite system often inherit the spatial structure and time delays of those of its subsystems. To illustrate this, the WS modes for systems A, B, and C are computed at Hz via diagonalization of these systems’ respective matrices. Salient features of a subset of the WS modes of each system along with their time delays are discussed next.

Subsystem A. WS mode #1 enters via port #1 and exits via port #2 (or vice versa) without noticeable interaction with the PEC walls; it experiences a time delay that corresponds to the distance between the centers of ports #1 and #2 (Fig. (a)a). WS mode #10 enters and exits via port #1 after reflecting off a PEC wall at a nearly normal direction, experiencing a time delay that corresponds to the roundtrip between port #1 and the PEC wall (Fig. (b)b).

Subsystem B. Similar to system A, WS mode #1 is a wave that enters via port #2 and exits via port #3 (or vice versa), while WS mode #7 only excites waves that enter and exit via port #3 after normally bouncing off a PEC wall (Fig. 11).

System C. Some of the WS modes in system C highly resemble those in its subsystems. For example, the spatial structure and time delay of WS mode #1 of system C (Fig. (a)a) are nearly identical to those of WS mode #7 of subsystem B (Fig. (b)b). Likewise, WS mode #6 of system C (Fig. (b)b) is very similar to mode #10 of subsystem A (Fig. (b)b). Other WS modes of system C combine traits from those in its subsystems. WS mode #12, for example, (Fig. (c)c) enters via port #1 and exits via port #3 (or vice versa), and is a hybrid of WS modes #1 from systems A and B shown in Figs. (a)a and (a)a; its spatial shift, to first order, is the sum of those experienced by modes #1 in systems A and B.
IiiC Periodic Photonic Crystal
Consider the periodic photonic crystal slab composed of unit cells that contain straight and curved waveguides shown in Fig. 13. The system is excited by TM fields at Hz, which is in the crystal’s stopband.
First, the slab is excited by a normally incident plane wave. The resulting field distribution is shown in Fig. 14 and includes reflected fields as well as relatively weak waves traveling down the waveguides. The reflected and guided waves obviously couple to multiple Floquet modes.
Next, the structure’s WS time delay matrix is constructed using a total of modes, or 40 in excess of the number of propagating modes. The WS relationship (17) exhibits an error of . Time delays/spatial shifts and WS modes are constructed by diagonalizing and shown in Figs. 15 and 16, respectively. The WS modes belong to one of two categories.

Reflection modes. WS modes #1–#30 reflect off the top or bottom surface of the crystal, without entering the channels. Mode #1 (Fig. (a)a) has the smallest incident angle, therefore its travel time is the shortest. By comparison, mode #28 (Fig. (b)b) has a larger incident angle, resulting in longer travel time.

Transmission modes. WS modes #33 and #34 (Figs. (c)c (d)d) are excited by beams targeting the apertures of the straight and curved waveguides, respectively, launching waves that travel down both channels. The spatial shifts experienced by these modes are proportional to the length of the channel in which they travel, and much larger than those of the reflection modes. Modes #31 and #32 (not shown) are similar to Modes #33 and #34 except that the phases of the fields exciting the apertures on both sides result in reduced energy stored in the slab, and hence smaller time delays.
The difference between the reflection and the transmission modes is further illustrated in Fig. (a)a, which shows the fraction of the energy reflected from the periodic system when excited by “incomplete WS modes” obtained by retaining only the portion of a WS mode such that illuminates one side. For WS modes #1–#30, only one of the Floquet ports is strongly excited and chosen as the incident port for reflectance calculation; for WS modes #31–#34, both Floquet ports are strongly excited, therefore the reflectance can be calculated by exciting either Floquet port. It is evident from Fig. (a)a that WS modes #1–#30 excite waves that mostly reflect off the structure, while most energy carried by WS modes #31–#34 makes its way through the channel and reaches the other port, with reflectances 14.57%, 22.45%, 14.26% and 22.36%. By contrast, Fig. (b)b shows that all the Floquet modes have reflectance of roughly 90%, indicating a more average behavior than the WS modes. No Floquet modes can transfer most of its energy through the structure.
Properties of WS modes can be better understood based on the above observations. Each WS mode only couples to itself and is frequency stable with minimal dispersion. Using WS modes to untangle the physical scattering phenomena, only the transmission modes may be excited to transfer the majority of energy through a complicated structure while preserving the information of the signal.
Iv Conclusion
A generalized WS relationship for guiding and periodic systems with ports that support evanescent modes was developed. The proposed formulation generalizes many previously established WS relationships for systems fed through ports that exclusively support propagating waves. The new formulation not only allows for the application of WS techniques to systems with inhomogeneities near ports, but also allows for the construction of WS time delay matrices of composite systems from those of its potentially tightly coupled subsystems.
Numerical examples involving both guiding and periodic systems validated the proposed formulation and demonstrated the use of WS time delay concepts for constructing WS modes that exhibit welldefined time delays upon interacting with a system through ports supporting evanescent fields.
Appendix A Floquet Modes
Similar to waveguides, fields interacting with periodic structures with normal incidence can be expanded by Floquet modes. The profile for TE modes is
(58) 
and that for TM modes is
(59) 
Here maps to the tuple ; and are periodicities of the unit cells; and , . The propagation constant in of the th Floquet mode is
(60) 
The mode impedance is for TE modes, and for TM modes, where at the Floquet port.
References
 [1] (201802) In situ realization of particlelike scattering states in a microwave cavity. Physical Review A 97 (2), pp. 021801. Cited by: §I.
 [2] (2016) Microwave experiments on atypical transport phenomena induced by spatial and spectral wave shaping. Ph.D. Thesis, Université Côte d’Azur. Cited by: §I.
 [3] (201906) Shaping the branched flow of light through disordered media. Proceedings of the National Academy of Sciences 116 (27), pp. 13260–13265. Cited by: §I.
 [4] (201511) Observation of Eisenbud–Wigner–Smith states as principal modes in multimode fibre. Nature Photonics 9 (11), pp. 751–757. Cited by: §I.
 [5] (202105) Generalization of Wigner time delay to subunitary scattering systems. Physical Review E 103 (5), pp. L050203. Cited by: §I.
 [6] (198602) Generalized scattering matrix method for analysis of cascaded and offset microstrip step discontinuities. IEEE Transactions on Microwave Theory and Techniques 34 (2), pp. 280–284. Cited by: §IIE.
 [7] (202105) Coherent wave control in complex media with arbitrary wavefronts. Physical Review Letters 126 (19), pp. 193903. Cited by: §I.
 [8] (202105) Ondemand coherent perfect absorption in complex scattering systems: time delay divergence and enhanced sensitivity to perturbations. Laser & Photonics Reviews 15 (7), pp. 2000471. Cited by: §I.
 [9] (201912) Optimizing light storage in scattering media with the dwelltime operator. Physical Review Letters 123 (24), pp. 243901. Cited by: §I.
 [10] (199905) Hybrid FE/BI modeling of 3D doubly periodic structures utilizing triangular prismatic elements and an MPIE formulation accelerated by the Ewald transformation. IEEE Transactions on Antennas and Propagation 47 (5), pp. 843–850. Cited by: §III.
 [11] (201712) Photoemission and photoionization time delays and rates. Structural Dynamics 4 (6), pp. 061502. Cited by: §I.
 [12] (201607) Particlelike wave packets in complex scattering systems. Physical Review B 94 (1), pp. 014209. External Links: Document Cited by: §I.
 [13] (201410) Full transmission and reflection of waves propagating through a maze of disorder. Physical review letters 113 (17), pp. 173901. Cited by: §I.
 [14] (2015) The finite element method in electromagnetics. John Wiley & Sons. Cited by: §III.
 [15] (201911) Numerical simulation of all optical demultiplexer based on pillar photonic crystal ring resonators. International Journal of Numerical Modelling: Electronic Networks, Devices and Fields 32 (2), pp. e2527. Cited by: Fig. 13.
 [16] (198908) Determination of the resonant frequencies in a complex cavity using the scattering matrix formulation. IEEE Transactions on Microwave Theory and Techniques 37 (8), pp. 1165–1170. Cited by: §IIE.
 [17] (202102) Wigner–Smith timedelay matrix for electromagnetics: theory and phenomenology. IEEE Transactions on Antennas and Propagation 69 (2), pp. 902–917. Cited by: §I, §I, §I, §I, §I, §I, §I, Fig. 1, §IIA, §IID, §IID, §IID.
 [18] (202107) WignerSmith time delay matrix for electromagnetics: computational aspects for radiation and scattering analysis. IEEE Transactions on Antennas and Propagation 69 (7), pp. 3995–4010. Cited by: §I, §I, §I, §I, §I, §I.
 [19] (196001) Lifetime matrix in collision theory. Physical Review 118 (1), pp. 349–356. External Links: Document Cited by: §I, §IIA.
 [20] (201610) Wigner time delay and related concepts: application to transport in coherent conductors. Physica E: Lowdimensional Systems and Nanostructures 82, pp. 16––33. External Links: Document Cited by: §I.