Skip to content

Commit

Permalink
update taper cells and models
Browse files Browse the repository at this point in the history
  • Loading branch information
flaport committed Mar 7, 2024
1 parent 825e1d3 commit cb4d965
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
37 changes: 25 additions & 12 deletions cspdk/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,46 @@ def bend_euler(info=None, **kwargs):
################

taper = gf.components.taper
taper_cross_section = gf.c.taper_cross_section


@gf.cell
def taper_cross_section(
cross_section1=xs_rc_tip,
cross_section2=xs_rc,
length: float = 10,
npoints: int = 2,
linear: bool = True,
**kwargs,
) -> gf.Component:
return gf.components.taper_cross_section(
cross_section1=cross_section1,
cross_section2=cross_section2,
length=length,
npoints=npoints,
linear=linear,
**kwargs,
).flatten()


trans_sc_rc10 = partial(
taper_cross_section,
cross_section1=xs_rc_tip,
cross_section2=xs_rc,
length=10,
linear=True,
npoints=2,
info={"model": "trans_sc_rc10"},
)
trans_sc_rc20 = partial(
taper_cross_section,
cross_section1=xs_rc_tip,
cross_section2=xs_rc,
length=20,
linear=True,
npoints=2,
info={"model": "trans_sc_rc20"},
)
trans_sc_rc50 = partial(
taper_cross_section,
cross_section1=xs_rc_tip,
cross_section2=xs_rc,
length=50,
linear=True,
npoints=2,
info={"model": "trans_sc_rc50"},
)

Expand Down Expand Up @@ -312,7 +325,7 @@ def gc_rectangular(
# MZI
################

mzi = gf.c.mzi
mzi = gf.components.mzi

mzi_sc = partial(
mzi,
Expand Down Expand Up @@ -344,14 +357,14 @@ def gc_rectangular(
)

mzi_nc = partial(
gf.c.mzi,
gf.components.mzi,
straight=straight_nc,
cross_section=xs_nc,
combiner=mmi1x2_nc,
splitter=mmi1x2_nc,
)
mzi_no = partial(
gf.c.mzi,
gf.components.mzi,
straight=straight_no,
cross_section=xs_no,
combiner=mmi1x2_no,
Expand Down Expand Up @@ -393,14 +406,14 @@ def die_nc(
"""
c = gf.Component()

fp = c << gf.c.rectangle(size=size, layer=LAYER.FLOORPLAN, centered=True)
fp = c << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN, centered=True)

# Add optical ports
x0 = -4925 + 2.827
y0 = 1650
grating_coupler = grating_coupler()

grating_coupler_array = gf.c.grating_coupler_array(
grating_coupler_array = gf.components.grating_coupler_array(
grating_coupler=grating_coupler,
n=ngratings,
pitch=grating_pitch,
Expand Down
9 changes: 5 additions & 4 deletions cspdk/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ def _crossing(wl=1.5):
_2port=_2port("o1", "o2"),
_3port=_3port("o1", "o2", "o3"),
_4port=_4port("o1", "o2", "o3", "o4"),
taper=_straight,
straight=_straight,
straight_sc=straight_sc,
straight_so=straight_so,
Expand All @@ -249,9 +248,11 @@ def _crossing(wl=1.5):
bend_ro=bend_ro,
bend_nc=bend_nc,
bend_no=bend_no,
trans_sc_rc10=trans_sc_rc10,
trans_sc_rc20=trans_sc_rc20,
trans_sc_rc50=trans_sc_rc50,
taper=_straight,
taper_cross_section=_straight,
trans_sc_rc10=_straight,
trans_sc_rc20=_straight,
trans_sc_rc50=_straight,
mmi1x2=mmi1x2,
mmi1x2_rc=mmi1x2_rc,
mmi1x2_sc=mmi1x2_sc,
Expand Down

0 comments on commit cb4d965

Please sign in to comment.