EME 🌈#

Eigenmode expansion (EME) computes the scattering matrix of a structure by solving for local eigenmodes in each cell of an EMESimulation and propagating them through the device. It is a frequency-domain, modal technique well-suited to guided-wave structures that are translation-invariant or slowly varying along a single propagation axis — tapers, mode converters, adiabatic bends, directional couplers, DBRs, and long periodic stacks. For strongly radiating, broadband-transient, or nonlinear problems, prefer FDTD.

The primary entry point is web.run():

import tidy3d as td
import tidy3d.web as web

sim = td.EMESimulation(
    size=(2.0, 2.0, 10.0),
    structures=[my_waveguide],
    freqs=[td.C_0 / 1.55],
    axis=2,
    eme_grid_spec=td.EMEUniformGrid(
        num_cells=5,
        mode_spec=td.EMEModeSpec(num_modes=4),
    ),
)
sim_data = web.run(sim, task_name="my_eme")
smatrix = sim_data.smatrix

The reference pages below cover the simulation object and its monitors, grid specification, propagation sweeps, and output data. The Local Propagation page documents an advanced workflow for running EME end-to-end on a local machine. For usage guidance (setup, convergence testing, bent waveguides, periodic structures, port / S-matrix basis), see the EME FAQ.

Simulation#

An EMESimulation is the top-level object for EME: it defines the simulation domain, the EME cells along the propagation axis, and the frequencies of interest. It is excitation-free — the solver always produces the full bidirectional scattering matrix between the two ports.

EMESimulation

EigenMode Expansion (EME) simulation.

Monitors#

EME simulations always produce a device scattering matrix; monitors record additional diagnostic data alongside it. EMEModeSolverMonitor returns the eigenmodes at each cell, EMEFieldMonitor returns the propagated E and H fields on a plane, and EMECoefficientMonitor returns the forward / backward modal coefficients per cell.

EMECoefficientMonitor

EME monitor for mode coefficients and related quantities.

EMEModeSolverMonitor

EME mode solver monitor.

EMEFieldMonitor

EME monitor for propagated electromagnetic field.

EMEMonitor

Abstract base class for EME monitors.

Grid Specification#

An EME grid divides the simulation along its propagation axis into cells where modes are solved locally, then matched at the cell interfaces. Pick EMEUniformGrid for evenly spaced cells that share a single EMEModeSpec, EMEExplicitGrid to place cell boundaries at known structural features with a per-cell mode spec, or EMECompositeGrid to combine both within one simulation.

EMEUniformGrid

Specification for a uniform EME grid.

EMECompositeGrid

EME grid made out of multiple subgrids.

EMEExplicitGrid

EME grid with explicitly defined internal boundaries.

EMEGrid

EME grid.

EMEModeSpec

Mode specification for EME cells.

Propagation Sweeps#

An EME sweep reuses previously computed mode data to evaluate the device at multiple parameter points without re-solving the modes. The sweep axis is exposed as a sweep_index coordinate on the resulting S-matrix. Broadband frequency studies do not use a sweep type — list the desired frequencies in EMESimulation freqs directly and control interpolation with EMEModeSpec interp_spec.

Warning

EMEFreqSweep is deprecated. For new simulations, list the desired frequencies in EMESimulation freqs and control the performance/accuracy tradeoff with EMEModeSpec interp_spec.

EMELengthSweep

Spec for sweeping EME cell lengths.

EMEModeSweep

Spec for sweeping number of modes in EME propagation step.

EMEPeriodicitySweep

Spec for sweeping number of repetitions of EME subgrids.

EMEFreqSweep

Deprecated spec for sweeping frequency in the EME propagation step.

Output Data#

Monitor Data#

EMECoefficientData

Data associated with an EMECoefficientMonitor.

EMEModeSolverData

Data associated with an EMEModeSolverMonitor.

EMEFieldData

Data associated with an EMEFieldMonitor.

Simulation Data#

EMESimulationData

Data associated with an EME simulation.

Datasets#

EMESMatrixDataset

Dataset storing the scattering matrix of an EME simulation.

EMECoefficientDataset

Dataset storing various coefficients related to the EME simulation.

EMEOverlapDataset

Dataset storing overlaps between EME modes.

EMEFieldDataset

Dataset storing scalar components of E and H fields from EME propagation.

EMEModeSolverDataset

Dataset storing the eigenmodes computed at each EME cell.

Pipeline Stages#

Intermediate artifacts produced by the local propagation pipeline (see EMESimulation.propagate()). All five classes support HDF5 round-trip, so they can be checkpointed to disk and reused across design iterations.

EMEStageCellModes

Mode solver result for one EME cell.

EMEStageCellOverlap

Self-overlap and metadata for one EME cell.

EMEStageInterfaceOverlap

Cross-cell overlap for one EME interface.

EMEStageCellSMatrix

Homogeneous propagation S-matrix for one EME cell at one sweep point.

EMEStageInterfaceSMatrix

Interface S-matrix for one EME interface at one sweep point.

Local Propagation#

EMESimulation exposes a pipeline for running EME end-to-end on a local machine, combining the local mode solver with a set of per-element stage methods for propagation. The convenience entry point is EMESimulation.propagate(); the staged methods give finer control for iterative design, caching intermediates to HDF5, or cloud-parallelizing mode solves. The propagation methods require the optional tidy3d-extras package with the local_eme feature; see the EME FAQ for recipes and prerequisites.

Note

The local pipeline returns only the device S-matrix. Any EMESimulation monitorsEMEFieldMonitor, EMEModeSolverMonitor, EMECoefficientMonitor, etc. — are dropped with a warning; run the simulation through the remote backend if you need monitor data. EMEFreqSweep and anisotropic media in bent cells with bend_medium_frame="global" are also unsupported on this path.

EMESimulation.mode_simulations

One ModeSimulation per EME cell, at full mode count.

EMESimulation.propagate(mode_data)

Propagate modes through the device to compute the full S-matrix.

EMESimulation.smatrix_in_basis(smatrix, ...)

Express a locally propagated S-matrix in another modal basis.

EMESimulation.compute_overlaps(mode_data)

Stage modes and compute all per-cell and per-interface overlaps.

EMESimulation.propagate_from_overlaps(...)

Propagate to the device S-matrix using pre-computed overlaps.

EMESimulation.stage_cell_modes(mode_data, ...)

Validate, filter, and stamp mode data for one cell.

EMESimulation.compute_cell_overlap(cell_modes)

Compute self-overlap, complex refractive index, and flux for one cell.

EMESimulation.compute_interface_overlap(...)

Compute cross-cell overlaps for one interface.

EMESimulation.compute_cell_smatrix(cell_overlap)

Compute homogeneous propagation S-matrix for one cell at one sweep point.

EMESimulation.compute_interface_smatrix(...)

Compute interface S-matrix for one interface at one sweep point.

EMESimulation.compute_smatrix(cell_overlaps, ...)

Stack cell and interface S-matrices into the final device S-matrix.