def measure_BusT1(device, q0_name, times, MC=None): if MC is None: MC = qc.station.components['MC'] q0 = device.qubits()[q0_name] cal_points = 4 cal_pts = times[-1] + \ np.arange(1, 1+cal_points)*(times[1]-times[0]) times = np.concatenate((times, cal_pts)) operation_dict = device.get_operation_dict() AWG = q0.AWG busT1swf = awg_swf.awg_seq_swf(fsqs.BusT1, parameter_name='times', unit='s', AWG=q0.AWG, fluxing_channels=[q0.fluxing_channel()], awg_seq_func_kwargs={ 'operation_dict': operation_dict, 'q0': q0_name, 'distortion_dict': q0.dist_dict() }) MC.set_sweep_function(busT1swf) MC.set_sweep_points(times) MC.set_detector_function(q0.int_avg_det_rot) MC.run('BusT1_{}'.format(q0.name)) ma.T1_Analysis(label='BusT1')
def tomo2Q_bell(bell_state, device, qS_name, qCZ_name, CPhase=True, nr_shots=256, nr_rep=1, mmt_label='', MLE=False, MC=None, run=True): """ Performs the fringe measurements of a resonant cphase gate between two qubits. low_qubit is gonna be swapped with the bus high_qubit is gonna be adiabatically pulsed """ if MC is None: MC = station.MC cal_points = 28 sweep_points = np.arange(nr_shots * nr_rep * (36 + cal_points)) operation_dict = device.get_operation_dict() qS = device.qubits()[qS_name] qCZ = device.qubits()[qCZ_name] detector = det.UHFQC_integration_logging_det( UHFQC=qS._acquisition_instr, AWG=qS.AWG, channels=[ qCZ.RO_acq_weight_function_I(), qS.RO_acq_weight_function_I() ], nr_shots=nr_shots, integration_length=qS.RO_acq_integration_length(), result_logging_mode='lin_trans') tomo_swf = awg_swf.awg_seq_swf( mqs.two_qubit_tomo_bell, # parameter_name='Pre-rotation', AWG=qS.AWG, fluxing_channels=[qS.fluxing_channel(), qCZ.fluxing_channel()], awg_seq_func_kwargs={ 'bell_state': bell_state, 'operation_dict': operation_dict, 'qS': qS.name, 'qCZ': qCZ.name, 'RO_target': qCZ.name, 'distortion_dict': qS.dist_dict() }) MC.soft_avg(1) # Single shots cannot be averaged. MC.set_sweep_function(tomo_swf) MC.set_sweep_points(sweep_points) MC.set_detector_function(detector) if run: MC.run('BellTomo_%s_%s_%s_%s' % (bell_state, qS_name, qCZ_name, mmt_label)) tomo.analyse_tomo(MLE=MLE, target_bell=bell_state % 10)
def measure_SWAP_CZ_SWAP(device, qS_name, qCZ_name, CZ_phase_corr_amps, sweep_qubit, excitations='both_cases', MC=None, upload=True): if MC is None: MC = station.components['MC'] if excitations == 'both_cases': CZ_phase_corr_amps = np.tile(CZ_phase_corr_amps, 2) amp_step = CZ_phase_corr_amps[1] - CZ_phase_corr_amps[0] swp_pts = np.concatenate( [CZ_phase_corr_amps, np.arange(4) * amp_step + CZ_phase_corr_amps[-1]]) qS = device.qubits()[qS_name] qCZ = device.qubits()[qCZ_name] int_avg_det = det.UHFQC_integrated_average_detector( UHFQC=qS._acquisition_instr, AWG=qS.AWG, channels=[ qCZ.RO_acq_weight_function_I(), qS.RO_acq_weight_function_I() ], nr_averages=qS.RO_acq_averages(), integration_length=qS.RO_acq_integration_length(), result_logging_mode='lin_trans') operation_dict = device.get_operation_dict() S_CZ_S_swf = awg_swf.awg_seq_swf( fsqs.SWAP_CZ_SWAP_phase_corr_swp, parameter_name='phase_corr_amps', unit='V', AWG=qS.AWG, fluxing_channels=[qS.fluxing_channel(), qCZ.fluxing_channel()], upload=upload, awg_seq_func_kwargs={ 'operation_dict': operation_dict, 'qS': qS.name, 'qCZ': qCZ.name, 'sweep_qubit': sweep_qubit, 'RO_target': qCZ.name, 'excitations': excitations, 'upload': upload, 'distortion_dict': qS.dist_dict() }) MC.set_sweep_function(S_CZ_S_swf) MC.set_detector_function(int_avg_det) MC.set_sweep_points(swp_pts) # MC.set_sweep_points(phases) MC.run('SWAP_CP_SWAP_{}_{}'.format(qS_name, qCZ_name)) ma.MeasurementAnalysis() # N.B. you may want to run different analysis
def rSWAP_scan(device, qS_name, qCZ_name, recovery_swap_amps, emulate_cross_driving=False, MC=None, upload=True): if MC is None: MC = station.components['MC'] amp_step = recovery_swap_amps[1] - recovery_swap_amps[0] swp_pts = np.concatenate( [recovery_swap_amps, np.arange(4) * amp_step + recovery_swap_amps[-1]]) qS = device.qubits()[qS_name] qCZ = device.qubits()[qCZ_name] int_avg_det = det.UHFQC_integrated_average_detector( UHFQC=qS._acquisition_instr, AWG=qS.AWG, channels=[ qCZ.RO_acq_weight_function_I(), qS.RO_acq_weight_function_I() ], nr_averages=qS.RO_acq_averages(), integration_length=qS.RO_acq_integration_length(), result_logging_mode='lin_trans') operation_dict = device.get_operation_dict() rSWAP_swf = awg_swf.awg_seq_swf( fsqs.rSWAP_amp_sweep, parameter_name='rSWAP amplitude', unit=r'% dac resolution', AWG=qS.AWG, fluxing_channels=[qS.fluxing_channel(), qCZ.fluxing_channel()], upload=upload, awg_seq_func_kwargs={ 'operation_dict': operation_dict, 'qS': qS.name, 'qCZ': qCZ.name, 'recovery_swap_amps': swp_pts, 'RO_target': qCZ.name, 'emulate_cross_driving': emulate_cross_driving, 'upload': upload, 'distortion_dict': qS.dist_dict() }) MC.set_sweep_function(rSWAP_swf) MC.set_detector_function(int_avg_det) MC.set_sweep_points(swp_pts) # MC.set_sweep_points(phases) MC.run('rSWAP_{}_{}'.format(qS_name, qCZ_name)) ma.MeasurementAnalysis() # N.B. you may want to run different analysis
def measure_chevron(device, q0_name, amps, length, MC=None): # Might belong better in some fluxing module but that does not exist yet if MC is None: MC = qc.station.components['MC'] if len(amps) == 1: slice_scan = True else: slice_scan = False operation_dict = device.get_operation_dict() # preparation of sweep points and cal points cal_points = 4 lengths_cal = length[-1] + \ np.arange(1, 1+cal_points)*(length[1]-length[0]) lengths_vec = np.concatenate((length, lengths_cal)) # start preparations q0 = device.qubits()[q0_name] q0.prepare_for_timedomain() dist_dict = q0.dist_dict() chevron_swf = awg_swf.awg_seq_swf(fsqs.chevron_seq, parameter_name='pulse_lengths', AWG=q0.AWG, fluxing_channels=[q0.fluxing_channel()], awg_seq_func_kwargs={ 'operation_dict': operation_dict, 'q0': q0_name, 'distortion_dict': q0.dist_dict() }) MC.set_sweep_function(chevron_swf) MC.set_sweep_points(lengths_vec) if not slice_scan: MC.set_sweep_function_2D(q0.AWG.parameters[q0.fluxing_channel() + '_amp']) MC.set_sweep_points_2D(amps) MC.set_detector_function(q0.int_avg_det_rot) if slice_scan: q0.AWG.parameters[q0.fluxing_channel() + '_amp'].set(amps[0]) MC.run('Chevron_slice_%s' % q0.name) ma.TD_Analysis(auto=True) else: MC.run('Chevron_2D_%s' % q0.name, mode='2D') ma.Chevron_2D(auto=True)
def measure_two_qubit_AllXY(device, q0_name, q1_name, sequence_type='sequential', MC=None): if MC is None: MC = qc.station.components['MC'] q0 = station.components[q0_name] q1 = station.components[q1_name] # AllXY on Data top # FIXME: multiplexed RO should come from the device int_avg_det = det.UHFQC_integrated_average_detector( UHFQC=q0._acquisition_instr, AWG=q0.AWG, channels=[ q1.RO_acq_weight_function_I(), q0.RO_acq_weight_function_I() ], nr_averages=q0.RO_acq_averages(), integration_length=q0.RO_acq_integration_length(), result_logging_mode='lin_trans') operation_dict = device.get_operation_dict() two_qubit_AllXY_sweep = awg_swf.awg_seq_swf(mqs.two_qubit_AllXY, awg_seq_func_kwargs={ 'operation_dict': operation_dict, 'q0': q0_name, 'q1': q1_name, 'RO_target': q0_name, 'sequence_type': sequence_type }) MC.set_sweep_function(two_qubit_AllXY_sweep) MC.set_sweep_points(np.arange(42)) MC.set_detector_function(int_avg_det) MC.run('2 qubit AllXY sequential') ma.MeasurementAnalysis()
def measure_SWAPN(device, q0_name, swap_amps, alpha=1., number_of_swaps=30, MC=None): if MC is None: MC = qc.station.components['MC'] q0 = device.qubits()[q0_name] # These are the sweep points swap_vec = np.arange(number_of_swaps) * 2 cal_points = 4 lengths_cal = swap_vec[-1] + \ np.arange(1, 1+cal_points)*(swap_vec[1]-swap_vec[0]) swap_vec = np.concatenate((swap_vec, lengths_cal)) operation_dict = device.get_operation_dict() AWG = q0.AWG repSWAP = awg_swf.awg_seq_swf(fsqs.SwapN, parameter_name='nr_pulses_list', unit='#', AWG=q0.AWG, fluxing_channels=[q0.fluxing_channel()], awg_seq_func_kwargs={ 'operation_dict': operation_dict, 'q0': q0_name, 'alpha': alpha, 'distortion_dict': q0.dist_dict() }) MC.set_sweep_function(repSWAP) MC.set_sweep_points(swap_vec) MC.set_sweep_function_2D(AWG.ch4_amp) MC.set_sweep_points_2D(swap_amps) MC.set_detector_function(q0.int_avg_det_rot) MC.run('SWAPN_{}_alpha_{}'.format(q0.name, alpha), mode='2D') ma.TwoD_Analysis(auto=True)