|
| 1 | +#!/usr/bin/env python3 |
| 2 | +# /// script |
| 3 | +# requires-python = ">=3.11,<3.13" |
| 4 | +# dependencies = [ |
| 5 | +# "marimo>=0.18.0", |
| 6 | +# "pyzmq", |
| 7 | +# "simphony==0.7.3", |
| 8 | +# "jax[cpu]", |
| 9 | +# "sax", |
| 10 | +# "matplotlib", |
| 11 | +# ] |
| 12 | +# /// |
| 13 | + |
| 14 | +import marimo |
| 15 | + |
| 16 | +__generated_with = "0.19.6" |
| 17 | +app = marimo.App() |
| 18 | + |
| 19 | + |
| 20 | +@app.cell(hide_code=True) |
| 21 | +def _(): |
| 22 | + import marimo as mo |
| 23 | + from _assignment_template import _ensure_lessons_on_path, load_lesson_template |
| 24 | + |
| 25 | + from textwrap import dedent as _dedent |
| 26 | + |
| 27 | + _ensure_lessons_on_path() |
| 28 | + inject_css, _make_doc_helpers, _make_health_refresh_button, header = load_lesson_template() |
| 29 | + inject_css(mo) |
| 30 | + |
| 31 | + header( |
| 32 | + mo, |
| 33 | + title="HW04 — Ring resonators (Simphony + design)", |
| 34 | + subtitle=( |
| 35 | + "Simulate ring resonators, measure FSR and Q, and design an add-drop ring." |
| 36 | + ), |
| 37 | + badges=["Week 4", "Homework", "Rings", "Simphony"], |
| 38 | + toc=[ |
| 39 | + ("Overview", "overview"), |
| 40 | + ("Part A — Simulate 3 radii + measure FSR", "part-a"), |
| 41 | + ("Part B — Design for target FSR + estimate m", "part-b"), |
| 42 | + ("Part C — Add-drop ring + critical coupling + Q", "part-c"), |
| 43 | + ("Part D — Layout add-drop filter + DRC", "part-d"), |
| 44 | + ("Submission", "submit"), |
| 45 | + ], |
| 46 | + build="2026-01-28", |
| 47 | + ) |
| 48 | + |
| 49 | + mo.callout(mo.md("Problem set (no solutions)."), kind="info") |
| 50 | + |
| 51 | + mo.md( |
| 52 | + _dedent( |
| 53 | + r""" |
| 54 | + <a id="overview"></a> |
| 55 | + ## Overview |
| 56 | +
|
| 57 | + Four tasks: |
| 58 | + 1. Simulate a ring resonator (3 radii) and measure the FSR. |
| 59 | + 2. Design a ring for a target FSR and estimate the mode number near 1550 nm. |
| 60 | + 3. Design an add-drop ring, attempt critical coupling, and estimate Q. |
| 61 | + 4. Lay out an add-drop filter with grating couplers and pass DRC. |
| 62 | + """ |
| 63 | + ).strip() |
| 64 | + ) |
| 65 | + return mo |
| 66 | + |
| 67 | + |
| 68 | +@app.cell(hide_code=True) |
| 69 | +def _(mo): |
| 70 | + from textwrap import dedent as _dedent |
| 71 | + |
| 72 | + mo.md( |
| 73 | + _dedent( |
| 74 | + r""" |
| 75 | + <a id="part-a"></a> |
| 76 | + ## Part A — Simulate 3 radii, measure FSR |
| 77 | +
|
| 78 | + Simulate an ideal all-pass ring resonator in Simphony for three radii. |
| 79 | + From the plots, measure the FSR near 1550 nm and compare to the analytic result from class. |
| 80 | + """ |
| 81 | + ).strip() |
| 82 | + ) |
| 83 | + return |
| 84 | + |
| 85 | + |
| 86 | +@app.cell |
| 87 | +def _(mo): |
| 88 | + from textwrap import dedent as _dedent |
| 89 | + |
| 90 | + mo.md( |
| 91 | + _dedent( |
| 92 | + r""" |
| 93 | + ### Part A deliverables |
| 94 | +
|
| 95 | + - Plot transmission vs wavelength for 3 radii. |
| 96 | + - Report measured FSR for each radius. |
| 97 | + - Report analytic FSR for each radius and percent error. |
| 98 | +
|
| 99 | + Helpful imports: |
| 100 | +
|
| 101 | + ```python |
| 102 | + from jax import config |
| 103 | + config.update("jax_enable_x64", True) |
| 104 | +
|
| 105 | + import jax.numpy as jnp |
| 106 | + import sax |
| 107 | + from simphony.libraries import ideal |
| 108 | + import matplotlib.pyplot as plt |
| 109 | + ``` |
| 110 | + """ |
| 111 | + ).strip() |
| 112 | + ) |
| 113 | + return |
| 114 | + |
| 115 | + |
| 116 | +@app.cell |
| 117 | +def _(mo): |
| 118 | + from textwrap import dedent as _dedent |
| 119 | + |
| 120 | + mo.md( |
| 121 | + _dedent( |
| 122 | + r""" |
| 123 | + Record your results in a table (R, measured FSR, analytic FSR, percent error). |
| 124 | + """ |
| 125 | + ).strip() |
| 126 | + ) |
| 127 | + return |
| 128 | + |
| 129 | + |
| 130 | +@app.cell(hide_code=True) |
| 131 | +def _(mo): |
| 132 | + from textwrap import dedent as _dedent |
| 133 | + |
| 134 | + mo.md( |
| 135 | + _dedent( |
| 136 | + r""" |
| 137 | + <a id="part-b"></a> |
| 138 | + ## Part B — Design for target FSR |
| 139 | +
|
| 140 | + Pick a target FSR near 1550 nm. Choose a ring radius that meets it (first pass), |
| 141 | + then estimate the mode number near 1550 nm (m). |
| 142 | + """ |
| 143 | + ).strip() |
| 144 | + ) |
| 145 | + return |
| 146 | + |
| 147 | + |
| 148 | +@app.cell |
| 149 | +def _(mo): |
| 150 | + from textwrap import dedent as _dedent |
| 151 | + |
| 152 | + mo.md( |
| 153 | + _dedent( |
| 154 | + r""" |
| 155 | + ### Part B deliverables |
| 156 | +
|
| 157 | + - Target FSR and chosen radius. |
| 158 | + - Estimated m near 1550 nm (value + nearest integer). |
| 159 | + """ |
| 160 | + ).strip() |
| 161 | + ) |
| 162 | + return |
| 163 | + |
| 164 | + |
| 165 | +@app.cell(hide_code=True) |
| 166 | +def _(mo): |
| 167 | + from textwrap import dedent as _dedent |
| 168 | + |
| 169 | + mo.md( |
| 170 | + _dedent( |
| 171 | + r""" |
| 172 | + <a id="part-c"></a> |
| 173 | + ## Part C — Add-drop ring + critical coupling + Q |
| 174 | +
|
| 175 | + Design an **add-drop ring resonator** and simulate both **through** and **drop** ports. |
| 176 | +
|
| 177 | + Goals: |
| 178 | + - Adjust coupling to attempt **critical coupling** (largest on-resonance extinction in the through port). |
| 179 | + - Estimate the **loaded Q** from your simulated spectrum (from the linewidth). |
| 180 | + - Compare your measured Q to an analytic estimate from class. |
| 181 | +
|
| 182 | + ### Part C deliverables |
| 183 | +
|
| 184 | + - Through + drop spectra for your add-drop ring (axes labeled). |
| 185 | + - A short note describing how you tuned coupling and whether you achieved near-critical coupling. |
| 186 | + - Q from the plot and your analytic Q estimate (with assumptions stated). |
| 187 | + """ |
| 188 | + ).strip() |
| 189 | + ) |
| 190 | + return |
| 191 | + |
| 192 | + |
| 193 | +@app.cell(hide_code=True) |
| 194 | +def _(mo): |
| 195 | + from textwrap import dedent as _dedent |
| 196 | + |
| 197 | + mo.md( |
| 198 | + _dedent( |
| 199 | + r""" |
| 200 | + <a id="part-d"></a> |
| 201 | + ## Part D — Layout add-drop filter + DRC |
| 202 | +
|
| 203 | + Lay out an **add-drop ring filter** with **grating couplers** (input, through, drop). |
| 204 | + Export a GDS and make sure it passes all DRC checks. |
| 205 | +
|
| 206 | + ### Part D deliverables |
| 207 | +
|
| 208 | + - GDS of your add-drop filter with grating couplers. |
| 209 | + - A DRC report showing 0 items. |
| 210 | + - A screenshot of the layout. |
| 211 | + """ |
| 212 | + ).strip() |
| 213 | + ) |
| 214 | + return |
| 215 | + |
| 216 | + |
| 217 | +@app.cell(hide_code=True) |
| 218 | +def _(mo): |
| 219 | + from textwrap import dedent as _dedent |
| 220 | + |
| 221 | + mo.md( |
| 222 | + _dedent( |
| 223 | + r""" |
| 224 | + <a id="submit"></a> |
| 225 | + ## Submission |
| 226 | +
|
| 227 | + Submit your plots/calculations (Parts A, B, C) and your layout artifacts (Part D). |
| 228 | + """ |
| 229 | + ).strip() |
| 230 | + ) |
| 231 | + return |
| 232 | + |
| 233 | + |
| 234 | +if __name__ == "__main__": |
| 235 | + app.run() |
0 commit comments