Tidy3D mode solver#

Tidy3D includes an open-source FDFD mode solver for simulating waveguide modes.

Waveguides#

Guided electromagnetic modes are those with an effective index larger than that of the waveguide cladding.

In the example below, we have a silicon waveguide (n = 3.4) surrounded by a SiO₂ cladding (n = 1.44). For a waveguide with dimensions of 220 nm in height and 450 nm in width, the effective index is calculated to be 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
strip = gt.modes.Waveguide(
    wavelength=1.55,
    core_width=0.5,
    core_thickness=0.22,
    slab_thickness=0.0,
    core_material="si",
    clad_material="sio2",
)
strip.plot_index()

<matplotlib.collections.QuadMesh object at 0x7efd7d566810>

../_images/c522e1406f274048141c71aa8c5ff5ca7437e4cde98da6a49a8cab3e045f0a6d.png
strip.plot_grid()

../_images/ffd1efc4631e28ff4c83ac4d7cec0434f0ddde6428b2700bd9fb31949786b2bf.png
strip.plot_field(field_name="Ex", mode_index=0)  # TE
00:56:56 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 0x7efd7d5a5750>

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

<matplotlib.collections.QuadMesh object at 0x7efd7b3088d0>

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

<matplotlib.collections.QuadMesh object at 0x7efd7b0c0450>

../_images/8f8c00acfde076fb05c6545d826cfd44c3f302fc4bd87d9f53c0f71200f835cb.png
strip.n_eff

array([2.51134734+4.42777628e-05j, 1.86463643+2.09422901e-04j])
rib = gt.modes.Waveguide(
    wavelength=1.55,
    core_width=0.5,
    core_thickness=0.22,
    slab_thickness=0.15,
    core_material="si",
    clad_material="sio2",
)
rib.plot_index()
rib.n_eff
00:56:57 UTC WARNING: Mode field at frequency index 0, mode index 1 does not    
             decay at the plane boundaries.                                     

array([2.67427418+3.10179974e-05j, 2.50854926+4.47861069e-05j])

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

<matplotlib.collections.QuadMesh object at 0x7efd7ad322d0>

../_images/7b0341dc5af8b0cb4c2154a88fda45e7840a92c7d11dc1db2f77496d10aae4ba.png
nitride = gt.modes.Waveguide(
    wavelength=1.55,
    core_width=1.0,
    core_thickness=400 * nm,
    slab_thickness=0.0,
    core_material="sin",
    clad_material="sio2",
)
nitride.plot_index()
nitride.n_eff

array([1.64461788+8.05914279e-05j, 1.57796343+1.42713228e-04j])

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

<matplotlib.collections.QuadMesh object at 0x7efd7ab0eb90>

../_images/af81b6ea3c68e718b968316ae497420c7e5433793c80b60e13d5ab51900cc1c5.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.

strip = gt.modes.Waveguide(
    wavelength=1.55,
    core_width=1.0,
    slab_thickness=0.0,
    core_material="si",
    clad_material="sio2",
    core_thickness=220 * nm,
    num_modes=4,
)
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")
00:57:00 UTC WARNING: Mode field at frequency index 0, mode index 3 does not    
             decay at the plane boundaries.                                     
00:57:02 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/9b8b75fce6a1ada6a5abbee54f4a7a432a1b928dab3d41eac96901cdfcc16efc.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

strip = gt.modes.Waveguide(
    wavelength=1.55,
    core_width=500 * nm,
    slab_thickness=0.0,
    core_material="si",
    clad_material="sio2",
    core_thickness=220 * nm,
    num_modes=4,
    group_index_step=10 * nm,
)
print(strip.n_group)
00:57:14 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.                                     
             WARNING: Mode field at frequency index 2, mode index 3 does not    
             decay at the plane boundaries.                                     
[4.17803969 4.08299706 2.71577378 1.50332985]

Bend modes#

You can compute bend modes specifying the bend radius.

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

<matplotlib.collections.QuadMesh object at 0x7efd79af0850>

../_images/66b8a3ac6bd70a65d3b906b588c9a443c7550d509a4c8c4d2bebd4eb825c7c65.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=1.55,
    core_width=500 * nm,
    core_thickness=220 * nm,
    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/6d95ec2d0b8c831f1f2de41330af3ee65cb3e49f59cda08f7a7993edb835cb1e.png
dB_cm = 2  # dB/cm
length = 2 * np.pi * radii * 1e-6
propagation_loss = dB_cm * length * 1e2
print(propagation_loss)

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()
[0.00502655 0.00628319 0.00753982]

<matplotlib.legend.Legend object at 0x7efd79881ed0>

../_images/656ad8755a44a12b3a6e5bc735ff078b5d23c704651b9d6e16b20ca7cfee7047.png
rib = gt.modes.Waveguide(
    wavelength=1.55,
    core_width=1000 * nm,
    core_thickness=220 * nm,
    slab_thickness=110 * nm,
    bend_radius=15,
    core_material="si",
    clad_material="sio2",
)
rib.plot_field(field_name="Ex", mode_index=0)  # TE
00:57:21 UTC WARNING: Mode field at frequency index 0, mode index 1 does not    
             decay at the plane boundaries.                                     

<matplotlib.collections.QuadMesh object at 0x7efd79726d90>

../_images/e26d10e00a29c937c9b3e30f597468951ff6d493b46e5d4f45d05ba24f9ad2f9.png
nitride_bend = gt.modes.Waveguide(
    wavelength=1.55,
    core_width=1000 * nm,
    core_thickness=400 * nm,
    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 0x7efd79152550>

../_images/aa85c269434c3fe431142bc26365f9666389a91e5e7ee46ce21d639196f17d0c.png
radii = np.array([30, 35, 40])
bend = gt.modes.Waveguide(
    wavelength=1.55,
    core_width=1000 * nm,
    core_thickness=400 * nm,
    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(propagation_loss)

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()
[0.03769911 0.0439823  0.05026548]

<matplotlib.legend.Legend object at 0x7efd7b05a010>

../_images/cb734147f0f5d98da700c83bf985ee4e41dbad55496b5e4778a7425baf2ade2b.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


c = gt.modes.WaveguideCoupler(
    wavelength=1.55,
    core_width=(500 * nm, 500 * nm),
    gap=200 * nm,
    core_thickness=220 * nm,
    slab_thickness=100 * nm,
    core_material="si",
    clad_material="sio2",
)
c.plot_index()

<matplotlib.collections.QuadMesh object at 0x7efd7addbf50>

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

<matplotlib.collections.QuadMesh object at 0x7efd7af86c90>

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

<matplotlib.collections.QuadMesh object at 0x7efd79380e50>

../_images/39cffcaf3356158103df2404eb021c2600c2ba78566fc3aa8385b5e6a81202ad.png
coupler = gt.modes.WaveguideCoupler(
    wavelength=1.55,
    core_width=(450 * nm, 450 * nm),
    core_thickness=220 * nm,
    core_material="si",
    clad_material="sio2",
    num_modes=4,
    gap=0.1,
)

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.45', '0.45'], 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='/github/home/.gdsfactory/modes', overwrite='False', gap='0.1')
Effective indices: [2.4637647 +6.57552457e-05j 2.39007229+5.06214923e-05j
 1.9225165 +1.99036730e-04j 1.71420814+2.37015946e-04j]
Mode areas: [0.31003254 0.33258301 0.57286555 0.59002858]
Coupling length: [10.5166863   3.72044606]

../_images/15c8c564fc156385eb2f46d0d392f8529b39ce1f9a4dc49a09177898c453b448.png