fdtdx.compute_mode

Contents

fdtdx.compute_mode#

fdtdx.compute_mode(frequency, inv_permittivities, inv_permeabilities, resolution, direction, mode_index=0, filter_pol=None, dtype=<class 'jax.numpy.float32'>, bend_radius=None, bend_axis=None)[source]#

Compute optical modes of a waveguide cross-section.

This function uses the Tidy3D mode solver to compute the optical modes of a given waveguide cross-section defined by its permittivity distribution.

By default modes are sorted by their effective index. The mode_index argument indexes this sorted list of modes and returns the desired mode. With filter_pol, it is also possible to only index a specific polarization.

Parameters:
  • frequency (float) – Operating frequency in Hz

  • inv_permittivities (jax.Array) – 3D array of inverse relative permittivity values

  • inv_permeabilities (jax.Array | float) – 3D array of inverse relative permittivity values or single float for uniform permeability distribution.

  • resolution (float) – resolution of the simulation grid in meter. For example a grid spacing of 10nm should be given as 10e-9.

  • direction (Literal["+", "-"]) – Propagation direction, either “+” or “-“.

  • mode_index (int, optional) – Index of the mode to compute. Defaults to 0.

  • filter_pol (Literal["te", "tm"] | None, optional)

  • dtype (jnp.dtype, optional) – Float dtype of the simulation. Controls whether mode fields are returned as complex64 (float32) or complex128 (float64). Defaults to jnp.float32.

  • bend_radius (float | None, optional) – Bend radius of the waveguide in meters. Must be set together with bend_axis. When set, the mode solver uses a conformal transformation to account for the bend. Defaults to None (straight waveguide).

  • bend_axis (int | None, optional) – Physical axis index (0/1/2) pointing from the waveguide toward the center of curvature. Must differ from the propagation axis. Required when bend_radius is set. Defaults to None.

Returns:

Tuple of E, H field and the effective index as complex-valued jax arrays.

Return type:

Tuple[jax.Array, jax.Array, jax.Array]