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 structuren_modes (
int) – number of modes to computelegend (
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])
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
structure (Structure) – The target structure to solve for modes.
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 modesx_step – 0.02
y_step – 0.02
thickness – 0.22
width – 0.5
slab_thickness – 0
sub_thickness – 0.5
sub_width – 2.0
clad_thickness – [0.5]
n_sub – sio2
n_wg – si
n_clads – [sio2]
wavelength (
float) – 1.55angle – 90.0
- Return type
List[float64]- Returns
List of the group indices found for each mode.