{
  "title": "ModeSolver",
  "public_path": "flex_rf.tidy3d.ModeSolver",
  "lookup_path": "tidy3d.plugins.mode.ModeSolver",
  "slug": "flex_rf/tidy3d/ModeSolver",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/modesolver/",
  "object_kind": "class",
  "introduction": "Interface for solving electromagnetic eigenmodes in a 2D plane with translational\ninvariance in the third dimension.",
  "notes": "",
  "examples": "",
  "references": "",
  "signature": "class ModeSolver(Tidy3dBaseModel)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/mode/mode_solver.py",
    "url": "",
    "lineno": 185,
    "endlineno": 3689
  },
  "bases": [
    "Tidy3dBaseModel"
  ],
  "parameter_rows": [
    {
      "name": "simulation",
      "annotation": "MODE_SIMULATION_TYPE",
      "default": "",
      "description": "Simulation or EMESimulation defining all structures and mediums.",
      "origin": "declared"
    },
    {
      "name": "plane",
      "annotation": "MODE_PLANE_TYPE",
      "default": "",
      "description": "Cross-sectional plane in which the mode will be computed.",
      "origin": "declared"
    },
    {
      "name": "mode_spec",
      "annotation": "ModeSpecType",
      "default": "",
      "description": "Container with specifications about the modes to be solved for.",
      "origin": "declared"
    },
    {
      "name": "freqs",
      "annotation": "FreqArray",
      "default": "",
      "description": "A list of frequencies at which to solve.",
      "origin": "declared"
    },
    {
      "name": "direction",
      "annotation": "Direction",
      "default": "'+'",
      "description": "Direction of waveguide mode propagation along the axis defined by its normal dimension.",
      "origin": "declared"
    },
    {
      "name": "colocate",
      "annotation": "bool",
      "default": "True",
      "description": "Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is `True`.",
      "origin": "declared"
    },
    {
      "name": "use_colocated_integration",
      "annotation": "bool",
      "default": "True",
      "description": "Only takes effect when `colocate=False`. If `True`, dot products and overlap integrals still use fields interpolated to grid cell boundaries (colocated), even though the field data is stored at native Yee grid positions. Experimental feature that can give improved accuracy by avoiding interpolation of fields to Yee cell positions for integration.",
      "origin": "declared"
    },
    {
      "name": "conjugated_dot_product",
      "annotation": "bool",
      "default": "True",
      "description": "Use conjugated or non-conjugated dot product for mode decomposition.",
      "origin": "declared"
    },
    {
      "name": "fields",
      "annotation": "tuple[EMField, ...]",
      "default": "['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']",
      "description": "Collection of field components to store in the monitor. Note that some methods like `flux`, `dot` require all tangential field components, while others like `mode_area` require all E-field components.",
      "origin": "declared"
    },
    {
      "name": "attrs",
      "annotation": "dict",
      "default": "factory: dict",
      "description": "Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, `attrs` are mutable. For example, the following is allowed for setting an `attr` `obj.attrs['foo'] = bar`. Also note that Tidy3D will raise a `TypeError` if `attrs` contain objects that can not be serialized. One can check if `attrs` are serializable by calling `obj.model_dump_json()`.",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "as_fdtd_mode_solver",
      "kind": "function",
      "signature": "as_fdtd_mode_solver()",
      "description": "Construct a new `ModeSolver` by converting `simulation` from a `EMESimulation` to an FDTD `Simulation`. Only used as a workaround until `EMESimulation` is natively supported in the `ModeSolver` webapi."
    },
    {
      "name": "bend_axis_3d",
      "kind": "function",
      "signature": "bend_axis_3d()",
      "description": "Converts the 2D bend axis into its corresponding 3D axis for a bend structure. For a straight waveguide, the rotated axis is equivalent to the bend axis and can be determined using angle_phi."
    },
    {
      "name": "bend_center",
      "kind": "function",
      "signature": "bend_center()",
      "description": "Computes the bend center based on plane center, angle_theta and angle_phi."
    },
    {
      "name": "data",
      "kind": "function",
      "signature": "data()",
      "description": "`ModeSolverData` containing the field and effective index data."
    },
    {
      "name": "data_raw",
      "kind": "function",
      "signature": "data_raw()",
      "description": "`ModeSolverData` containing the field and effective index on unexpanded grid."
    },
    {
      "name": "grid_snapped",
      "kind": "function",
      "signature": "grid_snapped()",
      "description": "The output grid snapped to the plane normal and to simulation 0-sized dims if any."
    },
    {
      "name": "is_plane",
      "kind": "function",
      "signature": "is_plane(val: MODE_PLANE_TYPE)",
      "description": "Raise validation error if not planar."
    },
    {
      "name": "normal_axis",
      "kind": "function",
      "signature": "normal_axis()",
      "description": "Axis normal to the mode plane."
    },
    {
      "name": "normal_axis_2d",
      "kind": "function",
      "signature": "normal_axis_2d()",
      "description": "Axis normal to the mode plane in a 2D plane that is normal to the bend_axis_3d."
    },
    {
      "name": "plane_center_tangential",
      "kind": "function",
      "signature": "plane_center_tangential(plane: MODE_PLANE_TYPE)",
      "description": "Mode lane center in the tangential axes."
    },
    {
      "name": "plane_in_sim_bounds",
      "kind": "function",
      "signature": "plane_in_sim_bounds()",
      "description": "Check that the plane is at least partially inside the simulation bounds."
    },
    {
      "name": "plot",
      "kind": "function",
      "signature": "plot(ax: Ax = None, hlim: tuple[float, float] | None = None, vlim: tuple[float, float] | None = None, fill_structures: bool = True, **patch_kwargs: Any)",
      "description": "Plot the mode plane simulation's components."
    },
    {
      "name": "plot_3d",
      "kind": "function",
      "signature": "plot_3d(width: int = 800, height: int = 800)",
      "description": "Render 3D plot of `ModeSolver` (in jupyter notebook only). Parameters ---------- width : float = 800 width of the 3d view dom's size height : float = 800 height of the 3d view dom's size"
    },
    {
      "name": "plot_eps",
      "kind": "function",
      "signature": "plot_eps(freq: float | None = None, alpha: float | None = None, ax: Ax = None)",
      "description": "Plot the mode plane simulation's components. The permittivity is plotted in grayscale based on its value at the specified frequency."
    },
    {
      "name": "plot_field",
      "kind": "function",
      "signature": "plot_field(field_name: str, val: Literal['real', 'imag', 'abs'] = 'real', scale: PlotScale = 'lin', eps_alpha: float = 0.2, robust: bool = True, vmin: float | None = None, vmax: float | None = None, ax: Ax = None, cmap: str | Colormap | None = None, **sel_kwargs: Any)",
      "description": "Plot the field for a `ModeSolverData` with `Simulation` plot overlaid."
    },
    {
      "name": "plot_field_components",
      "kind": "function",
      "signature": "plot_field_components(field_names: str | tuple[str, ...], mode_indices: int | tuple[int, ...] | None = None, val: Literal['real', 'imag', 'abs'] = 'real', scale: PlotScale = 'lin', eps_alpha: float = 0.2, robust: bool = True, vmin: float | None = None, vmax: float | None = None, ax: Any = None, cmap: str | Colormap | None = None, figsize: tuple[float, float] | None = None, titles: bool = True, show_n_eff: bool = False, **sel_kwargs: Any)",
      "description": "Plot multiple field components for one or more modes in a single call."
    },
    {
      "name": "plot_grid",
      "kind": "function",
      "signature": "plot_grid(ax: Ax = None, **kwargs: Any)",
      "description": "Plot the mode plane cell boundaries as lines."
    },
    {
      "name": "plot_pml",
      "kind": "function",
      "signature": "plot_pml(ax: Ax = None)",
      "description": "Plot the mode plane absorbing boundaries."
    },
    {
      "name": "plot_structures_eps",
      "kind": "function",
      "signature": "plot_structures_eps(freq: float | None = None, alpha: float | None = None, cbar: bool = True, reverse: bool = False, ax: Ax = None)",
      "description": "Plot the mode plane simulation's components. The permittivity is plotted in grayscale based on its value at the specified frequency."
    },
    {
      "name": "reduced_simulation_copy",
      "kind": "function",
      "signature": "reduced_simulation_copy()",
      "description": "Strip objects not used by the mode solver from simulation object. This might significantly reduce upload time in the presence of custom mediums."
    },
    {
      "name": "rotated_bend_center",
      "kind": "function",
      "signature": "rotated_bend_center()",
      "description": "Calculate the center at the rotated bend such that the modal plane is normal to the azimuthal direction of the bend."
    },
    {
      "name": "rotated_mode_solver_data",
      "kind": "function",
      "signature": "rotated_mode_solver_data()",
      "description": ""
    },
    {
      "name": "rotated_structures_copy",
      "kind": "function",
      "signature": "rotated_structures_copy()",
      "description": "Create a copy of the original ModeSolver with rotated structures to the simulation and updates the ModeSpec to disable bend correction and reset angles to normal."
    },
    {
      "name": "sim_data",
      "kind": "function",
      "signature": "sim_data()",
      "description": "`SimulationData` object containing the `ModeSolverData` for this object."
    },
    {
      "name": "sim_with_mode_solver_monitor",
      "kind": "function",
      "signature": "sim_with_mode_solver_monitor(name: str)",
      "description": "Creates `Simulation` from a `ModeSolver`. Creates a copy of the ModeSolver's original simulation with a mode solver monitor added corresponding to the ModeSolver parameters."
    },
    {
      "name": "sim_with_monitor",
      "kind": "function",
      "signature": "sim_with_monitor(freqs: list[float] | None = None, name: str | None = None)",
      "description": "Creates `Simulation` from a `ModeSolver`. Creates a copy of the ModeSolver's original simulation with a mode monitor added corresponding to the ModeSolver parameters."
    },
    {
      "name": "sim_with_source",
      "kind": "function",
      "signature": "sim_with_source(source_time: SourceTime, direction: Direction = None, mode_index: NonNegativeInt = 0)",
      "description": "Creates `Simulation` from a `ModeSolver`. Creates a copy of the ModeSolver's original simulation with a ModeSource added corresponding to the ModeSolver parameters."
    },
    {
      "name": "solve",
      "kind": "function",
      "signature": "solve()",
      "description": "`ModeSolverData` containing the field and effective index data."
    },
    {
      "name": "solver_symmetry",
      "kind": "function",
      "signature": "solver_symmetry()",
      "description": "Get symmetry for solver for propagation along self.normal axis."
    },
    {
      "name": "theta_reference",
      "kind": "function",
      "signature": "theta_reference()",
      "description": "Computes the azimutal angle of the reference modal plane."
    },
    {
      "name": "to_fdtd_mode_solver",
      "kind": "function",
      "signature": "to_fdtd_mode_solver()",
      "description": "Construct a new `ModeSolver` by converting `simulation` from a `EMESimulation` to an FDTD `Simulation`. Only used as a workaround until `EMESimulation` is natively supported in the `ModeSolver` webapi."
    },
    {
      "name": "to_mode_solver_monitor",
      "kind": "function",
      "signature": "to_mode_solver_monitor(name: str, colocate: bool | None = None, mode_spec: ModeSpec | None = None, freqs: list[float] | None = None)",
      "description": "Creates `ModeSolverMonitor` from a `ModeSolver` instance."
    },
    {
      "name": "to_monitor",
      "kind": "function",
      "signature": "to_monitor(freqs: list[float] | None = None, name: str | None = None)",
      "description": "Creates `ModeMonitor` from a `ModeSolver` instance plus additional specifications."
    },
    {
      "name": "to_source",
      "kind": "function",
      "signature": "to_source(source_time: SourceTime, direction: Direction = None, mode_index: NonNegativeInt = 0, num_freqs: PositiveInt = 1, **kwargs: Any)",
      "description": "Creates `ModeSource` from a `ModeSolver` instance plus additional specifications."
    },
    {
      "name": "validate_pre_upload",
      "kind": "function",
      "signature": "validate_pre_upload()",
      "description": "Validate the fully initialized mode solver is ok for upload to our servers."
    }
  ],
  "group": "flex_rf.tidy3d"
}
