# deduction for resonator placements # under condition that Xmon-Xmon distance equals # `xmon_x_distance` if res_idx == 0: worm_x = 1.2*CHIP.pcb_feedline_d else: worm_x = 1.2*CHIP.pcb_feedline_d + res_idx * xmon_x_distance - \ (L_coupling_list[res_idx] - L_coupling_list[0]) + \ (L1_list[res_idx] - L1_list[0])/2 worm_y = contact_pads[-1].end.y - ro_line_dy - to_line worm = EMResonator_TL2Qbit_worm3_2_XmonFork( Z_res, DPoint(worm_x, worm_y), L_coupling, L0, L1, r, L2, N, fork_x_span, fork_y_span, fork_metal_width, fork_gnd_gap ) xmon_center = (worm.fork_y_cpw1.end + worm.fork_y_cpw2.end) / 2 xmon_center += DPoint(0, -(cross_len + cross_width / 2) + xmon_fork_penetration) xmonCross = XmonCross(xmon_center, cross_width, cross_len, cross_gnd_gap) # translating all objects so that chip.p1 at coordinate origin xmonCross.place(cell, layer_photo) worm.place(tmp_reg) xmonCross_corrected = XmonCross(xmon_center, cross_width, cross_len, xmon_fork_gnd_gap) xmonCross_corrected.place(tmp_reg) # convert region to cell and display it cell.shapes(layer_photo).insert(tmp_reg) lv.zoom_fit() ## DRAWING SECTION END ##
for L1, L2, estimated_freq, to_line in pars: # clear this cell and layer cell.clear() fork_y_span = xmon_fork_penetration + xmon_fork_gnd_gap worm_x = CHIP.dx / 2 - L_coupling / 2 worm = EMResonator_TL2Qbit_worm3_XmonFork(Z_res, DPoint(worm_x, y - to_line), L_coupling, L0, L1, r, L2, N, fork_x_span, fork_y_span, fork_metal_width, fork_gnd_gap) xmon_center = (worm.fork_y_cpw1.end + worm.fork_y_cpw2.end) / 2 xmon_center += DPoint( 0, -(cross_len + cross_width / 2) + xmon_fork_penetration) xmonCross = XmonCross(xmon_center, cross_width, cross_len, cross_gnd_gap) # calculate simulation box dimensions chip_box = pya.Box(DPoint(0, 0), DPoint(CHIP.dx, CHIP.dy)) # placing all objects in proper order and translating them to origin cell.shapes(layer_photo).insert(chip_box) # translating all objects so that chip.p1 at coordinate origin xmonCross.place(cell, layer_photo) worm.place(cell, layer_photo) xmonCross_corrected = XmonCross(xmon_center, cross_width, cross_len, xmon_fork_gnd_gap) xmonCross_corrected.place(cell, layer_photo)
photo_reg = Region() # optimal to place everything in one region for L1, L2, estimated_freq, to_line in list(pars)[:1]: # clear this cell and layer cell.clear() fork_y_span = xmon_fork_penetration + xmon_fork_gnd_gap worm_x = CHIP.dx / 2 - (L_coupling + 2 * r) / 2 + (cross_len + cross_gnd_gap) / 2 worm = EMResonator_TL2Qbit_worm3_1_XmonFork( Z_res, DPoint(worm_x, y - to_line), L_coupling, L0, L1, r, L2, N, fork_x_span, fork_y_span, fork_metal_width, fork_gnd_gap) xmon_center = (worm.fork_y_cpw1.end + worm.fork_y_cpw2.end) / 2 xmon_center += DPoint( 0, -(cross_len + cross_width / 2) + xmon_fork_penetration) xmonCross = XmonCross(xmon_center, cross_width, cross_len, cross_gnd_gap) # calculate simulation box dimensions chip_box = pya.Box(DPoint(0, 0), DPoint(CHIP.dx, CHIP.dy)) # placing all objects in proper order and translating them to origin photo_reg.insert(chip_box) # translating all objects so that chip.p1 at coordinate origin xmonCross.place(photo_reg) worm.place(photo_reg) xmonCross_corrected = XmonCross(xmon_center, cross_width, cross_len, xmon_fork_gnd_gap) xmonCross_corrected.place(photo_reg)
r, N, tail_shape=res_tail_shape, tail_turn_radiuses=r, tail_segment_lengths=tail_segment_lengths, tail_turn_angles=tail_turn_angles, tail_trans_in=tail_trans_in, fork_x_span=fork_x_span, fork_y_span=fork_y_span, fork_metal_width=fork_metal_width, fork_gnd_gap=fork_gnd_gap) xmon_center_test = (worm_test.fork_y_cpw1.end + worm_test.fork_y_cpw2.end) / 2 xmon_center_test += DPoint( 0, -(cross_len + cross_width / 2) + xmon_fork_penetration) xmonCross_test = XmonCross(xmon_center_test, cross_width, cross_len, cross_gnd_gap) import math print(math.copysign(1, tail_turn_angles[0]) > 0) if math.copysign(1, tail_turn_angles[0]) > 0: CHIP.dx = (10 * Z_res.b + max(tail_segment_lengths[1], L_coupling + 2 * r) + (cross_len + cross_width / 2 + cross_gnd_gap)) else: CHIP.dx = (10 * Z_res.b + tail_segment_lengths[1] + L_coupling + 2 * r + (cross_len + cross_width / 2 + cross_gnd_gap)) CHIP.dy = 1.2 * (worm_test.coil0.start.y - xmonCross_test.center.y + (cross_width / 2 + cross_len + cross_gnd_gap)) CHIP.nX = int(CHIP.dx / 2.5e3)
cross_width_x = par[1] cross_len_y = par[2] cross_gnd_gap_x = par[3] cross_gnd_gap_y = par[4] xmon_dX = 2 * cross_len_x + cross_width_x + 2 * cross_gnd_gap_x CHIP.dx = 5 * xmon_dX CHIP.dy = 5 * xmon_dX CHIP.center = DPoint(CHIP.dx / 2, CHIP.dy / 2) chip_box = pya.Box(Point(0, 0), Point(CHIP.dx, CHIP.dy)) cell.shapes(layer_photo).insert(chip_box) xmon_cross1 = XmonCross(CHIP.center, cross_len_x, cross_width_x, cross_gnd_gap_x, sideY_length=cross_len_y, sideY_gnd_gap=cross_gnd_gap_y) xmon_cross1.place(cell, layer_photo) ## DRAWING SECTION END ## # lv.zoom_fit() ### MATLAB COMMANDER SECTION START ### ml_terminal = SonnetLab() print("starting connection...") from sonnetSim.cMD import CMD ml_terminal._send(CMD.SAY_HELLO) ml_terminal.clear() simBox = SimulationBox(CHIP.dx, CHIP.dy, 600, 600)
cross_width = 60e3 cross_len = 125e3 cross_gnd_gap = 20e3 xmon_resEnd_distances = [1e3 * x for x in range(1, 2)] for xmon_resEnd_distance in xmon_resEnd_distances: # clear this cell and layer cell.clear() worm = EMResonator_TL2Qbit_worm2(Z_res, origin, L_coupling, L1, r, L2, N) xmon_center = worm.cop_tail.end xmon_center += DPoint( 0, -(cross_len + cross_width / 2 + xmon_resEnd_distance)) xmonCross = XmonCross(xmon_center, cross_width, cross_len, cross_gnd_gap) # cutting everything out except for the tail that will be capcitavely coupled # to Xmon for key in list(worm.primitives.keys()): if key != "cop_tail": del worm.primitives[key] tmp_reg = Region() worm.place(tmp_reg) xmonCross.place(tmp_reg) bbox = tmp_reg.bbox() # calculate simulation box placement CHIP.dx = 3 * bbox.width() CHIP.dy = 3 * bbox.height() chip_p1 = DPoint(bbox.center()) + DPoint(-0.5 * CHIP.dx,
cell.clear() from itertools import product pars = product(cross_widths, cross_lens, cross_gnd_gaps) for cross_width, cross_len, cross_gnd_gap in pars: xmon_dX = 2 * cross_len + cross_width + 2 * cross_gnd_gap CHIP.dx = 5 * xmon_dX CHIP.dy = 5 * xmon_dX CHIP.center = DPoint(CHIP.dx / 2, CHIP.dy / 2) chip_box = pya.Box(Point(0, 0), Point(CHIP.dx, CHIP.dy)) cell.shapes(layer_photo).insert(chip_box) xmon_cross1 = XmonCross( CHIP.center, cross_width, cross_len, cross_gnd_gap ) xmon_cross1.place(cell, layer_photo) ## DRAWING SECTION END ## # lv.zoom_fit() ### MATLAB COMMANDER SECTION START ### ml_terminal = SonnetLab() print("starting connection...") from sonnetSim.cMD import CMD ml_terminal._send(CMD.SAY_HELLO) ml_terminal.clear() simBox = SimulationBox(CHIP.dx, CHIP.dy, 600, 600) ml_terminal.set_boxProps(simBox)