Sweep

waveguide width

modes.sweep_waveguide.sweep_waveguide(waveguides, sweep_param_list, plot=True, x_label='waveguide width (um)', fraction_mode_list=[], overwrite=False, n_modes=6, legend=None)[source]

Find the modes of many waveguides.

Parameters
  • waveguides (list) – A list of waveguides to find the modes of.

  • sweep_param_list (list) – parameter that we sweep (for plotting)

  • plot (bool) – True generates plots

  • x_label (str) – x-axis text to display in the plot.

  • fraction_mode_list (list) – A list of mode indices of the modes that should be included in the TE/TM mode fraction plot. If the list is empty, all modes will be included. The list is empty by default.

  • overwrite (bool) – when True forces to resimulate the structure

  • n_modes (int) – number of modes to compute

  • legend (None) –

Returns

A list of the effective indices found for each structure.

Return type

list

import numpy as np
import modes as ms

widths = np.arange(0.5, 2.0, 0.5)
wgs = [ms.waveguide(width=width) for width in widths]
r = ms.sweep_waveguide(
    wgs, widths, x_label="waveguide width", fraction_mode_list=[1, 2],
)
print(r["n_effs"][0])

(Source code)

_images/sweep-1_00.png

(png, hires.png, pdf)

_images/sweep-1_01.png

(png, hires.png, pdf)

_images/sweep-1_02.png

(png, hires.png, pdf)

wavelength

modes.sweep_wavelength.sweep_wavelength(wavelengths, plot=True, overwrite=False, **wg_kwargs)[source]

Solve for the effective indices of a fixed structure at different wavelengths.

Parameters
  • wavelengths (list) – list of wavelengths to sweep

  • plot (bool) – True generates plots

  • overwrite (bool) – when True forces to resimulate the structure

Returns

arguments for the waveguide results: dict of results resuls[‘n_effs’]: A list of the effective indices found for each wavelength. resuls[‘fractions_te’]:

Return type

wg_kwargs

Group index

modes.group_index.group_index(wavelength=1.55, wavelength_step=0.01, overwrite=False, n_modes=1, **wg_kwargs)[source]

Solve for the group index, \(n_g\), of a structure at a particular wavelength.

Parameters
  • wavelength (float) – center wavelength

  • wavelength_step (float) – The step to take below and above the nominal wavelength. This is used for approximating the gradient of \(n_\mathrm{eff}\) at the nominal wavelength. Default is 0.01.

  • n_modes (int) – number of modes

Keyword Arguments
  • wg – waveguide

  • fields_to_write – List of fields_to_write “Ex”, “Ey”, “Ez”, “Hx”, “Hy”, “Hz”

  • x_step – 0.02 grid step (um)

  • y_step – 0.02 grid step (um)

  • thickness – 0.22 (um)

  • width – 0.5 (um)

  • slab_thickness – 0 (um)

  • sub_width – 2.0 related to the total simulation width

  • sub_thickness – 0.5 bottom simulation margin

  • clad_thickness – [0.5] List of claddings (top simulation margin)

  • n_sub – sio2 substrate index material

  • n_wg – si waveguide index material

  • n_clads – list of cladding materials [sio2]

  • wavelength – 1.55 wavelength (um)

  • angle – 90 sidewall angle (degrees)

Return type

List[float64]

Returns

List of the group indices found for each mode.