Skip to content

flex_rf.tidy3d.MicrowaveModeSolverData

Type: class Base(s): MicrowaveModeDataBase, ModeSolverData

Data associated with a ModeSolverMonitor for microwave and RF applications: scalar components of E and H fields plus characteristic impedance data.

This class extends ModeSolverData with additional microwave-specific data including characteristic impedance, voltage coefficients, and current coefficients. The data is stored as DataArray objects using the xarray package.

The microwave mode solver data contains all field components (Ex, Ey, Ez, Hx, Hy, Hz) and effective indices from ModeSolverData, plus impedance calculations performed using voltage and current line integrals as specified in the MicrowaveModeSpec.

import tidy3d as td
import numpy as np
from tidy3d import Grid, Coords
from tidy3d.components.data.data_array import (
CurrentFreqModeDataArray,
ImpedanceFreqModeDataArray,
ScalarModeFieldDataArray,
ModeIndexDataArray,
VoltageFreqModeDataArray,
)
from tidy3d.components.microwave.data.dataset import TransmissionLineDataset
x = [-1, 1, 3]
y = [-2, 0]
z = [-3, -1, 1, 3, 5]
f = [2e14, 3e14]
mode_index = np.arange(3)
grid = Grid(boundaries=Coords(x=x, y=y, z=z))
field_coords = dict(x=x[:-1], y=y[:-1], z=z[:-1], f=f, mode_index=mode_index)
field = ScalarModeFieldDataArray((1+1j)*np.random.random((2,1,4,2,3)), coords=field_coords)
index_coords = dict(f=f, mode_index=mode_index)
index_data = ModeIndexDataArray((1+1j) * np.random.random((2,3)), coords=index_coords)
impedance_data = ImpedanceFreqModeDataArray(50 * np.ones((2, 3)), coords=index_coords)
voltage_data = VoltageFreqModeDataArray((1+1j) * np.random.random((2, 3)), coords=index_coords)
current_data = CurrentFreqModeDataArray((0.02+0.01j) * np.random.random((2, 3)), coords=index_coords)
tl_data = TransmissionLineDataset(
Z0=impedance_data,
voltage_coeffs=voltage_data,
current_coeffs=current_data
)
monitor = td.MicrowaveModeSolverMonitor(
center=(0, 0, 0),
size=(2, 0, 6),
freqs=[2e14, 3e14],
mode_spec=td.MicrowaveModeSpec(num_modes=3, impedance_specs=td.AutoImpedanceSpec()),
name='microwave_mode_solver',
)
data = MicrowaveModeSolverData(
monitor=monitor,
Ex=field,
Ey=field,
Ez=field,
Hx=field,
Hy=field,
Hz=field,
n_complex=index_data,
grid_expanded=grid,
transmission_line_data=tl_data
)
n_complex [ModeIndexDataArray]

Complex-valued effective propagation constants associated with the mode.

monitor [MicrowaveModeSolverMonitor]

Mode monitor associated with the data.

Ex [ScalarModeFieldDataArray | None] = None

Spatial distribution of the x-component of the electric field of the mode.

Ey [ScalarModeFieldDataArray | None] = None

Spatial distribution of the y-component of the electric field of the mode.

Ez [ScalarModeFieldDataArray | None] = None

Spatial distribution of the z-component of the electric field of the mode.

Hx [ScalarModeFieldDataArray | None] = None

Spatial distribution of the x-component of the magnetic field of the mode.

Hy [ScalarModeFieldDataArray | None] = None

Spatial distribution of the y-component of the magnetic field of the mode.

Hz [ScalarModeFieldDataArray | None] = None

Spatial distribution of the z-component of the magnetic field of the mode.

symmetry [tuple[Symmetry, Symmetry, Symmetry]] = (0, 0, 0)

Symmetry eigenvalues of the original simulation in x, y, and z.

symmetry_center [Coordinate | None] = None

Center of the symmetry planes of the original simulation in x, y, and z. Required only if any of the symmetry field are non-zero.

grid_expanded [Grid | None] = None

Grid discretization of the associated monitor in the simulation which created the data. Required if symmetries are present, as well as in order to use some functionalities like getting Poynting vector and flux.

grid_primal_correction [GRID_CORRECTION_TYPE] = 1.0

Correction factor that needs to be applied for data corresponding to a 2D monitor to take into account the finite grid in the normal direction in the simulation in which the data was computed. The factor is applied to fields defined on the primal grid locations along the normal direction.

grid_dual_correction [GRID_CORRECTION_TYPE] = 1.0

Correction factor that needs to be applied for data corresponding to a 2D monitor to take into account the finite grid in the normal direction in the simulation in which the data was computed. The factor is applied to fields defined on the dual grid locations along the normal direction.

amps [ModeAmpsDataArray | None] = None

Unused for ModeSolverData.

n_group_raw [GroupIndexDataArray | None] = None

Index associated with group velocity of the mode.

dispersion_raw [ModeDispersionDataArray | None] = None

Dispersion parameter for the mode.

eps_spec [list[EpsSpecType] | None] = None

Characterization of the permittivity profile on the plane where modes are computed. Possible values are ‘diagonal’, ‘tensorial_real’, ‘tensorial_complex’.

grid_distances_primal [tuple[float] | tuple[float, float]] = (0.0,)

Relative distances to the primal grid locations along the normal direction in the original simulation grid. Needed to recalculate grid corrections after interpolating in frequency.

grid_distances_dual [tuple[float] | tuple[float, float]] = (0.0,)

Relative distances to the dual grid locations along the normal direction in the original simulation grid. Needed to recalculate grid corrections after interpolating in frequency.

log [str | None] = None

A string containing the log information from the mode solver run.

transmission_line_data [TransmissionLineDataset | None] = None

Additional data relevant to transmission lines in RF and microwave applications, like characteristic impedance. This field is populated when a MicrowaveModeSpec has been used to set up the monitor or mode solver.

transmission_line_terminal_data [TransmissionLineTerminalDataset | None] = None

Additional data relevant to transmission line terminals in RF and microwave applications, like characteristic impedance, voltage transformation matrix, and current transformation matrix. This field is populated when a MicrowaveTerminalModeSpec has been used to set up the monitor or mode solver.

interp_in_freq(freqs: FreqArray, method: Literal['linear', 'cubic', 'poly'] = 'linear', renormalize: bool = True, recalculate_grid_correction: bool = True, assume_sorted: bool = False)

Interpolate mode data to new frequency points.