Layout#

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

import gdsfactory as gf

import ubcpdk
import ubcpdk.components as uc

Fixed Component cells#

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

c = uc.ebeam_crossing4()
c.plot()
2024-04-12 23:30:18.982 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ebeam_crossing4.lyp'.
../_images/b2b657be6c5aa2cb169c72af387a9a6f43754ee096b63c886a3e1a93ad321a45.png
c = uc.ebeam_swg_edgecoupler()
c.plot()
2024-04-12 23:30:19.141 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ebeam_swg_edgecoupler.lyp'.
../_images/d0f8f8f4b1ea8bafcbeff29229e345a1865d85322937cdb0201d3a27e792dab1.png
c = uc.ebeam_bdc_te1550()
c.plot()
2024-04-12 23:30:19.327 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ebeam_bdc_te1550.lyp'.
../_images/ddd4985aebc1005ec5374faa292515b42d5698647a23d32eb04b8cf2ea8404da.png
c = uc.ebeam_adiabatic_te1550()
c.plot()
2024-04-12 23:30:19.508 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ebeam_adiabatic_te1550.lyp'.
../_images/a07426511c7117524bbb3825b2b567b8508cf29ec0de7b49074c91f5a33c84fc.png
c = uc.ebeam_y_adiabatic()
c.plot()
2024-04-12 23:30:19.686 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ebeam_y_adiabatic.lyp'.
../_images/72e63c4c4d387ad9e0cd5b0fa3c023a3b30befb92a97a5a55ea572d25503ccba.png
c = uc.ebeam_y_1550()
c.plot()
2024-04-12 23:30:19.860 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ebeam_y_1550.lyp'.
../_images/3b1126ad2f137e3a473add518793c9fc397bf70969f0c135c5d6a708ee01f131.png

Parametric Component PCells#

You can also define cells adapted from gdsfactory generic pdk.

c = uc.straight(length=2)
c.plot()
2024-04-12 23:30:20.037 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/straight_length2_ubcpdkpcomponents.lyp'.
../_images/aff9e9210764cd6bfb828a7c7f18f35a22588137cf1ce644f2a5166e4fc3dc29.png
c = uc.bend(radius=5)
c.plot()
2024-04-12 23:30:20.210 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/bend_euler_sc_radius5.lyp'.
../_images/0947a3f53addcbb3208082d194b230ab2bb02badf349893186216661f97ae99f.png
c = uc.ring_with_crossing()
c.plot()
2024-04-12 23:30:20.392 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ring_single_dut_26538df6.lyp'.
../_images/bfa7f22ac6d16aa94f8228a160cf4e57b45161b47c393bbf2e50cba42fbed36e.png
c = uc.dbr()
c.plot()
2024-04-12 23:30:20.534 | WARNING  | gdsfactory.component:_write_library:1934 - UserWarning: Component dbr has invalid transformations. Try component.flatten_offgrid_references() first.
2024-04-12 23:30:20.547 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/dbr.lyp'.
../_images/3b6c6ef16424fc33b4c6c40ce7d6bfa7b26380f2824e85a2457ce009c3b1ba4b.png
c = uc.spiral()
c.plot()
2024-04-12 23:30:20.821 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/spiral_external_io.lyp'.
../_images/ef90b94997eddbb3eb72a161767383b6971a15fdfa0eadbe89813a301153efb6.png
c = uc.mzi_heater()
c.plot()
2024-04-12 23:30:21.048 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/mzi_a1fe9d55.lyp'.
../_images/1ed3b0430d7141e03e2ef488f7eedd13c28097fccb5b622b55a5bc9d931282bf.png
c = uc.ring_single_heater()
c.plot()
2024-04-12 23:30:21.253 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/ring_single_heater_cc91df46.lyp'.
../_images/82e7b74b180385ac528a7cef652fe707a7a5a18831f404809d996a95a4430c7b.png

Components with grating couplers#

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

splitter = uc.ebeam_y_1550()
mzi = gf.components.mzi(splitter=splitter)
mzi.plot()
2024-04-12 23:30:21.453 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/mzi_splitterebeam_y_1550.lyp'.
../_images/d58fc2e6e9011c8d544160941c3f0539c84dba160048f7f33023c5f33f1f60ea.png
component_fiber_array = uc.add_fiber_array(component=mzi)
component_fiber_array.plot()
2024-04-12 23:30:21.653 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/add_fiber_array_add_fiber_array_3de02987.lyp'.
../_images/53aa488ddf386b48fdfaad302cfc7a62fe0c8ccacac93aabac52436672b288c9.png
c = uc.ring_single_heater()
c = uc.add_fiber_array_pads_rf(c)
c.plot()
2024-04-12 23:30:21.864 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/add_fiber_array_add_fiber_array_35c727a6.lyp'.
../_images/588ee6bd2834322c97b568a63edceb6f3c981a2311602ff7b0838ca6f9c52032.png
c = uc.mzi_heater()
c = uc.add_fiber_array_pads_rf(c, optical_routing_type=2)
c.plot()
2024-04-12 23:30:22.086 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/add_fiber_array_add_fiber_array_3c63ffb9.lyp'.
../_images/1c78c0625cfcdc42914d16bb85151d23c39094a6ffae6f41bad4e7cde7d003ec.png

3D rendering#

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

Die assembly#

from functools import partial
from pathlib import Path

import gdsfactory as gf

import ubcpdk
import ubcpdk.components as uc
from ubcpdk import tech
from ubcpdk.tech import LAYER


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


@gf.cell
def EBeam_JoaquinMatres_1() -> gf.Component:
    """Add DBR cavities."""
    e = [add_gc(uc.straight())]
    e += [add_gc(uc.mzi(delta_length=dl)) for dl in [9.32, 93.19]]
    e += [
        add_gc(uc.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]
    ]

    e += [
        uc.dbr_cavity_te(w0=w0, dw=dw)
        for w0 in [0.5]
        for dw in [50e-3, 100e-3, 150e-3, 200e-3]
    ]
    e += [add_gc(uc.ring_with_crossing())]
    e += [add_gc(uc.ring_with_crossing(port_name="o2", with_component=False))]

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


gf.clear_cache()
c = EBeam_JoaquinMatres_1()
c.show()  # show in klayout
c.plot()  # plot in notebook
2024-04-12 23:30:23.156 | WARNING  | gdsfactory.klive:show:49 - UserWarning: Could not connect to klive server. Is klayout open and klive plugin installed?
2024-04-12 23:30:23.165 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/EBeam_JoaquinMatres_1.lyp'.
../_images/cae177efc8e0be3ddf2ad3655f5009828199e46e024da88b24ecb5ddf963f80d.png
@gf.cell
def EBeam_JoaquinMatres_2() -> gf.Component:
    """spirals for extracting straight waveguide loss"""
    N = 12
    radius = 10

    e = [
        uc.add_fiber_array(
            component=uc.spiral(
                N=N,
                radius=radius,
                y_straight_inner_top=0,
                x_inner_length_cutback=0,
            )
        )
    ]

    e.append(
        uc.add_fiber_array(
            component=uc.spiral(
                N=N,
                radius=radius,
                y_straight_inner_top=0,
                x_inner_length_cutback=185,
            )
        )
    )

    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
2024-04-12 23:30:23.646 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/EBeam_JoaquinMatres_2.lyp'.
../_images/64c23ee60cda68e45f2d1ba9dd69f5592841a0c4f5e415f54b68b6e2971fd74f.png
@gf.cell
def EBeam_JoaquinMatres_3() -> gf.Component:
    """contains mirror cavities and structures inside a resonator"""
    e = []
    e += [add_gc(uc.ebeam_crossing4())]
    e += [add_gc(uc.ebeam_adiabatic_te1550(), optical_routing_type=1)]
    e += [add_gc(uc.ebeam_bdc_te1550())]
    e += [add_gc(uc.ebeam_y_1550(), optical_routing_type=1)]
    e += [add_gc(uc.ebeam_y_adiabatic_tapers(), optical_routing_type=1)]
    e += [add_gc(uc.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


gf.clear_cache()
c = EBeam_JoaquinMatres_3()
c.show()  # show in klayout
c.plot()  # plot in notebook
2024-04-12 23:30:24.041 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/EBeam_JoaquinMatres_3.lyp'.
../_images/8c65090f16747470bc070833a3d218e6b3785960f10a30ce6f7b4f3f923c9ba8.png
@gf.cell
def EBeam_JoaquinMatres_4() -> gf.Component:
    """MZI interferometers."""
    mzi = partial(gf.components.mzi, splitter=uc.ebeam_y_1550)
    mzis = [mzi(delta_length=delta_length) for delta_length in [10, 40, 100]]
    mzis_gc = [uc.add_fiber_array(mzi) for mzi in mzis]

    mzis = [uc.mzi_heater(delta_length=delta_length) for delta_length in [40]]
    mzis_heater_gc = [
        uc.add_fiber_array_pads_rf(mzi, orientation=90, optical_routing_type=2)
        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


gf.clear_cache()
c = EBeam_JoaquinMatres_4()
c.show()  # show in klayout
c.plot()  # plot in notebook
2024-04-12 23:30:24.375 | WARNING  | gdsfactory.pack:pack:249 - UserWarning: unable to pack in one component, creating 2 components
2024-04-12 23:30:24.387 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/EBeam_JoaquinMatres_4.lyp'.
../_images/c7655899adc1a071f164916996f15b9de6b93cd208d7910885b468d410315d4c.png
@gf.cell
def EBeam_JoaquinMatres_5() -> gf.Component:
    """Ring resonators."""
    rings = [uc.ring_single_heater(length_x=length_x) for length_x in [4, 6]]
    rings = [gf.functions.rotate180(ring) for ring in rings]
    rings_gc = [uc.add_fiber_array_pads_rf(ring) for ring in rings]

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


gf.clear_cache()
c = EBeam_JoaquinMatres_5()
c.show()  # show in klayout
c.plot()  # plot in notebook
2024-04-12 23:30:24.639 | INFO     | gdsfactory.technology.layer_views:to_lyp:1018 - LayerViews written to '/tmp/gdsfactory/EBeam_JoaquinMatres_5.lyp'.
../_images/99c8dc4ca38fa141c2d89962deef0112acdc03e7ff93e7dded021a1a7c0b2689.png