def ring2(radius, gap, gap1, wg_ring_width, wg_coupler_width, wg_coupler_width2): gap2 = gap + wg_ring_width / 2.0 + wg_coupler_width / 2.0 gap3 = gap1 + wg_ring_width / 2.0 + wg_coupler_width / 2.0 wg_ring = WireWaveguideTemplate() wg_coupler = WireWaveguideTemplate() wg_ring.Layout(core_width=wg_ring_width, cladding_width=wg_ring_width + 6) wg_coupler.Layout(core_width=wg_coupler_width, cladding_width=wg_coupler_width + 6) wg_coupler2 = WireWaveguideTemplate() wg_coupler2.Layout(core_width=wg_coupler_width2, cladding_width=wg_coupler_width2 + 6) ring = RingRect180DropFilter( ring_trace_template=wg_ring, coupler_trace_templates=[wg_coupler, wg_coupler2]) ring_layout = ring.Layout( angle_step=0.1, bend_radius=radius, coupler_spacings=[gap2, gap3], straights=(0, 0), coupler_extensions=[i3.Coord2((20, 20)), i3.Coord2((20, 20))]) return ring
def initialize(self): # Socket self.SOCKET=TechnologyTree() self.SOCKET.LENGTH = 20.0 self.SOCKET.STRAIGHT_EXTENSION = (0.0, 0.05) # Default straight extentions used for the socket taper. self.SOCKET.MARGIN_FROM_GRATING = TECH.WG.SHORT_STRAIGHT # Distance between the last grating line and the end of the socket by default self.SOCKET.START_TRACE_TEMPLATE = TECH.PCELLS.WG.DEFAULT self.SOCKET.TRANSITION_LENGTH = 5.0 from picazzo3.traces.wire_wg import WireWaveguideTemplate wide_trace_template = WireWaveguideTemplate(name="LinearTransitionSocket_WGT") wide_trace_template.Layout(core_width=17.0, cladding_width=2 * TECH.WG.TRENCH_WIDTH + 17.0) self.SOCKET.WIDE_TRACE_TEMPLATE = wide_trace_template # Wide trace template. # Grating self.GRATING = TechnologyTree() self.GRATING.PERIOD = 0.63 # Default period used in the grating. self.GRATING.FOCAL_DISTANCE = 20.0 # Default focal distance of curved gratings. self.GRATING.BOX_WIDTH = 15.5 # Default box width self.GRATING.N_O_LINES = int(floor(self.GRATING.BOX_WIDTH / self.GRATING.PERIOD )) self.GRATING.START_RADIUS = self.GRATING.FOCAL_DISTANCE - self.GRATING.BOX_WIDTH / 2.0 # Default first radius of the grating. self.GRATING.ANGLE_SPAN = 90 # Default angle span of a curved grating when it is not boxed.
def initialize(self): self.SOCKET = TechnologyTree() self.SOCKET.LENGTH = 50.0 self.SOCKET.WIDTH = 10.0 from picazzo3.traces.wire_wg import WireWaveguideTemplate wide_trace_template = WireWaveguideTemplate() wide_trace_template.Layout(core_width=0.45, cladding_width=15.0) self.SOCKET.TRACE_TEMPLATE = wide_trace_template # Wide trace template. # TE Grating self.GRATING_TE = TechnologyTree() self.GRATING_TE.N_O_LINES = 25 # Default number of lines used. self.GRATING_TE.PERIOD = 0.63 # Default period used in the grating. self.GRATING_TE.LINE_WIDTH = 0.315 # Default linewidth used in the grating. self.GRATING_TE.BOX_WIDTH = 14.0 # Default box width # TM Grating self.GRATING_TM = TechnologyTree() self.GRATING_TM.N_O_LINES = 16 # Default number of lines used. self.GRATING_TM.PERIOD = 1.080 # Default period used in the grating. self.GRATING_TM.LINE_WIDTH = 0.540 # Default linewidth used in the grating. self.GRATING_TM.BOX_WIDTH = 14.0 # Default box width # default self.GRATING = self.GRATING_TE
def ring1(radius, gap, wg_ring_width, wg_coupler_width): gap2 = gap + wg_ring_width / 2.0 + wg_coupler_width / 2.0 wg_ring = WireWaveguideTemplate() wg_coupler = WireWaveguideTemplate() wg_ring.Layout(core_width=wg_ring_width, cladding_width=wg_ring_width + 6) wg_coupler.Layout(core_width=wg_coupler_width, cladding_width=wg_coupler_width + 6) ring = RingRectNotchFilter(ring_trace_template=wg_ring, coupler_trace_templates=[wg_coupler]) ring_layout = ring.Layout(angle_step=0.1, bend_radius=radius, coupler_spacings=[gap2], straights=(0, 0), coupler_extensions=[i3.Coord2((20, 20))]) return ring
def ring3(radius, gap, wg_ring_width, wg_coupler_width, angle): gap2 = gap + wg_ring_width / 2.0 + wg_coupler_width / 2.0 wg_ring = WireWaveguideTemplate() wg_coupler = WireWaveguideTemplate() wg_ring.Layout(core_width=wg_ring_width, cladding_width=wg_ring_width + 6) wg_coupler.Layout(core_width=wg_coupler_width, cladding_width=wg_coupler_width + 6) ring = RingRectWrappedNotchFilter(ring_trace_template=wg_ring, coupler_trace_templates=[wg_coupler]) ring_layout = ring.Layout(angle_step=0.1, bend_radius=radius, coupler_spacings=[gap2], straights=(0, 0), coupler_lengths=[0], coupler_angles=[angle, angle]) return ring
def gratingwaveguide(w_core, w_ebeam=1.5): # w_core [int] -> waveguide width # w_ebeam [int] -> ebeam beam width w_core = w_core + w_ebeam w_clad = w_core + 2 * w_ebeam wg = WireWaveguideTemplate() wg.Layout(core_width=w_core, cladding_width=w_clad) return wg
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 FBMSwaveguide(w_core, l_core, w_ebeam=1.5): # w_core [int] -> waveguide width # l_core [int] -> waveguide length # w_ebeam [int] -> ebeam beam width w_core = w_core + w_ebeam w_clad = w_core + 2 * w_ebeam wgt = WireWaveguideTemplate() wgt.Layout(core_width=w_core, cladding_width=w_clad) wg = wgt() wg.Layout(shape=[(0, 0), (l_core, 0)]) return (wgt, wg)
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 STANDARD_GRATING_1550_TE(): from picazzo3.fibcoup.uniform import UniformLineGrating as _ULG from picazzo3.traces.wire_wg import WireWaveguideTemplate t_tree = TECH.IO.FIBCOUP.STRAIGHT wg_t = WireWaveguideTemplate(name="STD_FIBCOUP_SOCKET_WG_TE_T") G = _ULG(name="std_grating_1550", trace_template=t_tree.SOCKET.TRACE_TEMPLATE, library=TECH.PCELLS.LIB) G.Layout(origin=(0.0, 0.0), period=t_tree.GRATING.PERIOD, line_width=t_tree.GRATING_TE.LINE_WIDTH, line_length=t_tree.GRATING_TE.BOX_WIDTH, n_o_periods=t_tree.GRATING_TE.N_O_LINES) TECH.PCELLS.LIB.add(G.dependencies( )) # make sure that the child cells are also added to this lib return G
def spiral(wgw, n_loop, inner_size, spacing, incoupling_length, w_ebeam=1.5): w_core = wgw + w_ebeam w_clad = wgw + 3 * w_ebeam wgt = WireWaveguideTemplate() wg = wgt.Layout(core_width=w_core, cladding_width=w_clad) s = DoubleSpiralWithInCouplingRounded(n_o_loops=n_loop, trace_template=wg) sl = s.Layout(angle_step=30, inner_size=inner_size, incoupling_length=incoupling_length, bend_radius=50, manhattan=False, spacing=spacing) print(sl.trace_length()) return s
def STANDARD_GRATING_1550_TM(): from picazzo3.fibcoup.uniform import UniformLineGrating as _ULG from picazzo3.traces.wire_wg import WireWaveguideTemplate std1550_grating_trench = 0.540 std1550_grating_period = 1.080 std1550_grating_n_o_periods = 16 wg_t = WireWaveguideTemplate(name="STD_FIBCOUP_SOCKET_WG_TM_T") wg_t.Layout(core_width=10.0, cladding_width=14.0) G = _ULG(name="std_grating_1550_tm", trace_template=wg_t, library=TECH.PCELLS.LIB) G.Layout(origin=(0.0, 0.0), period=std1550_grating_period, line_width=std1550_grating_trench, n_o_periods=std1550_grating_n_o_periods) TECH.PCELLS.LIB.add(G.dependencies( )) # make sure that the child cells are also added to this lib return G
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
def _default_trace_template(self): return WireWaveguideTemplate()
from technologies import silicon_photonics from ipkiss3 import all as i3 from picazzo3.traces.wire_wg import WireWaveguideTemplate from picazzo3.fibcoup.uniform import UniformLineGrating #Template garting waveguide side1_r = 3. #cladd reel obtenue au Ebeam side1 = side1_r / 2 w_core1_r = 10 #core reel obtenue au Ebeam w_core_w1 = w_core1_r + side1 w_clad_w1 = 2 * side1 + w_core_w1 wg_coupler = WireWaveguideTemplate() wg_coupler.Layout(core_width=w_core_w1, cladding_width=w_clad_w1) #Grating 1 socket_lentgh_def = 50 periode = 1.0 line_widthe = 0.5 * periode FGC1 = UniformLineGrating(trace_template=wg_coupler) FGC_layout1 = FGC1.Layout( period=periode, line_width=line_widthe, line_length=16.0, n_o_periods=35, origin=(0, 0), socket_length=socket_lentgh_def, ) from picazzo3.traces.wire_wg import WireWaveguideTransitionLinear
# 2. Import other python libraries. import numpy as np import pylab as plt # 3. Creating the trace template from picazzo3.traces.wire_wg import WireWaveguideTemplate socket_lentgh_def = 50 #related to grating_spiral code side1_r = 3. #cladd reel obtenue au Ebeam side1 = side1_r / 2 w_core1_r = 0.35 #core reel obtenue au Ebeam w_core_w1 = w_core1_r + side1 w_clad_w1 = 2 * side1 + w_core_w1 wg_length = 500 new_wg_template = WireWaveguideTemplate(name="my_wire") WG_IT19 = new_wg_template.Layout( core_width=w_core_w1, cladding_width=w_clad_w1, ) # 4. Define the spirals #---------SPIRAL IT19---------# from picazzo3.wg.spirals import DoubleSpiralWithInCouplingRounded n_o_loop_param = 3, inner_size_param = 572.93, spacing_param = 5, incoupling_length_param = 100,
from picazzo3.traces.wire_wg import WireWaveguideTemplate from euler90_rounding_algorithm import EulerArbAlgorithm # First the default of the class default_ring_resonator = SingleResonator(name="default") default_ring_resonator_layout = default_ring_resonator.Layout() default_ring_resonator_layout.write_gdsii("default_testing.gds") # now putting in a specific example, same as default but with Euler bends euler_ring_resonator = SingleResonator(name="euler_default") euler_ring_resonator_layout = euler_ring_resonator.Layout( ring_x_straight=5., rounding_algorithm=EulerArbAlgorithm) euler_ring_resonator_layout.write_gdsii("euler_test.gds") # putting in a detailed example for clarity waveguide_template = WireWaveguideTemplate(name="the_waveguide") waveguide_template_layout = waveguide_template.Layout(core_width=1.5, cladding_width=2.0) full_ring_resonator = SingleResonator(name="all_vars", wg_coupler_template=waveguide_template, wg_ring_template=waveguide_template) full_ring_layout = full_ring_resonator.Layout( bend_radius_ring=10., ring_x_straight=5., ring_y_straight=20., external_straights=15., external_gap=1., rounding_algorithm=EulerArbAlgorithm)
peak_transmission=0.60**0.5, reflection=0.01**0.5) # ####################################### # Splitter # ####################################### splitter = SimpleMMI() splitter_layout = splitter.Layout(length=14.1428571429, waveguide_spacing=2.1) splitter_cm = splitter.CircuitModel(straight_coupling1=0.45**0.5) # ####################################### # Termination # ####################################### wt = WireWaveguideTemplate() wt.Layout(core_width=0.9, cladding_width=2 * i3.TECH.WG.WIRE_WIDTH + 0.9) wwa = WireWgAperture(aperture_trace_template=wt) wwa_lay = wwa.Layout() wwa_cm = wwa.CircuitModel(reflection=0.001) # ####################################### # Simple circuit # ####################################### cells = { "gc_in": grating_coupler, "gc_ref": grating_coupler, "gc_pass": grating_coupler, "splitter": splitter }
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