Skip to content

Commit

Permalink
Merge pull request #9 from gdsfactory/add_more_designs
Browse files Browse the repository at this point in the history
add more designs
  • Loading branch information
joamatab authored Oct 29, 2023
2 parents fb23f01 + 89c1f7f commit 75adb6f
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 36 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions ubc2/test_masks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down
69 changes: 34 additions & 35 deletions ubc2/ubc_joaquin_matres1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Sample mask for the edx course Q1 2023."""

from functools import partial
from pathlib import Path

import gdsfactory as gf
Expand All @@ -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."""
Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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)
Expand Down
65 changes: 65 additions & 0 deletions ubc2/ubc_joaquin_matres_heaters.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 75adb6f

Please sign in to comment.