gplugins.tidy3d.write_sparameters_grating_coupler

gplugins.tidy3d.write_sparameters_grating_coupler#

gplugins.tidy3d.write_sparameters_grating_coupler(component: ComponentSpec, dirpath: str | Path | None = None, filepath: str | Path | None = None, overwrite: bool = False, port_waveguide_name: str = 'o1', fiber_port_prefix: str = 'o2', verbose: bool = False, run: bool = True, **kwargs) dict[str, ndarray][source]#

Get sparameter matrix from a gdsfactory grating coupler.

Assumes grating coupler waveguide port is facing to the left (west).

TODO: add a fiber model (more realistic than a gaussian_beam).

Parameters:
  • component – grating coupler gdsfactory Component to simulate.

  • dirpath – directory to store sparameters in npz. Defaults to active Pdk.sparameters_path.

  • filepath – optional sparameters file.

  • overwrite – overwrites stored Sparameter npz results.

  • verbose – prints info messages and progressbars.

  • run – runs simulation, if False, only plots simulation.

Keyword Arguments:
  • port_extension – extend ports beyond the PML.

  • layer_stack – contains layer to thickness, zmin and material. Defaults to active pdk.layer_stack.

  • thickness_pml – PML thickness (um).

  • xmargin – left/right distance from component to PML.

  • xmargin_left – left distance from component to PML.

  • xmargin_right – right distance from component to PML.

  • ymargin – left/right distance from component to PML.

  • ymargin_top – top distance from component to PML.

  • ymargin_bot – bottom distance from component to PML.

  • zmargin – thickness for cladding above and below core.

  • clad_material – material for cladding.

  • box_material – for bottom cladding.

  • substrate_material – for substrate.

  • box_thickness – bottom cladding thickness in (um).

  • substrate_thickness – (um).

  • port_waveguide_name – input port name.

  • port_margin – margin on each side of the port.

  • distance_source_to_monitors – in (um) source goes before monitors.

  • port_waveguide_offset – mode solver workaround. positive moves source forward, negative moves source backward.

  • wavelength – source center wavelength (um). if None takes mean between wavelength_start, wavelength_stop.

  • wavelength_start – in (um).

  • wavelength_stop – in (um).

  • wavelength_points – number of wavelengths.

  • plot_modes – plot source modes.

  • num_modes – number of modes to plot.

  • run_time_ps – make sure it’s sufficient for the fields to decay. defaults to 10ps and counts on the automatic shutoff to stop earlier if needed.

  • fiber_port_prefix – port prefix to place fiber source.

  • fiber_xoffset – fiber center xoffset to fiber_port_name.

  • fiber_z – fiber zoffset from grating zmax.

  • fiber_mfd – fiber mode field diameter (um).

  • fiber_angle_deg – fiber_angle in degrees with respect to normal.

  • material_name_to_tidy3d – dispersive materials have a wavelength dependent index. Maps layer_stack names with tidy3d material database names.

  • is_3d – True by default runs in 3D.

  • with_all_monitors – stores all monitor fields.