Esempio n. 1
0
    def _create_pulse_sequences(self):
        '''
        Creates a pulse sequence with no pulses for a reset time, then the laser on for a count_source_pulse_width time.
        The daq measurement window is then swept across the laser pulse window to measure counts from min_delay
        (can be negative) to max_delay, which are both defined with the laser on at 0.

        Returns: pulse_sequences, num_averages, tau_list, measurement_gate_width
            pulse_sequences: a list of pulse sequences, each corresponding to a different time 'tau' that is to be
            scanned over. Each pulse sequence is a list of pulse objects containing the desired pulses. Each pulse
            sequence must have the same number of daq read pulses
            num_averages: the number of times to repeat each pulse sequence
            tau_list: the list of times tau, with each value corresponding to a pulse sequence in pulse_sequences
            measurement_gate_width: the width (in ns) of the daq measurement


        '''
        pulse_sequences = []
        gate_delays = list(
            range(self.settings['min_delay'], self.settings['max_delay'],
                  self.settings['delay_interval_step_size']))
        reset_time = self.settings['reset_time']
        for delay in gate_delays:
            pulse_sequences.append([
                Pulse('laser', reset_time,
                      self.settings['count_source_pulse_width']),
                Pulse('apd_readout', delay + reset_time,
                      self.settings['measurement_gate_pulse_width'])
            ])
        return pulse_sequences, gate_delays, self.settings[
            'measurement_gate_pulse_width']
Esempio n. 2
0
    def _create_pulse_sequences(self):
        '''

        Returns: pulse_sequences, num_averages, tau_list, meas_time
            pulse_sequences: a list of pulse sequences, each corresponding to a different time 'tau' that is to be
            scanned over. Each pulse sequence is a list of pulse objects containing the desired pulses. Each pulse
            sequence must have the same number of daq read pulses
            num_averages: the number of times to repeat each pulse sequence
            tau_list: the list of times tau, with each value corresponding to a pulse sequence in pulse_sequences
            meas_time: the width (in ns) of the daq measurement

        '''
        pulse_sequences = []
        # tau_list = range(int(max(15, self.settings['tau_times']['time_step'])), int(self.settings['tau_times']['max_time'] + 15),
        #                  self.settings['tau_times']['time_step'])
        # JG 16-08-25 changed (15ns min spacing is taken care of later):
        tau_list = list(
            range(int(self.settings['tau_times']['min_time']),
                  int(self.settings['tau_times']['max_time']),
                  self.settings['tau_times']['time_step']))

        # ignore the sequence if the mw-pulse is shorter than 15ns (0 is ok because there is no mw pulse!)
        tau_list = [x for x in tau_list if x == 0 or x >= 15]
        nv_reset_time = self.settings['read_out']['nv_reset_time']
        delay_readout = self.settings['read_out']['delay_readout']
        microwave_channel = 'microwave_' + self.settings['mw_pulse'][
            'microwave_channel']

        laser_off_time = self.settings['read_out']['laser_off_time']
        delay_mw_readout = self.settings['read_out']['delay_mw_readout']
        pi_time = self.settings['mw_pulse']['pi_time']
        meas_time = self.settings['read_out']['readout_window']

        for tau in tau_list:
            pulse_sequence = \
                [Pulse('laser', laser_off_time, nv_reset_time),
                 Pulse('apd_readout', laser_off_time+ delay_readout + tau, meas_time),
                 ]
            # if tau is 0 there is actually no mw pulse
            if tau > 0:
                pulse_sequence += [
                    Pulse(microwave_channel,
                          laser_off_time + nv_reset_time + laser_off_time,
                          pi_time)
                ]

            pulse_sequence += [
                Pulse(
                    'laser', laser_off_time + nv_reset_time + laser_off_time +
                    delay_mw_readout, nv_reset_time),
                Pulse(
                    'apd_readout', laser_off_time + nv_reset_time +
                    laser_off_time + delay_mw_readout + delay_readout + tau,
                    meas_time)
            ]
            # ignore the sequence is the mw is shorter than 15ns (0 is ok because there is no mw pulse!)
            # if tau == 0 or tau>=15:
            pulse_sequences.append(pulse_sequence)

        return pulse_sequences, tau_list, meas_time
Esempio n. 3
0
    def _create_pulse_sequences(self):
        '''

        Returns: pulse_sequences, num_averages, tau_list
            pulse_sequences: a list of pulse sequences, each corresponding to a different time 'tau' that is to be
            scanned over. Each pulse sequence is a list of pulse objects containing the desired pulses. Each pulse
            sequence must have the same number of daq read pulses
            num_averages: the number of times to repeat each pulse sequence
            tau_list: the list of times tau, with each value corresponding to a pulse sequence in pulse_sequences
            meas_time: the width (in ns) of the daq measurement

        '''
        pulse_sequences = []
        reset_time = self.settings['reset_time']
        mw_time = self.settings['mw_time']
        pulse_sequences.append([
            Pulse('laser', 0, reset_time),
            Pulse('microwave_i', reset_time + 200, mw_time),
            Pulse('laser', reset_time + mw_time + 300,
                  self.settings['meas_time']),
            Pulse('apd_readout', reset_time + mw_time + 300,
                  self.settings['meas_time'])
        ])

        end_time_max = 0
        for pulse_sequence in pulse_sequences:
            for pulse in pulse_sequence:
                end_time_max = max(end_time_max,
                                   pulse.start_time + pulse.duration)
        for pulse_sequence in pulse_sequences:
            pulse_sequence.append(Pulse(
                'laser', end_time_max + 1850,
                15))  # Jan Feb 1st 2017: what is 1850??? Need to comment!

        return pulse_sequences, [mw_time], self.settings['meas_time']
Esempio n. 4
0
    def _create_pulse_sequences(self):
        '''

        Returns: pulse_sequences, num_averages, tau_list
            pulse_sequences: a list of pulse sequences, each corresponding to a different time 'tau' that is to be
            scanned over. Each pulse sequence is a list of pulse objects containing the desired pulses. Each pulse
            sequence must have the same number of daq read pulses
            num_averages: the number of times to repeat each pulse sequence
            tau_list: the list of times tau, with each value corresponding to a pulse sequence in pulse_sequences
            meas_time: the width (in ns) of the daq measurement

        '''

        tau = self.settings['tau_mw']
        pulse_sequences = []
        tau_list = [tau]

        nv_reset_time = self.settings['read_out']['nv_reset_time']
        delay_readout = self.settings['read_out']['delay_readout']
        microwave_channel = 'microwave_i'

        laser_off_time = self.settings['read_out']['laser_off_time']
        meas_time = self.settings['read_out']['meas_time']
        delay_mw_readout = self.settings['read_out']['delay_mw_readout']

        for tau in tau_list:
            pulse_sequence = \
                [Pulse('laser', laser_off_time + tau + 2 * 40, nv_reset_time)]
            #  Pulse('apd_readout', laser_off_time + tau + 2 * 40 + delay_readout, meas_time),
            #  ]
            # if tau is 0 there is actually no mw pulse
            if tau > 0:
                pulse_sequence += [
                    Pulse(
                        microwave_channel, laser_off_time + tau + 2 * 40 +
                        nv_reset_time + laser_off_time, tau)
                ]

            pulse_sequence += [
                Pulse(
                    'laser', laser_off_time + tau + 2 * 40 + nv_reset_time +
                    laser_off_time + tau + 2 * 40 + delay_mw_readout,
                    nv_reset_time),
                Pulse(
                    'apd_readout', laser_off_time + tau + 2 * 40 +
                    nv_reset_time + laser_off_time + tau + 2 * 40 +
                    delay_mw_readout + delay_readout, meas_time)
            ]
            # ignore the sequence is the mw is shorter than 15ns (0 is ok because there is no mw pulse!)
            # if tau == 0 or tau>=15:
            pulse_sequences.append(pulse_sequence)

        return pulse_sequences, tau_list, self.settings['read_out'][
            'meas_time']
Esempio n. 5
0
    def _combine_pulses(self, pulse_sequence, channel_id, overlap_window):
        """

        combines overlapping pulses in pulse_sequence with channeld id "channeld_id"

        Args:
            pulse_sequence: pulse sequence, list of Pulse object
            channel_id: id of channel where we combine the pulses if they overlap
            overlap_window: if pulses are closer than the "overlap_window" time window, they are considered overlapping and will be combined

        Returns: new pulse sequence, where the overlapping pulses have been combined

        """

        # split the sequence in the channels that we want to combine and the ones that we keep
        sequence_id = [
            pulse for pulse in pulse_sequence if pulse.channel_id == channel_id
        ]  # the sequences belonging to channel_id
        sequence_remainder = [
            pulse for pulse in pulse_sequence if pulse.channel_id != channel_id
        ]  # the sequences not belonging to channel_id

        # sort
        sequence_id = sorted(sequence_id, key=lambda pulse: pulse.start_time)

        # since the length of sequence_id shrinks over time we check on every iteration if we reached the end of the list
        # instead of doing a for index in range(len(sequence_id)) loop
        index = 0
        while True:
            if index >= len(sequence_id) - 1:
                break
            first_pulse = sequence_id[index]
            second_pulse = sequence_id[index + 1]
            if ((second_pulse.start_time) -
                (first_pulse.start_time +
                 first_pulse.duration)) < overlap_window:

                # the combined pulse duration is the max of either the first pulse duration or
                # the differnence between the end of the second pulse and the start of the first pulse
                # the first case seems a bit unusual but can happen, for mw switch pulses where both
                # the I and Q channel are mapped onto the same channel (mw_switch)
                combined_pulse_duration = max(
                    first_pulse.duration,
                    (second_pulse.start_time - first_pulse.start_time) +
                    second_pulse.duration)

                combined_pulse = Pulse(channel_id, first_pulse.start_time,
                                       combined_pulse_duration)
                sequence_id.remove(first_pulse)
                sequence_id.remove(second_pulse)
                sequence_id.insert(index, combined_pulse)
            else:
                index += 1

        # "adding" list in python concatenates them!
        return sequence_id + sequence_remainder
Esempio n. 6
0
    def _create_pulse_sequences(self):
        '''

        Returns: pulse_sequences, num_averages, tau_list, meas_time
            pulse_sequences: a list of pulse sequences, each corresponding to a different time 'tau' that is to be
            scanned over. Each pulse sequence is a list of pulse objects containing the desired pulses. Each pulse
            sequence must have the same number of daq read pulses
            num_averages: the number of times to repeat each pulse sequence
            tau_list: the list of times tau, with each value corresponding to a pulse sequence in pulse_sequences
            meas_time: the width (in ns) of the daq measurement

        '''
        pulse_sequences = []
        # tau_list = range(int(max(15, self.settings['tau_times']['time_step'])), int(self.settings['tau_times']['max_time'] + 15),
        #                  self.settings['tau_times']['time_step'])
        # JG 16-08-25 changed (15ns min spacing is taken care of later):
        tau_list = np.arange(self.settings['tau_times']['min_time'],
                             self.settings['tau_times']['max_time'],
                             self.settings['tau_times']['time_step'])
        tau_list = np.ndarray.tolist(tau_list)  # 20180731 ER convert to list

        # ignore the sequence if the mw-pulse is shorter than 15ns (0 is ok because there is no mw pulse!)
        tau_list = [x for x in tau_list if x == 0 or x >= 15]

        nv_reset_time = self.settings['read_out']['nv_reset_time']
        delay_readout = self.settings['read_out']['delay_readout']
        microwave_channel = 'microwave_' + self.settings['mw_pulses'][
            'microwave_channel']
        if self.settings['mw_pulses']['microwave_channel'] == 'i':
            mw_chan_pi = 'q'
        else:
            mw_chan_pi = 'i'
        microwave_channel_pi = 'microwave_' + mw_chan_pi
        pi_time = self.settings['mw_pulses']['pi_pulse_time']
        pi_half_time = self.settings['mw_pulses']['pi_half_pulse_time']
        three_pi_half_time = self.settings['mw_pulses']['3pi_half_pulse_time']

        laser_off_time = self.settings['read_out']['laser_off_time']
        meas_time = self.settings['read_out']['meas_time']
        delay_mw_readout = self.settings['read_out']['delay_mw_readout']

        for tau in tau_list:
            pulse_sequence = \
            [
                Pulse(microwave_channel, laser_off_time, pi_half_time),
                Pulse(microwave_channel_pi, laser_off_time + pi_half_time + tau - pi_time/2., pi_time),
                Pulse(microwave_channel, laser_off_time + pi_half_time + tau + tau, pi_half_time)
            ]

            end_of_first_HE = laser_off_time + pi_half_time + tau + tau + pi_half_time

            pulse_sequence += [
                Pulse('laser', end_of_first_HE + delay_mw_readout,
                      nv_reset_time),
                Pulse('apd_readout',
                      end_of_first_HE + delay_mw_readout + delay_readout,
                      meas_time),
            ]

            start_of_second_HE = end_of_first_HE + delay_mw_readout + nv_reset_time + laser_off_time

            pulse_sequence += \
            [
                Pulse(microwave_channel, start_of_second_HE, pi_half_time),
                Pulse(microwave_channel_pi, start_of_second_HE + pi_half_time + tau - pi_time/2., pi_time),
                Pulse(microwave_channel, start_of_second_HE + pi_half_time + tau + tau, three_pi_half_time)
            ]

            end_of_second_HE = start_of_second_HE + pi_half_time + tau + tau + three_pi_half_time

            pulse_sequence += [
                Pulse('laser', end_of_second_HE + delay_mw_readout,
                      nv_reset_time),
                Pulse('apd_readout',
                      end_of_second_HE + delay_mw_readout + delay_readout,
                      meas_time)
            ]
            # ignore the sequence is the mw is shorter than 15ns (0 is ok because there is no mw pulse!)
            # if tau == 0 or tau>=15:
            pulse_sequences.append(pulse_sequence)

        return pulse_sequences, tau_list, meas_time
Esempio n. 7
0
    def _create_pulse_sequences(self):
        '''

        Returns: pulse_sequences, num_averages, tau_list, meas_time
            pulse_sequences: a list of pulse sequences, each corresponding to a different time 'tau' that is to be
            scanned over. Each pulse sequence is a list of pulse objects containing the desired pulses. Each pulse
            sequence must have the same number of daq read pulses
            num_averages: the number of times to repeat each pulse sequence
            tau_list: the list of times tau, with each value corresponding to a pulse sequence in pulse_sequences
            meas_time: the width (in ns) of the daq measurement

        '''
        pulse_sequences = []
        # tau_list = range(int(max(15, self.settings['tau_times']['time_step'])), int(self.settings['tau_times']['max_time'] + 15),
        #                  self.settings['tau_times']['time_step'])
        # JG 16-08-25 changed (15ns min spacing is taken care of later):
        tau_list = list(
            range(int(self.settings['tau_times']['min_time']),
                  int(self.settings['tau_times']['max_time']),
                  self.settings['tau_times']['time_step']))

        # ignore the sequence if the mw-pulse is shorter than 15ns (0 is ok because there is no mw pulse!)
        tau_list = [x for x in tau_list if x == 0 or x >= 15]

        nv_reset_time = self.settings['read_out']['nv_reset_time']
        delay_readout = self.settings['read_out']['delay_readout']
        microwave_channel = 'microwave_' + self.settings['mw_pulses'][
            'microwave_channel']
        microwave_channel_pi2 = 'microwave_' + self.settings['mw_pulses'][
            'microwave_channel_pi2']
        pi_time = self.settings['mw_pulses']['pi_pulse_time']
        pi_half_time = self.settings['mw_pulses']['pi_half_pulse_time']
        three_pi_half_time = self.settings['mw_pulses']['3pi_half_pulse_time']

        laser_off_time = self.settings['read_out']['laser_off_time']
        meas_time = self.settings['read_out']['meas_time']
        delay_mw_readout = self.settings['read_out']['delay_mw_readout']

        for tau in tau_list:
            pulse_sequence = \
            [
                Pulse(microwave_channel_pi2, laser_off_time, pi_half_time), # pi/2 pulse
            ]

            next_pi_t = laser_off_time + pi_half_time / 2. + tau / 2 - pi_time / 2.
            N = self.settings['mw_pulses']['pi_pulse_blocks_k'] * 8
            counter = 0
            for ind in range(0, N):
                print("counter")
                print(counter)
                if counter % 2 == 0:
                    pulse_sequence += [
                        Pulse(microwave_channel, next_pi_t,
                              pi_time)  # pulses along x
                    ]
                else:
                    pulse_sequence += [
                        Pulse(microwave_channel_pi2, next_pi_t,
                              pi_time)  # pulses along y
                    ]
                next_pi_t = next_pi_t + tau
                counter += 1

            pulse_sequence += [
                Pulse(
                    microwave_channel_pi2, next_pi_t - tau + pi_time / 2. +
                    tau / 2 - pi_half_time / 2., pi_half_time)
            ]
            end_of_first_CPMG = next_pi_t - tau + pi_time / 2. + tau / 2 - pi_half_time / 2. + pi_half_time

            pulse_sequence += \
                [
                 Pulse('laser', end_of_first_CPMG + delay_mw_readout, nv_reset_time),
                 Pulse('apd_readout', end_of_first_CPMG + delay_mw_readout + delay_readout, meas_time)
                ]

            start_of_second_CPMG = end_of_first_CPMG + delay_mw_readout + nv_reset_time + laser_off_time

            pulse_sequence += \
            [
                Pulse(microwave_channel_pi2, start_of_second_CPMG, pi_half_time),
            ]

            next_pi_t = start_of_second_CPMG + pi_half_time / 2. + tau / 2 - pi_time / 2.
            counter = 0
            for ind in range(0, N):
                print("counter take 2")
                print(counter)
                if counter % 2 == 0:
                    pulse_sequence += [
                        Pulse(microwave_channel, next_pi_t,
                              pi_time)  # pulses along x
                    ]
                else:
                    pulse_sequence += [
                        Pulse(microwave_channel_pi2, next_pi_t,
                              pi_time)  # pulses along y
                    ]
                next_pi_t = next_pi_t + tau
                counter += 1

            pulse_sequence += [
                Pulse(
                    microwave_channel_pi2, next_pi_t - tau + pi_time / 2. +
                    tau / 2 - three_pi_half_time / 2., three_pi_half_time)
            ]

            end_of_second_CPMG = next_pi_t - tau + pi_time / 2. + tau / 2 - three_pi_half_time / 2. + three_pi_half_time

            pulse_sequence += [
                Pulse('laser', end_of_second_CPMG + delay_mw_readout,
                      nv_reset_time),
                Pulse('apd_readout',
                      end_of_second_CPMG + delay_mw_readout + delay_readout,
                      meas_time)
            ]
            # ignore the sequence is the mw is shorter than 15ns (0 is ok because there is no mw pulse!)
            # if tau == 0 or tau>=15:
            pulse_sequences.append(pulse_sequence)

        return pulse_sequences, tau_list, meas_time
Esempio n. 8
0
    def _create_pulse_sequences(self):
        '''

        Returns: pulse_sequences, num_averages, tau_list
            pulse_sequences: a list of pulse sequences, each corresponding to a different time 'tau' that is to be
            scanned over. Each pulse sequence is a list of pulse objects containing the desired pulses. Each pulse
            sequence must have the same number of daq read pulses
            num_averages: the number of times to repeat each pulse sequence
            tau_list: the list of times tau, with each value corresponding to a pulse sequence in pulse_sequences
            meas_time: the width (in ns) of the daq measurement

        '''
        pulse_sequences = []
        # tau_list = range(int(max(15, self.settings['min_delay_time'])), int(self.settings['max_delay_time'] + 15),
        #                  self.settings['delay_time_step'])

        # JG: changed the previous because the 15ns is taken care of later
        tau_list = list(
            range(int(self.settings['tau_times']['min_time']),
                  int(self.settings['tau_times']['max_time']),
                  self.settings['tau_times']['time_step']))

        reset_time = self.settings['read_out']['nv_reset_time']
        pi_time = self.settings['mw_pulses']['pi_pulse_time']
        pi_half_time = pi_time / 2.0

        ref_meas_off_time = self.settings['read_out']['ref_meas_off_time']
        meas_time = self.settings['read_out']['meas_time']
        delay_mw_init = self.settings['read_out']['delay_mw_init']
        delay_mw_readout = self.settings['read_out']['delay_mw_readout']

        number_of_pulse_blocks = self.settings['mw_pulses'][
            'number_of_pulse_blocks']

        for tau in tau_list:

            pulse_sequence = []

            #initialize and pi/2 pulse
            pulse_sequence.extend([
                Pulse('laser', 0,
                      reset_time - ref_meas_off_time - 15 - meas_time),
                Pulse('apd_readout', reset_time - 15 - meas_time, meas_time),
                Pulse('laser', reset_time - 15 - meas_time, meas_time),
                Pulse('microwave_i', reset_time + delay_mw_init, pi_half_time)
            ])

            #CPMG xyxyyxyx loops added number_of_pulse_blocks times
            section_begin_time = reset_time + delay_mw_init + pi_half_time - tau / 2  #for the first pulse, only wait tau/2
            # JG 16-08-19 - begin changed to pi time instead of pi/2
            # section_begin_time = reset_time + delay_mw_init + pi_time
            # JG 16-08-19 - end

            for i in range(0, number_of_pulse_blocks):
                pulse_sequence.extend([
                    Pulse('microwave_i',
                          section_begin_time + 1 * tau - pi_half_time,
                          pi_time),
                    Pulse('microwave_q',
                          section_begin_time + 2 * tau - pi_half_time,
                          pi_time),
                    Pulse('microwave_i',
                          section_begin_time + 3 * tau - pi_half_time,
                          pi_time),
                    Pulse('microwave_q',
                          section_begin_time + 4 * tau - pi_half_time,
                          pi_time),
                ])
                section_begin_time += 4 * tau

            #pi/2 and readout
            pulse_sequence.extend([
                Pulse('microwave_i', section_begin_time + tau / 2,
                      pi_half_time),
                Pulse(
                    'laser', section_begin_time + tau / 2 + pi_half_time +
                    delay_mw_readout, meas_time),
                Pulse(
                    'apd_readout', section_begin_time + tau / 2 +
                    pi_half_time + delay_mw_readout, meas_time)
            ])

            # JG 16-08-19 - begin changed to pi time instead of pi/2
            # pulse_sequence.extend([Pulse('microwave_i', section_begin_time + tau, pi_half_time),
            #                        Pulse('laser',       section_begin_time + tau + pi_half_time + delay_mw_readout, meas_time),
            #                        Pulse('apd_readout', section_begin_time + tau + pi_half_time + delay_mw_readout, meas_time)])
            # JG 16-08-19 - end

            pulse_sequences.append(pulse_sequence)

        # end_time_max = 0
        # for pulse_sequence in pulse_sequences:
        #     for pulse in pulse_sequence:
        #         end_time_max = max(end_time_max, pulse.start_time + pulse.duration)
        # for pulse_sequence in pulse_sequences:
        #     pulse_sequence.append(Pulse('laser', end_time_max + 1850, 15))

        return pulse_sequences, tau_list, meas_time
Esempio n. 9
0
    def _create_pulse_sequences(self):
        '''
        creates the pulse sequence for the Hahn echo /
        Returns: pulse_sequences, num_averages, tau_list
            pulse_sequences: a list of pulse sequences, each corresponding to a different time 'tau' that is to be
            scanned over. Each pulse sequence is a list of pulse objects containing the desired pulses. Each pulse
            sequence must have the same number of daq read pulses
            num_averages: the number of times to repeat each pulse sequence
            tau_list: the list of times tau, with each value corresponding to a pulse sequence in pulse_sequences
            meas_time: the width (in ns) of the daq measurement

        '''
        pulse_sequences = []

        tau_list = list(
            range(
                int(self.settings['tau_times']['min_time']),
                int(self.settings['tau_times']['max_time'] +
                    self.settings['tau_times']['time_step']),
                self.settings['tau_times']['time_step']))

        reset_time = self.settings['read_out']['nv_reset_time']
        pi_time = self.settings['mw_pulses']['pi_pulse_time']
        pi_half_time = pi_time / 2.0

        ref_meas_off_time = self.settings['read_out']['ref_meas_off_time']
        meas_time = self.settings['read_out']['meas_time']
        delay_mw_init = self.settings['read_out']['delay_mw_init']
        delay_mw_readout = self.settings['read_out']['delay_mw_readout']
        number_of_pi_pulses = self.settings['mw_pulses']['number_of_pi_pulses']

        for tau in tau_list:

            # pulse_sequence = [Pulse('laser', 0, reset_time - ref_meas_off_time - 15 - meas_time),
            #                   Pulse('apd_readout', reset_time - 15 - meas_time, meas_time),
            #                   Pulse('laser', reset_time - 15 - meas_time, meas_time),
            #                   Pulse('microwave_i', reset_time + delay_mw_init, pi_half_time)
            #                   ]
            # # 16-08-25 JG: changed :
            pulse_sequence = [
                Pulse('laser', 0,
                      reset_time - ref_meas_off_time - 15 - meas_time),
                Pulse('apd_readout', reset_time - 15 - meas_time, meas_time),
                Pulse('laser', reset_time - 15 - meas_time, meas_time),
                Pulse('microwave_i',
                      reset_time + delay_mw_init - pi_half_time / 2,
                      pi_half_time)
            ]

            # next_pi_pulse_time = reset_time + delay_mw_init + pi_half_time + tau
            # # 16-08-19 JG: changed :
            next_pi_pulse_time = reset_time + delay_mw_init
            # # 16-08-25 JG: changed :
            # next_pi_pulse_time = reset_time + delay_mw_init - pi_half_time / 2 + tau / 2

            for n in range(1, number_of_pi_pulses + 1):
                next_pi_pulse_time += tau / 2
                pulse_sequence.extend([
                    Pulse('microwave_q', next_pi_pulse_time - pi_time / 2,
                          pi_time)
                ])
                # next_pi_pulse_time += tau*2 + pi_time
                # 16-08-19 JG: changed:
                # next_pi_pulse_time += tau
                # 16 - 08 -24 JG: changed
                next_pi_pulse_time += tau / 2

            if number_of_pi_pulses == 0:
                next_pi_pulse_time += tau

            # pulse_sequence.extend([Pulse('microwave_i', next_pi_pulse_time-tau, pi_half_time),
            #                         Pulse('laser', next_pi_pulse_time-tau + delay_mw_readout + pi_half_time, meas_time),
            #                         Pulse('apd_readout',next_pi_pulse_time-tau + delay_mw_readout + pi_half_time, meas_time)
            #                         ])
            # 16-08-19 JG: changed:
            # pulse_sequence.extend([Pulse('microwave_i', next_pi_pulse_time-tau/2 + pi_half_time, pi_half_time),
            #                         Pulse('laser',      next_pi_pulse_time-tau/2 + pi_time + delay_mw_readout, meas_time),
            #                         Pulse('apd_readout',next_pi_pulse_time-tau/2 + pi_time + delay_mw_readout, meas_time)
            #                         ])
            # pulse_sequences.append(pulse_sequence)
            # 16 - 08 -24 JG: changed
            # pulse_sequence.extend([Pulse('microwave_i', next_pi_pulse_time + pi_half_time, pi_half_time),
            #                        Pulse('laser', next_pi_pulse_time + pi_time + delay_mw_readout, meas_time),
            #                        Pulse('apd_readout', next_pi_pulse_time + pi_time + delay_mw_readout,
            #                              meas_time)
            #                        ])

            # # 16-08-25 JG: changed :
            pulse_sequence.extend([
                Pulse('microwave_i', next_pi_pulse_time - pi_half_time / 2,
                      pi_half_time),
                Pulse('laser',
                      next_pi_pulse_time + pi_half_time + delay_mw_readout,
                      meas_time),
                Pulse('apd_readout',
                      next_pi_pulse_time + pi_half_time + delay_mw_readout,
                      meas_time)
            ])

            pulse_sequences.append(pulse_sequence)

        # TEMPORATTY: THIS IS TO SEE IF THE OVERALL TIME OF A SEQUENCE SHOULD ALWAYS BE THE SAME
        # IF WE WANT TO KEEP THIS ADD ADDITIONAL PARAMETER TO THE SCRIPT SETTINGS
        # end_time_max = 0
        # for pulse_sequence in pulse_sequences:
        #     for pulse in pulse_sequence:
        #         end_time_max = max(end_time_max, pulse.start_time + pulse.duration)
        # for pulse_sequence in pulse_sequences:
        #     pulse_sequence.append(Pulse('laser', end_time_max + 1850, 15))

        return pulse_sequences, tau_list, meas_time
Esempio n. 10
0
    def _add_mw_switch_to_sequences(self, pulse_sequences):
        """
        Adds the microwave switch to a sequence by toggling it on/off for every microwave_i or microwave_q pulse,
        with a buffer given by mw_switch_extra_time
        Args:
            pulse_sequences: Pulse sequence without mw switch
        Returns: Pulse sequence with mw switch added in appropriate places
        """
        gating = self.settings['mw_switch']['gating']
        mw_switch_time = self.settings['mw_switch']['extra_time']

        pulse_sequences_with_mw_switch = []
        for pulse_sequence in pulse_sequences:
            mw_switch_pulses = []
            # add a switch pulse for each microwave pulse, pulses are carved with i and q channels and wide mw switch pulses are added to surpress leakage
            if gating == 'mw_iq':
                for pulse in pulse_sequence:
                    if pulse.channel_id in ['microwave_i', 'microwave_q']:
                        mw_switch_pulses.append(
                            Pulse('microwave_switch',
                                  pulse.start_time - mw_switch_time,
                                  pulse.duration + 2 * mw_switch_time))

                # add the mw switch pulses to the pulse sequences
                pulse_sequence.extend(mw_switch_pulses)

                # combine overlapping pulses and those that are within 2*mw_switch_extra_time
                pulse_sequence = self._combine_pulses(
                    pulse_sequence,
                    channel_id='microwave_switch',
                    overlap_window=2 * mw_switch_time)

            elif gating == 'mw_switch':
                # in the case gating == 'mw_switch', the pulse is carved with the mw switch
                # thus, we extend the duration of the i and q pulses by mw_switch_time before and after

                for index, pulse in enumerate(pulse_sequence):
                    if pulse.channel_id in ['microwave_i', 'microwave_q']:
                        mw_switch_pulses.append(
                            Pulse('microwave_switch', pulse.start_time,
                                  pulse.duration))

                        # replace the i and q pulses with wider pulses
                        new_pulse = Pulse(pulse.channel_id,
                                          pulse.start_time - mw_switch_time,
                                          pulse.duration + 2 * mw_switch_time)
                        pulse_sequence.remove(pulse)
                        pulse_sequence.insert(index, new_pulse)

                # add the mw switch pulses to the pulse sequences
                pulse_sequence.extend(mw_switch_pulses)

                # combine overlapping pulses and those that are within 2*mw_switch_extra_time
                pulse_sequence = self._combine_pulses(pulse_sequence,
                                                      channel_id='microwave_i',
                                                      overlap_window=2 *
                                                      mw_switch_time)
                pulse_sequence = self._combine_pulses(pulse_sequence,
                                                      channel_id='microwave_q',
                                                      overlap_window=2 *
                                                      mw_switch_time)
            pulse_sequences_with_mw_switch.append(pulse_sequence)

        return pulse_sequences_with_mw_switch