Tidy3D mode solver#

Waveguides#

[1]:
import gdsfactory.simulation.gtidy3d as gt
2022-06-28 17:08:20.681 | INFO     | gdsfactory.config:<module>:52 - Load '/home/runner/work/gdsfactory/gdsfactory/gdsfactory' 5.11.4
2022-06-28 17:08:22.239 | INFO     | gdsfactory.simulation.gtidy3d:<module>:52 - Tidy3d '1.4.1' installed at ['/usr/share/miniconda/envs/anaconda-client-env/lib/python3.9/site-packages/tidy3d']
[2]:
strip = gt.modes.Waveguide(wavelength=1.55, wg_width=0.5, t_wg=0.22, t_slab=0.0)
strip.plot_index()
<Figure size 432x288 with 2 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_2_1.png
[3]:
strip = gt.modes.find_modes(wavelength=1.55, wg_width=0.5, t_wg=0.22, t_slab=0.0)
2022-06-28 17:08:22.426 | INFO     | gdsfactory.simulation.gtidy3d.modes:find_modes:445 - load /home/runner/work/gdsfactory/gdsfactory/gdslib/modes/70451810.pkl waveguide from file cache.
[4]:
strip.plot_index()
<Figure size 432x288 with 2 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_4_1.png
[5]:
strip.plot_Ex(0)  # TE
strip.plot_Ey(1)  # TM
<Figure size 432x288 with 3 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_5_1.png
<Figure size 432x288 with 3 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_5_3.png
[6]:
rib = gt.modes.find_modes(wavelength=1.55, wg_width=0.5, t_wg=0.22, t_slab=0.15)
rib.plot_index()
2022-06-28 17:08:23.168 | INFO     | gdsfactory.simulation.gtidy3d.modes:find_modes:445 - load /home/runner/work/gdsfactory/gdsfactory/gdslib/modes/94034b0c.pkl waveguide from file cache.
<Figure size 432x288 with 2 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_6_2.png
[7]:
rib.plot_Ex(index=0)
rib.plot_Ey(index=0)
<Figure size 432x288 with 3 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_7_1.png
<Figure size 432x288 with 3 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_7_3.png

Bend modes#

You can compute bend modes specifying the bend radius.

[8]:
strip_bend = gt.modes.find_modes(
    wavelength=1.55, wg_width=0.5, t_wg=0.22, t_slab=0.0, bend_radius=3
)
2022-06-28 17:08:23.806 | INFO     | gdsfactory.simulation.gtidy3d.modes:find_modes:445 - load /home/runner/work/gdsfactory/gdsfactory/gdslib/modes/42500eaa.pkl waveguide from file cache.
[9]:
# lets plot the fundamental TE mode
strip_bend.plot_Ex(0)
strip_bend.plot_Ey(0)
<Figure size 432x288 with 3 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_10_1.png
<Figure size 432x288 with 3 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_10_3.png
[10]:
# lets plot the fundamental TM mode
strip_bend.plot_Ex(1)
strip_bend.plot_Ey(1)
<Figure size 432x288 with 3 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_11_1.png
<Figure size 432x288 with 3 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_11_3.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).

[11]:
import gdsfactory.simulation.gtidy3d as gt
import matplotlib.pyplot as plt

r, integral = gt.modes.sweep_bend_loss()
plt.plot(r, integral, ".")
plt.xlabel("bend radius (um)")
plt.ylabel("Transmission")
plt.show()
/usr/share/miniconda/envs/anaconda-client-env/lib/python3.9/site-packages/tidy3d/plugins/mode/transforms.py:59: RuntimeWarning: divide by zero encountered in true_divide
  dwdz_e = radius / new_coords[norm_axis][:-1]
<Figure size 432x288 with 1 Axes>
../../../_images/notebooks_plugins_tidy3d_01_tidy3d_modes_13_2.png