gplugins.tidy3d.write_sparameters#
- gplugins.tidy3d.write_sparameters(component: ~gdsfactory.component.Component, layer_stack: ~gdsfactory.technology.layer_stack.LayerStack | None = None, material_mapping: dict[str, ~typing.Annotated[~typing.Any, ~pydantic.functional_validators.AfterValidator(func=~gplugins.tidy3d.types.validate_medium), ~pydantic.functional_serializers.PlainSerializer(func=~gplugins.tidy3d.types.<lambda>, return_type=PydanticUndefined, when_used=json)]] = {'si': Si, 'sin': SiN, 'sio2': SiO2}, extend_ports: ~typing.Annotated[float, ~annotated_types.Ge(ge=0)] = 0.5, port_offset: float = 0.2, pad_xy_inner: ~typing.Annotated[float, ~annotated_types.Ge(ge=0)] = 2.0, pad_xy_outer: ~typing.Annotated[float, ~annotated_types.Ge(ge=0)] = 2.0, pad_z_inner: float = 0.0, pad_z_outer: ~typing.Annotated[float, ~annotated_types.Ge(ge=0)] = 0.0, dilation: float = 0.0, wavelength: float = 1.55, bandwidth: float = 0.2, num_freqs: int = 21, min_steps_per_wvl: int = 30, center_z: float | str | None = None, sim_size_z: float = 4.0, port_size_mult: float | tuple[float, float] = (4.0, 3.0), run_only: tuple[tuple[str, int], ...] | None = None, element_mappings: tuple[tuple[tuple[tuple[str, int], tuple[str, int]], tuple[tuple[str, int, tuple[str, int]]]], ...] = (), extra_monitors: tuple[~typing.Any, ...] | None = None, mode_spec: ~tidy3d.components.mode_spec.ModeSpec = ModeSpec(), boundary_spec: ~tidy3d.components.boundary.BoundarySpec = BoundarySpec(), symmetry: tuple[~typing.Annotated[~typing.Literal[0, -1, 1], ~pydantic.functional_validators.BeforeValidator(func=~tidy3d.components.types.base._dtype2python, json_schema_input_type=PydanticUndefined)], ~typing.Annotated[~typing.Literal[0, -1, 1], ~pydantic.functional_validators.BeforeValidator(func=~tidy3d.components.types.base._dtype2python, json_schema_input_type=PydanticUndefined)], ~typing.Annotated[~typing.Literal[0, -1, 1], ~pydantic.functional_validators.BeforeValidator(func=~tidy3d.components.types.base._dtype2python, json_schema_input_type=PydanticUndefined)]] = (0, 0, 0), run_time: float = 1e-12, shutoff: float = 1e-05, folder_name: str = 'default', dirpath: ~pathlib.Path | str = PosixPath('/home/runner/.gdsfactory/sparameters'), verbose: bool = True, plot_simulation_layer_name: str | None = None, plot_simulation_port_index: int = 0, plot_simulation_z: float | None = None, plot_simulation_x: float | None = None, plot_mode_index: int | None = 0, plot_mode_port_name: str | None = None, plot_epsilon: bool = False, filepath: ~pathlib.Path | str | None = None, overwrite: bool = False, **kwargs: ~typing.Any) dict[str, ndarray[Any, Any]][source]#
Writes the S-parameters for a component.
- Parameters:
component – gdsfactory component to write the S-parameters for.
layer_stack – The layer stack for the component. If None, uses active pdk layer_stack.
material_mapping – A mapping of material names to Tidy3DMedium instances. Defaults to material_name_to_medium.
extend_ports – The extension length for ports.
port_offset – The offset for ports. Defaults to 0.2.
pad_xy_inner – The inner padding in the xy-plane. Defaults to 2.0.
pad_xy_outer – The outer padding in the xy-plane. Defaults to 2.0.
pad_z_inner – The inner padding in the z-direction. Defaults to 0.0.
pad_z_outer – The outer padding in the z-direction. Defaults to 0.0.
dilation – Dilation of the polygon in the base by shifting each edge along its normal outwards direction by a distance;
wavelength – The wavelength for the ModalComponentModeler. Defaults to 1.55.
bandwidth – The bandwidth for the ModalComponentModeler. Defaults to 0.2.
num_freqs – The number of frequencies for the ModalComponentModeler. Defaults to 21.
min_steps_per_wvl – The minimum number of steps per wavelength for the ModalComponentModeler. Defaults to 30.
center_z – The z-coordinate for the center of the ModalComponentModeler. If None, the z-coordinate of the component is used. Defaults to None.
sim_size_z – simulation size um in the z-direction for the ModalComponentModeler. Defaults to 4.
port_size_mult – The size multiplier for the ports in the ModalComponentModeler. Defaults to (4.0, 3.0).
run_only – The run only specification for the ModalComponentModeler. Defaults to None.
element_mappings – The element mappings for the ModalComponentModeler. Defaults to ().
extra_monitors – The extra monitors for the ModalComponentModeler. Defaults to None.
mode_spec – The mode specification for the ModalComponentModeler. Defaults to td.ModeSpec(num_modes=1).
boundary_spec – The boundary specification for the ModalComponentModeler. Defaults to td.BoundarySpec.all_sides(boundary=td.PML()).
symmetry (tuple[Symmetry, Symmetry, Symmetry], optional) – The symmetry for the simulation. Defaults to (0,0,0).
run_time – The run time for the ModalComponentModeler.
shutoff – The shutoff value for the ModalComponentModeler. Defaults to 1e-5.
folder_name – The folder name for the ModalComponentModeler in flexcompute website. Defaults to “default”.
dirpath – Optional directory path for writing the Sparameters. Defaults to “~/.gdsfactory/sparameters”.
verbose – Whether to print verbose output for the ModalComponentModeler. Defaults to True.
plot_simulation_layer_name – Optional layer name to plot. Defaults to None.
plot_simulation_port_index – which port index to plot. Defaults to 0.
plot_simulation_z – which z coordinate to plot. Defaults to None.
plot_simulation_x – which x coordinate to plot. Defaults to None.
plot_mode_index – which mode index to plot. Defaults to 0.
plot_mode_port_name – which port name to plot. Defaults to None.
plot_epsilon – whether to plot epsilon. Defaults to False.
filepath – Optional file path for the S-parameters. If None, uses hash of simulation.
overwrite – Whether to overwrite existing S-parameters. Defaults to False.
kwargs – Additional keyword arguments for the tidy3d Simulation constructor.