def grating_coupler_uniform_optimized( widths=(0.5, 0.2, 0.3), width_grating=11, length_taper=150, width=0.5, partial_etch=False, layer=pp.LAYER.WG, layer_partial_etch=pp.LAYER.SLAB150, taper=None, polarization="te", wavelength=1500, ): """ Grating coupler uniform (not focusing) Args: widths: of each teeth width_grating: 11 length_taper: 150 width: 0.5 partial_etch: False .. plot:: :include-source: import pp c = pp.c.grating_coupler_uniform_optimized() pp.plotgds(c) """ # returns a fiber grating c = Component() x = 0 if partial_etch: partetch_overhang = 5 # make the etched areas (opposite to teeth) for i, wt in enumerate(widths): if i % 2 == 1: _compass = pp.c.compass( size=[wt, width_grating + partetch_overhang * 2], layer=layer_partial_etch, ) cgrating = c.add_ref(_compass) cgrating.x += x + wt / 2 x += wt # draw the deep etched square around the grating xgrating = np.sum(widths) deepbox = c.add_ref(pp.c.compass(size=[xgrating, width_grating], layer=layer)) deepbox.movex(xgrating / 2) else: for i, wt in enumerate(widths): if i % 2 == 0: cgrating = c.add_ref( pp.c.compass(size=[wt, width_grating], layer=layer) ) cgrating.x += x + wt / 2 x += wt # make the taper if taper is None: taper = pp.c.taper( length=length_taper, width1=width, width2=width_grating, port=None, layer=layer, ) taper_ref = c.add_ref(taper) taper_ref.xmax = 0 port = taper_ref.ports.get("W0") or taper_ref.ports.get("1") c.polarization = polarization c.wavelength = wavelength c.add_port(port=taper_ref.ports[port.name], name="W0") pp.assert_grating_coupler_properties(c) return c
def grating_coupler_uniform( num_teeth: int = 20, period: float = 0.75, fill_factor: float = 0.5, width_grating: float = 11.0, length_taper: float = 150.0, width: float = 0.5, partial_etch: bool = False, layer: Tuple[int, int] = pp.LAYER.WG, layer_partial_etch: Tuple[int, int] = pp.LAYER.SLAB150, polarization="te", wavelength=1500, ) -> Component: """Grating coupler uniform Args: num_teeth: 20 period: 0.75 fill_factor: 0.5 width_grating: 11 length_taper: 150 width: 0.5 partial_etch: False .. plot:: :include-source: import pp c = pp.c.grating_coupler_uniform() pp.plotgds(c) """ # returns a fiber grating G = Component() if partial_etch: partetch_overhang = 5 _compass = compass( size=[period * (1 - fill_factor), width_grating + partetch_overhang * 2], layer=layer_partial_etch, ) # make the etched areas (opposite to teeth) for i in range(num_teeth): cgrating = G.add_ref(_compass) cgrating.x += i * period # draw the deep etched square around the grating deepbox = G.add_ref( compass(size=[num_teeth * period, width_grating], layer=layer) ) deepbox.movex(num_teeth * period / 2) else: for i in range(num_teeth): cgrating = G.add_ref( compass(size=[period * fill_factor, width_grating], layer=layer) ) cgrating.x += i * period # make the taper tgrating = G.add_ref( taper( length=length_taper, width1=width_grating, width2=width, port=None, layer=layer, ) ) tgrating.xmin = cgrating.xmax G.add_port(port=tgrating.ports["2"], name="W0") G.polarization = polarization G.wavelength = wavelength G.rotate(180) return G