Layout#

All UBC ubcpdk.cells are conveniently combined into the ubcpdk.components module.

import gdsfactory as gf

from ubcpdk import PDK, cells

PDK.activate()

Fixed Component cells#

Most ubcpdk components are imported from GDS files as fixed cells.

c = cells.ebeam_crossing4()
c.plot()
../_images/e0129b49d96fd2a69ce3d4ead81d1af87963edcda59fa3a83059ce420002c25c.png
c = cells.ebeam_swg_edgecoupler()
c.plot()
../_images/b05ca8f67e87c3eacba3f2faa946ab7de33edca14eaab2c6484c0d40e45d422c.png
c = cells.ebeam_bdc_te1550()
c.plot()
../_images/52817e5adc0c92c57917f621815a8be78b9edc2efad8f9d6da149e686a36ff00.png
c = cells.ebeam_adiabatic_te1550()
c.plot()
../_images/b4e9721533f8ecb16c083ba8a62387401517b91e502dcd9bbcac97f10407496a.png
c = cells.ebeam_y_adiabatic()
c.plot()
../_images/84d617a635ec15d6ca941af435bc6b9e7252ba6f1f082048600b44a6c9058a48.png
c = cells.ebeam_y_1550()
c.plot()
../_images/af27358252cd7c06bab199350d68196de65196fa08177f40fbfc8680c4aa1922.png

Parametric Component PCells#

You can also define cells adapted from gdsfactory generic pdk.

c = cells.straight(length=2)
c.plot()
../_images/f087adb6b99181e90de31b59024cbcc608e916bc6048c2b92bff41d1c8d406b0.png
c = cells.bend_euler(radius=5)
c.plot()
../_images/6c442ec140ac37d49e557c0b4dae783a80c39852863550f4f090d39e5282e336.png
c = cells.spiral()
c.plot()
../_images/3f002bc58a2df6bba1058bf24f36eb66ef3488630a0252a02bee017070a19061.png
c = cells.ring_single_heater()
c.plot()
../_images/37309a07265c76a832cea7a9861a2839d3e1e27f04d7f0fbce3aa9426f57d3ea.png

Components with grating couplers#

To test your devices you can add grating couplers. Both for single fibers and for fiber arrays.

splitter = cells.ebeam_y_1550()
mzi = gf.components.mzi(splitter=splitter)
mzi.plot()
../_images/a50fab43276893a856e132b2105217a7cfba33768249050b14c80bd215f00143.png
component_fiber_array = cells.add_fiber_array(component=mzi, fanout_length=5)
component_fiber_array.plot()
../_images/bd66d20f9e6c0dc8b8e04393244a7d9b0b40b392fb68b5f2237b07165cec143b.png
c = cells.ring_single_heater()
c = cells.add_fiber_array_pads_rf(c)
c.plot()
../_images/ecd0ee4520a94de38c9e6e3f3b262610edfcd2850de3de85fdd1f4639bcf707c.png
c = cells.mzi_heater()
c = cells.add_fiber_array_pads_rf(c)
c.plot()
../_images/214bb52d89b9c92017f6f9d27329a11c44f9fd330ac5289418fd0693844ac16e.png

3D rendering#

scene = c.to_3d()
scene.show()

Die assembly#

from functools import partial

import gdsfactory as gf

from ubcpdk.tech import LAYER

size = (440, 470)
add_gc = cells.add_fiber_array


@gf.cell
def EBeam_JoaquinMatres_1() -> gf.Component:
    """Add DBR cavities."""
    e = [add_gc(cells.straight())]
    e += [add_gc(cells.mzi(delta_length=dl)) for dl in [9.32, 93.19]]
    e += [
        add_gc(cells.ring_single(radius=12, gap=gap, length_x=coupling_length))
        for gap in [0.2]
        for coupling_length in [2.5, 4.5, 6.5]
    ]

    c = gf.Component()
    _ = c << gf.pack(e, max_size=size, spacing=2)[0]
    _ = c << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN)
    return c


c = EBeam_JoaquinMatres_1()
c.show()  # show in klayout
c.plot()  # plot in notebook
../_images/e7e3acb8ff35458db1ffe4b7ae15498d36c547023f698e8d964e874cb7f2d0ad.png
def EBeam_JoaquinMatres_2() -> gf.Component:
    """spirals for extracting straight waveguide loss"""

    e = [
        cells.add_fiber_array(component=cells.spiral(n_loops=8, length=length))
        for length in [0, 100, 200]
    ]

    c = gf.Component()
    _ = c << gf.pack(e, max_size=size, spacing=2)[0]
    _ = c << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN)
    return c


c = EBeam_JoaquinMatres_2()
c.show()  # show in klayout
c.plot()  # plot in notebook
../_images/eb256afec9be3eb5fe6f147869742e00774f973e049833179a26b8c163682d48.png
def EBeam_JoaquinMatres_3() -> gf.Component:
    """Contains mirror cavities and structures inside a resonator."""
    e = []
    e += [add_gc(cells.ebeam_crossing4())]
    e += [add_gc(cells.ebeam_adiabatic_te1550())]
    e += [add_gc(cells.ebeam_bdc_te1550())]
    e += [add_gc(cells.ebeam_y_1550())]
    e += [add_gc(cells.straight(), component_name=f"straight_{i}") for i in range(2)]
    c = gf.Component()
    _ = c << gf.pack(e, max_size=size, spacing=2)[0]
    _ = c << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN)
    return c


c = EBeam_JoaquinMatres_3()
c.show()  # show in klayout
c.plot()  # plot in notebook
2026-03-09 17:56:10.025 | ERROR    | kfactory.kcell:name:688 - Name conflict in kfactory.kcell::name at line 688
Renaming Unnamed_349 (cell_index=349) to straight_L10_CSstrip_WNone_N2_with_gc would cause it to be named the same as:
 - straight_L10_CSstrip_WNone_N2_with_gc (cell_index=130), function_name=None, basename=None
2026-03-09 17:56:10.054 | ERROR    | kfactory.kcell:name:688 - Name conflict in kfactory.kcell::name at line 688
Renaming Unnamed_351 (cell_index=351) to straight_L10_CSstrip_WNone_N2_with_gc would cause it to be named the same as:
 - straight_L10_CSstrip_WNone_N2_with_gc (cell_index=349), function_name=None, basename=None
 - straight_L10_CSstrip_WNone_N2_with_gc (cell_index=130), function_name=None, basename=None
../_images/be075f1ca38c8b1aab3b5df2407b027bb0069d2c635f3239d846f02d438a6fea.png
def EBeam_JoaquinMatres_4() -> gf.Component:
    """MZI interferometers."""
    mzi = partial(gf.components.mzi, splitter=cells.ebeam_y_1550)
    mzis = [mzi(delta_length=delta_length) for delta_length in [10, 40]]
    mzis_gc = [cells.add_fiber_array(mzi, fanout_length=5) for mzi in mzis]

    mzis = [cells.mzi_heater(delta_length=delta_length) for delta_length in [40]]
    mzis_heater_gc = [
        cells.add_fiber_array_pads_rf(mzi, orientation=90) for mzi in mzis
    ]

    e = mzis_gc + mzis_heater_gc
    c = gf.Component()
    _ = c << gf.pack(e, max_size=size, spacing=2)[0]
    _ = c << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN)
    return c


c = EBeam_JoaquinMatres_4()
c.show()  # show in klayout
c.plot()  # plot in notebook
../_images/4154839e7338b3806fa6792bbe3de7b671467ad541e801b10d2e412ca8edd857.png
def EBeam_JoaquinMatres_5() -> gf.Component:
    """Ring resonators."""

    rings = []
    for length_x in [4, 6]:
        ring = cells.ring_single_heater(length_x=length_x)
        ring_gc = cells.add_fiber_array_pads_rf(ring, pad_yspacing=10)
        rings.append(ring_gc)

    c = gf.Component()
    _ = c << gf.pack(rings, max_size=size, spacing=2)[0]
    _ = c << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN)
    return c


c = EBeam_JoaquinMatres_5()
c.show()  # show in klayout
c.plot()  # plot in notebook
../_images/e808ac1afc3236d78c17d18f25164ea491e61ab625ba2ea4bf1df2e677d75f0b.png