Component FDTD simulations#
Thanks to the GDSFactory plugin you can directly run simulations in different FDTD solvers.
See tutorial
Tidy3d#
You can read about the tidy3d gdsfactory plugin
import gplugins as sim
import gplugins.tidy3d as gt
import ubcpdk.components as pdk
from ubcpdk.config import PATH
c = pdk.ebeam_y_1550()
c.plot()
2024-04-12 23:30:29.258 | INFO | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ebeam_y_1550.lyp'.
sp = gt.write_sparameters(c, filepath=PATH.sparameters / "ebeam_y_1550_20634f71.npz")
23:30:29 UTC WARNING: 'geometry=PolySlab(type='PolySlab', axis=2, sidewall_angle=0.0, reference_plane='middle', slab_bounds=(-13.0, -3.0), dilation=0.0, vertices=array([[ 11.901, 7.001], [ 11.901, -7.001], [-11.901, -7.001], [-11.901, 7.001], [ 11.901, 7.001]])) name='substrate_0' type='Structure' medium=Medium(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)' (at `simulation.structures[0]`) is completely outside of simulation domain.
WARNING: 'geometry=PolySlab(type='PolySlab', axis=2, sidewall_angle=0.0, reference_plane='middle', slab_bounds=(-13.0, -3.0), dilation=0.0, vertices=array([[ 11.901, 7.001], [ 11.901, -7.001], [-11.901, -7.001], [-11.901, 7.001], [ 11.901, 7.001]])) name='substrate_0' type='Structure' medium=Medium(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)' (at `simulation.structures[0]`) is completely outside of simulation domain.
Simulation loaded from PosixPath('/__w/ubc/ubc/sparameters/ebeam_y_1550_20634f71.npz')
sp.keys()
dict_keys(['o1@0,o1@0', 'o2@0,o1@0', 'o3@0,o1@0', 'o1@0,o2@0', 'o2@0,o2@0', 'o3@0,o2@0', 'o1@0,o3@0', 'o2@0,o3@0', 'o3@0,o3@0', 'wavelengths'])
sim.plot.plot_sparameters(sp)
sim.plot.plot_loss1x2(sp)
sim.plot.plot_imbalance1x2(sp)
Lumerical FDTD#
You can write the Sparameters for all components in the UBC ubcpdk.components
PDK using lumerical FDTD plugin in gplugins
To run simulations uncomment the following lines
import gplugins as sim
import ubcpdk.components as pdk
for f in [
pdk.bend,
pdk.coupler,
pdk.coupler_ring,
pdk.ebeam_y_1550,
pdk.ebeam_crossing4,
]:
component = f()
component.plot_klayout()
# ls.write_sparameters_lumerical(component=component)
2024-04-12 23:30:30.331 | INFO | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/bend_euler_sc.lyp'.
2024-04-12 23:30:30.394 | INFO | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/coupler__ubcpdkpcomponents.lyp'.
2024-04-12 23:30:30.474 | INFO | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/coupler_ring__ubcpdkpcomponents.lyp'.
2024-04-12 23:30:30.538 | INFO | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ebeam_y_1550.lyp'.
2024-04-12 23:30:30.605 | INFO | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ebeam_crossing4.lyp'.
# sp = ls.read.read_sparameters_lumerical(component=ubcpdk.components.straight())
# sim.plot_sparameters(sp)