gplugins.lumerical.write_sparameters_lumerical#
- gplugins.lumerical.write_sparameters_lumerical(component: ComponentSpec, session: object | None = None, run: bool = True, overwrite: bool = False, dirpath: PathType | None = None, layer_stack: LayerStack | None = None, simulation_settings: SimulationSettingsLumericalFdtd = SimulationSettingsLumericalFdtd(background_material='sio2', port_margin=1.5, port_extension=5.0, mesh_accuracy=2, wavelength_start=1.2, wavelength_stop=1.6, wavelength_points=500, simulation_time=1e-11, simulation_temperature=300, frequency_dependent_profile=True, field_profile_samples=15, distance_monitors_to_pml=0.5, material_name_to_lumerical={'si': 'Si (Silicon) - Palik', 'sio2': 'SiO2 (Glass) - Palik', 'sin': 'Si3N4 (Silicon Nitride) - Phillip'}), material_name_to_lumerical: dict[str, MaterialSpec] | None = None, delete_fsp_files: bool = True, xmargin: float = 0, ymargin: float = 0, xmargin_left: float = 0, xmargin_right: float = 0, ymargin_top: float = 0, ymargin_bot: float = 0, zmargin: float = 1.0, **settings) np.ndarray [source]#
Returns and writes component Sparameters using Lumerical FDTD.
If simulation exists it returns the Sparameters directly unless overwrite=True which forces a re-run of the simulation
Writes Sparameters both in .npz and .DAT (interconnect format) as well as simulation settings in .YAML
In the npz format you can see S12m where m stands for magnitude and S12a where a stands for angle in radians
Your components need to have ports, that will extend over the PML.
For your Fab technology you can overwrite
simulation_settings
dirpath
layerStack
converts gdsfactory units (um) to Lumerical units (m)
Disclaimer: This function tries to extract Sparameters automatically is hard to make a function that will fit all your possible simulation settings. You can use this function for inspiration to create your own.
- Parameters:
component – Component to simulate.
session – you can pass a session=lumapi.FDTD() or it will create one.
run – True runs Lumerical, False only draws simulation.
overwrite – run even if simulation results already exists.
dirpath – directory to store sparameters in npz. Defaults to active Pdk.sparameters_path.
layer_stack – contains layer to thickness, zmin and material. Defaults to active pdk.layer_stack.
simulation_settings – dataclass with all simulation_settings.
material_name_to_lumerical – alias to lumerical material’s database name or refractive index. translate material name in LayerStack to lumerical’s database name.
delete_fsp_files – deletes lumerical fsp files after simulation.
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.
- Keyword Arguments:
background_material – for the background.
port_margin – on both sides of the port width (um).
port_height – port height (um).
port_extension – port extension (um).
mesh_accuracy – 2 (1: coarse, 2: fine, 3: superfine).
wavelength_start – 1.2 (um).
wavelength_stop – 1.6 (um).
wavelength_points –
simulation_time –
related to max path length 3e8/2.4*10e-12*1e6 = 1.25mm.
simulation_temperature – in kelvin (default = 300).
frequency_dependent_profile – computes mode profiles for different wavelengths.
field_profile_samples – number of wavelengths to compute field profile.
top view ________________________________ | | | xmargin | port_extension |<------> port_margin ||<--> o2_|___________ _________||_o3 | \ / | | \ / | | ====== | | / \ | o1_|___________/ \__________|_o4 | | | | |ymargin | | | | |___|___________________________| side view ________________________________ | | | | | | |ymargin | |<---> _____ _____ | | | | | | | | | | | | | | |_____| |_____| | | | | | | | | |zmargin | | | | |_______|_______________________|
- Returns:
- Sparameters np.ndarray (wavelengths, o1@0,o1@0, o1@0,o2@0 …)
suffix a for angle in radians and m for module.