示例#1
0
def measure_chevron(
        device,
        q0_name,
        q1_name,
        CC,
        MC,
        QWG_flux_lutman,  # operation_dict,
        amps=np.arange(0.482, .491, .0010),
        lengths=np.arange(50e-9, 500e-9, 5e-9),
        wait_during_flux=400e-8,
        wait_after_trigger=40e-9,
        excite_q1=True):
    '''
    Measure chevron for the qubits q0 and q1.

    Args:
        device:  device object
        q0_name : name of the first qubit. q0 will be flux pulsed
        q1_name : name of the second qubit (what is this needed for? )

    '''
    CC = device.central_controller.get_instr()
    operation_dict = Starmon.get_operation_dict()
    single_pulse_elt = mqqs.chevron_seq(q0.name,
                                        q1.name,
                                        excite_q1=excite_q1,
                                        RO_target=q0.name,
                                        wait_during_flux=wait_during_flux,
                                        wait_after_trigger=wait_after_trigger)
    # single_pulse_elt = flux_pulse_seq('QR', 'QL')
    single_pulse_asm = qta.qasm_to_asm(single_pulse_elt.name, operation_dict)
    qumis_file = single_pulse_asm
    CC.load_instructions(qumis_file.name)
    CC.start()

    s1 = swf.QWG_lutman_par(QWG_flux_lutman, QWG_flux_lutman.F_amp)
    s2 = swf.QWG_lutman_par(QWG_flux_lutman, QWG_flux_lutman.F_length)
    MC.soft_avg(1)
    MC.set_sweep_function(s1)
    MC.set_sweep_function_2D(s2)
    MC.set_sweep_points(amps)
    MC.set_sweep_points_2D(lengths)
    d = det.UHFQC_integrated_average_detector(
        UHFQC=q0._acquisition_instrument,
        AWG=CC,
        channels=[
            q0.RO_acq_weight_function_I(),
            q1.RO_acq_weight_function_I()
        ],
        nr_averages=q0.RO_acq_averages(),
        real_imag=True,
        single_int_avg=True,
        result_logging_mode='lin_trans',
        integration_length=q0.RO_acq_integration_length(),
        seg_per_point=1)

    d._set_real_imag(True)

    MC.set_detector_function(d)
    MC.run('Chevron_{}_{}'.format(q0.name, q1.name), mode='2D')
示例#2
0
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
示例#3
0
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
示例#4
0
def measure_two_qubit_AllXY(device,
                            q0_name,
                            q1_name,
                            sequence_type='sequential',
                            MC=None,
                            result_logging_mode='lin_trans'):

    if MC is None:
        MC = qc.station.components['MC']

    q0 = device.find_instrument(q0_name)
    q1 = device.find_instrument(q1_name)

    q0.prepare_for_timedomain()
    q1.prepare_for_timedomain()

    double_points = True
    AllXY = mqqs.two_qubit_AllXY(q0_name,
                                 q1_name,
                                 RO_target=q0_name,
                                 sequence_type=sequence_type,
                                 replace_q1_pulses_X180=False,
                                 double_points=double_points)

    op_dict = device.get_operation_dict()
    for q in device.qubits():
        op_dict['I ' + q]['instruction'] = ''

    s = swf.QASM_Sweep(AllXY.name, device.central_controller.get_instr(),
                       op_dict)
    d = det.UHFQC_integrated_average_detector(
        device.acquisition_instrument.get_instr(),
        AWG=device.central_controller.get_instr(),
        nr_averages=q0.RO_acq_averages(),
        integration_length=q0.RO_acq_integration_length(),
        result_logging_mode=result_logging_mode,
        channels=[
            q0.RO_acq_weight_function_I(),
            q1.RO_acq_weight_function_I()
        ])

    MC.set_sweep_function(s)
    MC.set_sweep_points(np.arange(21 * (1 + double_points)))
    MC.set_detector_function(d)
    MC.run('AllXY_{}_{}'.format(q0_name, q1_name))
    ma.MeasurementAnalysis()
示例#5
0
    def get_integrated_average_detector(self, seg_per_point: int = 1):
        qnames = self.qubits()
        q0 = self.find_instrument(qnames[0])
        q1 = self.find_instrument(qnames[1])

        w0 = q0.RO_acq_weight_function_I()
        w1 = q1.RO_acq_weight_function_I()

        d = det.UHFQC_integrated_average_detector(
            UHFQC=self.acquisition_instrument.get_instr(),
            AWG=self.central_controller.get_instr(),
            channels=[w0, w1],
            nr_averages=self.RO_acq_averages(),
            real_imag=True,
            single_int_avg=True,
            result_logging_mode='digitized',
            integration_length=q0.RO_acq_integration_length(),
            seg_per_point=seg_per_point)
        return d
示例#6
0
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 _do_set_acquisition_instr(self, acquisition_instr):
        # Specifying the int_avg det here should allow replacing it with ATS
        # or potential digitizer acquisition easily

        self._acquisition_instr = self.find_instrument(acquisition_instr)
        if 'CBox' in acquisition_instr:
            if self.AWG() != 'None':
                logging.info("setting CBox acquisition")
                print('starting int avg')
                self.int_avg_det = det.CBox_integrated_average_detector(
                    self._acquisition_instr,
                    self.AWG.get_instr(),
                    nr_averages=self.RO_acq_averages(),
                    integration_length=self.RO_acq_integration_length(
                    ),
                    normalize=True)
                print('starting int avg rot')
                self.int_avg_det_rot = det.CBox_integrated_average_detector(
                    self._acquisition_instr,
                    self.AWG.get_instr(),
                    nr_averages=self.RO_acq_averages(),
                    integration_length=self.RO_acq_integration_length(
                    ),
                    normalize=True)
                print('starting int log det')
                self.int_log_det = det.CBox_integration_logging_det(
                    self._acquisition_instr,
                    self.AWG.get_instr(),
                    integration_length=self.RO_acq_integration_length())

                self.input_average_detector = det.CBox_input_average_detector(
                    self._acquisition_instr,
                    self.AWG.get_instr(), nr_averages=self.RO_acq_averages())

        elif 'UHFQC' in acquisition_instr:
            logging.info("setting UHFQC acquisition")
            self.input_average_detector = det.UHFQC_input_average_detector(
                UHFQC=self._acquisition_instr,
                AWG=self.AWG.get_instr(), nr_averages=self.RO_acq_averages())

            self.int_avg_det = det.UHFQC_integrated_average_detector(
                UHFQC=self._acquisition_instr, AWG=self.AWG.get_instr(),
                channels=[self.RO_acq_weight_function_I(),
                          self.RO_acq_weight_function_Q()],
                nr_averages=self.RO_acq_averages(),
                integration_length=self.RO_acq_integration_length())

            self.int_log_det = det.UHFQC_integration_logging_det(
                UHFQC=self._acquisition_instr, AWG=self.AWG.get_instr(),
                channels=[self.RO_acq_weight_function_I(),
                          self.RO_acq_weight_function_Q()],
                integration_length=self.RO_acq_integration_length())

        elif 'DDM' in acquisition_instr:
            logging.info("setting DDM acquisition")
            self.input_average_detector = det.DDM_input_average_detector(
                DDM=self._acquisition_instr,
                AWG=self.AWG, nr_averages=self.RO_acq_averages())

            self.int_avg_det = det.DDM_integrated_average_detector(
                DDM=self._acquisition_instr, AWG=self.AWG,
                channels=[self.RO_acq_weight_function_I(),
                          self.RO_acq_weight_function_Q()],
                nr_averages=self.RO_acq_averages(),
                integration_length=self.RO_acq_integration_length())

            self.int_log_det = det.DDM_integration_logging_det(
                DDM=self._acquisition_instr, AWG=self.AWG,
                channels=[self.RO_acq_weight_function_I(),
                          self.RO_acq_weight_function_Q()],
                integration_length=self.RO_acq_integration_length())

        elif 'ATS' in acquisition_instr:
            logging.info("setting ATS acquisition")
            raise NotImplementedError()