Component FDTD simulations

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'.
../_images/3b1126ad2f137e3a473add518793c9fc397bf70969f0c135c5d6a708ee01f131.png
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)
../_images/481d025a3b9a5f9a5f67808a87184f69823ece1c9e6cc669abd536d92d593995.png
sim.plot.plot_loss1x2(sp)
../_images/c1ab7073e15168ed899bb9bc38ed9a5c3742d2a0e31625af18914e723ce27594.png
sim.plot.plot_imbalance1x2(sp)
../_images/21f665bc8cff9c94f750b7e8c5e7df989272bd0fc87074c377f0f87ce14a9524.png

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'.
../_images/c13b3e14bc90ebe251b6af24a0b998036a97b513a2b9aef249bc9490217731f5.png ../_images/8bf4fed0500a82cedb8fed22e7088c62b2932ff18d97ac2ab95bd4c5c996eb29.png ../_images/d6348f2ec4e829011a4f2e875549015e71864fa119e6abf775706607a52a541a.png ../_images/3b1126ad2f137e3a473add518793c9fc397bf70969f0c135c5d6a708ee01f131.png ../_images/b2b657be6c5aa2cb169c72af387a9a6f43754ee096b63c886a3e1a93ad321a45.png
# sp = ls.read.read_sparameters_lumerical(component=ubcpdk.components.straight())
# sim.plot_sparameters(sp)