Skip to content

Commit

Permalink
Merge pull request #1628 from gdsfactory/modesolver_update2
Browse files Browse the repository at this point in the history
Modesolver update2
  • Loading branch information
joamatab committed May 11, 2023
2 parents cb78627 + f5a3dc8 commit f23b165
Show file tree
Hide file tree
Showing 44 changed files with 1,182 additions and 1,745 deletions.
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Expand Up @@ -1567,7 +1567,7 @@

## [5.7.0](https://github.com/gdsfactory/gdsfactory/pull/400)

- tidy3d mode solver accepts ncore and nclad floats.
- tidy3d mode solver accepts core_material and clad_material floats.
- add file cache to tidy3d to `gt.modes.find_modes`
- fix get_bundle [issue](https://github.com/gdsfactory/gdsfactory/issues/396)
- clean cross-sections [PR](https://github.com/gdsfactory/gdsfactory/pull/398/files)
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/08_pdk.py
Expand Up @@ -129,7 +129,7 @@ class LayerMap(BaseModel):
VIAC: Layer = (40, 0)
WGCLAD: Layer = (111, 0)
WGN: Layer = (34, 0)
WGNCLAD: Layer = (36, 0)
WGclad_material: Layer = (36, 0)

class Config:
frozen = True
Expand Down
28 changes: 14 additions & 14 deletions docs/notebooks/devsim/01_pin_waveguide.py
Expand Up @@ -62,8 +62,8 @@

nm = 1e-9
c = get_simulation_xsection.PINWaveguide(
wg_width=500 * nm,
wg_thickness=220 * nm,
core_width=500 * nm,
core_thickness=220 * nm,
slab_thickness=90 * nm,
)

Expand Down Expand Up @@ -167,10 +167,10 @@
np.log(np.abs(np.real(n_dist[0].T - n_undoped.T))),
origin="lower",
extent=[
-c.xmargin - c.ppp_offset - c.wg_width / 2,
c.xmargin + c.npp_offset + c.wg_width / 2,
-c.xmargin - c.ppp_offset - c.core_width / 2,
c.xmargin + c.npp_offset + c.core_width / 2,
0,
c.t_clad + c.t_box + c.wg_thickness,
c.t_clad + c.t_box + c.core_thickness,
],
)
plt.colorbar(label="$log10(|n_{doped} - n_{undoped}|)$")
Expand All @@ -183,10 +183,10 @@
np.log(np.abs(np.real(n_dist[-4].T - n_undoped.T))),
origin="lower",
extent=[
-c.xmargin - c.ppp_offset - c.wg_width / 2,
c.xmargin + c.npp_offset + c.wg_width / 2,
-c.xmargin - c.ppp_offset - c.core_width / 2,
c.xmargin + c.npp_offset + c.core_width / 2,
0,
c.t_clad + c.t_box + c.wg_thickness,
c.t_clad + c.t_box + c.core_thickness,
],
)
plt.colorbar(label="$log10(|n_{doped} - n_{undoped}|)$")
Expand All @@ -199,10 +199,10 @@
np.log(np.abs(np.imag(n_dist[0].T - n_undoped.T))),
origin="lower",
extent=[
-c.xmargin - c.ppp_offset - c.wg_width / 2,
c.xmargin + c.npp_offset + c.wg_width / 2,
-c.xmargin - c.ppp_offset - c.core_width / 2,
c.xmargin + c.npp_offset + c.core_width / 2,
0,
c.t_clad + c.t_box + c.wg_thickness,
c.t_clad + c.t_box + c.core_thickness,
],
)
plt.colorbar(label=r"$log10(|\kappa_{doped} - \kappa_{undoped}|)$")
Expand All @@ -215,10 +215,10 @@
np.log(np.abs(np.imag(n_dist[-4].T))),
origin="lower",
extent=[
-c.xmargin - c.ppp_offset - c.wg_width / 2,
c.xmargin + c.npp_offset + c.wg_width / 2,
-c.xmargin - c.ppp_offset - c.core_width / 2,
c.xmargin + c.npp_offset + c.core_width / 2,
0,
c.t_clad + c.t_box + c.wg_thickness,
c.t_clad + c.t_box + c.core_thickness,
],
)
plt.colorbar(label=r"$log10(|\kappa_{doped} - \kappa_{undoped}|)$")
Expand Down
24 changes: 12 additions & 12 deletions docs/notebooks/materials.py
Expand Up @@ -36,11 +36,11 @@
# %% tags=[]
strip = gt.modes.Waveguide(
wavelength=1.55,
wg_width=0.5,
wg_thickness=0.22,
core_width=0.5,
core_thickness=0.22,
slab_thickness=0.0,
ncore="si",
nclad="sio2",
core_material="si",
clad_material="sio2",
)
strip.plot_index()

Expand All @@ -53,11 +53,11 @@
# %% tags=[]
strip = gt.modes.Waveguide(
wavelength=1.55,
wg_width=0.5,
wg_thickness=0.22,
core_width=0.5,
core_thickness=0.22,
slab_thickness=0.0,
ncore="sin",
nclad="sio2",
core_material="sin",
clad_material="sio2",
)
strip.plot_index()

Expand All @@ -78,11 +78,11 @@ def sin(wav: float) -> float:
# %% tags=[]
strip = gt.modes.Waveguide(
wavelength=1.5,
wg_width=0.5,
wg_thickness=0.22,
core_width=0.5,
core_thickness=0.22,
slab_thickness=0.0,
ncore="sin",
nclad="sio2",
core_material="sin",
clad_material="sio2",
)
strip.plot_index()

Expand Down
10 changes: 5 additions & 5 deletions docs/notebooks/meep/001_meep_sparameters.py
Expand Up @@ -166,20 +166,20 @@
# For faster simulations you can do an effective mode approximation, to compute the mode of the slab and run a 2D simulation to speed your [simulations](https://www.lumerical.com/learn/whitepapers/lumericals-2-5d-fdtd-propagation-method/)

# + id="VlVLdT3EA56h"
ncore = sim.get_effective_indices(
ncore=3.4777,
ncladding=1.444,
core_material = sim.get_effective_indices(
core_material=3.4777,
clad_materialding=1.444,
nsubstrate=1.444,
thickness=0.22,
wavelength=1.55,
polarization="te",
)[0]

ncore
core_material

# + id="otBqKwoXA56h"
sp = gm.write_sparameters_meep(
c, resolution=20, is_3d=False, material_name_to_meep=dict(si=ncore)
c, resolution=20, is_3d=False, material_name_to_meep=dict(si=core_material)
)

# + id="kZGNjAX6A56h"
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/meep/002_gratings.py
Expand Up @@ -31,10 +31,10 @@
# | air_gap_thickness
# _ _ _| _ _ _ _ _ _ _
# |
# nclad | top_clad_thickness
# clad_material | top_clad_thickness
# _ _ _| _ _ _ _ _ _ _
# _|-|_|-|_|-|___ | _| etch_depth
# ncore | |core_thickness
# core_material | |core_thickness
# ______________|_ _ _|_ _ _ _ _ _ _ _
# |
# nbox |box_thickness
Expand Down

0 comments on commit f23b165

Please sign in to comment.