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': Medium(attrs={}, name='Si', frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, heat_spec=None, type='Medium', permittivity=12.0409, conductivity=0.0), 'sin': Medium(attrs={}, name='SiN', frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, heat_spec=None, type='Medium', permittivity=4.0, conductivity=0.0), 'sio2': Medium(attrs={}, name='SiO2', frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, heat_spec=None, type='Medium', permittivity=2.1609, conductivity=0.0)}, 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.ModeSpec = ModeSpec(attrs={}, num_modes=1, target_neff=None, num_pml=(0, 0), filter_pol='te', angle_theta=0.0, angle_phi=0.0, precision='single', bend_radius=None, bend_axis=None, track_freq='central', group_index_step=False, type='ModeSpec'), boundary_spec: ~tidy3d.components.boundary.BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={}, plus=PML(attrs={}, name=None, type='PML', num_layers=12, parameters=PMLParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=1.5, type='PMLParams', kappa_order=3, kappa_min=1.0, kappa_max=3.0, alpha_order=1, alpha_min=0.0, alpha_max=0.0)), minus=PML(attrs={}, name=None, type='PML', num_layers=12, parameters=PMLParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=1.5, type='PMLParams', kappa_order=3, kappa_min=1.0, kappa_max=3.0, alpha_order=1, alpha_min=0.0, alpha_max=0.0)), type='Boundary'), y=Boundary(attrs={}, plus=PML(attrs={}, name=None, type='PML', num_layers=12, parameters=PMLParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=1.5, type='PMLParams', kappa_order=3, kappa_min=1.0, kappa_max=3.0, alpha_order=1, alpha_min=0.0, alpha_max=0.0)), minus=PML(attrs={}, name=None, type='PML', num_layers=12, parameters=PMLParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=1.5, type='PMLParams', kappa_order=3, kappa_min=1.0, kappa_max=3.0, alpha_order=1, alpha_min=0.0, alpha_max=0.0)), type='Boundary'), z=Boundary(attrs={}, plus=PML(attrs={}, name=None, type='PML', num_layers=12, parameters=PMLParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=1.5, type='PMLParams', kappa_order=3, kappa_min=1.0, kappa_max=3.0, alpha_order=1, alpha_min=0.0, alpha_max=0.0)), minus=PML(attrs={}, name=None, type='PML', num_layers=12, parameters=PMLParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=1.5, type='PMLParams', kappa_order=3, kappa_min=1.0, kappa_max=3.0, alpha_order=1, alpha_min=0.0, alpha_max=0.0)), type='Boundary'), type='BoundarySpec'), symmetry: tuple[~typing.Literal[0, -1, 1], ~typing.Literal[0, -1, 1], ~typing.Literal[0, -1, 1]] = (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) dict[str, ndarray] [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 ComponentModeler. Defaults to 1.55.
bandwidth – The bandwidth for the ComponentModeler. Defaults to 0.2.
num_freqs – The number of frequencies for the ComponentModeler. Defaults to 21.
min_steps_per_wvl – The minimum number of steps per wavelength for the ComponentModeler. Defaults to 30.
center_z – The z-coordinate for the center of the ComponentModeler. 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 ComponentModeler. Defaults to 4.
port_size_mult – The size multiplier for the ports in the ComponentModeler. Defaults to (4.0, 3.0).
run_only – The run only specification for the ComponentModeler. Defaults to None.
element_mappings – The element mappings for the ComponentModeler. Defaults to ().
extra_monitors – The extra monitors for the ComponentModeler. Defaults to None.
mode_spec – The mode specification for the ComponentModeler. Defaults to td.ModeSpec(num_modes=1, filter_pol=”te”).
boundary_spec – The boundary specification for the ComponentModeler. 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 ComponentModeler.
shutoff – The shutoff value for the ComponentModeler. Defaults to 1e-5.
folder_name – The folder name for the ComponentModeler 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 ComponentModeler. 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.