Skip to content

Commit

Permalink
update meow defaul cell_length
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab committed Dec 22, 2022
1 parent e9dbf0d commit 5d6f97d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 11 deletions.
50 changes: 43 additions & 7 deletions docs/notebooks/plugins/eme/01_meow.ipynb
Expand Up @@ -225,6 +225,49 @@
"c"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Lets do a convergence tests on the `cell_length` parameter. This depends a lot on the structure."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```python\n",
"\n",
"import matplotlib.pyplot as plt\n",
"\n",
"trans = []\n",
"cells_lengths = [0.1, 0.25, 0.5, 0.75, 1]\n",
"\n",
"for cell_length in cells_lengths:\n",
" m = MEOW(component=c, \n",
" layerstack=filtered_layerstack, \n",
" wavelength=1.55,\n",
" resolution_x=100,\n",
" resolution_y=100,\n",
" spacing_x=1,\n",
" spacing_y=-3,\n",
" num_modes=4,\n",
" cell_length=cell_length,\n",
" )\n",
" sp = m.compute_sparameters()\n",
" te0_trans = np.abs(sp[\"o1@0,o2@0\"])**2\n",
" trans.append(te0_trans)\n",
" \n",
"plt.plot(cells_lengths, trans, '.-')\n",
"plt.title(\"10um taper, resx = resy = 100, num_modes = 4\")\n",
"plt.xlabel(\"Cell length (um)\")\n",
"plt.ylabel(\"TE0 transmission\")\n",
"\n",
"```\n",
"\n",
"![](https://user-images.githubusercontent.com/46427609/209006396-86afc058-a992-49a4-93be-54d98ab822f4.png)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -366,13 +409,6 @@
"source": [
"T"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions gdsfactory/simulation/eme/meow_eme.py
Expand Up @@ -26,9 +26,9 @@ def __init__(
component: gf.Component,
layerstack,
wavelength: float = 1.55,
temperature: float = 25,
temperature: float = 25.0,
num_modes: int = 4,
cell_length: float = 1.0,
cell_length: float = 0.5,
spacing_x: float = 2.0,
center_x: float = 0,
resolution_x: int = 100,
Expand Down
4 changes: 2 additions & 2 deletions gdsfactory/simulation/eme/test_meow_simulation.py
Expand Up @@ -51,11 +51,11 @@ def test_cells():
)

c = gf.components.taper(length=10, width2=2)
m = MEOW(component=c, layerstack=layerstack, wavelength=1.55)
m = MEOW(component=c, layerstack=layerstack, wavelength=1.55, cell_length=1)
assert len(m.cells) == 10

c = gf.components.taper(length=1, width2=2)
m = MEOW(component=c, layerstack=layerstack, wavelength=1.55)
m = MEOW(component=c, layerstack=layerstack, wavelength=1.55, cell_length=1)
assert len(m.cells) == 1


Expand Down

0 comments on commit 5d6f97d

Please sign in to comment.