コード例 #1
0
def flux_square_phase_fix(ftpts, pulse_location, pulse, pulse_cfg, mm_target_info, flux_pulse_info):

    if flux_pulse_info["fix_phase"]:

        if pulse.name[-1] == "f":
            dc_offset = mm_target_info["dc_offset_freq_ef"]
            shifted_frequency = mm_target_info["flux_pulse_freq_ef"]
            bare_frequency = shifted_frequency - dc_offset
            waveforms_qubit_flux = ap.sideband(
                ftpts,
                ap.square(
                    ftpts,
                    pulse.amp,
                    pulse_location - pulse.length - 0.5 * (pulse.span_length - pulse.length),
                    pulse.length,
                    pulse_cfg["square"]["ramp_sigma"],
                ),
                np.zeros(len(ftpts)),
                freq=bare_frequency,
                phase=360 * dc_offset / 1e9 * (ftpts + pulse_location) + pulse.phase,
                offset=False,
            )[0]

        else:
            dc_offset = mm_target_info["dc_offset_freq"]
            shifted_frequency = mm_target_info["flux_pulse_freq"]
            bare_frequency = shifted_frequency - dc_offset
            waveforms_qubit_flux = ap.sideband(
                ftpts,
                ap.square(
                    ftpts,
                    pulse.amp,
                    pulse_location - pulse.length - 0.5 * (pulse.span_length - pulse.length),
                    pulse.length,
                    pulse_cfg["square"]["ramp_sigma"],
                ),
                np.zeros(len(ftpts)),
                freq=bare_frequency,
                phase=360 * dc_offset / 1e9 * (ftpts + pulse_location) + pulse.phase,
                offset=False,
            )[0]

    else:
        waveforms_qubit_flux = ap.sideband(
            ftpts,
            ap.square(
                ftpts,
                pulse.amp,
                pulse_location - pulse.length - 0.5 * (pulse.span_length - pulse.length),
                pulse.length,
                pulse_cfg["square"]["ramp_sigma"],
            ),
            np.zeros(len(ftpts)),
            pulse.freq,
            pulse.phase,
            offset=False,
        )[0]

    return waveforms_qubit_flux
コード例 #2
0
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        wtpts = self.get_waveform_times('qubit drive I')
        mtpts = self.get_marker_times('qubit buffer')

        ii = 0
        w = self.pi_length
        a = self.pulse_cfg['a']

        # TODO: pulseblaster out of sync bug#

        awg_trig_len = 100
        start_pulseblaster(self.exp_period_ns, awg_trig_len,
                           self.origin + self.measurement_delay,
                           self.card_trig_width, self.measurement_width)
        run_pulseblaster()

        if self.pi_pulse:
            if self.pulse_type == 'square':
                self.waveforms['qubit drive I'][ii], self.waveforms['qubit drive Q'][ii] = \
                    ap.sideband(wtpts,
                                 ap.square(wtpts, a, self.origin - w - 2 * self.ramp_sigma , w,
                                            self.ramp_sigma), np.zeros(len(wtpts)),
                                 self.pulse_cfg['iq_freq'], 0)

                self.markers['qubit buffer'][ii] = ap.square(
                    mtpts, 1, self.origin - w - 4 * self.ramp_sigma -
                    self.marker_start_buffer,
                    w + 4 * self.ramp_sigma + self.marker_start_buffer)

            if self.pulse_type == 'gauss':
                gauss_sigma = w  #covention for the width of gauss pulse
                self.waveforms['qubit drive I'][ii], self.waveforms['qubit drive Q'][ii] = \
                    ap.sideband(wtpts,
                                 ap.gauss(wtpts, a, self.origin - 3 * gauss_sigma , gauss_sigma),
                                 np.zeros(len(wtpts)),
                                 self.pulse_cfg['iq_freq'], 0)
                self.markers['qubit buffer'][ii] = ap.square(
                    mtpts, 1,
                    self.origin - 6 * gauss_sigma - self.marker_start_buffer,
                    6 * gauss_sigma + self.marker_start_buffer)

        self.markers['readout pulse'][ii] = ap.square(
            mtpts, 1, self.origin + self.measurement_delay,
            self.measurement_width)
        self.markers['card trigger'][ii] = ap.square(
            mtpts, 1, self.origin - self.card_delay + self.measurement_delay,
            self.card_trig_width)
コード例 #3
0
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        wtpts = self.get_waveform_times('qubit drive I')
        mtpts = self.get_marker_times('qubit buffer')

        ii = 0
        w =self.pi_length
        a=self.pulse_cfg['a']

        # TODO: pulseblaster out of sync bug#

        awg_trig_len = 100
        start_pulseblaster(self.exp_period_ns, awg_trig_len, self.origin + self.measurement_delay,
                           self.card_trig_width, self.measurement_width)
        run_pulseblaster()

        if self.pi_pulse:
            if self.pulse_type == 'square':
                    self.waveforms['qubit drive I'][ii], self.waveforms['qubit drive Q'][ii] = \
                        ap.sideband(wtpts,
                                     ap.square(wtpts, a, self.origin - w - 2 * self.ramp_sigma , w,
                                                self.ramp_sigma), np.zeros(len(wtpts)),
                                     self.pulse_cfg['iq_freq'], 0)

                    self.markers['qubit buffer'][ii] = ap.square(mtpts, 1,
                                                                  self.origin - w - 4 * self.ramp_sigma - self.marker_start_buffer,
                                                                  w + 4 * self.ramp_sigma + self.marker_start_buffer)

            if self.pulse_type == 'gauss':
                gauss_sigma = w  #covention for the width of gauss pulse
                self.waveforms['qubit drive I'][ii], self.waveforms['qubit drive Q'][ii] = \
                    ap.sideband(wtpts,
                                 ap.gauss(wtpts, a, self.origin - 3 * gauss_sigma , gauss_sigma),
                                 np.zeros(len(wtpts)),
                                 self.pulse_cfg['iq_freq'], 0)
                self.markers['qubit buffer'][ii] = ap.square(mtpts, 1, self.origin - 6 * gauss_sigma - self.marker_start_buffer ,
                                                              6 * gauss_sigma + self.marker_start_buffer)

        self.markers['readout pulse'][ii] = ap.square(mtpts, 1, self.origin + self.measurement_delay,
                                                       self.measurement_width)
        self.markers['card trigger'][ii] = ap.square(mtpts, 1,
                                                      self.origin - self.card_delay + self.measurement_delay,
                                                      self.card_trig_width)
コード例 #4
0
def square(wtpts, mtpts, origin, marker_start_buffer, marker_end_buffer, pulse_location, pulse, pulse_cfg):
    qubit_waveforms = ap.sideband(
        wtpts,
        ap.square(
            wtpts,
            pulse.amp,
            origin - pulse_location - pulse.length - 0.5 * (pulse.span_length - pulse.length),
            pulse.length,
            pulse_cfg["square"]["ramp_sigma"],
        ),
        np.zeros(len(wtpts)),
        pulse.freq,
        pulse.phase,
    )
    qubit_marker = ap.square(
        mtpts,
        1,
        origin - pulse_location - pulse.span_length - marker_start_buffer,
        pulse.span_length + marker_start_buffer - marker_end_buffer,
    )
    return (qubit_waveforms, qubit_marker)
コード例 #5
0
ファイル: HistogramSequence.py プロジェクト: ziqianli/slab
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        wtpts = self.get_waveform_times('qubit drive I')
        mtpts = self.get_marker_times('qubit buffer')

        for ii, d in enumerate(self.histo_pts):
            self.markers['readout pulse'][ii] = ap.square(mtpts, 1, self.origin + self.measurement_delay,
                                                           self.measurement_width)
            self.markers['card trigger'][ii] = ap.square(mtpts, 1,
                                                          self.origin - self.card_delay + self.measurement_delay,
                                                          self.card_trig_width)

            w = self.pi_length
            a = d * self.a

            if self.pulse_type == 'square':
                self.waveforms['qubit drive I'][ii], self.waveforms['qubit drive Q'][ii] = \
                    ap.sideband(wtpts,
                                 ap.square(wtpts, a, self.origin - w - 2 * self.ramp_sigma , w,
                                            self.ramp_sigma), np.zeros(len(wtpts)),
                                 self.pulse_cfg['iq_freq'], 0)

                self.markers['qubit buffer'][ii] = ap.square(mtpts, 1,
                                                              self.origin - w - 4 * self.ramp_sigma - self.marker_start_buffer,
                                                              w + 4 * self.ramp_sigma + self.marker_start_buffer)

            if self.pulse_type == 'gauss':
                gauss_sigma = w  #covention for the width of gauss pulse
                self.waveforms['qubit drive I'][ii], self.waveforms['qubit drive Q'][ii] = \
                    ap.sideband(wtpts,
                                 ap.gauss(wtpts, a, self.origin - 3 * gauss_sigma , gauss_sigma),
                                 np.zeros(len(wtpts)),
                                 self.pulse_cfg['iq_freq'], 0)

                self.markers['qubit buffer'][ii] = ap.square(mtpts, 1, self.origin - 6 * gauss_sigma - self.marker_start_buffer ,
                                                              6 * gauss_sigma + self.marker_start_buffer)
コード例 #6
0
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        wtpts = self.get_waveform_times('qubit drive I')
        mtpts = self.get_marker_times('qubit buffer')

        ii = 0
        # TODO: pulseblaster out of sync bug#

        awg_trig_len = 100
        start_pulseblaster(self.exp_period_ns, awg_trig_len, self.origin + self.measurement_delay,
                           self.card_trig_width, self.measurement_width)
        run_pulseblaster()

        self.markers['readout pulse'][ii] = ap.square(mtpts, 1, self.origin + self.measurement_delay,
                                                       self.measurement_width)
        self.markers['card trigger'][ii] = ap.square(mtpts, 1,
                                                      self.origin - self.card_delay + self.measurement_delay,
                                                      self.card_trig_width)

        pulse_probe_len = self.pulse_probe_len
        a = self.a

        if self.pulse_type == 'square':
            self.waveforms['qubit drive I'][ii] = ap.sideband(wtpts,
                                                               ap.square(wtpts, a,
                                                                          self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                                                                          pulse_probe_len, self.ramp_sigma),
                                                               np.zeros(len(wtpts)),
                                                              self.pulse_probe_cfg['iq_freq'], 0)[0]
            self.waveforms['qubit drive Q'][ii] = ap.sideband(wtpts,
                                                               ap.square(wtpts, a,
                                                                          self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                                                                          pulse_probe_len, self.ramp_sigma),
                                                               np.zeros(len(wtpts)),
                                                              self.pulse_probe_cfg['iq_freq'], 0)[1]
            self.markers['qubit buffer'][ii] = ap.square(mtpts, 1,
                                                          self.origin - pulse_probe_len - 3 * self.ramp_sigma - self.marker_start_buffer,
                                                          pulse_probe_len + 4 * self.ramp_sigma + self.marker_start_buffer)

            high_values_indices = self.markers['qubit buffer'][ii] > 1
            self.markers['qubit buffer'][ii][high_values_indices] = 1

        if self.pulse_type == 'gauss':
            self.waveforms['qubit drive I'][ii] = ap.sideband(wtpts,
                                                               ap.gauss(wtpts, a, self.origin - 3 * pulse_probe_len,
                                                                         pulse_probe_len), np.zeros(len(wtpts)),
                                                              self.pulse_probe_cfg['iq_freq'], 0)[0]
            self.waveforms['qubit drive Q'][ii] = ap.sideband(wtpts,
                                                               ap.gauss(wtpts, a, self.origin - 3 * pulse_probe_len,
                                                                         pulse_probe_len), np.zeros(len(wtpts)),
                                                              self.pulse_probe_cfg['iq_freq'], 0)[1]
            self.markers['qubit buffer'][ii] = ap.square(mtpts, 1, self.origin - 6 * pulse_probe_len - self.marker_start_buffer,
                                                           6 * pulse_probe_len + self.marker_start_buffer)

            high_values_indices = self.markers['qubit buffer'][ii] > 1
            self.markers['qubit buffer'][ii][high_values_indices] = 1
コード例 #7
0
def gauss(wtpts, mtpts, origin, marker_start_buffer, marker_end_buffer, pulse_location, pulse):
    qubit_waveforms = ap.sideband(
        wtpts,
        ap.gauss(wtpts, pulse.amp, origin - pulse_location - 0.5 * pulse.span_length, pulse.length),
        np.zeros(len(wtpts)),
        pulse.freq,
        pulse.phase,
    )
    qubit_marker = ap.square(
        mtpts,
        1,
        origin - pulse_location - pulse.span_length - marker_start_buffer,
        pulse.span_length + marker_start_buffer - marker_end_buffer,
    )
    return (qubit_waveforms, qubit_marker)
コード例 #8
0
ファイル: PulseProbeSequence.py プロジェクト: ziqianli/slab
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        wtpts = self.get_waveform_times('qubit drive I')
        mtpts = self.get_marker_times('qubit buffer')

        ii = 0
        self.markers['readout pulse'][ii] = ap.square(
            mtpts, 1, self.origin + self.measurement_delay,
            self.measurement_width)
        self.markers['card trigger'][ii] = ap.square(
            mtpts, 1, self.origin - self.card_delay + self.measurement_delay,
            self.card_trig_width)

        pulse_probe_len = self.pulse_probe_len
        a = self.a

        if self.pulse_type == 'square':
            self.waveforms['qubit drive I'][ii] = ap.sideband(
                wtpts,
                ap.square(wtpts, a,
                          self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                          pulse_probe_len, self.ramp_sigma),
                np.zeros(len(wtpts)), 0, 0)[0]
            self.waveforms['qubit drive Q'][ii] = ap.sideband(
                wtpts,
                ap.square(wtpts, a,
                          self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                          pulse_probe_len, self.ramp_sigma),
                np.zeros(len(wtpts)), 0, 0)[1]
            self.markers['qubit buffer'][ii] = ap.square(
                mtpts, 1, self.origin - pulse_probe_len - 3 * self.ramp_sigma -
                self.marker_start_buffer, pulse_probe_len +
                4 * self.ramp_sigma + self.marker_start_buffer)

            high_values_indices = self.markers['qubit buffer'][ii] > 1
            self.markers['qubit buffer'][ii][high_values_indices] = 1

        if self.pulse_type == 'gauss':
            self.waveforms['qubit drive I'][ii] = ap.sideband(
                wtpts,
                ap.gauss(wtpts, a,
                         self.origin - 3 * pulse_probe_len, pulse_probe_len),
                np.zeros(len(wtpts)), self.fe_sideband_freq, self.phase)[0]
            self.waveforms['qubit drive Q'][ii] = ap.sideband(
                wtpts,
                ap.gauss(wtpts, a,
                         self.origin - 3 * pulse_probe_len, pulse_probe_len),
                np.zeros(len(wtpts)), self.fe_sideband_freq, self.phase)[1]
            self.markers['qubit buffer'][ii] = ap.square(
                mtpts, 1,
                self.origin - 6 * pulse_probe_len - self.marker_start_buffer,
                6 * pulse_probe_len + self.marker_start_buffer)

            high_values_indices = self.markers['qubit buffer'][ii] > 1
            self.markers['qubit buffer'][ii][high_values_indices] = 1
コード例 #9
0
def flux_square(ftpts, pulse_location, pulse, pulse_cfg):
    waveforms_qubit_flux = ap.sideband(
        ftpts,
        ap.square(
            ftpts,
            pulse.amp,
            pulse_location - pulse.length - 0.5 * (pulse.span_length - pulse.length),
            pulse.length,
            pulse_cfg["square"]["ramp_sigma"],
        ),
        np.zeros(len(ftpts)),
        pulse.freq,
        pulse.phase,
        offset=False,
    )[0]
    return waveforms_qubit_flux
コード例 #10
0
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        wtpts = self.get_waveform_times('qubit drive I')
        mtpts = self.get_marker_times('qubit buffer')

        ii = 0
        self.markers['readout pulse'][ii] = ap.square(mtpts, 1, self.origin + self.measurement_delay,
                                                       self.measurement_width)
        self.markers['card trigger'][ii] = ap.square(mtpts, 1,
                                                      self.origin - self.card_delay + self.measurement_delay,
                                                      self.card_trig_width)

        pulse_probe_len = self.pulse_probe_len
        a = self.a

        if self.pulse_type == 'square':
            self.waveforms['qubit drive I'][ii] = ap.sideband(wtpts,
                                                               ap.square(wtpts, a,
                                                                          self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                                                                          pulse_probe_len, self.ramp_sigma),
                                                               np.zeros(len(wtpts)),
                                                               0, 0)[0]
            self.waveforms['qubit drive Q'][ii] = ap.sideband(wtpts,
                                                               ap.square(wtpts, a,
                                                                          self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                                                                          pulse_probe_len, self.ramp_sigma),
                                                               np.zeros(len(wtpts)),
                                                               0, 0)[1]
            self.markers['qubit buffer'][ii] = ap.square(mtpts, 1,
                                                          self.origin - pulse_probe_len - 3 * self.ramp_sigma - self.marker_start_buffer,
                                                          pulse_probe_len + 4 * self.ramp_sigma + self.marker_start_buffer)

            high_values_indices = self.markers['qubit buffer'][ii] > 1
            self.markers['qubit buffer'][ii][high_values_indices] = 1

        if self.pulse_type == 'gauss':
            self.waveforms['qubit drive I'][ii] = ap.sideband(wtpts,
                                                               ap.gauss(wtpts, a, self.origin - 3 * pulse_probe_len,
                                                                         pulse_probe_len), np.zeros(len(wtpts)),
                                                               self.fe_sideband_freq, self.phase)[0]
            self.waveforms['qubit drive Q'][ii] = ap.sideband(wtpts,
                                                               ap.gauss(wtpts, a, self.origin - 3 * pulse_probe_len,
                                                                         pulse_probe_len), np.zeros(len(wtpts)),
                                                               self.fe_sideband_freq, self.phase)[1]
            self.markers['qubit buffer'][ii] = ap.square(mtpts, 1, self.origin - 6 * pulse_probe_len - self.marker_start_buffer,
                                                           6 * pulse_probe_len + self.marker_start_buffer)

            high_values_indices = self.markers['qubit buffer'][ii] > 1
            self.markers['qubit buffer'][ii][high_values_indices] = 1
コード例 #11
0
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        # waveform dict
        self.waveforms_dict = {}
        self.waveforms_tpts_dict = {}

        for awg in self.awg_info:
            for waveform in awg['waveforms']:
                self.waveforms_dict[waveform['name']] = self.waveforms[waveform['name']]
                self.waveforms_tpts_dict[waveform['name']] = self.get_waveform_times(waveform['name'])

        wtpts = self.get_waveform_times('qubit drive I')
#        mtpts = self.get_marker_times('qubit buffer')

        ii = 0
        # TODO: pulseblaster out of sync bug#

        awg_trig_len = 100
        start_pulseblaster(self.exp_period_ns, awg_trig_len, self.origin+self.card_delay, self.origin + self.measurement_delay,
                           self.card_trig_width, self.measurement_width)
        run_pulseblaster()

        # self.markers['readout pulse'][ii] = ap.square(mtpts, 1, self.origin + self.measurement_delay,
        #                                                self.measurement_width)
        # self.markers['card trigger'][ii] = ap.square(mtpts, 1,
        #                                               self.origin - self.card_delay + self.measurement_delay,
        #                                               self.card_trig_width)

        pulse_probe_len = self.pulse_probe_len
        a = self.a

        if self.pulse_type == 'square':
            if 'qubit drive I' in self.waveforms_dict:
                self.waveforms['qubit drive I'][ii] = ap.sideband(wtpts,
                                                                   ap.square(wtpts, a,
                                                                              self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                                                                              pulse_probe_len, self.ramp_sigma),
                                                                   np.zeros(len(wtpts)),
                                                                  self.pulse_probe_cfg['iq_freq'], 0)[0]
            if 'qubit drive Q' in self.waveforms_dict:
                self.waveforms['qubit drive Q'][ii] = ap.sideband(wtpts,
                                                                   ap.square(wtpts, a,
                                                                              self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                                                                          pulse_probe_len, self.ramp_sigma),
                                                               np.zeros(len(wtpts)),
                                                              self.pulse_probe_cfg['iq_freq'], 0)[1]
            # self.markers['qubit buffer'][ii] = ap.square(mtpts, 1,
            #                                               self.origin - pulse_probe_len - 3 * self.ramp_sigma - self.marker_start_buffer,
            #                                               pulse_probe_len + 4 * self.ramp_sigma + self.marker_start_buffer)
            #
            # high_values_indices = self.markers['qubit buffer'][ii] > 1
            # self.markers['qubit buffer'][ii][high_values_indices] = 1

        if self.pulse_type == 'gauss':
            if 'qubit drive I' in self.waveforms_dict:
                self.waveforms['qubit drive I'][ii] = ap.sideband(wtpts,
                                                               ap.gauss(wtpts, a, self.origin - 3 * pulse_probe_len,
                                                                         pulse_probe_len), np.zeros(len(wtpts)),
                                                              self.pulse_probe_cfg['iq_freq'], 0)[0]
            if 'qubit drive Q' in self.waveforms_dict:
                self.waveforms['qubit drive Q'][ii] = ap.sideband(wtpts,
                                                               ap.gauss(wtpts, a, self.origin - 3 * pulse_probe_len,
                                                                         pulse_probe_len), np.zeros(len(wtpts)),
                                                              self.pulse_probe_cfg['iq_freq'], 0)[1]
            # self.markers['qubit buffer'][ii] = ap.square(mtpts, 1, self.origin - 6 * pulse_probe_len - self.marker_start_buffer,
            #                                                6 * pulse_probe_len + self.marker_start_buffer)
            #
            # high_values_indices = self.markers['qubit buffer'][ii] > 1
            # self.markers['qubit buffer'][ii][high_values_indices] = 1

        ## heterodyne pulse
        self.marker_start_buffer = 0
        self.marker_end_buffer = 0

        heterodyne_pulsedata = ap.square(wtpts, self.cfg['readout']['heterodyne_a'], self.origin, self.cfg['readout']['width']+1000, 10)

        temp_h_I, temp_h_Q = \
            ap.sideband(wtpts, heterodyne_pulsedata, np.zeros(len(wtpts)), self.cfg['readout']['heterodyne_freq'], 0)

        if 'hetero_ch1' in self.waveforms_dict:
            self.waveforms['hetero_ch1'][ii] = temp_h_I
        if 'hetero_ch2' in self.waveforms_dict:
            self.waveforms['hetero_ch2'][ii] = temp_h_Q
コード例 #12
0
ファイル: HistogramSequence.py プロジェクト: ziqianli/slab
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        # waveform dict
        self.waveforms_dict = {}
        self.waveforms_tpts_dict = {}

        for awg in self.awg_info:
            for waveform in awg['waveforms']:
                self.waveforms_dict[waveform['name']] = self.waveforms[waveform['name']]
                self.waveforms_tpts_dict[waveform['name']] = self.get_waveform_times(waveform['name'])

        wtpts = self.get_waveform_times('qubit drive I')
        # mtpts = self.get_marker_times('qubit buffer')

        # todo: why no pulse blaster code here? c.f. vacuum rabi

        awg_trig_len = 100
        start_pulseblaster(self.exp_period_ns, awg_trig_len, self.origin + self.card_delay,
                           self.origin + self.measurement_delay,
                           self.card_trig_width, self.measurement_width)


        for ii, d in enumerate(self.histo_pts):

            # self.markers['readout pulse'][ii] = ap.square(mtpts, 1, self.origin + self.measurement_delay,
            #                                                self.measurement_width)
            # self.markers['card trigger'][ii] = ap.square(mtpts, 1,
            #                                               self.origin - self.card_delay + self.measurement_delay,
            #                                               self.card_trig_width)

            w = self.pi_length
            if ii>0:
                a = self.pi_a
            else:
                a = 0

            w_ef = self.pi_ef_length
            if ii>1:
                a_ef = self.pi_ef_a
            else:
                a_ef = 0

            if 'qubit drive I' in self.waveforms_dict:
                self.waveforms['qubit drive I'][ii] = np.zeros(len(wtpts))
            if 'qubit drive Q' in self.waveforms_dict:
                self.waveforms['qubit drive Q'][ii] = np.zeros(len(wtpts))

            if self.pulse_type == 'square':
                pulsedata = ap.square(wtpts, a,
                                      self.origin - (w + 2 * self.ramp_sigma) - (w_ef + 4 * self.ramp_sigma), w,
                                      self.ramp_sigma)
                pulsedata_ef = ap.square(wtpts, a_ef, self.origin - (w + 2 * self.ramp_sigma), w_ef, self.ramp_sigma)

            if self.pulse_type == 'gauss':
                pulsedata = ap.gauss(wtpts, a, self.origin - 3 * w - 6 * w_ef, w)
                pulsedata_ef = ap.gauss(wtpts, a_ef, self.origin - 3 * w_ef, w_ef)

            temp_I, temp_Q = ap.sideband(wtpts, pulsedata, np.zeros(len(wtpts)), self.pulse_cfg['iq_freq'], 0)
            if 'qubit drive I' in self.waveforms_dict:
                self.waveforms['qubit drive I'][ii] += temp_I
            if 'qubit drive Q' in self.waveforms_dict:
                self.waveforms['qubit drive Q'][ii] += temp_Q

            # ef pulse shifted in freq by alpha
            # consistent with implementation in ef_rabi
            temp_I_ef, temp_Q_ef = ap.sideband(wtpts, pulsedata_ef, np.zeros(len(wtpts)),
                                         self.pulse_cfg['iq_freq'] + self.cfg['qubit']['alpha'], 0)
            if 'qubit drive I' in self.waveforms_dict:
                self.waveforms['qubit drive I'][ii] += temp_I_ef
            if 'qubit drive Q' in self.waveforms_dict:
                self.waveforms['qubit drive Q'][ii] += temp_Q_ef

            # self.markers['qubit buffer'][ii] = ap.square(mtpts, 1,
            #                                              self.origin - self.max_pulse_width - self.marker_start_buffer,
            #                                              self.max_pulse_width + self.marker_start_buffer)

            ## heterodyne pulse
            self.marker_start_buffer = 0
            self.marker_end_buffer = 0


            heterodyne_pulsedata = ap.square(wtpts, self.readout_cfg['heterodyne_a'], self.origin, self.readout_cfg['width'] + 1000, 10)

            temp_h_I, temp_h_Q = \
                ap.sideband(wtpts, heterodyne_pulsedata, np.zeros(len(wtpts)), self.cfg['readout']['heterodyne_freq'],
                            0)

            if 'hetero_ch1' in self.waveforms_dict:
                self.waveforms['hetero_ch1'][ii] = temp_h_I
            if 'hetero_ch2' in self.waveforms_dict:
                self.waveforms['hetero_ch2'][ii] = temp_h_Q
            ##

            ## flux pulses

            # this is to align flux pulse to readout? (diff in 2 pxdac cards)
            hw_delay = self.cfg['flux_pulse_info']['pxdac_hw_delay']

            if self.cfg['flux_pulse_info']['on_during_drive'] and self.cfg['flux_pulse_info']['on_during_readout']:

                flux_width = max(self.max_pulse_width + self.readout_cfg['delay'] + self.readout_cfg['width'] \
                                 - self.cfg['flux_pulse_info']['flux_drive_delay'], 0)
                flux_comp_width = flux_width  # self.cfg['flux_pulse_info']['dc_comp_pulse_length']
                flux_delay = self.cfg['flux_pulse_info']['flux_drive_delay'] + hw_delay
                flux_idle = 100.0
                flux_start = self.origin - self.max_pulse_width + flux_delay
                flux_comp_start = flux_start + flux_width + flux_idle

            elif (self.cfg['flux_pulse_info']['on_during_drive']) and (
            not self.cfg['flux_pulse_info']['on_during_readout']):

                flux_width = max(self.max_pulse_width - self.cfg['flux_pulse_info']['flux_drive_delay'], 0)
                flux_comp_width = flux_width  # self.cfg['flux_pulse_info']['dc_comp_pulse_length']
                flux_delay = self.cfg['flux_pulse_info']['flux_drive_delay'] + hw_delay
                flux_idle = self.readout_cfg['delay'] + self.readout_cfg['width'] + 100
                flux_start = self.origin - self.max_pulse_width + flux_delay
                flux_comp_start = flux_start + flux_width + flux_idle

            elif (not self.cfg['flux_pulse_info']['on_during_drive']) and (self.cfg['flux_pulse_info']['on_during_readout']):

                flux_width = self.readout_cfg['delay'] + self.readout_cfg['width']
                flux_comp_width = flux_width  # self.cfg['flux_pulse_info']['dc_comp_pulse_length']
                flux_delay = hw_delay
                flux_idle = 100.0
                flux_start = self.origin + flux_delay
                flux_comp_start = flux_start + flux_width + flux_idle

            else:
                flux_width = 0
                flux_comp_width = 0
                flux_delay = 0
                flux_idle = 0
                flux_start = self.origin
                flux_comp_start = flux_start

            flux_a = self.cfg['flux_pulse_info']['flux_a']
            flux_freq = self.cfg['flux_pulse_info']['flux_freq']
            # pulse_exponent = self.cfg['flux_pulse_info']['pulse_exponent']
            sigma = self.cfg["pulse_info"]["square_exp"]["ramp_sigma"]

            for jj in range(4):

                # flux_area = flux_width * flux_a[ii]
                flux_comp_a = - flux_a[jj]  # flux_area/float(flux_comp_width)

                f_I = np.zeros(len(self.waveforms_tpts_dict['flux_%d' % (jj + 1)]))
                f_Q = np.zeros(len(self.waveforms_tpts_dict['flux_%d' % (jj + 1)]))

                if flux_width > 0:
                    # self.psb.append('flux_' + str(ii + 1), 'general', 'square', amp=flux_a[ii],
                    #                 length=flux_width, freq=flux_freq[ii],
                    #                 delay=flux_delay)

                    flux_pulsedata = ap.square(self.waveforms_tpts_dict['flux_%d' % (jj + 1)], flux_a[jj], flux_start,
                                               flux_width, sigma)
                    temp_f_I, temp_f_Q = \
                        ap.sideband(self.waveforms_tpts_dict['flux_%d' % (jj + 1)], flux_pulsedata,
                                    np.zeros(len(self.waveforms_tpts_dict['flux_%d' % (jj + 1)])),
                                    flux_freq[jj], 0)
                    f_I += temp_f_I
                    f_Q += temp_f_Q

                if flux_comp_width > 0:
                    # self.psb.append('flux_' + str(ii + 1), 'general', 'square', amp=flux_comp_a,
                    #                 length=flux_comp_width, freq=flux_freq[ii],
                    #                 delay=flux_delay + flux_idle)

                    flux_pulsedata = ap.square(self.waveforms_tpts_dict['flux_%d' % (jj + 1)], flux_comp_a, flux_comp_start,
                                               flux_comp_width, sigma)
                    temp_f_I, temp_f_Q = \
                        ap.sideband(self.waveforms_tpts_dict['flux_%d' % (jj + 1)], flux_pulsedata,
                                    np.zeros(len(self.waveforms_tpts_dict['flux_%d' % (jj + 1)])),
                                    flux_freq[jj], 0)
                    f_I += temp_f_I
                    f_Q += temp_f_Q

                if 'flux_%d' %(jj+1) in self.waveforms_dict:
                    self.waveforms['flux_%d' %(jj+1)][ii] = f_I
コード例 #13
0
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        wtpts = self.get_waveform_times('qubit drive I')
        #        mtpts = self.get_marker_times('qubit buffer')

        ii = 0
        w = self.pi_length
        a = self.pulse_cfg['pi_a']

        w_ef = self.pi_ef_length
        a_ef = self.pulse_cfg['pi_ef_a']

        # TODO: pulseblaster out of sync bug#

        awg_trig_len = 100
        start_pulseblaster(self.exp_period_ns, awg_trig_len,
                           self.origin + self.card_delay,
                           self.origin + self.measurement_delay,
                           self.card_trig_width, self.measurement_width)
        run_pulseblaster()

        # waveform dict
        self.waveforms_dict = {}
        self.waveforms_tpts_dict = {}

        for awg in self.awg_info:
            for waveform in awg['waveforms']:
                self.waveforms_dict[waveform['name']] = self.waveforms[
                    waveform['name']]
                self.waveforms_tpts_dict[
                    waveform['name']] = self.get_waveform_times(
                        waveform['name'])

        if 'qubit drive I' in self.waveforms_dict:
            self.waveforms['qubit drive I'][ii] = np.zeros(len(wtpts))

        if 'qubit drive Q' in self.waveforms_dict:
            self.waveforms['qubit drive Q'][ii] = np.zeros(len(wtpts))

        if self.pi_pulse:

            if self.pulse_type == 'square':
                pulsedata = ap.square(
                    wtpts, a, self.origin - (w + 2 * self.ramp_sigma) -
                    (w_ef + 4 * self.ramp_sigma), w, self.ramp_sigma)

            if self.pulse_type == 'gauss':
                pulsedata = ap.gauss(wtpts, a, self.origin - 3 * w - 6 * w_ef,
                                     w)

            temp_I, temp_Q = ap.sideband(wtpts, pulsedata,
                                         np.zeros(len(wtpts)),
                                         self.pulse_cfg['iq_freq'], 0)

            if 'qubit drive I' in self.waveforms_dict:
                self.waveforms['qubit drive I'][ii] += temp_I
            if 'qubit drive Q' in self.waveforms_dict:
                self.waveforms['qubit drive Q'][ii] += temp_Q

        if self.pi_ef_pulse:

            if self.pulse_type == 'square':
                pulsedata = ap.square(wtpts, a_ef,
                                      self.origin - (w + 2 * self.ramp_sigma),
                                      w_ef, self.ramp_sigma)

            if self.pulse_type == 'gauss':
                pulsedata = ap.gauss(wtpts, a_ef, self.origin - 3 * w_ef, w_ef)

            # ef pulse shifted in freq by alpha
            # consistent with implementation in ef_rabi
            temp_I, temp_Q = ap.sideband(
                wtpts, pulsedata, np.zeros(len(wtpts)),
                self.pulse_cfg['iq_freq'] + self.cfg['qubit']['alpha'], 0)
            if 'qubit drive I' in self.waveforms_dict:
                self.waveforms['qubit drive I'][ii] += temp_I
            if 'qubit drive Q' in self.waveforms_dict:
                self.waveforms['qubit drive Q'][ii] += temp_Q

        # self.waveforms['qubit drive I'][ii], self.waveforms['qubit drive Q'][ii] = \
        #         ap.sideband(wtpts, pulsedata, np.zeros(len(wtpts)), self.pulse_cfg['iq_freq'], 0)

        ## heterodyne pulse
        self.marker_start_buffer = 0
        self.marker_end_buffer = 0

        heterodyne_pulsedata = ap.square(wtpts,
                                         self.cfg['readout']['heterodyne_a'],
                                         self.origin,
                                         self.cfg['readout']['width'] + 1000,
                                         10)

        temp_h_I, temp_h_Q =\
            ap.sideband(wtpts, heterodyne_pulsedata, np.zeros(len(wtpts)), self.cfg['readout']['heterodyne_freq'], 0)

        if 'hetero_ch1' in self.waveforms_dict:
            self.waveforms['hetero_ch1'][ii] = temp_h_I
        if 'hetero_ch2' in self.waveforms_dict:
            self.waveforms['hetero_ch2'][ii] = temp_h_Q
コード例 #14
0
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        # waveform dict
        self.waveforms_dict = {}
        self.waveforms_tpts_dict = {}

        for awg in self.awg_info:
            for waveform in awg['waveforms']:
                self.waveforms_dict[waveform['name']] = self.waveforms[
                    waveform['name']]
                self.waveforms_tpts_dict[
                    waveform['name']] = self.get_waveform_times(
                        waveform['name'])

        wtpts = self.get_waveform_times('qubit drive I')
        #        mtpts = self.get_marker_times('qubit buffer')

        ii = 0
        # TODO: pulseblaster out of sync bug#

        awg_trig_len = 100
        start_pulseblaster(self.exp_period_ns, awg_trig_len,
                           self.origin + self.card_delay,
                           self.origin + self.measurement_delay,
                           self.card_trig_width, self.measurement_width)
        run_pulseblaster()

        # self.markers['readout pulse'][ii] = ap.square(mtpts, 1, self.origin + self.measurement_delay,
        #                                                self.measurement_width)
        # self.markers['card trigger'][ii] = ap.square(mtpts, 1,
        #                                               self.origin - self.card_delay + self.measurement_delay,
        #                                               self.card_trig_width)

        pulse_probe_len = self.pulse_probe_len
        a = self.a

        if self.pulse_type == 'square':
            if 'qubit drive I' in self.waveforms_dict:
                self.waveforms['qubit drive I'][ii] = ap.sideband(
                    wtpts,
                    ap.square(
                        wtpts, a,
                        self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                        pulse_probe_len, self.ramp_sigma),
                    np.zeros(len(wtpts)), self.pulse_probe_cfg['iq_freq'],
                    0)[0]
            if 'qubit drive Q' in self.waveforms_dict:
                self.waveforms['qubit drive Q'][ii] = ap.sideband(
                    wtpts,
                    ap.square(
                        wtpts, a,
                        self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                        pulse_probe_len, self.ramp_sigma),
                    np.zeros(len(wtpts)), self.pulse_probe_cfg['iq_freq'],
                    0)[1]
            # self.markers['qubit buffer'][ii] = ap.square(mtpts, 1,
            #                                               self.origin - pulse_probe_len - 3 * self.ramp_sigma - self.marker_start_buffer,
            #                                               pulse_probe_len + 4 * self.ramp_sigma + self.marker_start_buffer)
            #
            # high_values_indices = self.markers['qubit buffer'][ii] > 1
            # self.markers['qubit buffer'][ii][high_values_indices] = 1

        if self.pulse_type == 'gauss':
            if 'qubit drive I' in self.waveforms_dict:
                self.waveforms['qubit drive I'][ii] = ap.sideband(
                    wtpts,
                    ap.gauss(wtpts, a, self.origin - 3 * pulse_probe_len,
                             pulse_probe_len), np.zeros(len(wtpts)),
                    self.pulse_probe_cfg['iq_freq'], 0)[0]
            if 'qubit drive Q' in self.waveforms_dict:
                self.waveforms['qubit drive Q'][ii] = ap.sideband(
                    wtpts,
                    ap.gauss(wtpts, a, self.origin - 3 * pulse_probe_len,
                             pulse_probe_len), np.zeros(len(wtpts)),
                    self.pulse_probe_cfg['iq_freq'], 0)[1]
            # self.markers['qubit buffer'][ii] = ap.square(mtpts, 1, self.origin - 6 * pulse_probe_len - self.marker_start_buffer,
            #                                                6 * pulse_probe_len + self.marker_start_buffer)
            #
            # high_values_indices = self.markers['qubit buffer'][ii] > 1
            # self.markers['qubit buffer'][ii][high_values_indices] = 1

        ## heterodyne pulse
        self.marker_start_buffer = 0
        self.marker_end_buffer = 0

        heterodyne_pulsedata = ap.square(wtpts,
                                         self.cfg['readout']['heterodyne_a'],
                                         self.origin,
                                         self.cfg['readout']['width'] + 1000,
                                         10)

        temp_h_I, temp_h_Q = \
            ap.sideband(wtpts, heterodyne_pulsedata, np.zeros(len(wtpts)), self.cfg['readout']['heterodyne_freq'], 0)

        if 'hetero_ch1' in self.waveforms_dict:
            self.waveforms['hetero_ch1'][ii] = temp_h_I
        if 'hetero_ch2' in self.waveforms_dict:
            self.waveforms['hetero_ch2'][ii] = temp_h_Q
コード例 #15
0
    def build_sequence(self):
        PulseSequence.build_sequence(self)

        wtpts = self.get_waveform_times('qubit drive I')
        mtpts = self.get_marker_times('qubit buffer')

        ii = 0
        # TODO: pulseblaster out of sync bug#

        awg_trig_len = 100
        start_pulseblaster(self.exp_period_ns, awg_trig_len,
                           self.origin + self.measurement_delay,
                           self.card_trig_width, self.measurement_width)
        run_pulseblaster()

        self.markers['readout pulse'][ii] = ap.square(
            mtpts, 1, self.origin + self.measurement_delay,
            self.measurement_width)
        self.markers['card trigger'][ii] = ap.square(
            mtpts, 1, self.origin - self.card_delay + self.measurement_delay,
            self.card_trig_width)

        pulse_probe_len = self.pulse_probe_len
        a = self.a

        if self.pulse_type == 'square':
            self.waveforms['qubit drive I'][ii] = ap.sideband(
                wtpts,
                ap.square(wtpts, a,
                          self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                          pulse_probe_len, self.ramp_sigma),
                np.zeros(len(wtpts)), self.pulse_probe_cfg['iq_freq'], 0)[0]
            self.waveforms['qubit drive Q'][ii] = ap.sideband(
                wtpts,
                ap.square(wtpts, a,
                          self.origin - pulse_probe_len - 3 * self.ramp_sigma,
                          pulse_probe_len, self.ramp_sigma),
                np.zeros(len(wtpts)), self.pulse_probe_cfg['iq_freq'], 0)[1]
            self.markers['qubit buffer'][ii] = ap.square(
                mtpts, 1, self.origin - pulse_probe_len - 3 * self.ramp_sigma -
                self.marker_start_buffer, pulse_probe_len +
                4 * self.ramp_sigma + self.marker_start_buffer)

            high_values_indices = self.markers['qubit buffer'][ii] > 1
            self.markers['qubit buffer'][ii][high_values_indices] = 1

        if self.pulse_type == 'gauss':
            self.waveforms['qubit drive I'][ii] = ap.sideband(
                wtpts,
                ap.gauss(wtpts, a,
                         self.origin - 3 * pulse_probe_len, pulse_probe_len),
                np.zeros(len(wtpts)), self.pulse_probe_cfg['iq_freq'], 0)[0]
            self.waveforms['qubit drive Q'][ii] = ap.sideband(
                wtpts,
                ap.gauss(wtpts, a,
                         self.origin - 3 * pulse_probe_len, pulse_probe_len),
                np.zeros(len(wtpts)), self.pulse_probe_cfg['iq_freq'], 0)[1]
            self.markers['qubit buffer'][ii] = ap.square(
                mtpts, 1,
                self.origin - 6 * pulse_probe_len - self.marker_start_buffer,
                6 * pulse_probe_len + self.marker_start_buffer)

            high_values_indices = self.markers['qubit buffer'][ii] > 1
            self.markers['qubit buffer'][ii][high_values_indices] = 1
コード例 #16
0
    def build(self, pulse_sequence_matrix, total_pulse_span_length_list):
        '''
        Parse the pulse sequence matrix generated previously.
        For each pulse sequence, location of readout and card is fixed.
        Pulses are appended backward, from the last pulse to the first pulse.
        '''
        self.origin = self.max_length - (self.measurement_delay + self.measurement_width + self.start_end_buffer)
        self.uses_tek2 = False
        for ii in range(len(pulse_sequence_matrix)):
            self.markers_readout[ii] = ap.square(self.mtpts, 1, self.origin + self.measurement_delay,
                                                 self.measurement_width)
            self.markers_card[ii] = ap.square(self.mtpts, 1,
                                              self.origin - self.card_delay + self.measurement_delay,
                                              self.card_trig_width)
            self.waveforms_qubit_I[ii], self.waveforms_qubit_Q[ii] = \
                ap.sideband(self.wtpts,
                            np.zeros(len(self.wtpts)), np.zeros(len(self.wtpts)),
                            0, 0)
            self.waveforms_qubit_flux[ii] = ap.sideband(self.ftpts,
                                                        np.zeros(len(self.ftpts)), np.zeros(len(self.ftpts)),
                                                        0, 0)[0]
            self.markers_qubit_buffer[ii] = ap.square(self.mtpts, 0, 0, 0)
            pulse_location = 0
            flux_pulse_location = total_pulse_span_length_list[ii]
            flux_pulse_started = False
            flux_end_location = 0
            # The range defined in this way means having the for loop with index backward.
            for jj in range(len(pulse_sequence_matrix[ii]) - 1, -1, -1):
                pulse_defined = True
                pulse = pulse_sequence_matrix[ii][jj]
                if pulse.target == "q":
                    if pulse.type == "square":
                        qubit_waveforms, qubit_marker = square(self.wtpts, self.mtpts, self.origin,
                                                               self.marker_start_buffer, self.marker_end_buffer,pulse_location, pulse,
                                                               self.pulse_cfg)
                    elif pulse.type == "gauss":
                        qubit_waveforms, qubit_marker = gauss(self.wtpts, self.mtpts, self.origin,
                                                              self.marker_start_buffer, self.marker_end_buffer,pulse_location, pulse)
                    else:
                        raise ValueError('Wrong pulse type has been defined')
                    if pulse_defined:
                        self.waveforms_qubit_I[ii] += qubit_waveforms[0]
                        self.waveforms_qubit_Q[ii] += qubit_waveforms[1]
                        self.markers_qubit_buffer[ii] += qubit_marker

                elif pulse.target[:4] == "q,mm":
                    self.uses_tek2 = True
                    if flux_pulse_started == False:
                        flux_end_location = pulse_location
                        flux_pulse_started = True
                    mm_target = int(pulse.target[4])
                    mm_target_info = self.cfg['multimodes'][mm_target]
                    flux_pulse_info = self.cfg['flux_pulse_info']
                    if pulse.type == "square":
                        # waveforms_qubit_flux = flux_square(self.ftpts, flux_pulse_location, pulse,
                        #                                    self.cfg['flux_pulse_info'])

                        waveforms_qubit_flux = flux_square_phase_fix(self.ftpts, flux_pulse_location, pulse,
                                                           self.cfg['flux_pulse_info'],mm_target_info, flux_pulse_info)
                    elif pulse.type == "gauss":
                        waveforms_qubit_flux = flux_gauss(self.ftpts, flux_pulse_location, pulse)
                    else:
                        raise ValueError('Wrong pulse type has been defined')
                    if pulse_defined:
                        self.waveforms_qubit_flux[ii] += waveforms_qubit_flux
                elif pulse.target[:4] == "q:mm":
                    self.uses_tek2 = True
                    if flux_pulse_started == False:
                        flux_end_location = pulse_location
                        flux_pulse_started = True
                    if pulse.type == "square":
                        waveforms_qubit_flux = flux_square(self.ftpts, flux_pulse_location, pulse,
                                                           self.cfg['flux_pulse_info'])
                    elif pulse.type == "gauss":
                        waveforms_qubit_flux = flux_gauss(self.ftpts, flux_pulse_location, pulse)
                    else:
                        raise ValueError('Wrong pulse type has been defined')
                    if pulse_defined:
                        self.waveforms_qubit_flux[ii] += waveforms_qubit_flux
                elif pulse.target == "idle":
                    pass

                high_values_indices = self.markers_qubit_buffer[ii] > 1
                self.markers_qubit_buffer[ii][high_values_indices] = 1

                pulse_location += pulse.span_length
                if flux_pulse_started:
                    flux_pulse_location -= pulse.span_length

            if self.uses_tek2:
                self.markers_ch3m1[ii] = ap.square(self.mtpts, 1,
                                                self.origin - flux_end_location - total_pulse_span_length_list[
                                                    ii] - self.tek2_trigger_delay,
                                                self.card_trig_width)
        return (self.markers_readout,
                self.markers_card,
                self.waveforms_qubit_I,
                self.waveforms_qubit_Q,
                self.waveforms_qubit_flux,
                self.markers_qubit_buffer,
                self.markers_ch3m1)