def spiralcircuit(wgw, nl, i_s, s, il, tl, gwgw, gsl, gp, gdc, w_ebeam=4): # wgw [int] -> waveguide width # nl -> Number of loops in the spiral # i_s -> inner size of the spiral coordinate2 # s -> spacing between the individual loops # il -> incoupling length # tl -> taper length # gwgw = 10 # width of the waveguide for the grating # gsl = 78 # grating socket length # gp = 2.3 # grating period length # gdc = [0-1] -> grating duty cycle w_core = wgw + w_ebeam w_clad = wgw + 3 * w_ebeam gwg = gratingwaveguide(gwgw) g = grating(gwg, gsl, gp, gdc) sp = spiral(wgw, nl, i_s, s, il) wgt = WireWaveguideTemplate() wgt.Layout(core_width=w_core, cladding_width=w_clad) t = taper(gwg, wgt, tl) circuit = PlaceAndAutoRoute(child_cells={ "grating1": g, "taper1": t, "spiral": sp, "taper2": t, "grating2": g }) print i_s[0] circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((gsl / 2, 0)), "taper1": i3.Translation((gsl, 0)), "spiral": i3.Translation((gsl + tl, 0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + # i3.Translation(( # gsl + 2 * tl + i_s[0] + (4 * nl + 1) * s + 2 * il, 0)), i3.Translation((gsl + 2 * tl + i_s[0] + 4 * (nl - 1) * s + 300 + 2 * il, 0)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl * 3 / 2 + 2 * tl + i_s[0] + 4 * (nl - 1) * s + 300 + 2 * il, 0)) }) return circuit
def waveguidecircuit(wg_length, w_core, w_clad, taper_length, grating_wg_width, grating_socket_length, grating_period, grating_dc): # wg_length [int] -> waveguide length # wg_width [int] -> waveguide width # taper_length [int] -> taper length # grating_wg_width [int] -> width of the waveguide for the grating # grating_socket_length [int] -> grating socket length # grating_period [int] -> grating period # grating_dc [0-1] -> grating duty cycle wgt = WireWaveguideTemplate() wgt.Layout(core_width=w_core, cladding_width=w_clad) wg = wgt() wg.Layout(shape=[(0, 0), (wg_length, 0)]) gwg = gratingwaveguide(grating_wg_width) g = grating(gwg, grating_socket_length, grating_period, grating_dc) t = taper(gwg, wgt, taper_length) circuit = PlaceAndAutoRoute(child_cells={ "grating1": g, "taper1": t, "wire": wg, "taper2": t, "grating2": g }) circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((grating_socket_length / 2, 0)), "taper1": i3.Translation((grating_socket_length, 0)), "wire": i3.Translation((grating_socket_length + taper_length, 0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((grating_socket_length + 2 * taper_length + wg_length, 0)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((grating_socket_length * 3 / 2 + 2 * taper_length + wg_length, 0)) }) return circuit
def FBMSwaveguidecircuit(wg_length, wg_width, taper_length, grating_wg_width, grating_socket_length, grating_period, grating_dc): # wg_length [int] -> waveguide length # wg_width [int] -> waveguide width # taper_length [int] -> taper length # grating_wg_width [int] -> width of the waveguide for the grating # grating_socket_length [int] -> grating socket length # grating_period [int] -> grating period # grating_dc [0-1] -> grating duty cycle gwg = gratingwaveguide(grating_wg_width) g = grating(gwg, grating_socket_length, grating_period, grating_dc) (wgt, wg) = FBMSwaveguide(wg_width, wg_length) t = taper(gwg, wgt, taper_length) circuit = PlaceAndAutoRoute(child_cells={ "grating1": g, "taper1": t, "wire": wg, "taper2": t, "grating2": g }) circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((g.Layout.view.socket_length / 2, 0)), "taper1": i3.Translation((g.Layout.view.socket_length, 0)), "wire": i3.Translation((g.Layout.view.socket_length + t.Layout.view.end_position[0], 0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((g.Layout.view.socket_length + 2 * t.Layout.view.end_position[0] + wg.Layout.view.shape[1][0], 0)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((g.Layout.view.socket_length * 3 / 2 + 2 * t.Layout.view.end_position[0] + wg.Layout.view.shape[1][0], 0)) }) return circuit
def spiralcircuit(wgw, nl, i_s, s, il, tl, gwgw, gsl, gp, gdc, w_ebeam=1.5): w_core = wgw + w_ebeam w_clad = wgw + 3 * w_ebeam gwg = gratingwaveguide(gwgw) g = grating(gwg, gsl, gp, gdc) sp = spiral(wgw, nl, i_s, s, il) wgt = WireWaveguideTemplate() wgt.Layout(core_width=w_core, cladding_width=w_clad) t = taper(gwg, wgt, tl) circuit = PlaceAndAutoRoute(child_cells={ "grating1": g, "taper1": t, "spiral": sp, "taper2": t, "grating2": g }) circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((gsl / 2, 0)), "taper1": i3.Translation((gsl, 0)), "spiral": i3.Translation((gsl + tl, 0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl + 2 * tl + i_s[0] + (4 * nl + 1) * s + 2 * il, 0)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl * 3 / 2 + 2 * tl + i_s[0] + (4 * nl + 1) * s + 2 * il, 0)) }) return circuit
def ringcircuit3(radius, gap, wg_ring_width, wg_coupler_width, angle, lx, ly, tl, gwgw, gsl, gp, gdc): gwg = gratingwaveguide(gwgw) g = grating(gwg, gsl, gp, gdc) r = ring3(radius, gap, wg_ring_width, wg_coupler_width, angle) wgt = WireWaveguideTemplate() wgt.Layout(core_width=wg_coupler_width, cladding_width=wg_coupler_width + 6) t = taper(gwg, wgt, tl) circuit = PlaceAndAutoRoute(child_cells={ "grating1": g, "taper1": t, "ring": r, "taper2": t, "grating2": g }) circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((gsl / 2.0, ly)), "taper1": i3.Translation((gsl, ly)), "ring": i3.Translation((gsl + tl + lx / 2.0, radius + gap + wg_ring_width / 2.0 + wg_coupler_width / 2.0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl + 2 * tl + lx, ly)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl * 3 / 2.0 + 2 * tl + lx, ly)) }) return circuit
child_cells={ "1": mmi1, "2": mmi2, "3": mmi3, "cell_1": mmmi1, "cell_2": mmmi2, "cell_3": mmmi3 }) pr_layout = pr.Layout( child_transformations={ "1": (0, 0), "2": i3.HMirror(0.0) + i3.Translation((6000, 0)), "3": (6000, 0), "cell_1": i3.HMirror(0.0) + i3.Translation((3300, 0)) + i3.Translation((9000, 0.0)), "cell_2": i3.Translation((3300, 0)) + i3.Translation((9000, 0.0)), "cell_3": i3.HMirror(0.0) + i3.Translation((9900, 0)) + i3.Translation((9000, 0.0)) }) # pr_layout.visualize() pr_layout.write_gdsii("merge.gds") # # #layout.visualize(annotate=True) # # # # my_ring_layout.write_gdsii("my_ring.gds")
# Define Templates wg_t1 = WireWaveguideTemplate() wg_t1.Layout( core_width=15.0, cladding_width=15.0 + 16.0, ) # Define components WG1 = i3.Waveguide(trace_template=wg_t1) layout_WG1 = WG1.Layout(shape=[(0.0, 0.0), (50.0, 0.0)]) pr = PlaceAndAutoRoute(trace_template=wg_t1, child_cells={ "WGup": WG1, "WGdown": WG1 }, links=[ ("WGup:in", "WGdown:out"), ]) layout = pr.Layout(child_transformations={ "WGup": (400, 0), "WGdown": (-4000, 0) }, ) #layout.visualize(annotate=True) layout.write_gdsii("testmmi2.gds")
# mmmi3 = v9(name="PP3", length2=102) # # mmmi3_layout = mmmi3.Layout() # # # prr = PlaceAndAutoRoute(child_cells={ "cell_1": mmmi1, # "cell_2": mmmi2, # "cell_3": mmmi3 }) prr_layout = prr.Layout( child_transformations={ "cell_1": i3.HMirror(0.0) # "cell_2": (3300, 0), # "cell_3": (6600, 0) # "cell_1": i3.HMirror(0.0)+i3.Translation((3300, 0)), # "cell_2": i3.Translation((3300, 0)), # "cell_3": i3.HMirror(0.0) + i3.Translation((9900, 0)) }) # # # prr_layout.visualize() prr_layout.write_gdsii("2_2_MMI2112_V4.gds") mmmi1 = v9(name="PP1", length2=97) mmmi1_layout = mmmi1.get_default_view(i3.LayoutView) prr = PlaceAndAutoRoute(child_cells={"cell_1": mmmi1}) prr_layout = prr.Layout(child_transformations={"cell_1": (0, 0)})
dc_11 = Lspiral(width=11, name="ring3", offset=3) dc_9 = Lspiral(width=9, name="ring4", offset=4) dc_7 = Lspiral(width=7, name="ring5", offset=5) dc_5 = Lspiral(width=5, name="ring6", offset=6) dc_46 = Lspiral(width=4.6, name="ring7", offset=7) dc_42 = Lspiral(width=4.2, name="ring8", offset=8) dc_38 = Lspiral(width=3.8, name="ring9", offset=9) dc_34 = Lspiral(width=3.4, name="ring10", offset=10) dc_30 = Lspiral(width=3.0, name="ring11", offset=11) dc_26 = Lspiral(width=2.6, name="ring12", offset=12) pr = PlaceAndAutoRoute( child_cells={ "dc0": dc_20, "dc1": dc_17, "dc2": dc_14, "dc3": dc_11, "dc4": dc_9, "dc5": dc_7, "dc6": dc_5, "dc7": dc_46, "dc8": dc_42, "dc9": dc_38, "dc10": dc_34, "dc11": dc_30, "dc12": dc_26, }) pr_layout = pr.Layout() # pr_layout.visualize() pr_layout.write_gdsii("lspiral.gds")
spr6_layout = spr6.Layout() spr7 = my_dc(gap_inc_vec=[300, 200], sm_width=4.0) spr7_layout = spr7.Layout() spr8 = my_dc(gap_inc_vec=[300, 200], sm_width=4.2) spr8_layout = spr8.Layout() pr = PlaceAndAutoRoute( child_cells={ "dc1": spr1, "dc2": spr2, "dc3": spr3, "dc4": spr4, "dc5": spr5, "dc6": spr6, "dc7": spr7, "dc8": spr8 }) pr_layout = pr.Layout( child_transformations={ "dc1": (0, 0), "dc2": i3.VMirror(-2000) + i3.Translation((0, 4000)), "dc3": (0, 8500), "dc4": i3.VMirror(-2000) + i3.Translation((0, 12500)), "dc5": (0, 17000), "dc6": i3.VMirror(-2000) + i3.Translation((0, 21000)), "dc7": (0, 25500), "dc8": i3.VMirror(-2000) + i3.Translation((0, 29500)) }) # pr_layout.visualize() pr_layout.write_gdsii("spiral.gds")
"my_wire_t3": wg_left, "my_wire_t4": wg_rigth, }, ) my_circuit_layout1 = my_circuit.Layout( child_transformations={ "grating1": i3.Translation((-socket_lentgh_def / 2 + field_Ebeamx / 2 + socket_lentgh_def, field_Ebeamy)), "taper_G_c1": i3.Translation((field_Ebeamx / 2 + socket_lentgh_def, field_Ebeamy)), "taper_G_c2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180.0, absolute_rotation=False) + i3.Translation((field_Ebeamx / 2 + field_Ebeamx + wg_length - socket_lentgh_def, field_Ebeamy)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180.0, absolute_rotation=False) + i3.Translation((socket_lentgh_def / 2 + field_Ebeamx / 2 + field_Ebeamx + wg_length - socket_lentgh_def, field_Ebeamy)), }) my_circuit_layout1.visualize() my_circuit_layout1.write_gdsii("grating_11.gds")
height=20.0) # elems += i3.PolygonText(layer=i3.TECH.PPLAYER.WG.TEXT, # text='Name={}_R={}_delay={}'.format(name, self.R, self.delay_length), # # coordinate=(0.0, -counter * 5 * self.R - 2 * self.R + 50.0 # -100 # ), # alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), # font=2, # height=20.0) return elems # dc_10 = my_dc() # dc_10_layout = dc_10.Layout() # dc_10_layout.visualize(annotate=True) # dc_10_layout.write_gdsii("DC_V3.gds") dc_10 = my_dc(width=10) dc_15 = my_dc(width=15) dc_20 = my_dc(width=20) pr = PlaceAndAutoRoute(child_cells={"dc1": dc_10, "dc2": dc_15, "dc3": dc_20}) pr_layout = pr.Layout(child_transformations={ "dc1": (0, 0), "dc2": (0, 8300), "dc3": (0, 16600) }) # pr_layout.visualize() pr_layout.write_gdsii("3_DC_V3.gds")
Spiral_width = incoupling_length_param[0] + 2 * ( n_o_loop_param[0] + 1) * spacing_param[0] + inner_size_param[0] print Spiral_width from picazzo3.routing.place_route import PlaceAndAutoRoute my_circuit = PlaceAndAutoRoute( trace_template=WG_IT19, child_cells={ "spiral_c1": my_spiral, }, ) field_Ebeamx = 500 field_Ebeamy = 25 + 25 * 50 taper_length = 200 my_circuit_layout2 = my_circuit.Layout( bend_radius=50, child_transformations={ "spiral_c1": (field_Ebeamx / 2 + taper_length + socket_lentgh_def + wg_length / 2 - Spiral_width / 2 - incoupling_length_param[0] / 2, field_Ebeamy), }) #my_circuit_layout2.visualize() my_circuit_layout2.write_gdsii("spiral_11.gds")
height=20.0) # elems += i3.PolygonText(layer=i3.TECH.PPLAYER.WG.TEXT, # text='Name={}_R={}_delay={}'.format(name, self.R, self.delay_length), # # coordinate=(0.0, -counter * 5 * self.R - 2 * self.R + 50.0 # -100 # ), # alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), # font=2, # height=20.0) return elems # dc_10 = my_dc(width=10) # dc_10_layout = dc_10.Layout() # dc_10_layout.visualize(annotate=True) # dc_10_layout.write_gdsii("3_DC_V3.gds") dc_10 = my_dc(width=10) dc_15 = my_dc(width=15) dc_20 = my_dc(width=20) pr = PlaceAndAutoRoute(child_cells={"dc1": dc_10, "dc2": dc_15, "dc3": dc_20}) pr_layout = pr.Layout(child_transformations={ "dc1": (0, 0), "dc2": (0, 10700), "dc3": (0, 21400) }) # pr_layout.visualize() pr_layout.write_gdsii("3_DC_V3.gds")
def ringcircuit2(radius, gap, gap1, wg_ring_width, wg_coupler_width, wg_coupler_width2, tl, gwgw, gsl, gp, gdc, gp2, gdc2): gwg = gratingwaveguide(gwgw) g = grating(gwg, gsl, gp, gdc) g2 = grating(gwg, gsl, gp2, gdc2) r = ring2(radius, gap, gap1, wg_ring_width, wg_coupler_width, wg_coupler_width2) wgt = WireWaveguideTemplate() wgt.Layout(core_width=wg_coupler_width, cladding_width=wg_coupler_width + 6) wgt2 = WireWaveguideTemplate() wgt2.Layout(core_width=wg_coupler_width2, cladding_width=wg_coupler_width2 + 6) t = taper(gwg, wgt, tl) t2 = taper(gwg, wgt2, tl) circuit = PlaceAndAutoRoute( child_cells={ "grating1": g, "taper1": t, "ring": r, "taper2": t, "grating2": g, "grating3": g2, "taper3": t2, "taper4": t2, "grating4": g2 }) circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((gsl / 2.0, 0)), "taper1": i3.Translation((gsl, 0)), "ring": i3.Translation((gsl + tl + 20, radius + gap + wg_ring_width / 2.0 + wg_coupler_width / 2.0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl + 2 * tl + 40, 0)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl * 3 / 2.0 + 2 * tl + 40, 0)), "grating3": i3.Translation((gsl / 2.0, 2 * radius + gap + gap1 + wg_ring_width + wg_coupler_width)), "taper3": i3.Translation((gsl, 2 * radius + gap + gap1 + wg_ring_width + wg_coupler_width)), "taper4": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl + 2 * tl + 40, 2 * radius + gap + gap1 + wg_ring_width + wg_coupler_width)), "grating4": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl * 3 / 2.0 + 2 * tl + 40, 2 * radius + gap + gap1 + wg_ring_width + wg_coupler_width)) }) return circuit
"WGuptaper2": i3.HMirror() + i3.Translation((3100, 4000)), "WGdowntaper2": i3.HMirror() + i3.Translation((3100, -4000)), "WGup2": (3050, 4000), "WGdown2": (3050, -4000) } return child_transformations def _default_bend_radius(self): bend_radius = 300 return bend_radius mmi1 = ring() mmi2 = ring() mmi1_layout = mmi1.Layout(length=300) mmi2_layout = mmi2.Layout(length=400) pr = PlaceAndAutoRoute(child_cells={ "1": mmi1, "2": mmi2, }) layout = pr.Layout(child_transformations={ "1": (0, 0), "2": (4100, 0), }) layout.write_gdsii("testmmiV8.gds") #layout.visualize(annotate=True) # # my_ring_layout.write_gdsii("my_ring.gds") # layout.write_gdsii("testmmiV7.gds")
"dc3": spr3, "dc4": spr4, "dc5": spr5, "dc6": spr6, "dc7": spr7, "dc8": spr8 }) # pr_layout = pr.Layout(child_transformations={"dc1": (0, 0), # "dc2": i3.VMirror(-2000) + i3.Translation((0, 700)), # "dc3": (0, 5200), # "dc4": i3.VMirror(-2000) + i3.Translation((0, 5900)), # "dc5": (0, 10400), # "dc6": i3.VMirror(-2000) + i3.Translation((0, 11100)), # "dc7": (0, 15600), # "dc8": i3.VMirror(-2000) + i3.Translation((0, 16300)) # }) pr_layout = pr.Layout( child_transformations={ "dc1": (0, 0), "dc2": i3.Translation((0, 2350)), "dc3": (0, 2350 * 2), "dc4": i3.Translation((0, 2350 * 3)), "dc5": (0, 2350 * 4 + 500), "dc6": i3.Translation((0, 2350 * 5 + 500)), "dc7": (0, 2350 * 6 + 500), "dc8": i3.Translation((0, 2350 * 7 + 500)) }) # pr_layout.visualize() pr_layout.write_gdsii("spiral_v2.gds")
i3.vector_match_transform(wwa_lay.ports["in"], r_layouts[cnt-1].ports["in2"].transform_copy(transformations["ring{}".format(cnt)])) + \ i3.Translation(translation=(10.0,10.0)) transformations['gc_ref'] = i3.vector_match_transform( grating_coupler_layout.ports["out"], i3.Vector(position=(9 * d, -d / 2), angle=0.0)) transformations['gc_pass'] = i3.vector_match_transform( grating_coupler_layout.ports["out"], i3.Vector(position=(9 * d, d / 2), angle=0.0)) # Create the PCell my_circuit = PlaceAndAutoRoute(child_cells=cells, links=links) # Create Layout layout = my_circuit.Layout(child_transformations=transformations) layout.visualize(annotate=True) layout.write_gdsii("full_circuit_8.gds") # If the you pick resonance frequencies that lead to a off-grid ports it is safest to flatten your entire design. top_cell_layout_flat = layout.layout.flat_copy() top_layout_flat = i3.LayoutCell().Layout(elements=top_cell_layout_flat) top_layout_flat.write_gdsii("full_circuit_flat_8.gds") # Simulate cm = my_circuit.CircuitModel() wavelengths = np.linspace(1.52, 1.58, 4001) S = cm.get_smatrix(wavelengths=wavelengths) plt.figure() plt.plot(wavelengths,
mmi_slots = mmi_slots_cell() from picazzo3.routing.place_route import PlaceAndAutoRoute pr = PlaceAndAutoRoute(child_cells={"mmi1": mmi_slots, # "mmi2": mmi_slots, }, links=[]) layout = pr.Layout(child_transformations={"mmi1": i3.Rotation(rotation=90), # "score": (4745., 400.), # "sbundle1": (-200., 499 + 10.), # "sbundle2": (-200., 598 + 20), # "sbundle3": (-200., 697. + 30), # "spirals150": (304.97, 698 + 99. + 43), # "spirals200": (304.97, 824 + 99. + 56), # "rbundle1": (-200., 950 + 99. + 66), # "rbundle2": (-200., 1036 + 99. + 76), # "rbundle3": (-200., 1036 + 99 + 86. + 86), # "spiral06":(304.97,1120+99+86), # "spiral07":(304.97,1290+99+86) } ) # layout.visualize() layout.write_gdsii("importtest.GDS")
# current_id += mmi1.param_num # from copy import deepcopy # mmi1.wg_t1 = deepcopy(mmi1.wg_t1 ) mmi2 = v8(name="P2", widtha=30) mmi2_layout = mmi2.Layout(length=500) mmi3 = v8(name="P3", widtha=20) # mmi1.set(width=10) mmi1_layout = mmi1.Layout() # mmi1_layout.write_gdsii("MMI22_V2.gds") # mmi2 = v8(name="P2", width=20) # mmi2.set(width=20) # mmi2_layout = mmi2.Layout() # mmi3 = v8(name="P3", widtha=20) # mmi2.set(width=20) mmi3_layout = mmi3.Layout(length=406) # print mmi1.width # mmi1_layout.write_gdsii("MMI22_V2_1.gds") # mmi2_layout.write_gdsii("MMI22_V2_2.gds") # mmi3_layout.write_gdsii("MMI22_V2_3.gds") pr = PlaceAndAutoRoute(child_cells={"1": mmi1, "2": mmi2, "3": mmi3}) pr_layout = pr.Layout(child_transformations={ "1": (0, 0), "2": i3.HMirror(0.0) + i3.Translation((6000, 0)), "3": (6000, 0) }) # pr_layout.visualize() pr_layout.write_gdsii("MMI22_V2.gds")
"WGdowntaper2":WG3}, links=[ ("MMI1b:out2", "WGuptaper2:in"), ("MMI1b:out1", "WGdowntaper2:in"), # ("MMI1b:out","MMI1a:in"), ("WGuptaper:out", "MMI1b:in2"), ("WGdowntaper:out", "MMI1b:in1") ] ) layout = pr.Layout(child_transformations={"MMI1b": (1200, 0), "WGup": (0, 4000), "WGuptaper":(0,4000), "WGdown": (0, -4000), "WGdowntaper":(0,-4000), "WGuptaper2":(2700,4000), "WGdowntaper2":(2700,-4000), "WGup2": (3050, 4000), "WGdown2": (3050, -4000)}, bend_radius=300 ) pr2 = PlaceAndAutoRoute( child_cells={ "1": pr, "2": pr, "3": pr, # "WGup2": WG1, # "WGdown2": WG1, # "WGuptaper":WG2, # "WGdowntaper":WG2,
wg_width = 0.5 lengths = [5000, 10000, 20000, 40000] true_lengths = [] child_cells = dict() child_cells["straight_ref_top"] = StraightWgLossEbeamFBMSMerged(name="Straight_ref_top", wg_width=wg_width) child_cells["straight_ref_bottom"] = StraightWgLossEbeamFBMSMerged(name="Straight_ref_bottom", wg_width=wg_width) for num,length in enumerate(lengths): a = SpiralWgLossEbeamFBMSMerged(name="Spiral_length_"+str(length), spiral_length=length, wg_width=wg_width) a_lo = a.Layout() child_cells["length"+str(length)] = a # true_lengths.append(a_lo.get_true_length()) # print length, true_lengths[num] child_transformations = dict() child_transformations["length40000"] = (0,0) # middle_x_plane = (a_lo.ports["in"].position.x+a_lo.ports["out"].position.x)/2.0 si = a_lo.size_info() # middle_x_plane = (a_lo.west.position.x+a_lo.east.position.x)/2.0 middle_x_plane = (si.west+si.east)*0.5 child_transformations["length5000"] = i3.CMirror(mirror_center=(middle_x_plane,0)) + i3.Translation((0,600)) child_transformations["length10000"] = (0,700) child_transformations["length20000"] = i3.CMirror(mirror_center=(middle_x_plane,0)) + i3.Translation((0,600+700)) child_transformations["straight_ref_top"] = (0,600+700+100) child_transformations["straight_ref_bottom"] = (0,-100) SpiralWg = PlaceAndAutoRoute(name="SpiralWgEbeam"+str(wg_width),child_cells=child_cells) lo = SpiralWg.Layout(child_transformations=child_transformations) gds_name = os.path.join(os.curdir, "spiral_wg_sweep_width"+str(wg_width)+".gds") lo.write_gdsii(gds_name)
}, links=[ ("MMI1a:out2", "WGuptaper2:in"), ("MMI1a:out1", "WGdowntaper2:in"), # ("MMI1b:out","MMI1a:in"), ("WGuptaper:out", "MMI1b:in2"), ("WGdowntaper:out", "MMI1b:in1") ]) layout = pr.Layout(child_transformations={ "MMI1a": (1787, 0), "MMI1b": (1200, 0), "WGup": (0, 4000), "WGuptaper": (0, 4000), "WGdown": (0, -4000), "WGdowntaper": (0, -4000), "WGuptaper2": (2700, 4000), "WGdowntaper2": (2700, -4000), "WGup2": (3050, 4000), "WGdown2": (3050, -4000) }, bend_radius=300) #layout.visualize(annotate=True) pr2 = PlaceAndAutoRoute( trace_template=wg_sm2, child_cells={"test": pr}, links=[ # ("MMI1a:out2", "WGuptaper2:in"), # ("MMI1a:out1", "WGdowntaper2:in"),
"drop_grating": my_grating, "ring": my_ring }, links=[("in_grating:out", "ring:in1"), ("pass_grating:out", "ring:out1"), ("add_grating:out", "ring:in2"), ("drop_grating:out", "ring:out2")]) distance_x = 100.0 distance_y = 30.0 my_circuit_layout = my_circuit.Layout( child_transformations={ "ring": (0, 0), "in_grating": i3.Rotation(rotation=0) + i3.Translation((-distance_x, -distance_y)), "pass_grating": i3.Rotation(rotation=180) + i3.Translation((distance_x, -distance_y)), "add_grating": i3.Rotation(rotation=180) + i3.Translation((distance_x, distance_y)), "drop_grating": i3.Rotation(rotation=0) + i3.Translation((-distance_x, distance_y)), }) my_circuit_layout.visualize() # 6. Simulate my_circuit_cm = my_circuit.CircuitModel() wavelengths = np.linspace(1.50, 1.6, 2001) S = my_circuit_cm.get_smatrix(wavelengths=wavelengths) # 7. Plot plt.plot(wavelengths, np.abs(S['in_grating_vertical_in', 'pass_grating_vertical_in'])**2,
dc_10 = my_dc(gap_inc_vec=[0.6, 0.8, 1.0, 1.2], length=40, name="ring1") dc_10_layout = dc_10.Layout() dc_15 = my_dc(gap_inc_vec=[0.6, 0.8, 1.0, 1.2], length=60, name="ring2") dc_15_layout = dc_15.Layout() dc_20 = my_dc(gap_inc_vec=[0.6, 0.8, 1.0, 1.2], length=90, name="ring3") dc_20_layout = dc_20.Layout() dc_25 = my_dc(gap_inc_vec=[0.6, 0.8, 1.0, 1.2], length=120, name="ring4") dc_25_layout = dc_25.Layout() # dc_10_layout.visualize(annotate=True) # dc_10_layout.write_gdsii("DC_V4.gds") # dc_10 = my_dc(width=10) # dc_15 = my_dc(width=15) # dc_20 = my_dc(width=20) pr = PlaceAndAutoRoute(child_cells={ "dc1": dc_10, "dc2": dc_15, "dc3": dc_20, "dc4": dc_25 }) pr_layout = pr.Layout( child_transformations={ "dc1": (0, 0), "dc2": i3.HMirror(1500) + i3.Translation((3000, 0)), "dc3": (6000, 0), "dc4": i3.HMirror(1500) + i3.Translation((9000, 0)) }) # pr_layout.visualize() pr_layout.write_gdsii("ring_double.gds")
"WGdowntaper":WG2, "WGuptaper2":WG3, "WGdowntaper2":WG3}, links=[ ("MMI1b:out2", "WGuptaper2:in"), ("MMI1b:out1", "WGdowntaper2:in"), ("MMI1a:in1","WGdown2:out"),("MMI1a:in2","WGup2:out"), ("MMI1a:out1","WGdown3:in"),("MMI1a:out2","WGup3:in"), ("WGuptaper:out", "MMI1b:in2"), ("WGdowntaper:out", "MMI1b:in1") ] ) layout = pr.Layout(child_transformations={"MMI1b": (1200, 0), "MMI1a": (1200+3600, 0), "WGup": (0, 4000), "WGuptaper":(0,4000), "WGdown": (0, -4000), "WGdowntaper":(0,-4000), "WGuptaper2":(2700,2000), "WGdowntaper2":(2700,-6000), "WGup2": (3050, 2000),"WGup3": (7050, 4000),"WGdown3": (7050, -4000), "WGdown2": (3050, -6000)}, bend_radius=300 ) #layout.visualize(annotate=True) # my_ring_layout.write_gdsii("my_ring.gds") layout.write_gdsii("testmmiV6.gds")
# mmi2_layout.write_gdsii("MMI22_V2_2.gds") # mmi3_layout.write_gdsii("MMI22_V2_3.gds") pr = PlaceAndAutoRoute( child_cells={ "1": mmi1, "2": mmi2, "3": mmi3, # "4": mmi4, # "5": mmi5, # "6": mmi6, # "7": mmi7, # "8": mmi8, # "9": mmi9 }) pr_layout = pr.Layout( child_transformations={ "1": (0, 0), "2": i3.HMirror(0.0) + i3.Translation((6000, 0)), "3": (6000, 0), # "4": (0, 8300), # "5": i3.HMirror(0.0) + i3.Translation((6000, 8300)), # "6": (6000, 8300), # "7": (0, 16600), # "8": i3.HMirror(0.0) + i3.Translation((6000, 16600)), # "9": (6000, 16600) }) pr_layout.visualize(annotate=True) pr_layout.write_gdsii("1_MMI22_V4.gds")
"12": mmi12, "13": mmi13, "14": mmi14, "15": mmi15 } ) pr_layout = pr.Layout(child_transformations={"10": (0, 0), "1": i3.HMirror(0.0) + i3.Translation((6000, 0)), "2": (6000, 0), "12": (0, 10700), "4": i3.HMirror(0.0) + i3.Translation((6000, 10700)), "5": (6000, 10700), "14": (0, 21400), "7": i3.HMirror(0.0) + i3.Translation((6000, 21400)), "8": (6000, 21400), "3": i3.HMirror(0.0) + i3.Translation((12000, 0)), "11": (12000, 0), "6": i3.HMirror(0.0) + i3.Translation((12000, 10700)), "13": (12000, 10700), "9": i3.HMirror(0.0) + i3.Translation((12000, 21400)), "15": (12000, 21400) }) pr_layout.visualize(annotate=True) pr_layout.write_gdsii("1_MMI22_V4.gds")
"WGuptaper": WG2, "WGdowntaper": WG2, "WGuptaper2": WG3, "WGdowntaper2": WG3 }, links=[ ("MMI1b:out2", "WGuptaper2:in"), ("MMI1b:out1", "WGdowntaper2:in"), # ("MMI1b:out","MMI1a:in"), ("WGuptaper:out", "MMI1b:in2"), ("WGdowntaper:out", "MMI1b:in1") ]) layout = pr.Layout(child_transformations={ "MMI1b": (1500, 0), "WGup": (0, 4000), "WGuptaper": (0, 4000), "WGdown": (0, -4000), "WGdowntaper": (0, -4000), "WGuptaper2": (2600, 4000), "WGdowntaper2": (2600, -4000), "WGup2": (2950, 4000), "WGdown2": (2950, -4000) }, bend_radius=300) # layout.visualize(annotate=True) # my_ring_layout.write_gdsii("my_ring.gds") layout.write_gdsii("DC_V1.gds")
# dc_10_layout.write_gdsii("DC_V4.gds") # # Interface(pocket= False, tilt=False).Layout.view.write_gdsii("interface1.gds") dc20 = Interface(name="haha", pocket= False, tilt=False) dc20_layout = dc20.Layout() # dc20.visualize() print("Done writing Release.gds!") dc_15 = my_dc(gap_inc_vec=[390, 398, 406], name="ring2") dc_15_layout = dc_15.Layout() pr = PlaceAndAutoRoute( child_cells={ "dc1": dc_10, "dc2": dc_15, "dc3": dc20, # "dc3": dc_20, # "dc4": dc_25 } ) pr_layout = pr.Layout(child_transformations={"dc1": (0, 0), "dc2": i3.HMirror(2500) - i3.Translation((5000, 0)), "dc3": (-15000, 0), }) pr_layout.visualize() pr_layout.write_gdsii("execute_test2.gds")