{ "cells": [ { "cell_type": "markdown", "id": "a65a6737", "metadata": {}, "source": [ "# Distributed Bragg reflector and cavity" ] }, { "cell_type": "markdown", "id": "47e433db", "metadata": {}, "source": [ "A [distributed Bragg reflector](https://en.wikipedia.org/wiki/Distributed_Bragg_reflector) (DBR) is a multilayer structure consisting of alternating layers of high refractive index and low refractive index. When the thickness of each layer is close to a quarter of the medium wavelength, nearly perfect reflection occurs due to constructive interference of the reflected waves at each layer. DBR is commonly used at optical and UV wavelengths due to the fact that metallic reflectors have a high loss at high frequencies. Besides free space optics, similar concepts have also been applied to integrated photonics and fiber optics. Furthermore, high-Q cavities based on DBR structures are widely popular in lasers, filters, and sensors.\n", "\n", "Although Tidy3D uses highly optimized algorithms and hardware designed to perform large 3D simulations at ease, the computational efficiency can be improved exponentially if we can reduce the dimension of the model. The DBR structure has translational symmetry along the two in-plane directions. Thus, simulating a DBR is effectively a 1D problem. \n", "\n", "" ] }, { "cell_type": "code", "execution_count": 1, "id": "67c41dde", "metadata": { "execution": { "iopub.execute_input": "2023-02-03T04:23:26.181445Z", "iopub.status.busy": "2023-02-03T04:23:26.181145Z", "iopub.status.idle": "2023-02-03T04:23:27.222307Z", "shell.execute_reply": "2023-02-03T04:23:27.221901Z" } }, "outputs": [ { "data": { "text/html": [ "
[22:23:27] WARNING This version of Tidy3D was pip installed from the 'tidy3d-beta' repository on __init__.py:103\n", " PyPI. Future releases will be uploaded to the 'tidy3d' repository. From now on, \n", " please use 'pip install tidy3d' instead. \n", "\n" ], "text/plain": [ "\u001b[2;36m[22:23:27]\u001b[0m\u001b[2;36m \u001b[0m\u001b[31mWARNING \u001b[0m This version of Tidy3D was pip installed from the \u001b[32m'tidy3d-beta'\u001b[0m repository on \u001b]8;id=26776;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/__init__.py\u001b\\\u001b[2m__init__.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=758446;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/__init__.py#103\u001b\\\u001b[2m103\u001b[0m\u001b]8;;\u001b\\\n", "\u001b[2;36m \u001b[0m PyPI. Future releases will be uploaded to the \u001b[32m'tidy3d'\u001b[0m repository. From now on, \u001b[2m \u001b[0m\n", "\u001b[2;36m \u001b[0m please use \u001b[32m'pip install tidy3d'\u001b[0m instead. \u001b[2m \u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
INFO Using client version: 1.9.0rc1 __init__.py:121\n", "\n" ], "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m Using client version: \u001b[1;36m1.9\u001b[0m.0rc1 \u001b]8;id=942352;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/__init__.py\u001b\\\u001b[2m__init__.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=519148;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/__init__.py#121\u001b\\\u001b[2m121\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import tidy3d as td\n", "import tidy3d.web as web\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n" ] }, { "cell_type": "markdown", "id": "a0c8e122", "metadata": {}, "source": [ "## Simulating the Stopband of a DBR" ] }, { "cell_type": "markdown", "id": "f150734b", "metadata": {}, "source": [ "### Simulation Setup " ] }, { "cell_type": "markdown", "id": "86d2bbb5", "metadata": {}, "source": [ "The most common DBR is made of alternating layers of titanium dioxide ($TiO_2$) and silica ($SiO_2$). The target stopband of the DBR is around 630 nm. " ] }, { "cell_type": "code", "execution_count": 2, "id": "3c528785", "metadata": { "execution": { "iopub.execute_input": "2023-02-03T04:23:27.225045Z", "iopub.status.busy": "2023-02-03T04:23:27.224563Z", "iopub.status.idle": "2023-02-03T04:23:27.227290Z", "shell.execute_reply": "2023-02-03T04:23:27.226918Z" } }, "outputs": [], "source": [ "lda0 = 0.63 # central wavelength\n", "freq0 = td.C_0 / lda0 # central frequency\n", "freqs = freq0 * np.linspace(0.5, 1.5, 1001) # frequency range of interest\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "a80a24bf", "metadata": { "execution": { "iopub.execute_input": "2023-02-03T04:23:27.229320Z", "iopub.status.busy": "2023-02-03T04:23:27.229161Z", "iopub.status.idle": "2023-02-03T04:23:27.231333Z", "shell.execute_reply": "2023-02-03T04:23:27.230980Z" } }, "outputs": [], "source": [ "n_tio2 = 2.5 # refractive index of TiO2\n", "n_sio2 = 1.5 # refractive index of SiO2\n", "n_s = 1.5 # refractive index of the substrate material. It's set to SiO2 in this case\n", "inf_eff = 10 # effective infinity in this model\n" ] }, { "cell_type": "markdown", "id": "8c710663", "metadata": {}, "source": [ "The bandwidth of the stopband is given by \n", "\n", "$$\n", "\\frac{\\Delta f}{f_0} = \\frac{4}{\\pi} arcsin(\\frac{n_1-n_2}{n_1+n_2}),\n", "$$\n", "\n", "where $f_0$ is the central frequency, $n_1$ is the refractive index of the high index material, and $n_2$ is the refractive index of the low index material. We use the above equation to estimate the bandwidth of the DBR." ] }, { "cell_type": "code", "execution_count": 4, "id": "2a4913bb", "metadata": { "execution": { "iopub.execute_input": "2023-02-03T04:23:27.233251Z", "iopub.status.busy": "2023-02-03T04:23:27.233103Z", "iopub.status.idle": "2023-02-03T04:23:27.235568Z", "shell.execute_reply": "2023-02-03T04:23:27.235219Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The normalized bandwidth of the reflection band is 0.32\n" ] } ], "source": [ "df = 4 * np.arcsin((n_tio2 - n_sio2) / (n_tio2 + n_sio2)) / np.pi\n", "print(f\"The normalized bandwidth of the reflection band is {df:1.2f}\")\n" ] }, { "cell_type": "markdown", "id": "7be52b05", "metadata": {}, "source": [ "Next, we construct a function that builds the DBR layers given four parameters: the refractive indices of the materials, the number of layer pairs, and the starting position of the lowest layer. This function will be handy for constructing the DBR as well as the cavity device in the next section. " ] }, { "cell_type": "code", "execution_count": 5, "id": "8c34ee9c", "metadata": { "execution": { "iopub.execute_input": "2023-02-03T04:23:27.237635Z", "iopub.status.busy": "2023-02-03T04:23:27.237469Z", "iopub.status.idle": "2023-02-03T04:23:27.241925Z", "shell.execute_reply": "2023-02-03T04:23:27.241563Z" } }, "outputs": [], "source": [ "def build_layers(n_1, n_2, N, z_0):\n", " # n_1 and n_2 are the refractive indices of the two materials\n", " # N is the number of repeated pairs of low/high refractive index material\n", " # z_0 is the z coordinate of the lowest layer\n", "\n", " material_1 = td.Medium(permittivity=n_1**2) # define the first material\n", " material_2 = td.Medium(permittivity=n_2**2) # define the second material\n", " t_1 = lda0 / (4 * n_1) # thickness of the first material\n", " t_2 = lda0 / (4 * n_2) # thicness of the second material\n", " layers = [] # holder for all the layers\n", "\n", " # building layers alternatively\n", " for i in range(2 * N):\n", " if i % 2 == 0:\n", " layers.append(\n", " td.Structure(\n", " geometry=td.Box.from_bounds(\n", " rmin=(-inf_eff, -inf_eff, z_0),\n", " rmax=(inf_eff, inf_eff, z_0 + t_1),\n", " ),\n", " medium=material_1,\n", " )\n", " )\n", " z_0 = z_0 + t_1\n", " else:\n", " layers.append(\n", " td.Structure(\n", " geometry=td.Box.from_bounds(\n", " rmin=(-inf_eff, -inf_eff, z_0),\n", " rmax=(inf_eff, inf_eff, z_0 + t_2),\n", " ),\n", " medium=material_2,\n", " )\n", " )\n", " z_0 = z_0 + t_2\n", "\n", " return layers\n" ] }, { "cell_type": "markdown", "id": "00772287", "metadata": {}, "source": [ "We plan to perform a parameter sweep of $N$, the number of layer pairs. In order to do so, we define another function that takes $N$ as an argument and builds the simulation including structures, source, monitor, and so on." ] }, { "cell_type": "code", "execution_count": 6, "id": "426ca532", "metadata": { "execution": { "iopub.execute_input": "2023-02-03T04:23:27.244115Z", "iopub.status.busy": "2023-02-03T04:23:27.243785Z", "iopub.status.idle": "2023-02-03T04:23:27.250172Z", "shell.execute_reply": "2023-02-03T04:23:27.249820Z" } }, "outputs": [], "source": [ "def make_DBR(N):\n", "\n", " # build the DBR layers using the previously defined function\n", " DBR = build_layers(n_tio2, n_sio2, N, 0)\n", "\n", " thickness = N * (\n", " lda0 / (4 * n_tio2) + lda0 / (4 * n_sio2)\n", " ) # total thickness of the DBR layers\n", "\n", " # build the substrate structure\n", " sub = td.Structure(\n", " geometry=td.Box.from_bounds(\n", " rmin=(-inf_eff, -inf_eff, -inf_eff), rmax=(inf_eff, inf_eff, 0)\n", " ),\n", " medium=td.Medium(permittivity=n_s**2),\n", " )\n", "\n", " # the entire DBR structure includes the layers and the substrate\n", " DBR.append(sub)\n", "\n", " # create a plane wave excitation source\n", " fwidth = 0.5 * freq0 # width of the frequency distribution\n", " plane_wave = td.PlaneWave(\n", " source_time=td.GaussianPulse(freq0=freq0, fwidth=fwidth),\n", " size=(td.inf, td.inf, 0),\n", " center=(0, 0, thickness + lda0 / 4),\n", " direction=\"-\",\n", " pol_angle=0,\n", " )\n", "\n", " # create a flux monitor to measure the reflectance\n", " flux_monitor = td.FluxMonitor(\n", " center=(0, 0, thickness + lda0 / 2),\n", " size=(td.inf, td.inf, 0),\n", " freqs=freqs,\n", " name=\"R\",\n", " )\n", "\n", " Lz = thickness + 2 * lda0 # simulation domain size in z direction\n", " run_time = 100 / fwidth # simulation run time\n", "\n", " sim = td.Simulation(\n", " size=(0, 0, Lz), # simulation domain sizes in x and y directions are set to 0\n", " center=(0, 0, thickness / 2),\n", " grid_spec=td.GridSpec.auto(min_steps_per_wvl=60, wavelength=lda0),\n", " structures=DBR,\n", " sources=[plane_wave],\n", " monitors=[flux_monitor],\n", " run_time=run_time,\n", " boundary_spec=td.BoundarySpec(x=td.Boundary.periodic(), y=td.Boundary.periodic(), z=td.Boundary.pml()), # pml is applied in the z direction\n", " shutoff=1e-7,\n", " ) # early shutoff level is decreased to 1e-7 to increase the simulation accuracy\n", " return sim\n" ] }, { "cell_type": "markdown", "id": "318abb79", "metadata": {}, "source": [ "To visualize the relationship between reflectance and the number of repeated pairs, we perform a parameter sweep. N is swept from 2 to 10 in a total of 5 simulations." ] }, { "cell_type": "code", "execution_count": 7, "id": "c42cfd32", "metadata": { "execution": { "iopub.execute_input": "2023-02-03T04:23:27.252237Z", "iopub.status.busy": "2023-02-03T04:23:27.252081Z", "iopub.status.idle": "2023-02-03T04:23:27.266886Z", "shell.execute_reply": "2023-02-03T04:23:27.266497Z" }, "tags": [] }, "outputs": [], "source": [ "Ns = np.array([2, 3, 4, 5, 10]) # collection of N for the parameter sweep\n", "sims = {\n", " f\"N={N:.2f}\": make_DBR(N) for N in Ns\n", "} # construct simulations for each N from Ns\n" ] }, { "cell_type": "markdown", "id": "6568d3d7", "metadata": {}, "source": [ "Submit the batch to the server. " ] }, { "cell_type": "code", "execution_count": 8, "id": "20157b64", "metadata": { "execution": { "iopub.execute_input": "2023-02-03T04:23:27.268905Z", "iopub.status.busy": "2023-02-03T04:23:27.268747Z", "iopub.status.idle": "2023-02-03T04:24:02.719878Z", "shell.execute_reply": "2023-02-03T04:24:02.719459Z" } }, "outputs": [ { "data": { "text/html": [ "
INFO Created task 'N=2.00' with task_id 'd54531b6-6dd1-424e-82b3-ef581e19f834'. webapi.py:120\n", "\n" ], "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m Created task \u001b[32m'\u001b[0m\u001b[32mN\u001b[0m\u001b[32m=\u001b[0m\u001b[32m2\u001b[0m\u001b[32m.00'\u001b[0m with task_id \u001b[32m'd54531b6-6dd1-424e-82b3-ef581e19f834'\u001b[0m. \u001b]8;id=696577;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=181410;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#120\u001b\\\u001b[2m120\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "cf05f16e3ebf472db32a3daf2fda64e3", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:23:29] INFO Created task 'N=3.00' with task_id 'a130a757-4019-4669-a7b6-898b14a4ea19'. webapi.py:120\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:23:29]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m Created task \u001b[32m'\u001b[0m\u001b[32mN\u001b[0m\u001b[32m=\u001b[0m\u001b[32m3\u001b[0m\u001b[32m.00'\u001b[0m with task_id \u001b[32m'a130a757-4019-4669-a7b6-898b14a4ea19'\u001b[0m. \u001b]8;id=470510;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=938273;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#120\u001b\\\u001b[2m120\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "1316877710d842129e91165e2b192924", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:23:31] INFO Created task 'N=4.00' with task_id '60ee0088-a0a4-4b80-9440-8d4620fc0d4b'. webapi.py:120\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:23:31]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m Created task \u001b[32m'\u001b[0m\u001b[32mN\u001b[0m\u001b[32m=\u001b[0m\u001b[32m4\u001b[0m\u001b[32m.00'\u001b[0m with task_id \u001b[32m'60ee0088-a0a4-4b80-9440-8d4620fc0d4b'\u001b[0m. \u001b]8;id=682387;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=10087;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#120\u001b\\\u001b[2m120\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ba02c047b4e34557b075f10d9eb2dc30", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:23:33] INFO Created task 'N=5.00' with task_id '0822dd62-843d-4786-aae9-7aca7a53c6be'. webapi.py:120\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:23:33]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m Created task \u001b[32m'\u001b[0m\u001b[32mN\u001b[0m\u001b[32m=\u001b[0m\u001b[32m5\u001b[0m\u001b[32m.00'\u001b[0m with task_id \u001b[32m'0822dd62-843d-4786-aae9-7aca7a53c6be'\u001b[0m. \u001b]8;id=79873;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=177312;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#120\u001b\\\u001b[2m120\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "09bea9c104c74a449a8d429a1305dfc6", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:23:34] INFO Created task 'N=10.00' with task_id '616df681-e1c3-4b2e-b19d-d72eca7a6b5f'. webapi.py:120\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:23:34]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m Created task \u001b[32m'\u001b[0m\u001b[32mN\u001b[0m\u001b[32m=\u001b[0m\u001b[32m10\u001b[0m\u001b[32m.00'\u001b[0m with task_id \u001b[32m'616df681-e1c3-4b2e-b19d-d72eca7a6b5f'\u001b[0m. \u001b]8;id=927249;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=819498;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#120\u001b\\\u001b[2m120\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a09cdf56c561448e902f3890f8524dae", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:23:38] Started working on Batch. container.py:361\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:23:38]\u001b[0m\u001b[2;36m \u001b[0mStarted working on Batch. \u001b]8;id=491621;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/container.py\u001b\\\u001b[2mcontainer.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=313143;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/container.py#361\u001b\\\u001b[2m361\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ee92be7c663c4f2aaf31119af713b58f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:24:02] Batch complete. container.py:382\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:24:02]\u001b[0m\u001b[2;36m \u001b[0mBatch complete. \u001b]8;id=874554;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/container.py\u001b\\\u001b[2mcontainer.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=724605;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/container.py#382\u001b\\\u001b[2m382\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "batch = web.Batch(simulations=sims)\n", "batch_results = batch.run(path_dir=\"data\")\n" ] }, { "cell_type": "markdown", "id": "a5fb6368", "metadata": {}, "source": [ "### Result Visualization " ] }, { "cell_type": "markdown", "id": "e5624996", "metadata": {}, "source": [ "Once the batch of simulations is complete, we can plot the reflectance spectra.\n", "\n", "Analytically, the reflectance at the central frequency is given by\n", "\n", "$$\n", "R = [\\frac{n_0(n_1)^{2N}-n_s(n_2)^{2N}}{n_0(n_1)^{2N}+n_s(n_2)^{2N}}]^2,\n", "$$\n", "\n", "where $n_0=1$ is the refractive index of the superstrate, $n_s=n_{SiO_2}$ is the refractive index of the substrate. We will use this analytical solution to validate the accuracy of our simulations." ] }, { "cell_type": "code", "execution_count": 9, "id": "75083244", "metadata": { "execution": { "iopub.execute_input": "2023-02-03T04:24:03.085714Z", "iopub.status.busy": "2023-02-03T04:24:03.085605Z", "iopub.status.idle": "2023-02-03T04:24:09.744624Z", "shell.execute_reply": "2023-02-03T04:24:09.744098Z" } }, "outputs": [ { "data": { "text/html": [ "
[22:24:03] INFO downloading file \"output/monitor_data.hdf5\" to webapi.py:593\n", " \"data/d54531b6-6dd1-424e-82b3-ef581e19f834.hdf5\" \n", "\n" ], "text/plain": [ "\u001b[2;36m[22:24:03]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m downloading file \u001b[32m\"output/monitor_data.hdf5\"\u001b[0m to \u001b]8;id=819537;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=791959;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#593\u001b\\\u001b[2m593\u001b[0m\u001b]8;;\u001b\\\n", "\u001b[2;36m \u001b[0m \u001b[32m\"data/d54531b6-6dd1-424e-82b3-ef581e19f834.hdf5\"\u001b[0m \u001b[2m \u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "2b35ef61ec2140af9e2cc21a2f5df401", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:24:04] INFO loading SimulationData from data/d54531b6-6dd1-424e-82b3-ef581e19f834.hdf5 webapi.py:415\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:24:04]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m loading SimulationData from data/\u001b[93md54531b6-6dd1-424e-82b3-ef581e19f834\u001b[0m.hdf5 \u001b]8;id=80197;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=193527;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#415\u001b\\\u001b[2m415\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
INFO downloading file \"output/monitor_data.hdf5\" to webapi.py:593\n", " \"data/a130a757-4019-4669-a7b6-898b14a4ea19.hdf5\" \n", "\n" ], "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m downloading file \u001b[32m\"output/monitor_data.hdf5\"\u001b[0m to \u001b]8;id=231278;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=924331;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#593\u001b\\\u001b[2m593\u001b[0m\u001b]8;;\u001b\\\n", "\u001b[2;36m \u001b[0m \u001b[32m\"data/a130a757-4019-4669-a7b6-898b14a4ea19.hdf5\"\u001b[0m \u001b[2m \u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "bab2a3438b0e4f90a58ba10682b67cf3", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:24:05] INFO loading SimulationData from data/a130a757-4019-4669-a7b6-898b14a4ea19.hdf5 webapi.py:415\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:24:05]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m loading SimulationData from data/\u001b[93ma130a757-4019-4669-a7b6-898b14a4ea19\u001b[0m.hdf5 \u001b]8;id=542056;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=904971;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#415\u001b\\\u001b[2m415\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
INFO downloading file \"output/monitor_data.hdf5\" to webapi.py:593\n", " \"data/60ee0088-a0a4-4b80-9440-8d4620fc0d4b.hdf5\" \n", "\n" ], "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m downloading file \u001b[32m\"output/monitor_data.hdf5\"\u001b[0m to \u001b]8;id=433375;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=462141;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#593\u001b\\\u001b[2m593\u001b[0m\u001b]8;;\u001b\\\n", "\u001b[2;36m \u001b[0m \u001b[32m\"data/60ee0088-a0a4-4b80-9440-8d4620fc0d4b.hdf5\"\u001b[0m \u001b[2m \u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c858d4e4444c4dc9885279a39e1dae92", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:24:06] INFO loading SimulationData from data/60ee0088-a0a4-4b80-9440-8d4620fc0d4b.hdf5 webapi.py:415\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:24:06]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m loading SimulationData from data/\u001b[93m60ee0088-a0a4-4b80-9440-8d4620fc0d4b\u001b[0m.hdf5 \u001b]8;id=80652;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=785394;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#415\u001b\\\u001b[2m415\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:24:07] INFO downloading file \"output/monitor_data.hdf5\" to webapi.py:593\n", " \"data/0822dd62-843d-4786-aae9-7aca7a53c6be.hdf5\" \n", "\n" ], "text/plain": [ "\u001b[2;36m[22:24:07]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m downloading file \u001b[32m\"output/monitor_data.hdf5\"\u001b[0m to \u001b]8;id=416383;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=252371;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#593\u001b\\\u001b[2m593\u001b[0m\u001b]8;;\u001b\\\n", "\u001b[2;36m \u001b[0m \u001b[32m\"data/0822dd62-843d-4786-aae9-7aca7a53c6be.hdf5\"\u001b[0m \u001b[2m \u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "2900e8cdfe4a4247877bff3be55b4112", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:24:08] INFO loading SimulationData from data/0822dd62-843d-4786-aae9-7aca7a53c6be.hdf5 webapi.py:415\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:24:08]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m loading SimulationData from data/\u001b[93m0822dd62-843d-4786-aae9-7aca7a53c6be\u001b[0m.hdf5 \u001b]8;id=456857;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=32137;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#415\u001b\\\u001b[2m415\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
INFO downloading file \"output/monitor_data.hdf5\" to webapi.py:593\n", " \"data/616df681-e1c3-4b2e-b19d-d72eca7a6b5f.hdf5\" \n", "\n" ], "text/plain": [ "\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m downloading file \u001b[32m\"output/monitor_data.hdf5\"\u001b[0m to \u001b]8;id=106499;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=391813;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#593\u001b\\\u001b[2m593\u001b[0m\u001b]8;;\u001b\\\n", "\u001b[2;36m \u001b[0m \u001b[32m\"data/616df681-e1c3-4b2e-b19d-d72eca7a6b5f.hdf5\"\u001b[0m \u001b[2m \u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n" ], "text/plain": [ "\u001b[?25l" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "cb1462ac245c44ab90c156a3d4056e02", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "\n", "\u001b[?25h" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
[22:24:09] INFO loading SimulationData from data/616df681-e1c3-4b2e-b19d-d72eca7a6b5f.hdf5 webapi.py:415\n", "\n" ], "text/plain": [ "\u001b[2;36m[22:24:09]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO \u001b[0m loading SimulationData from data/\u001b[93m616df681-e1c3-4b2e-b19d-d72eca7a6b5f\u001b[0m.hdf5 \u001b]8;id=510403;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py\u001b\\\u001b[2mwebapi.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=86242;file:///Users/twhughes/Documents/Flexcompute/tidy3d-docs/tidy3d/tidy3d/web/webapi.py#415\u001b\\\u001b[2m415\u001b[0m\u001b]8;;\u001b\\\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "