示例#1
0
 def _default_child_transformations(self):
     trans = dict()
     trans["dircoup1"] = (1650, 0)
     trans["dircoup2"] = (4950, 0)
     # for counter in range(0, 8, 1):
     #     print counter
     #     trans['straight' + str(counter)] = (2000 * (counter + 1), 0)
     #     trans["taper" + str(counter)] = (0, 2000 * (counter + 1))
     trans["straight0"] = (0, 4000)
     trans["straight1"] = (0, -4000)
     trans["straight2"] = (3150, 2000)
     trans["straight3"] = (3150, -6000)
     trans["straight4"] = (3300, 2000)
     trans["straight5"] = (3300, -6000)
     trans["straight6"] = (6450, 4000)
     trans["straight7"] = (6450, -4000)
     trans["taper0"] = (150, 4000)
     trans["taper1"] = (150, -4000)
     trans["taper2"] = i3.HMirror(150) + i3.Translation((2850, 2000))
     trans["taper3"] = i3.HMirror(150) + i3.Translation((2850, -6000))
     trans["taper4"] = (3450, 2000)
     trans["taper5"] = (3450, -6000)
     trans["taper6"] = i3.HMirror(150) + i3.Translation((6150, 4000))
     trans["taper7"] = i3.HMirror(150) + i3.Translation((6150, -4000))
     return trans
示例#2
0
        def _default_child_transformations(self):
            trans = dict()
            column = 3500
            # trans["dircoup1"] = (1650, 0)
            # trans["dircoup2"] = (4950, 0)
            # trans['mzi_22_22_0'] = (0, 0)
            trans['ring0'] = (1300, -2400)
            # trans['ring1'] = i3.VMirror(0) + i3.Translation((1300, 2000))
            trans['ring1'] = (1300 + column, -2400)
            trans['ring2'] = (1300 + 2 * column, -2400)
            trans['ring3'] = (1300 + 3 * column, -2400)

            trans["taper0"] = (0, -4000)
            trans["taper1"] = i3.HMirror(0) + i3.Translation((column, -3500))
            trans["taper2"] = (0 + column, -3500)
            trans["taper3"] = i3.HMirror(0) + i3.Translation(
                (2 * column, -4000))
            trans["taper4"] = (0 + 2 * column, -4000)
            trans["taper5"] = i3.HMirror(0) + i3.Translation(
                (3 * column, -3500))
            trans["taper6"] = (0 + 3 * column, -3500)
            trans["taper7"] = i3.HMirror(0) + i3.Translation(
                (4 * column, -4000))

            return trans
示例#3
0
        def _default_child_transformations(self):
            d = {}
            for counter, child in enumerate(self.Spiral_list):
                ip = child.ports["in"].position
                #print self.child_cells['InPort' + str(counter)].ports["out"].position
                #print self.child_cells['OutPort' + str(counter)].ports.position
                print '----------------'
                print 'spiral length:', child.total_length
                print 'counter: ', counter
                #print ip
                op = child.ports["out"].position
                #print op

                print 'The lateral size of the spiral is', op[0] - ip[0]
                print 'The type of mask is: ', self.tipo
                print 'The number of widths is: ', self.n
                print 'The number of lengths is: ', self.lengths
                print 'The width number is: ', self.width
                print '----------------'
                iz = child.inner_size
                sx = iz[1] + 200
                #sx=1200
                if self.tipo == 1:

                    d['Spiral' + str(counter)] = i3.Translation(
                        translation=(-(op[0] - ip[0]) / 2,
                                     self.n * counter * sx))
                    d['InPort' + str(counter)] = i3.HMirror() + i3.Translation(
                        translation=(-self.chip_length / 2.0 -
                                     self.couplingWG_l, self.n * counter * sx))
                    d['OutPort' + str(counter)] = i3.Translation(
                        translation=(self.chip_length / 2.0 +
                                     self.couplingWG_l, self.n * counter * sx))
                if self.tipo == 2:
                    d['Spiral' + str(counter)] = i3.Translation(
                        translation=(-(op[0] - ip[0]) / 2,
                                     -(self.n + 0.5) * counter * sx))
                    #d['InPort' + str(counter)] = i3.HMirror()+ i3.Translation(translation=(-self.chip_length*(3/4)-self.couplingWG_l, -(self.n+0.5)*counter*sx))
                    #d['OutPort' + str(counter)] = i3.Rotation(rotation=90) + i3.Translation(translation=((op[0]-ip[0])/2+2*self.R+(((self.n+0.5)*counter+self.width)*sx/4), self.chip_length*(3/4)+(self.width+counter-(((counter+1)-1.0)%self.lengths))*sx))
                    d['InPort' + str(counter)] = i3.HMirror() + i3.Translation(
                        translation=(-self.chip_length * (1 / 2) - 2000,
                                     -(self.n + 0.5) * counter * sx))
                    d['OutPort' + str(counter)] = i3.Rotation(
                        rotation=90) + i3.Translation(translation=(
                            (op[0] - ip[0]) / 2 + 2 * self.R +
                            (((self.n + 0.5) * counter + self.width) * sx / 4),
                            3000 + self.chip_length * (3 / 4) +
                            (self.width + counter -
                             (((counter + 1) - 1.0) % self.lengths)) * sx))
                #For awg's
                #if self.tipo==2:
                #d['Spiral' + str(counter)] = i3.Translation(translation=(-(op[0]-ip[0])/2, -(self.n+0.5)*counter*sx))
                #d['InPort' + str(counter)] = i3.HMirror()+ i3.Translation(translation=(-self.chip_length*(3/4.0), -(self.n+0.5)*counter*sx))
                #d['OutPort' + str(counter)] = i3.Rotation(rotation=90) + i3.Translation(translation=((op[0]-ip[0])/2+2*self.R
                #+(((self.n+0.5)*counter+self.width)*sx/100.0)
                #, self.chip_length*(2/4.0)+
                #(self.width+counter-(((counter+1)-1.0)%self.lengths))*sx))
            return d
示例#4
0
        def _default_child_transformations(self):
            d = {}
            for counter, child in enumerate(self.s_length_vec):
                #ip= child.ports["in"].position
                #print self.child_cells['InPort' + str(counter)].ports["out"].position
                #print self.child_cells['OutPort' + str(counter)].ports.position
                print '----------------'

                #print 'spiral length:', child.total_length
                print 'counter: ', counter
                print 'self.n = ', self.n
                print 'self.width: ', self.width
                #print 'sx: ', sx

                if self.tipo == 1:
                    sx = 70
                    a = 0.5
                    print 2 * (22362 * 0.5 - self.couplingWG_l)
                    print 'tipo = ', self.tipo

                    #d['Spiral' + str(counter)] = i3.Translation(translation=(-(op[0]-ip[0])/2, self.n*counter*sx))
                    #d['InPort' + str(counter)] = i3.HMirror()+ i3.Translation(translation=(-self.chip_length*0.5, (self.n+a)*counter*sx))
                    #d['OutPort' + str(counter)] = i3.Translation(translation=(self.chip_length*0.5, (self.n+a)*counter*sx))

                    d['InPort' + str(counter)] = i3.HMirror() + i3.Translation(
                        translation=(-22362 * 0.5 + self.couplingWG_l,
                                     (self.n + a) * counter * sx))
                    d['OutPort' + str(counter)] = i3.Translation(
                        translation=(22362 * 0.5 - self.couplingWG_l,
                                     (self.n + a) * counter * sx))

                #if self.tipo==2:
                #d['Spiral' + str(counter)] = i3.Translation(translation=(-(op[0]-ip[0])/2, -(self.n+0.5)*counter*sx))
                #d['InPort' + str(counter)] = i3.HMirror()+ i3.Translation(translation=(-self.chip_length*(3/4)-self.couplingWG_l, -(self.n+0.5)*counter*sx))
                #d['OutPort' + str(counter)] = i3.Rotation(rotation=90) + i3.Translation(translation=((op[0]-ip[0])/2+2*self.R+(((self.n+0.5)*counter+self.width)*sx/4), self.chip_length*(3/4)+(self.width+counter-(((counter+1)-1.0)%self.lengths))*sx))
                if self.tipo == 2:
                    sx = 100
                    #d['Spiral' + str(counter)] = i3.Translation(translation=(-(op[0]-ip[0])/2, -(self.n+1)*counter*sx))
                    a = 7.0
                    print 'increment of length between waveguides of same width: ', (
                        self.n + a) * 1 * sx + ((self.n + a) * 1 + 0) * sx
                    print 'increment of length between waveguides of same length group: ', (
                        self.n + a) * 0 * sx + (
                            (self.n + a) * 0 + self.width) * sx

                    d['InPort' + str(counter)] = i3.HMirror() + i3.Translation(
                        translation=(0.0 - self.chip_length * 0.5,
                                     -(self.n + a) * counter * sx))
                    d['OutPort' + str(counter)] = i3.Rotation(
                        rotation=90) + i3.Translation(translation=(
                            (((self.n + a) * counter + self.width) * sx),
                            self.chip_length * 0.5 +
                            (self.width + counter -
                             (((counter + 1) - 1.0) % self.lengths)) * sx))

            return d
示例#5
0
 def _default_child_transformations(self):
     child_transformations = {"MMI1b": (1300, 0),
                              "WGup": (0, 4000),
                              "WGuptaper": (0, 4000),
                              "WGdown": (0, -4000),
                              "WGdowntaper": (0, -4000),
                              "WGuptaper2": i3.HMirror() + i3.Translation((3300, 2000)),
                              "WGdowntaper2": i3.HMirror() + i3.Translation((3300, -6000)),
                              "WGup2": (3150, 2000),
                              "WGdown2": (3150, -6000)}
     return child_transformations
 def _default_child_transformations(self):
     return {
         "spl1": (0.0, 0.0),
         "grin": (-200, -200),
         "grout1":
         i3.HMirror() + i3.Translation(translation=(600, +150)),
         "grout2":
         i3.HMirror() + i3.Translation(translation=(600, -100)),
         "bp1": (300, 0),
         "bp2": (500, 150),
         "bp3": (-100, -100)
     }
示例#7
0
        def _default_child_transformations(self):
            trans = dict()
            column = 6000
            trans['ring0'] = (1300, 0)
            trans['ring1'] = (1300, 8000 + 0 * column)
            trans['ring2'] = (1300, 8000 + 1 * column )
            trans['ring3'] = (1300, 8000 + 2 * column )

            trans["taper0"] = (0, 4000)
            trans["taper1"] = (0, -4000)
            trans["taper2"] = i3.HMirror(0) + i3.Translation((3000, 2500))
            trans["taper3"] = i3.HMirror(0) + i3.Translation((3000, -2500))

            trans["taper4"] = (0, 8000)
            trans["taper5"] = i3.HMirror(0) + i3.Translation((3000, 6500))
            trans["taper6"] = i3.HMirror(0) + i3.Translation((3000, 9500))

            trans["taper7"] = (0, 8000+ 1 * column )
            trans["taper8"] = i3.HMirror(0) + i3.Translation((3000, 6500+ 1 * column ))
            trans["taper9"] = i3.HMirror(0) + i3.Translation((3000, 9500+ 1 * column ))

            trans["taper10"] = (0, 8000+ 2 * column)
            trans["taper11"] = i3.HMirror(0) + i3.Translation((3000, 6500+ 2 * column))
            trans["taper12"] = i3.HMirror(0) + i3.Translation((3000, 9500+ 2 * column))


            return trans
示例#8
0
 def _default_child_transformations(self):
     trans = dict()
     trans["spiral"] = (-self._spiral_in_out_distance(), 0.0)
     trans["wg_right"] = (0.0, 0.0)
     trans["taper_right"] = i3.Translation((self.right_wg_length, 0))
     trans["expanded_wg_right"] = i3.Translation(
         (self.right_wg_length + self.taper_length, 0))
     trans["wg_left"] = i3.HMirror(mirror_plane_x=0.0) + i3.Translation(
         (-self._spiral_in_out_distance(), 0))
     trans["taper_left"] = i3.HMirror(
         mirror_plane_x=0.0) + i3.Translation((-self.spiral_width, 0))
     trans["expanded_wg_left"] = i3.HMirror(
         mirror_plane_x=0.0) + i3.Translation(
             (-self.spiral_width - self.taper_length, 0))
     return trans
示例#9
0
        def _default_child_transformations(self):
            # print self.cell.mmi1_12.get_default_view(i3.LayoutView).length
            # print self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['in1'].x
            # print self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['out'].x
            # a = self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['out'].x - self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['in1'].x
            a = self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['out'].x
            child_transformations = {"MMI1a": (a + 490, 0),
                                     "taper": (a, 0),
                                     "taper2": i3.HMirror(0.0) + i3.Translation((a + 490, 0))
                                     # "WGup": (0, 4000),
                                     # "WGuptaper": (0, 4000),
                                     # "WGdown": (0, -4000),
                                     # "WGdowntaper": (0, -4000),
                                     # "WGuptaper2": i3.HMirror() + i3.Translation((3400, 4000)),
                                     # "WGdowntaper2": i3.HMirror() + i3.Translation((3400, -4000)),
                                     # "WGup2": (3250, 4000),
                                     # "WGdown2": (3250, -4000)
                                     }
            return child_transformations


# mmi1 = MMI2112()
# mmi1_layout = mmi1.Layout(length=120)
# mmi1_layout.visualize(annotate=True)
# print mmi1_layout.ports
# mmi1_layout.write_gdsii("MMI2112_V5.gds")
示例#10
0
        def _default_child_transformations(self):
            a = self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['out'].x
            child_transformations = {"MMI1a": (a + 490, 0),
                                     "taper": (a, 0),
                                     "taper2": i3.HMirror(0.0) + i3.Translation((a + 490, 0))

                                     }
            return child_transformations
示例#11
0
        def _default_child_transformations(self):
            trans = dict()
            column = 10000
            # trans["dircoup1"] = (1650, 0)
            # trans["dircoup2"] = (4950, 0)
            # trans['mzi_22_22_0'] = (0, 0)
            trans['ring0'] = (1500, 0)
            # trans['ring1'] = (2500, 0 + column)
            # trans['ring2'] = (2500, 0 + 2 * column)
            # trans['ring3'] = (1500, 0 + 3 * column)

            trans["taper0"] = (0, 4000)
            trans["taper1"] = (0, -4000)
            trans["taper2"] = i3.HMirror(0) + i3.Translation((4000, 2500))
            trans["taper3"] = i3.HMirror(0) + i3.Translation((4000, -2500))

            return trans
示例#12
0
        def _default_child_transformations(self):
            trans = dict()

            trans["spiral"] = (-self._spiral_in_out_distance(), 0.0)
            trans["wg_right"] = (0.0, 0.0)
            trans["taper_right"] = i3.Translation((self.right_wg_length, 0))

            start_x_expanded_wg_right = self.right_wg_length + self.taper_length
            trans["expanded_wg_right"] = i3.Translation(
                (start_x_expanded_wg_right, 0))

            start_x_taper_wg_SM2expanded_wg_right = start_x_expanded_wg_right + self.expanded_wg_length
            trans["taper_expanded_wg2wg_SM_right"] = i3.Translation(
                (start_x_taper_wg_SM2expanded_wg_right, 0.0))

            start_x_wg_SM_right = start_x_taper_wg_SM2expanded_wg_right + self.taper_length
            trans["wg_SM_right"] = i3.Translation((start_x_wg_SM_right, 0.0))

            start_x_gc_taper_right = start_x_wg_SM_right + self.wg_SM_length
            trans["gc_taper_right"] = i3.Translation(
                (start_x_gc_taper_right, 0))

            start_x_gc_slab_right = start_x_gc_taper_right + self.gc_taper_length
            trans["gc_slab_right"] = i3.Translation((start_x_gc_slab_right, 0))

            trans["wg_left"] = i3.HMirror(mirror_plane_x=0.0) + i3.Translation(
                (-self._spiral_in_out_distance(), 0))

            trans["taper_left"] = i3.HMirror(
                mirror_plane_x=0.0) + i3.Translation((-self.spiral_width, 0))

            start_x_expanded_wg_left = -self.spiral_width - self.taper_length
            trans["expanded_wg_left"] = i3.HMirror(
                mirror_plane_x=0.0) + i3.Translation(
                    (start_x_expanded_wg_left, 0))

            start_x_taper_expanded_wg2wg_SM_left = start_x_expanded_wg_left - self.expanded_wg_length
            trans["taper_expanded_wg2wg_SM_left"] = i3.HMirror(
                mirror_plane_x=0.0) + i3.Translation(
                    (start_x_taper_expanded_wg2wg_SM_left, 0))

            start_x_wg_SM_left = start_x_taper_expanded_wg2wg_SM_left - self.taper_length
            trans["wg_SM_left"] = i3.HMirror(
                mirror_plane_x=0.0) + i3.Translation((start_x_wg_SM_left, 0))

            start_x_gc_taper_left = start_x_wg_SM_left - self.wg_SM_length
            trans["gc_taper_left"] = i3.HMirror(
                mirror_plane_x=0.0) + i3.Translation(
                    (start_x_gc_taper_left, 0))

            start_x_gc_slab_left = start_x_gc_taper_left - self.gc_taper_length
            trans["gc_slab_left"] = i3.HMirror(
                mirror_plane_x=0.0) + i3.Translation((start_x_gc_slab_left, 0))
            return trans
示例#13
0
 def _default_child_transformations(self):
     child_transformations = {
         # "MMI1b": (1300, 0),
         # "WGup": (0, 4000),
         # "WGuptaper": (0, 4000),
         # "WGdown": (0, -4000),
         # "WGdowntaper": (0, -4000),
         # "WGuptaper2": i3.HMirror() + i3.Translation((3000, 2000)),
         # "WGdowntaper2": i3.HMirror() + i3.Translation((3000, -6000)),
         # "WGup2": (2850, 2000),
         # "WGdown2": (2850, -6000),
         "dummy1": (1300, -300),
         "DWGup": (0, 20750),
         "DWGuptaper": (0, 20750),
         "DWGdown": (0, -4150),
         "DWGdowntaper": (0, -4150),
         "DWGuptaper2": i3.HMirror() + i3.Translation((3000, 20750)),
         "DWGdowntaper2": i3.HMirror() + i3.Translation((3000, -6150)),
         "DWGup2": (2850, 20750),
         "DWGdown2": (2850, -6150)
     }
     return child_transformations
示例#14
0
文件: mzm.py 项目: mberard/AEPONYX
 def _default_child_transformations(self):
     return {
         'splitter': (-(self.spacing_x / 2), 0),
         'combiner':
         i3.HMirror() + i3.Translation((self.spacing_x / 2, 0)),
         'modulator1':
         i3.VMirror() +
         i3.Translation(translation=(-self.length_modulator / 2.0,
                                     -self.spacing_y / 2)),
         'modulator2':
         i3.Translation(
             (-self.length_modulator / 2.0, self.spacing_y / 2)),
     }
示例#15
0
        def _default_child_transformations(self):
            trans = dict()
            column = 4500
            # trans["dircoup1"] = (1650, 0)
            # trans["dircoup2"] = (4950, 0)
            # trans['mzi_22_22_0'] = (0, 0)
            trans['ring0'] = (1500, -3000)
            trans['ring4'] = (1500, -3000 + 2 * column)
            trans['ring1'] = (1500, -300)
            trans['ring5'] = (1500, -300 + 2 * column)

            trans['ring2'] = (1500, -3000 + column)
            trans['ring6'] = (1500, -3000 + 3 * column)
            trans['ring3'] = (1500, -300 + column)
            trans['ring7'] = (1500, -300 + 3 * column)

            trans["taper0"] = (0, -2100)
            trans["taper1"] = (0, -3850)
            trans["taper2"] = i3.HMirror(0) + i3.Translation((3000, -1500))
            trans["taper3"] = i3.Translation((0, -4000))
            trans["taper4"] = (0, -1950)
            trans["taper5"] = i3.HMirror(0) + i3.Translation((3000, -1350))

            trans["taper6"] = (0, -2100 + column)
            trans["taper7"] = (0, -3850 + column)
            trans["taper8"] = i3.HMirror(0) + i3.Translation(
                (3000, -1500 + column))
            trans["taper9"] = i3.Translation((0, -4000 + column))
            trans["taper10"] = (0, -1950 + column)
            trans["taper11"] = i3.HMirror(0) + i3.Translation(
                (3000, -1350 + column))
            trans["taper12"] = (0, -2100 + 2 * column)
            trans["taper13"] = (0, -3850 + 2 * column)
            trans["taper14"] = i3.HMirror(0) + i3.Translation(
                (3000, -1500 + 2 * column))
            trans["taper15"] = i3.Translation((0, -4000 + 2 * column))
            trans["taper16"] = (0, -1950 + 2 * column)
            trans["taper17"] = i3.HMirror(0) + i3.Translation(
                (3000, -1350 + 2 * column))
            trans["taper18"] = (0, -2100 + 3 * column)
            trans["taper19"] = (0, -3850 + 3 * column)
            trans["taper20"] = i3.HMirror(0) + i3.Translation(
                (3000, -1500 + 3 * column))
            trans["taper21"] = i3.Translation((0, -4000 + 3 * column))
            trans["taper22"] = (0, -1950 + 3 * column)
            trans["taper23"] = i3.HMirror(0) + i3.Translation(
                (3000, -1350 + 3 * column))

            return trans
示例#16
0
 def _generate_instances(self, insts):
     for cnt, mmi in enumerate(self.mmis):
         si = mmi.size_info()
         t = i3.Translation(translation=(0, cnt * self.mmi_sep))
         if cnt % 2 == 0:
             transformation = i3.HMirror(
                 mirror_plane_x=si.center[0]) + t
         else:
             transformation = t
         insts += i3.SRef(name="mmi_{}".format(cnt),
                          reference=mmi,
                          transformation=transformation)
     return insts
示例#17
0
        def _generate_ports(self, ports):

            ports = super(DropRingAtWavelength.Layout,
                          self)._generate_ports(ports)
            port_loc = i3.Coord2(
                (-self.directional_coupler.coupler_length / 2.0 -
                 self.width_m1 / 2.0, 0.0))
            pin = i3.ElectricalPort(process=self.layer_heater.process,
                                    name="el_in",
                                    position=port_loc)
            ports += pin
            ports += pin.transform_copy(
                transformation=i3.HMirror()).modified_copy(name="el_out")

            return ports
示例#18
0
文件: cell.py 项目: mberard/AEPONYX
        def _default_child_transformations(self):
            offset_x = self.modulator_length / 2.
            delta = self.delta
            delay = self.delay

            return {
                'splitter':
                i3.Translation((-(50. + offset_x), 0.)),
                'arm1':
                i3.Translation((-offset_x, -delta + (delay / 2. if
                                                     (delay < 0) else 0.))),
                'arm2':
                i3.Translation((-offset_x, delta + (delay / 2. if
                                                    (delay >= 0) else 0.))),
                'combiner':
                i3.HMirror(0.) + i3.Translation((50. + offset_x, 0.))
            }
		def _default_child_transformations(self):
			d={}
			position=0
			for counter, child  in enumerate(self.Grating_list):
				
				d['pillar{}'.format(counter)] = i3.Translation(translation=(position, 0.0))
				position=position+self.Lo[counter]+self.Le[counter]
				print 'pillar position: ', position
				print 'counter= ', counter
				print 'Lo: ', self.Lo[counter]
				print 'Le: ', self.Le[counter]
				
			#d['InPort'] = i3.HMirror()+ i3.Translation(translation=(position+10,0))
			d['InPort'] = i3.HMirror()+ i3.Translation(translation=(self.coupling_l+self.socket_length,0))
			d['OutPort'] = i3.Translation(translation=(-50,0.0))
												   
			return d			
示例#20
0
        def _default_child_transformations(self):
            trans = dict()
            row = 3000
            trans["CHILD0"] = (0, 0)
            trans["CHILD1"] = i3.HMirror(2500) - i3.Translation((5000, 0))
            trans['CHILD2'] = (-15000, -5000)
            trans['CHILD3'] = (-15000, 0)
            trans['CHILD4'] = (-15000, 2000 + row * 1)
            trans['CHILD5'] = (-15000, 2000 + row * 2)
            trans['CHILD6'] = (-15000, 2000 + row * 3)
            trans['CHILD7'] = (-15000, 2000 + row * 4)
            trans['CHILD8'] = (-15000, 2000 + row * 5)
            trans['CHILD9'] = (-15000, 2000 + row * 6)
            trans['CHILD10'] = i3.Rotation(rotation=180) + i3.Translation(
                (15000, 0))
            trans['CHILD11'] = i3.Rotation(rotation=180) + i3.Translation(
                (15000, 5000))
            trans['CHILD12'] = i3.Rotation(rotation=180) + i3.Translation(
                (15000, 5000 + row * 1))
            trans['CHILD13'] = i3.Rotation(rotation=180) + i3.Translation(
                (15000, 5000 + row * 2))
            trans['CHILD14'] = i3.Rotation(rotation=180) + i3.Translation(
                (15000, 5000 + row * 3))
            trans['CHILD15'] = i3.Rotation(rotation=180) + i3.Translation(
                (15000, 5000 + row * 4))
            trans['CHILD16'] = i3.Rotation(rotation=180) + i3.Translation(
                (15000, 5000 + row * 5))
            trans['CHILD17'] = i3.Rotation(rotation=180) + i3.Translation(
                (15000, 5000 + row * 6))

            # trans['CHILD14'] = (-15000, 0 + row * -1)
            # trans['CHILD15'] = (-15000, 0 + row * 0)
            # trans['CHILD16'] = (-15000, 0 + row * 1)
            # trans['CHILD17'] = (-15000, 0 + row * 2)
            # trans['CHILD18'] = (-15000, 0 + row * 3)
            # trans['CHILD19'] = (-15000, 0 + row * 4)
            # trans['CHILD20'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 0))
            # trans['CHILD21'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 1))
            # trans['CHILD22'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 2))
            # trans['CHILD23'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 3))
            # trans['CHILD24'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 4))
            # trans['CHILD25'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 5))

            return trans
示例#21
0
 def _default_child_transformations(self):
     # print self.cell.mmi1_12.get_default_view(i3.LayoutView).length
     # print self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['in1'].x
     # print self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['out'].x
     # a = self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['out'].x - self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['in1'].x
     a = self.cell.mmi1_21.get_default_view(i3.LayoutView).ports['out'].x
     child_transformations = {"MMI1a": (a + 490, 0),
                              "taper": (a, 0),
                              "taper2": i3.HMirror(0.0) + i3.Translation((a + 490, 0))
                              # "WGup": (0, 4000),
                              # "WGuptaper": (0, 4000),
                              # "WGdown": (0, -4000),
                              # "WGdowntaper": (0, -4000),
                              # "WGuptaper2": i3.HMirror() + i3.Translation((3400, 4000)),
                              # "WGdowntaper2": i3.HMirror() + i3.Translation((3400, -4000)),
                              # "WGup2": (3250, 4000),
                              # "WGdown2": (3250, -4000)
                              }
     return child_transformations
示例#22
0
        def _generate_elements(self, elems):

            elems = super(DropRingAtWavelength.Layout,
                          self)._generate_elements(elems)

            r = self.directional_coupler.bend_radius
            dcl = self.directional_coupler.coupler_length

            # Metal 1
            ring_s = i3.RingSegment(layer=self.layer_heater,
                                    center=(-dcl / 2.0, r),
                                    angle_start=180,
                                    angle_end=270,
                                    inner_radius=r - self.width_m1 / 2.0,
                                    outer_radius=r + self.width_m1 / 2.0)

            elems += ring_s
            trans = [
                i3.HMirror(),
                i3.VMirror(mirror_plane_y=self._get_distance_between_dc() /
                           2.0)
            ]
            trans.append(trans[0] + trans[1])
            for t in trans:
                elems += ring_s.transform_copy(t)

            straights = i3.Path(layer=self.layer_heater,
                                shape=[(-r - dcl / 2.0, r),
                                       (-r - dcl / 2.0,
                                        self._get_distance_between_dc() - r)],
                                line_width=self.width_m1)

            elems += straights
            elems += straights.transform_copy(trans[0])

            top = i3.Path(layer=self.layer_heater,
                          shape=[(-dcl / 2.0, self._get_distance_between_dc()),
                                 (dcl / 2.0, self._get_distance_between_dc())],
                          line_width=self.width_m1)

            elems += top
            return elems
示例#23
0
        def _default_child_transformations(self):
            d = {}
            for counter, child in enumerate(self.child_cells):
                # We get the layoutview of the childcell
                spiral = self.child_cells[child].get_default_view(self)
                isz_0 = spiral.instances['Spiral0'].reference.inner_size
                sx = isz_0[1] + 200
                print 'sx = ', sx
                #print("inner_size = {}".format(isz_0, isz_1))

                number = self.n
                if self.tipo == 1:
                    d['Spirals' + str(counter)] = i3.Translation(
                        translation=(0.0, (counter) *
                                     sx))  #+i3.HMirror()+i3.VMirror()
                if self.tipo == 2:
                    d['Spirals' + str(counter)] = i3.Translation(translation=(
                        0.0, -(counter) * sx)) + i3.HMirror() + i3.VMirror()

            return d
        def _generate_instances(self, insts):
            # includes the get components and the waveguides
            the_rings = self._get_components()
            insts += the_rings
            wg_in_layout, wg_pass_layout = self.wgs  #  wg_pass_layout, wg_ring_layout
            insts += i3.SRef(reference=wg_in_layout, name="wg_in")

            # ok so now I grab the last ring from the rings and use it to determine its position
            last_ring = the_rings[-1]
            east_side_ring = last_ring.size_info().east

            # and I get the waveguide properties for ring and coupler, to give correct outside gap
            ring_core_width = self.wg_ring_template.core_width
            ring_clad_width = self.wg_ring_template.cladding_width

            bus_wg_core_width = self.wg_coupler_template.core_width
            bus_wg_clad_width = self.wg_coupler_template.cladding_width

            final_x_spot = (east_side_ring - ring_clad_width/2.) + ring_core_width/2. \
                           + self.external_gap + bus_wg_core_width/2.

            # rather than making a new waveguide we can mirror the previous structure into the final position
            # thus we need to determine the difference in the core position of the original structure
            # with the *negative* position of the final x position, and then the mirror will flip it around
            bus_core_pos = wg_in_layout.size_info(
            ).east - bus_wg_clad_width / 2.

            # now we translate the original structure to the desired negative position, and horizontally mirror around 0
            output_transformation = i3.HMirror() + i3.Translation(
                (-1. * (-final_x_spot - bus_core_pos), 0.))

            # finally we perform the SRef on the previous layout and transform it with a new name
            insts += i3.SRef(reference=wg_in_layout,
                             name="wg_out",
                             transformation=output_transformation)

            return insts
示例#25
0
        def _default_child_transformations(self):
            trans = dict()
            row = 5000
            trans["CHILD0"] = (0, 0)  #MMI
            trans["CHILD1"] = i3.HMirror(2500) - i3.Translation(
                (5000, 0))  #MMI
            trans["CHILD2"] = i3.HMirror(0) + i3.Translation((20000, 0))  # MMI
            trans["CHILD3"] = i3.Translation((16000, 10000))  # MMI
            trans['CHILD4'] = i3.VMirror(0) + i3.Translation(
                (16000, 20000))  #MMI

            trans['CHIL0'] = (-16000, -4000 + row * 0)
            trans['CHIL1'] = (-16000, -4000 + row * 1)
            trans['CHIL2'] = (-16000, -4000 + row * 2)
            trans['CHIL3'] = (-16000, -4000 + row * 3)
            trans['CHIL4'] = (-16000, -4000 + row * 4)
            trans['CHIL5'] = (-16000, -4000 + row * 5)
            trans['CHIL6'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 0))
            trans['CHIL7'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 1))
            trans['CHIL8'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 2))
            trans['CHIL9'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 3))
            trans['CHIL10'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 4))
            trans['CHIL11'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 5))
            trans['CHIL12'] = (4000, -4000 + row * 0)
            trans['CHIL13'] = (4000, -4000 + row * 1)
            trans['CHIL14'] = (4000, -4000 + row * 2)
            trans['CHIL15'] = (4000, -4000 + row * 3)
            trans['CHIL16'] = (4000, -4000 + row * 4)
            trans['CHIL17'] = (4000, -4000 + row * 5)

            trans['CHIL18'] = (-16000, -4000 + row * 0)
            trans['CHIL19'] = (-16000, -4000 + row * 1)
            trans['CHIL20'] = (-16000, -4000 + row * 2)
            trans['CHIL21'] = (-16000, -4000 + row * 3)
            trans['CHIL22'] = (-16000, -4000 + row * 4)
            trans['CHIL23'] = (-16000, -4000 + row * 5)
            trans['CHIL24'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 0))
            trans['CHIL25'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 1))
            trans['CHIL26'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 2))
            trans['CHIL27'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 3))
            trans['CHIL28'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 4))
            trans['CHIL29'] = i3.Rotation(rotation=180) + i3.Translation(
                (16000, -1000 + row * 5))

            # for _ in np.arange(10):
            #     trans['CHIL{}'.format(_)] = NotImplemented
            for _ in range(30, 36, 1):
                trans['CHIL{}'.format(_)] = (4000, -4000 + row * (_ - 30))
            # trans['CHIL30'] = (4000, -4000 + row * 0)
            # trans['CHIL31'] = (4000, -4000 + row * 1)
            # trans['CHIL32'] = (4000, -4000 + row * 2)
            # trans['CHIL33'] = (4000, -4000 + row * 3)
            # trans['CHIL34'] = (4000, -4000 + row * 4)
            # trans['CHIL35'] = (4000, -4000 + row * 5)
            # trans['CHILD23'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 0))
            # trans['CHILD24'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 1))
            # trans['CHILD25'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 2))
            # trans['CHILD26'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 3))
            # trans['CHILD27'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 4))
            # trans['CHILD28'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 5))
            # trans['CHILD29'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 6))

            # trans['CHILD32'] = (-14500, -3000 + row * 0)
            # trans['CHILD33'] = (-14500, -3000 + row * 1)
            # trans['CHILD34'] = (-14500, -3000 + row * 2)
            # trans['CHILD35'] = (-14500, -3000 + row * 3)
            # trans['CHILD36'] = (-14500, -3000 + row * 4)
            # trans['CHILD37'] = (-14500, -3000 + row * 5)
            # trans['CHILD38'] = (-14500, -3000 + row * 6)
            # trans['CHILD39'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 0))
            # trans['CHILD40'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 1))
            # trans['CHILD41'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 2))
            # trans['CHILD42'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 3))
            # trans['CHILD43'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 4))
            # trans['CHILD44'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 5))
            # trans['CHILD45'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 6))
            # trans['CHILD46'] = (-2500, -3000 + row * 0)
            # trans['CHILD47'] = (-2500, -3000 + row * 1)
            # trans['CHILD48'] = (-2500, -3000 + row * 2)
            # trans['CHILD49'] = (-2500, -3000 + row * 3)
            # trans['CHILD50'] = (-2500, -3000 + row * 4)
            # trans['CHILD51'] = (-2500, -3000 + row * 5)
            # trans['CHILD52'] = (-2500, -3000 + row * 6)
            # trans['CHILD53'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 0))
            # trans['CHILD54'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 1))
            # trans['CHILD55'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 2))
            # trans['CHILD56'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 3))
            # trans['CHILD57'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 4))
            # trans['CHILD58'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 5))
            # trans['CHILD59'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 6))
            #
            # trans['CHILD60'] = (-14500, -3000 + row * 0)
            # trans['CHILD61'] = (-14500, -3000 + row * 1)
            # trans['CHILD62'] = (-14500, -3000 + row * 2)
            # trans['CHILD63'] = (-14500, -3000 + row * 3)
            # trans['CHILD64'] = (-14500, -3000 + row * 4)
            # trans['CHILD65'] = (-14500, -3000 + row * 5)
            # trans['CHILD66'] = (-14500, -3000 + row * 6)
            # trans['CHILD67'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 0))
            # trans['CHILD68'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 1))
            # trans['CHILD69'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 2))
            # trans['CHILD70'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 3))
            # trans['CHILD71'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 4))
            # trans['CHILD72'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 5))
            # trans['CHILD73'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 6))
            # trans['CHILD74'] = (-2500, -3000 + row * 0)
            # trans['CHILD75'] = (-2500, -3000 + row * 1)
            # trans['CHILD76'] = (-2500, -3000 + row * 2)
            # trans['CHILD77'] = (-2500, -3000 + row * 3)
            # trans['CHILD78'] = (-2500, -3000 + row * 4)
            # trans['CHILD79'] = (-2500, -3000 + row * 5)
            # trans['CHILD80'] = (-2500, -3000 + row * 6)
            # trans['CHILD81'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 0))
            # trans['CHILD82'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 1))
            # trans['CHILD83'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 2))
            # trans['CHILD84'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 3))
            # trans['CHILD85'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 4))
            # trans['CHILD86'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 5))
            # trans['CHILD87'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 6))
            return trans
示例#26
0
# mmmi1_layout.write_gdsii("MMI2112_V4_2.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})
示例#27
0
            }
            return child_transformations

        def _default_bend_radius(self):
            bend_radius = 300
            return bend_radius


mmmi1 = v6(name="PP1")
mmmi1_layout = mmmi1.Layout(length2=92)
mmmi2 = v6(name="PP2")
mmmi2_layout = mmmi2.Layout(length2=97)
mmmi3 = v6(name="PP3")
mmmi3_layout = mmmi3.Layout(length2=102)

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) + i3.Translation((3300, 0)),
        "cell_2": i3.Translation((3300, 0)),
        "cell_3": i3.HMirror(0.0) + i3.Translation((9900, 0))
    })

prr_layout.visualize(annotate=True)
prr_layout.write_gdsii("2_2_MMI2112_V6_line_20.gds")
示例#28
0
# 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")
示例#29
0
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")
示例#30
0
		def _default_child_transformations(self):
			d={}
			a=2.2
			for counter, child in enumerate(self.MZI_22_22_list):
				if self.tipo==1:
					d['mzi_22_22_' + str(counter)] = i3.Translation(translation=((-1)**counter*2*self.R,counter*5*self.R))
					d['InPort1_' + str(counter)] = i3.HMirror()+i3.Translation(translation=(-self.chip_length*0.5, counter*5*self.R-2.2*self.R))
					d['OutPort1_' + str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5, counter*5*self.R-2.2*self.R))
					d['InPort2_' + str(counter)] = i3.HMirror()+i3.Translation(translation=(-self.chip_length*0.5, counter*5*self.R+2.2*self.R))
					d['OutPort2_' + str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5, counter*5*self.R+2.2*self.R))                    
					print 'transformation ' +str(counter) + ' is ' +str(d)
				if self.tipo==2:
					#l_coupling=self.child_cells['Coupler'].l_coupling
					#radius=self.child_cells['Coupler'].local_bend_radius
					print 'R= ',self.R
					#print 'translation port: '
					
					
					##For w=20
					d['mzi_22_22_' + str(counter)] = i3.Translation(translation=(counter*850+1200+1000+200,-counter*5*self.R))
					d['InPort1_'+ str(counter)] = i3.HMirror()+i3.Translation(translation=(1500, -5*self.R*counter-a*self.R))
					d['OutPort1_'+ str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+counter*50+counter*4*self.R+a*self.R-100, self.R*a))
					d['InPort2_'+ str(counter)] = i3.HMirror()+i3.Translation(translation=(1500, -5*self.R*counter+a*self.R))
					d['OutPort2_'+ str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+counter*50+counter*4*self.R-100, self.R*a)) 
					
				d['InPortWG1'] = i3.HMirror()+i3.Translation(translation=(1500, 1000.0))
				d['OutPortWG1']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5-500, self.R*a))
				d['InPortWG2'] = i3.HMirror()+i3.Translation(translation=(1500, -3400+670))
				d['OutPortWG2']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+2500, self.R*a))				
				d['InPortWG3'] = i3.HMirror()+i3.Translation(translation=(1500, -6500))
				d['OutPortWG3']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+5600, self.R*a))				
									
				#d['mzi_22_22_' + str(counter)] = i3.Translation(translation=(counter*850+1200+1000+200,-counter*5*self.R))
				#d['InPort1_'+ str(counter)] = i3.HMirror()+i3.Translation(translation=(1500, -5*self.R*counter-a*self.R))
				#d['OutPort1_'+ str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+1100+counter*50+counter*4*self.R+a*self.R-100, self.R*a))
				#d['InPort2_'+ str(counter)] = i3.HMirror()+i3.Translation(translation=(1500, -5*self.R*counter+a*self.R))
				#d['OutPort2_'+ str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+1100+counter*50+counter*4*self.R-100, self.R*a)) 
				
				#d['InPortWG1'] = i3.HMirror()+i3.Translation(translation=(1500, 1000.0))
				#d['OutPortWG1']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5-500+1200, self.R*a))
				#d['InPortWG2'] = i3.HMirror()+i3.Translation(translation=(1500, -3400+670))
				#d['OutPortWG2']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+2500+1100, self.R*a))				
				#d['InPortWG3'] = i3.HMirror()+i3.Translation(translation=(1500, -6500))
				#d['OutPortWG3']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+5600+1400, self.R*a))					
				################
			for counter2, child in enumerate(self.MZI_12_22_list):
				if self.tipo==1:
					
					d['mzi_12_22_' + str(counter+1+counter2)] = i3.Translation(translation=((-1)**counter2*2*self.R-self.length_22+counter*50+counter*4*self.R,(counter+1+counter2)*5*self.R))
					d['InPort_' + str(counter+1+counter2)] = i3.HMirror()+i3.Translation(translation=(-self.chip_length*0.5, (counter+1+counter2)*5*self.R))
					d['OutPort1_' + str(counter+1+counter2)]= i3.Translation(translation=(self.chip_length*0.5-self.bend_radius*counter*0.2-a*self.R-550, (counter+1+counter2)*5*self.R-2.2*self.R))
					d['OutPort2_' + str(counter+1+counter2)]= i3.Translation(translation=(self.chip_length*0.5-self.bend_radius*counter*0.2-550, (counter+1+counter2)*5*self.R+2.2*self.R))
				if self.tipo==2:
					#l_coupling=self.child_cells['Coupler'].l_coupling
					#radius=self.child_cells['Coupler'].local_bend_radius
					print 'R= ',self.R
					a=2.2
					b=500
					d['mzi_12_22_'+ str(counter+1+counter2)] = i3.Translation(translation=((counter+2+counter2)*850+1200+200+580,-(counter+1+counter2)*5*self.R-b))
					d['InPort_'+ str(counter+1+counter2)] = i3.HMirror()+i3.Translation(translation=(1500, -(5*self.R)*(counter+1+counter2)-b))
					d['OutPort1_'+ str(counter+1+counter2)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+(counter+1+counter2)*50+a*self.R+(counter+1+counter2)*4*self.R+b, self.R*a))
					d['OutPort2_'+ str(counter+1+counter2)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+(counter+1+counter2)*50+(counter+1+counter2)*4*self.R+b,self.R*a)) 
					
					#d['mzi_12_22_'+ str(counter+1+counter2)] = i3.Translation(translation=((counter+2+counter2)*850+1200+200+580+1000,-(counter+1+counter2)*5*self.R-b))
					#d['InPort_'+ str(counter+1+counter2)] = i3.HMirror()+i3.Translation(translation=(1500, -(5*self.R)*(counter+1+counter2)-b))
					#d['OutPort1_'+ str(counter+1+counter2)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+1200+(counter+1+counter2)*50+a*self.R+(counter+1+counter2)*4*self.R+b, self.R*a))
					#d['OutPort2_'+ str(counter+1+counter2)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+1200+(counter+1+counter2)*50+(counter+1+counter2)*4*self.R+b,self.R*a)) 							
			################
			print '__________________________'    
			print "Last layout child cell done" 
			print d
			print '_ _ _ _ _ _ _ _ _ _ _ _ _ '
			return d