def __init__(self, origin, params, trans_in=None): self.params = params self.a = params[0] self.b = params[1] self.jos1_b = params[2] self.jos1_a = params[3] self.f1 = params[4] self.d1 = params[5] self.jos2_b = params[6] self.jos2_a = params[7] self.f2 = params[8] self.d2 = params[9] self.w = params[10] self.dCap = params[11] self.gap = params[12] self.square_a = params[13] self.dSquares = params[14] self.alum_over = params[15] self.B1_width = params[16] # calculated parameters self.B2_width = self.a + self.jos1_a / 2 - self.jos2_a / 2 - self.w self.qbit_width = 2 * self.w + self.B2_width self.B3_width = self.b - self.jos2_a / 2 - self.jos1_a / 2 - 2 * self.w self.B1_height = (self.dSquares - 2 * self.w - self.b) / 2 self._alpha_1 = 0.5 self._length1 = (self.b + 2 * self.w + self.jos1_b) self._alpha_2 = 0.5 self._length2 = (self.b + 2 * self.w - 2 * self.f2 - self.jos2_b ) #length self._length_right = (self.b + 2 * self.w - 2 * self.jos2_b) / 3 self.p0 = DPoint(0, 0) self.p1 = self.p0 - DPoint(0, self.dCap + self.square_a) self.p2 = self.p1 + DPoint(self.square_a / 2 - self.qbit_width / 2, -(self.dCap + self.B1_height)) self.p3 = self.p2 + DPoint(self.qbit_width - self.w, 0) self.p4 = self.p2 + DPoint(self.w, -self.w) self.p5 = self.p3 + DPoint(2 * self.w + self.jos2_a, -(2 * self._length_right + 2 * self.jos2_b)) self.p6 = self.p3 - DPoint(0, self.b + 2 * self.w) self.p7 = self.p6 - DPoint(self.B3_width, 0) self.p8 = self.p7 - DPoint(self.w, self.B1_height) self.p9 = self.p1 - DPoint( 0, self.square_a + self.b + 2 * self.B1_height + 2 * self.w) self.SQ1 = pya.DBox(self.p1, self.p1 + DPoint(self.square_a, self.square_a)) self._B1p1 = self.p2 + DPoint( (self.B2_width + 2 * self.w) / 2 - self.B1_width / 2, 0) self.B1 = pya.DBox( self._B1p1, self._B1p1 + DPoint(self.B1_width, self.B1_height + self.alum_over)) self.B2 = pya.DBox(self.p4, self.p3) self.B3 = pya.DBox(self.p7, self.p7 + DPoint(self.B3_width, self.w)) self._B4p1 = self.p8 + DPoint( (self.B3_width + 2 * self.w) / 2 - self.B1_width / 2, -self.alum_over) self.B4 = pya.DBox( self._B4p1, self._B4p1 + DPoint(self.B1_width, self.B1_height + self.alum_over)) self.SQ2 = pya.DBox(self.p9, self.p9 + DPoint(self.square_a, self.square_a)) self.poly_1 = self._make_polygon(self._length1 * self._alpha_1, self.w, self.d1, self.f1, self.jos1_b) self.poly_1.transform(DCplxTrans(1.0, 270, False, self.p2)) self.poly_2 = self._make_polygon(self._length1 * (1 - self._alpha_1), self.w, self.d1, self.f1, self.jos1_b) self.poly_2.transform(DCplxTrans(1.0, 90, False, self.p7)) self.poly_3 = self._make_polygon(self._length_right + self.jos2_b, self.w, self.d2, self.f2, self.jos2_b) self.poly_3.transform(DCplxTrans(1.0, 270, False, self.p3)) self.poly_4 = self._make_polygon( self._length_right + self.jos2_b - self.f2, self.w, self.d2, self.f2, self.jos2_b) self.poly_4.transform( DCplxTrans( 1.0, 270, True, self.p5 + DPoint(0, self._length_right + self.jos2_b - self.f2))) _poly_tmp = self._make_polygon( self._length_right + self.jos2_b - self.f2, self.w, self.d2, self.f2, self.jos2_b) _poly_tmp.transform( DCplxTrans(1.0, 90, False, self.p5 + DPoint(0, self.jos2_b + self.f2))) _reg_tmp4 = Region() _reg_tmp4.insert(SimplePolygon(self.poly_4)) _reg_tmp = Region() _reg_tmp.insert(SimplePolygon(_poly_tmp)) self._reg_tmp_to_metal = (_reg_tmp + _reg_tmp4).merged() self.poly_5 = self._make_polygon(self._length_right + self.jos2_b, self.w, self.d2, self.f2, self.jos2_b) self.poly_5.transform(DCplxTrans(1.0, 90, True, self.p6)) super().__init__(origin, trans_in)
def init_regions(self): self.metal_regions["bridges_1"] = Region( ) # region with ground contacts self.empty_regions["bridges_1"] = Region() # remains empty self.metal_regions["bridges_2"] = Region() # remains empty self.empty_regions["bridges_2"] = Region( ) # region with erased bridge area center = DPoint(0, 0) self.connections = [center] self.angle_connections = [0] # init metal region of ground touching layer top_gnd_center = center + DPoint( 0, self.gnd2gnd_dy / 2 + self.gnd_touch_dy / 2) p1 = top_gnd_center + DPoint(-self.gnd_touch_dx / 2, -self.gnd_touch_dy / 2) p2 = p1 + DVector(self.gnd_touch_dx, self.gnd_touch_dy) top_gnd_touch_box = pya.DBox(p1, p2) self.metal_regions["bridges_1"].insert( pya.Box().from_dbox(top_gnd_touch_box)) bot_gnd_center = center + DPoint( 0, -(self.gnd2gnd_dy / 2 + self.gnd_touch_dy / 2)) p1 = bot_gnd_center + DPoint(-self.gnd_touch_dx / 2, -self.gnd_touch_dy / 2) p2 = p1 + DVector(self.gnd_touch_dx, self.gnd_touch_dy) bot_gnd_touch_box = pya.DBox(p1, p2) self.metal_regions["bridges_1"].insert( pya.Box().from_dbox(bot_gnd_touch_box)) # init empty region for second layout layer # points start from left-bottom corner and goes in clockwise direction p1 = bot_gnd_touch_box.p1 + DPoint(-self.surround_gap, -self.surround_gap) p2 = p1 + DPoint( 0, self.surround_gap + self.gnd_touch_dy + self.transition_len - self.surround_gap) # top left corner + `surrounding_gap` + `transition_length` p3 = bot_gnd_touch_box.p1 + DPoint(0, bot_gnd_touch_box.height()) + \ DPoint(0, self.transition_len) bl_pts_list = [p1, p2, p3] # bl stands for bottom-left ''' exploiting symmetry of reflection at x and y axes. ''' # reflecting at x-axis tl_pts_list = list(map(lambda x: DTrans.M0 * x, bl_pts_list)) # tl stands for top-left # preserving order tl_pts_list = reversed( list(tl_pts_list)) # preserving clockwise points order # converting iterator to list l_pts_list = list(itertools.chain(bl_pts_list, tl_pts_list)) # l stands for left # reflecting all points at y-axis r_pts_list = list(map(lambda x: DTrans.M90 * x, l_pts_list)) r_pts_list = list( reversed(r_pts_list)) # preserving clockwise points order # gathering points pts_list = l_pts_list + r_pts_list # concatenating proper ordered lists empty_polygon = DSimplePolygon(pts_list) self.empty_regions["bridges_2"].insert( SimplePolygon.from_dpoly(empty_polygon))
def init_regions(self): self.metal_region.insert(SimplePolygon().from_dpoly(self.poly1))