EMEModel

class photonforge.EMEModel(eme_grid_spec, medium=None, symmetry=(0, 0, 0), monitors=(), structures=(), grid_spec=None, subpixel=True, bounds=((None, None, None), (None, None, None)), constraint='passive', simulation_updates={}, verbose=True)[source]

S matrix model based on Eigenmode Expansion calculation.

Parameters:
  • eme_grid_spec (Annotated[EMEUniformGrid | EMEExplicitGrid | EMECompositeGrid, _]) – 1D grid in the that specifies the EME cells where mode solving is performed along the propagation direction.

  • medium (Annotated[Medium | AnisotropicMedium | PECMedium | PMCMedium | PoleResidue | Sellmeier | Lorentz | Debye | Drude | FullyAnisotropicMedium | CustomMedium | CustomPoleResidue | CustomSellmeier | CustomLorentz | CustomDebye | CustomDrude | CustomAnisotropicMedium | PerturbationMedium | PerturbationPoleResidue | LossyMetalMedium, _] | None) – Background medium. If None, the technology default is used.

  • symmetry (Annotated[Sequence[int], _]) – Component symmetries.

  • monitors (Sequence[Annotated[FieldMonitor | FieldTimeMonitor | AuxFieldTimeMonitor | PermittivityMonitor | FluxMonitor | FluxTimeMonitor | ModeMonitor | ModeSolverMonitor | FieldProjectionAngleMonitor | FieldProjectionCartesianMonitor | FieldProjectionKSpaceMonitor | DiffractionMonitor | DirectivityMonitor, _]]) – Extra field monitors added to the simulation.

  • structures (Sequence[Structure]) – Additional structures included in the simulations.

  • grid_spec (Annotated[float, exclusiveMinimum=0] | GridSpec | None) – Simulation grid specification. A single float can be used to specify the min_steps_per_wvl for an auto grid.

  • subpixel (SubpixelSpec | bool) – Flag controlling subpixel averaging in the simulation grid or an instance of tidy3d.SubpixelSpec.

  • bounds (Annotated[Sequence[Sequence[float | None]], _]) – Bound overrides for the final simulation.

  • constraint (Literal['passive', 'unitary'] | None) – Constraint for EME propagation. Possible values are "passive" and "unitary".

  • simulation_updates (dict[str, Any]) – Dictionary of updates applied to the simulation generated by this model. See example in Tidy3DModel.

  • verbose (bool) – Control solver verbosity.

If not set, the default values for the component simulations are defined based on the wavelengths used in the s_matrix call.

Methods

data_file_for(component, *[, _skip_warning])

DEPRECATED: Use EMEModel.batch_data.

data_path_for(component, *[, _skip_warning])

DEPRECATED: Use EMEModel.batch_data.

estimate_cost(*args, **kwargs)

Estimate the cost for S matrix computation.

from_bytes(byte_repr)

De-serialize this model.

get_simulation(component, frequencies)

Create an EME simulation for a component.

s_matrix(component, frequencies[, ...])

Compute the S matrix for a component using this model.

setup_time_stepper(component, time_step[, ...])

Obtain a time stepper for a component using this model.

simulation_data(component, frequencies, *[, ...])

Return the EME simulation data for a given component.

simulation_data_for(component, *[, ...])

DEPRECATED: Use EMEModel.batch_data.

start(component, frequencies, *[, verbose, ...])

Start computing the S matrix response from a component.

update(*args, **kwargs)

Update this model.

Attributes

parametric_function

Function used to update a parametric component.

parametric_kwargs

Keyword arguments used to update a parametric component.

properties

Object properties.

random_variables

Random variables associated to this modles's parameters.

time_stepper

Time stepper associated with this model.

data_file_for(component, *, _skip_warning=False)[source]

DEPRECATED: Use EMEModel.batch_data.

Parameters:

component (Component)

Return type:

Path | None

data_path_for(component, *, _skip_warning=False)[source]

DEPRECATED: Use EMEModel.batch_data.

Parameters:

component (Component)

Return type:

Path

classmethod from_bytes(byte_repr)[source]

De-serialize this model.

Parameters:

byte_repr (bytes)

Return type:

EMEModel

get_simulation(component, frequencies)[source]

Create an EME simulation for a component.

Parameters:
  • component (Component) – Instance of Component for calculation.

  • frequencies (Sequence[float]) – Sequence of frequencies for the simulation.

Returns:

EME simulation and 2 tuples with the names of the ports on each side of the domain.

Return type:

tuple[EMESimulation, tuple[tuple[str], tuple[str]]]

simulation_data(component, frequencies, *, verbose=None, show_progress=True, **kwargs)[source]

Return the EME simulation data for a given component.

Uses the same arguments as EMEModel.start().

Parameters:
  • component (Component)

  • frequencies (Sequence[float])

  • verbose (bool | None)

  • show_progress (bool)

  • kwargs (Any)

Return type:

EMESimulationData | None

simulation_data_for(component, *, _skip_warning=False)[source]

DEPRECATED: Use EMEModel.batch_data.

Parameters:

component (Component)

Return type:

EMESimulationData | None

start(component, frequencies, *, verbose=None, cost_estimation=False, **kwargs)[source]

Start computing the S matrix response from a component.

Parameters:
  • component (Component) – Component from which to compute the S matrix.

  • frequencies (Sequence[float]) – Sequence of frequencies at which to perform the computation.

  • verbose (bool | None) – If set, overrides the model’s verbose attribute.

  • cost_estimation (bool) – If set, simulations are uploaded, but not executed. S matrix will not be computed.

  • **kwargs (Any) – Unused.

Returns:

Result object with attributes status and s_matrix.

Return type:

_EMEModelRunner

Important

When using geometry symmetry, the mode numbering in inputs is relative to the solver run with the symmetry applied, not the mode number presented in the final S matrix.