def draw_readout_launch(chip, mpr_params, qubit_params): N = qubit_params['num_qubits'] Qn = chip.get_component(f'Q{N - 1:02d}') mpr_params['hero_bond.x'] = Qn.node('pad1_bottom')[0] launch = qlib.Launch(cpw=mpr_params['cpw'], **mpr_params['readout_launch']) keys = ['cpw', 'hero_bond', 'shift_x_position', 'radius'] rline_params = Params( {k: v for k, v in mpr_params.items() if k in keys} ) bus = chip.get_component('BUS') # Compute the launch x position launch_x = chip.extent()[0, 1] - mpr_params['launch_x_offset'] readout_line = ReadoutLine( start=bus.node('IDC.cpw1'), launch=launch, launch_position=np.array((launch_x, mpr_params['launch_y'])), **rline_params ).place() chip.add_component(readout_line, cid='BUSLINE', layers=mpr_params['layer'])
def draw_control_lines(chip, control_params): cpw = control_params['cpw'] N = control_params['num_ctrl_lines_per_side'] * 2 ## Creating the launch component launch = qlib.Launch(cpw=cpw, taper_length=control_params['bondpad'].pop('taper'), bondpad=control_params['bondpad']) ## Compute control line ys control_line_ys = np.linspace( control_params['ctrl_line_y_start'], control_params['ctrl_line_y_end'], control_params['num_ctrl_lines_per_side'] + 1) ## Compute intersection position intersection = (control_params['intersection_start_x'] + control_params['intersection_end_x']) / 2 ## Reorder by Qubit ID (0 indexed, clockwise, starting from lower left) control_line_ys = np.concatenate( [control_line_ys[:-1], control_line_ys[1:][::-1]]) x_left = chip.extent()[0][0] + control_params['ctrl_line_x_offset'] x_right = chip.extent()[0][1] - control_params['ctrl_line_x_offset'] ## Make ControlLines and add to chip for i, y in enumerate(control_line_ys): rotation, sign, x = (0, -1, x_left) if i < N // 2 else (180, 1, x_right) qb = chip.get_component(f'Q{i:02d}') start = np.array((x, y)) end = qb.node('cutout_left') + (sign * control_params['qubit_separation'], 0) ctrl_line = ControlLine(cpw, launch, start, end, intersection, rotation).place() chip.add_component(ctrl_line, cid=f'CONTROLLINE{i:02d}', layers=control_params['layer'])