diff --git a/Makefile b/Makefile index ffafcdd..ce17f36 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,12 @@ install: pip install -e .[dev] pre-commit install -dev: +dev: gmsh pip install -e .[dev,docs] +gmsh: + sudo apt-get install -y python3-gmsh gmsh libglu1-mesa libxi-dev libxmu-dev libglu1-mesa-dev + test: pytest -s diff --git a/ubc2/test_masks.py b/ubc2/test_masks.py index f528e08..27f27cf 100644 --- a/ubc2/test_masks.py +++ b/ubc2/test_masks.py @@ -5,6 +5,7 @@ import ubc2.ubc_helge as m12 import ubc2.ubc_joaquin_matres1 as m11 +import ubc2.ubc_joaquin_matres_heaters as heaters import ubc2.ubc_simon as m13 import ubc2.ubc_simon_bends as bends import ubc2.ubc_simon_dcs as dcs @@ -49,6 +50,8 @@ def test_masks_2023_v1(): dcs.test_mask_dcs_4, dcs.test_mask_dcs_5, dcs.test_mask_dcs_6, + heaters.test_mzi_heater, + heaters.test_ring_heater, ]: mask() diff --git a/ubc2/ubc_joaquin_matres1.py b/ubc2/ubc_joaquin_matres1.py index f56515a..e738191 100644 --- a/ubc2/ubc_joaquin_matres1.py +++ b/ubc2/ubc_joaquin_matres1.py @@ -1,6 +1,5 @@ """Sample mask for the edx course Q1 2023.""" -from functools import partial from pathlib import Path import gdsfactory as gf @@ -13,12 +12,12 @@ from ubc2.write_mask import ( add_gc, pack, - pack_actives, size, - size_actives, write_mask_gds_with_metadata, ) +length_x = 0.1 + def test_mask1() -> Path: """Add DBR cavities.""" @@ -108,46 +107,46 @@ def test_mask3() -> Path: def test_mask4() -> Path: - """Heated MZI interferometers.""" - mzi = partial(gf.components.mzi, splitter=ubcpdk.components.ebeam_y_1550) - mzis = [mzi(delta_length=delta_length) for delta_length in [10, 40, 100]] - mzis_gc = [pdk.add_fiber_array(mzi) for mzi in mzis] - - mzis = [pdk.mzi_heater(delta_length=delta_length) for delta_length in [40]] - mzis_heater_gc = [ - pdk.add_fiber_array_pads_rf(mzi, orientation=90, optical_routing_type=2) - for mzi in mzis + """Ring resonators Radius 10um.""" + gaps = [50, 100, 150, 200] + radiuses = [10] + + rings = [ + pdk.ring_double( + radius=radius, length_x=length_x, gap=gap * 1e-3, decorator=add_gc + ) + for radius in radiuses + for gap in gaps + ] + gaps = [100, 150] + radiuses = [3] + rings += [ + pdk.ring_double( + radius=radius, length_x=length_x, gap=gap * 1e-3, decorator=add_gc + ) + for radius in radiuses + for gap in gaps ] - c = pack_actives(mzis_gc + mzis_heater_gc) + c = pack(rings) m = c[0] - m.name = "EBeam_heaters_JoaquinMatres_14" - _ = m << gf.components.rectangle(size=size_actives, layer=LAYER.FLOORPLAN) + m.name = "EBeam_JoaquinMatres_14" + _ = m << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN) return write_mask_gds_with_metadata(m) def test_mask5() -> Path: - """Heated Ring resonators.""" - lengths_x = [0.2] - gaps = [0.2] - - rings = [ - pdk.ring_double_heater(radius=12, length_x=length_x, gap=gap) - for length_x in lengths_x - for gap in gaps - ] - rings = [gf.functions.rotate180(ring) for ring in rings] - rings_gc = [pdk.add_fiber_array_pads_rf(ring) for ring in rings] - rings_gc += [ - add_gc(pdk.ring_double(radius=12, gap=gap, length_x=length_x)) - for gap in gaps - for length_x in lengths_x + """Ring resonators.""" + e = [] + e += [ + pdk.dbr_cavity_te(dw=dw * 1e-3, n=350) + for dw in [5, 10, 20, 40, 60, 80, 100, 150, 200] ] - c = pack_actives(rings_gc) + c = pack(e) m = c[0] - m.name = "EBeam_heaters_JoaquinMatres_15" - _ = m << gf.components.rectangle(size=size_actives, layer=LAYER.FLOORPLAN) + m.name = "EBeam_JoaquinMatres_15" + _ = m << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN) return write_mask_gds_with_metadata(m) @@ -212,8 +211,8 @@ def test_mask7() -> Path: # c = test_mask1() # dbr and mzi # c = test_mask2() # spirals # c = test_mask3() # coupler and crossing - c = test_mask4() # heated mzis - # c = test_mask5() # heated rings + # c = test_mask4() # rings + c = test_mask5() # dbr cavity # c = test_mask6() # 1x2 mmis # c = test_mask7() # 2x2mmis gf.show(c) diff --git a/ubc2/ubc_joaquin_matres_heaters.py b/ubc2/ubc_joaquin_matres_heaters.py new file mode 100644 index 0000000..8a0a498 --- /dev/null +++ b/ubc2/ubc_joaquin_matres_heaters.py @@ -0,0 +1,65 @@ +"""Sample mask for the edx course Q1 2023.""" + +from functools import partial +from pathlib import Path + +import gdsfactory as gf +import ubcpdk +import ubcpdk.components as pdk +from ubcpdk.tech import LAYER + +from ubc2.write_mask import ( + add_gc, + pack_actives, + size_actives, + write_mask_gds_with_metadata, +) + + +def test_mzi_heater() -> Path: + """Heated MZI interferometers.""" + mzi = partial(gf.components.mzi, splitter=ubcpdk.components.ebeam_y_1550) + mzis = [mzi(delta_length=delta_length) for delta_length in [10, 40, 100]] + mzis_gc = [pdk.add_fiber_array(mzi) for mzi in mzis] + + mzis = [pdk.mzi_heater(delta_length=delta_length) for delta_length in [40]] + mzis_heater_gc = [ + pdk.add_fiber_array_pads_rf(mzi, orientation=90, optical_routing_type=2) + for mzi in mzis + ] + + c = pack_actives(mzis_gc + mzis_heater_gc) + m = c[0] + m.name = "EBeam_heaters_JoaquinMatres_14" + _ = m << gf.components.rectangle(size=size_actives, layer=LAYER.FLOORPLAN) + return write_mask_gds_with_metadata(m) + + +def test_ring_heater() -> Path: + """Heated Ring resonators.""" + lengths_x = [0.2] + gaps = [0.2] + + rings = [ + pdk.ring_double_heater(radius=12, length_x=length_x, gap=gap) + for length_x in lengths_x + for gap in gaps + ] + rings = [gf.functions.rotate180(ring) for ring in rings] + rings_gc = [pdk.add_fiber_array_pads_rf(ring) for ring in rings] + rings_gc += [ + add_gc(pdk.ring_double(radius=12, gap=gap, length_x=length_x)) + for gap in gaps + for length_x in lengths_x + ] + + c = pack_actives(rings_gc) + m = c[0] + m.name = "EBeam_heaters_JoaquinMatres_15" + _ = m << gf.components.rectangle(size=size_actives, layer=LAYER.FLOORPLAN) + return write_mask_gds_with_metadata(m) + + +if __name__ == "__main__": + c = test_ring_heater() + gf.show(c)