FDFD mode solver#

We also have a FDFD mode solver.

Waveguides#

Guided Electromagnetic modes are the ones that have an effective index larger than the cladding of the waveguide

Here is a waveguide of Silicon (n=3.4) surrounded by SiO2 (n=1.44) cladding

For a 220 nm height x 450 nm width the effective index is 2.466

import gdsfactory as gf
import gplugins.tidy3d as gt
import matplotlib.pyplot as plt
import numpy as np
from gdsfactory.generic_tech import get_generic_pdk

gf.config.rich_output()
PDK = get_generic_pdk()
PDK.activate()

nm = 1e-3
wg_width = 0.5
wavelength = 1.55
core_thickness = 0.22
slab_thickness = 0.0
core_material = "si"  # can be a string or a number with the refractive index
clad_material = "sio2"

slab_thickness_rib = 0.15
nitride_thickness = 0.4

strip = gt.modes.Waveguide(
    wavelength=wavelength,
    core_width=wg_width,
    core_thickness=core_thickness,
    slab_thickness=slab_thickness,
    core_material=core_material,
    clad_material=clad_material,
    num_modes=2,
    sidewall_angle=np.deg2rad(10),
)

strip.plot_index()

<matplotlib.collections.QuadMesh object at 0x7fc625a4ee50>

../_images/5123668ca140393b4a6cb84e15cfe62a109b739ecb096ee8af57bad493090400.png
strip.plot_grid()

../_images/82874309e57ad3a6f1b0295bae75bc8a09d0056063e8ecccc0e9f442a1145697.png
strip.plot_field(field_name="Ex", mode_index=0)  # TE
15:57:50 UTC WARNING: The group index was not computed. To calculate group      
             index, pass 'group_index_step = True' in the 'ModeSpec'.           

<matplotlib.collections.QuadMesh object at 0x7fc62311a0d0>

../_images/4b44d724fbc39e36a1926f89d0a6ca6d1d2048322b279c89341bcffb84625e76.png
strip.plot_field(field_name="Ex", mode_index=0, value="dB")  # TE

<matplotlib.collections.QuadMesh object at 0x7fc623174f10>

../_images/3c266febfd6839ab364b18ec66c38ec93695428945767875cd6efb8d19a2180c.png
strip.plot_field(field_name="Ey", mode_index=1)  # TM

<matplotlib.collections.QuadMesh object at 0x7fc6231c4fd0>

../_images/4a33d7f9bbdfc4b7b26ed293c8e6e492528be788195367964b07b009da326bd8.png
strip.n_eff

array([2.54959783+4.11062054e-05j, 1.88581037+2.04207812e-04j])
slab_thickness = 0.15

rib = gt.modes.Waveguide(
    wavelength=wavelength,
    core_width=wg_width,
    core_thickness=core_thickness,
    slab_thickness=slab_thickness,
    core_material=core_material,
    clad_material=clad_material,
    num_modes=2,
    sidewall_angle=np.deg2rad(10),
)

rib.plot_index()
rib.n_eff
15:57:52 UTC WARNING: Mode field at frequency index 0, mode index 1 does not    
             decay at the plane boundaries.                                     

array([2.67680485+3.13289436e-05j, 2.50895287+4.47976905e-05j])

../_images/f550ae640e7c7286f9ccf72bffa2daf6c47b5481f1dc5b341c5e927c010db451.png
rib.plot_field(field_name="Ex", mode_index=0)  # TE

<matplotlib.collections.QuadMesh object at 0x7fc622e63110>

../_images/748d9673a3befc357699ef994a57a14a6ff5795f629dfc7c6466dcd4294c0c5f.png
nitride = gt.modes.Waveguide(
    wavelength=wavelength,
    core_width=1.0,
    core_thickness=nitride_thickness,
    slab_thickness=0.0,
    core_material="sin",  # can be a string or a number with the refractive index
    clad_material="sio2",
    sidewall_angle=np.deg2rad(10)
)
nitride.plot_index()
nitride.n_eff

array([1.65390492+7.63134331e-05j, 1.58330988+1.40964564e-04j])

../_images/5b0b9c6252257ab477af5e2cd7a5775966a111e11eabc2e0803fc8bc5e0c8da2.png
nitride.plot_field(field_name="Ex", mode_index=0)  # TE

<matplotlib.collections.QuadMesh object at 0x7fc622ed0750>

../_images/a7149e92dd1c7edb15442e5ae2d00c71589529e27737b7154e2448607ee7aa82.png

Sweep width#

You can sweep the waveguide width and compute the modes.

By increasing the waveguide width, the waveguide supports many more TE and TM modes. Where TE modes have a dominant Ex field and TM modes have larger Ey fields.

Notice that waveguides wider than 0.450 um support more than one TE mode. Therefore the maximum width for single mode operation is 0.450 um.

wg_width = 0.5
wavelength = 1.55
core_thickness = 0.22
slab_thickness = 0.0
core_material = "si"  # can be a string or a number with the refractive index
clad_material = "sio2"

strip = gt.modes.Waveguide(
    wavelength=wavelength,
    core_width=wg_width,
    core_thickness=core_thickness,
    slab_thickness=slab_thickness,
    core_material=core_material,
    clad_material=clad_material,
    num_modes=4,
    sidewall_angle=np.deg2rad(10),
)

w = np.linspace(400 * nm, 1000 * nm, 7)
n_eff = gt.modes.sweep_n_eff(strip, core_width=w)
fraction_te = gt.modes.sweep_fraction_te(strip, core_width=w)

for i in range(4):
    plt.plot(w, n_eff.sel(mode_index=i).real, c="k")
    plt.scatter(
        w, n_eff.sel(mode_index=i).real, c=fraction_te.sel(mode_index=i), vmin=0, vmax=1
    )
plt.axhline(y=1.44, color="k", ls="--")
plt.colorbar().set_label("TE fraction")
plt.xlabel("Width of waveguide µm")
plt.ylabel("Effective refractive index")
plt.title("Effective index sweep")
15:57:55 UTC WARNING: Mode field at frequency index 0, mode index 3 does not    
             decay at the plane boundaries.                                     
15:57:56 UTC WARNING: Mode field at frequency index 0, mode index 3 does not    
             decay at the plane boundaries.                                     

Text(0.5, 1.0, 'Effective index sweep')

../_images/34dce7308460da51cca5f09a4cc0c91d554ebb358dd5277bc23b8ea53cdd95ef.png

Exercises

  • What is the maximum width to support a single TE mode at 1310 nm?

  • For a Silicon Nitride (n=2) 400nm thick waveguide surrounded by SiO2 (n=1.44), what is the maximum width to support a single TE mode at 1550 nm?

  • For two 500x220nm Silicon waveguides surrounded by SiO2, what is the coupling length (100% coupling) for 200 nm gap?

Group index#

You can also compute the group index for a waveguide.

nm = 1e-3
wavelength = 1.55
wg_width = 0.5
core_thickness = 0.22

strip = gt.modes.Waveguide(
    wavelength=wavelength,
    core_width=wg_width,
    slab_thickness=0.0,
    core_material="si",
    clad_material="sio2",
    core_thickness=core_thickness,
    num_modes=4,
    group_index_step=10 * nm,
)
print(strip.n_group)
15:58:05 UTC WARNING: Mode field at frequency index 0, mode index 3 does not    
             decay at the plane boundaries.                                     
             WARNING: Mode field at frequency index 1, mode index 3 does not    
             decay at the plane boundaries.                                     
15:58:06 UTC WARNING: Mode field at frequency index 2, mode index 3 does not    
             decay at the plane boundaries.                                     
[4.17803969 4.08299706 2.71577378 1.50333028]

Bend modes#

You can compute bend modes specifying the bend radius.

strip_bend = gt.modes.Waveguide(
    wavelength=wavelength,
    core_width=wg_width,
    core_thickness=core_thickness,
    slab_thickness=0.0,
    bend_radius=4,
    core_material="si",
    clad_material="sio2",
)
strip_bend.plot_field(field_name="Ex", mode_index=0)  # TE
             WARNING: Mode field at frequency index 0, mode index 1 does not    
             decay at the plane boundaries.                                     

<matplotlib.collections.QuadMesh object at 0x7fc622cbe590>

../_images/ddf2dcb5c4028b7c8c263c3c64b00cc90a91fc87eaca79aea6d31e15e0f6d340.png

Bend loss#

You can also compute the losses coming from the mode mismatch from the bend into a straight waveguide. To compute the bend loss due to mode mismatch you can calculate the mode overlap of the straight mode and the bent mode. Because there are two mode mismatch interfaces the total loss due to mode mismatch will be squared (from bend to straight and from straight to bend).

from paper

radii = np.arange(4, 7)
bend = gt.modes.Waveguide(
    wavelength=wavelength,
    core_width=wg_width,
    core_thickness=core_thickness,
    core_material="si",
    clad_material="sio2",
    num_modes=1,
    bend_radius=radii.min(),
)
mismatch = gt.modes.sweep_bend_mismatch(bend, radii)

plt.plot(radii, 10 * np.log10(mismatch))
plt.title("Strip waveguide bend")
plt.xlabel("Radius (μm)")
plt.ylabel("Mismatch (dB)")

Text(0, 0.5, 'Mismatch (dB)')

../_images/faec42c4ae4027325dfb6b6ff38dccba67e0e5b4ac5e45b91856db8ecf6601fd.png
dB_cm = 2  # dB/cm
length = 2 * np.pi * radii * 1e-6
propagation_loss = dB_cm * length * 1e2
print(f"Propagation loss for 2πR bend: {propagation_loss} dB")

plt.title("Bend90 loss for TE polarization")
plt.plot(radii, -10 * np.log10(mismatch), ".", label="mode loss")
plt.plot(radii, propagation_loss, ".", label="propagation loss")
plt.xlabel("bend radius (um)")
plt.ylabel("Loss (dB)")
plt.legend()
Propagation loss for 2πR bend: [0.00502655 0.00628319 0.00753982] dB

<matplotlib.legend.Legend object at 0x7fc621a62750>

../_images/1065806a408ccacc8bc01333530b4c7fd9cb266aec465780542672a8931c28ba.png
rib = gt.modes.Waveguide(
    wavelength=wavelength,
    core_width=wg_width,
    core_thickness=core_thickness,
    slab_thickness=slab_thickness_rib,
    bend_radius=15,
    core_material="si",
    clad_material="sio2",
)
rib.plot_field(field_name="Ex", mode_index=0)  # TE
15:58:10 UTC WARNING: Mode field at frequency index 0, mode index 0 does not    
             decay at the plane boundaries.                                     
             WARNING: Mode field at frequency index 0, mode index 1 does not    
             decay at the plane boundaries.                                     

<matplotlib.collections.QuadMesh object at 0x7fc621a33e50>

../_images/6d5acda87e865854e9f0b7b6e960f02e5f234b12f3e9f8daaee9c9f9afc55026.png
nitride_bend = gt.modes.Waveguide(
    wavelength=1.55,
    core_width=1000 * nm,
    core_thickness=nitride_thickness,
    slab_thickness=0.0,
    bend_radius=30,
    core_material="sin",
    clad_material="sio2",
)
nitride_bend.plot_field(field_name="Ex", mode_index=0, value="abs")  # TE

<matplotlib.collections.QuadMesh object at 0x7fc621411390>

../_images/421c56e5d01c1341d88684ae8b6362e4ca2afc7627273ec693a36bfcdb08d320.png
radii = np.array([30, 35, 40])
bend = gt.modes.Waveguide(
    wavelength=wavelength,
    core_width=1000 * nm,
    core_thickness=nitride_thickness,
    core_material="sin",
    clad_material="sio2",
    num_modes=1,
    bend_radius=radii.min(),
)
mismatch = gt.modes.sweep_bend_mismatch(bend, radii)
dB_cm = 2  # dB/cm
length = 2 * np.pi * radii * 1e-6
propagation_loss = dB_cm * length * 1e2
print(f"propagation_loss for 2PI degree bend = {propagation_loss} dB")

plt.title("Bend90 loss for TE polarization")
plt.plot(radii, -10 * np.log10(mismatch), ".", label="mode loss")
plt.plot(radii, propagation_loss, ".", label="propagation loss")
plt.xlabel("bend radius (um)")
plt.ylabel("Loss (dB)")
plt.legend()
propagation_loss for 2PI degree bend = [0.03769911 0.0439823  0.05026548] dB

<matplotlib.legend.Legend object at 0x7fc621bc6590>

../_images/127f53e01f5a3bbae8b6005aafa226aed5763fff295d32bc0fbbfdf1779cbedd.png

Exercises

  • For a 500nm wide 220nm thick Silicon waveguide surrounded by SiO2, what is the minimum bend radius to have less than 0.04dB loss for TE polarization at 1550nm?

  • For a 500nm wide 220nm thick Silicon waveguide surrounded by SiO2, what is the minimum bend radius to have 99% power transmission for TM polarization at 1550nm?

Waveguide coupler#

You can also compute the modes of a waveguide coupler.

       ore_width[0]  core_width[1]
        <------->     <------->
         _______       _______   _
        |       |     |       | |
        |       |     |       |
        |       |_____|       | | core_thickness
        |slab_thickness       |
        |_____________________| |_
                <----->
                  gap


gap = 200 * nm

c = gt.modes.WaveguideCoupler(
    wavelength=wavelength,
    core_width=(wg_width, wg_width),
    gap=gap,
    core_thickness=core_thickness,
    slab_thickness=slab_thickness,
    core_material="si",
    clad_material="sio2",
)
c.plot_index()

<matplotlib.collections.QuadMesh object at 0x7fc62157d810>

../_images/3d2956ad02f8f731e09ff7522de4bed31a38352831e7425183f05f05165b304c.png
c.plot_field(field_name="Ex", mode_index=0)  # TE

<matplotlib.collections.QuadMesh object at 0x7fc6213b8c50>

../_images/72f8e5bcf461507be4ae3183cbeeb7cfcd4c4f7c740100dcaffd7b3b870ad7d7.png
c.plot_field(field_name="Ex", mode_index=1)  # TE

<matplotlib.collections.QuadMesh object at 0x7fc62178bad0>

../_images/45b7c345ff00eda8f49b91c22f08dc5b99aff0a0fb8a3b1b59499001882cda1e.png
coupler = gt.modes.WaveguideCoupler(
    wavelength=wavelength,
    core_width=(wg_width, wg_width),
    gap=gap,
    core_thickness=core_thickness,
    slab_thickness=slab_thickness,
    core_material="si",
    clad_material="sio2",
    num_modes=4,
)

print("\nCoupler:", coupler)
print("Effective indices:", coupler.n_eff)
print("Mode areas:", coupler.mode_area)
print("Coupling length:", coupler.coupling_length())

gaps = np.linspace(0.05, 0.15, 11)
lengths = gt.modes.sweep_coupling_length(coupler, gaps)

_, ax = plt.subplots(1, 1)
ax.plot(gaps, lengths)
ax.set(xlabel="Gap (μm)", ylabel="Coupling length (μm)")
ax.legend(["TE", "TM"])
ax.grid()
Coupler: WaveguideCoupler(wavelength=array(1.55), core_width=['0.5', '0.5'], core_thickness='0.22', core_material='si', clad_material='sio2', box_material=None, slab_thickness='0.0', clad_thickness=None, box_thickness=None, side_margin=None, sidewall_angle='0.0', sidewall_thickness='0.0', sidewall_k='0.0', surface_thickness='0.0', surface_k='0.0', bend_radius=None, num_modes='4', group_index_step='False', precision='double', grid_resolution='20', max_grid_scaling='1.2', cache_path='/home/runner/.gdsfactory/modes', overwrite='False', gap='0.2')
Effective indices: [2.51642926+4.72655552e-05j 2.49247523+4.48849401e-05j
 1.90917889+2.00702360e-04j 1.80953208+2.20839326e-04j]
Mode areas: [0.26817256 0.26019659 0.65752823 0.60130012]
Coupling length: [32.35363595  7.77746926]

../_images/f28eabafc2bd1a9a6f3cb1f850f678b3d886609063c682fe2fb3fbf7ed3aca69.png