Beispiel #1
0
    def _gen_rfcs_block():

        optimize_pb = pb.PulseBlock()
        optimize_pb.insert(p_obj=po.PTrue(ch='aom', dur=1e-6))
        optimize_pb.insert(p_obj=po.PTrue(ch='mw_gate', dur=1e-6))
        optimize_pb.dflt_dict = dict(aom=po.DTrue(), mw_gate=po.DTrue())
        return optimize_pb
Beispiel #2
0
    def _gen_p_block(self):

        count_trace_pb = pb.PulseBlock()

        # Sample clock
        t_step = (self._l_margin + self._laser_dur + self._r_margin) / self._n_pts

        for idx in range(self._n_pts):
            count_trace_pb.append(
                p_obj=po.PTrue(
                    ch='ctr_gate',
                    dur=t_step / 2,
                    t0=t_step / 2
                )
            )

        # Laser pulse
        count_trace_pb.insert(
            p_obj=po.PTrue(
                ch='aom',
                dur=self._laser_dur,
                t0=self._l_margin
            )
        )

        # Relaxation period and all off pulse block
        count_trace_pb.append(
            p_obj=po.PFalse(
                ch='aom',
                dur=t_step,
                t0=self._relax
            )
        )
        count_trace_pb.append(
            p_obj=po.PFalse(
                ch='ctr_gate',
                dur=t_step,
            )
        )

        # Duration of full PB
        # [for gated_ctr.get_count_ar() timeout]
        self._pb_dur = count_trace_pb.dur

        # Default value
        count_trace_pb.dflt_dict = dict(
            aom=po.DFalse(),
            ctr_gate=po.DFalse()
        )

        return count_trace_pb
Beispiel #3
0
    def _gen_rfcs_block():

        optimize_pb = pb.PulseBlock(
            p_obj_list=[
                po.PTrue(ch='aom', dur=1e-6)
            ],
            dflt_dict=dict(aom=po.DTrue())
        )

        return optimize_pb
Beispiel #4
0
    def _gen_rabi_elem(tau=0, safety_window=200e-9):
        rabi_elem = pb.PulseBlock()

        # Init green_aom pulse
        rabi_elem.insert(p_obj=po.PTrue(ch='aom', dur=2e-6 +
                                        2 * safety_window))

        # Normalization pulse
        rabi_elem.insert(p_obj=po.PTrue(ch='ctr_gate', t0=1.5e-6, dur=0.5e-6))

        # mw pulse
        rabi_elem.append(
            p_obj=po.PTrue(ch='mw_gate', dur=tau, t0=4 * safety_window))

        tmp_dur = rabi_elem.dur + 4 * safety_window

        # Readout AOM pulse
        rabi_elem.insert(p_obj=po.PTrue(ch='aom', dur=1e-6, t0=tmp_dur))

        # readout ctr_gate pulse
        rabi_elem.insert(p_obj=po.PTrue(ch='ctr_gate', dur=0.5e-6, t0=tmp_dur))

        return rabi_elem
Beispiel #5
0
    def _gen_p_block(self, safety_window=200e-9):

        # ========== Prepare individual blocks =========

        # ------- pre_init_pb --------
        # Long optical pumping before first pulse

        pre_init_pb = pb.PulseBlock(p_obj_list=[po.PTrue(ch='aom', dur=3e-6)])

        # ------- all_off_pb --------
        # Switch all channels off after the full pulse sequence

        all_off_pb = pb.PulseBlock(p_obj_list=[
            po.PFalse(ch='aom', dur=1e-6),
            po.PFalse(ch='mw_gate', dur=1e-6),
            po.PFalse(ch='ctr_gate', dur=1e-6)
        ])

        # ========== Construct full rabi_pb =========

        rabi_pb = pb.PulseBlock(name='RabiPB')

        # Pre-init block
        rabi_pb.insert_pb(pb_obj=pre_init_pb)

        # rabi_element ** n_pts
        for tau in self.tau_ar:
            rabi_pb.append_pb(pb_obj=self._gen_rabi_elem(
                tau=tau, safety_window=safety_window))

        # All-off block
        rabi_pb.append_pb(pb_obj=all_off_pb)

        # Default values
        rabi_pb.dflt_dict = dict(aom=po.DFalse(),
                                 ctr_gate=po.DFalse(),
                                 mw_gate=po.DFalse())

        # Correct for aom delay
        rabi_pb.add_offset(offset_dict=dict(aom=-self._aom_delay))

        # Duration of full RabiPB
        # [for gated_ctr.get_count_ar() timeout]
        self._rabi_pb_dur = rabi_pb.dur

        return rabi_pb
Beispiel #6
0
def pb_expand_test(res_dict, indicate_bounds=True):
    """ Helper method to test pb_zip()

    This method takes direct output res_dict of pb_zip() call and reconstructs
    the original pulse block according to the sequence.
    To visualize boundaries between individual sequence elements, set optional
    indicate_bounds parameter to True. This will add zero-length divider pulses
    on one of the channels.

    :param res_dict: (dict) return of pb_zip() call to be reconstructed back
    into a plain waveform.
    :param indicate_bounds: (bool) if True, divider pulses will be added to one
    of the channels after each individual waveform.
    :return: (PulseBlock) reconstructed plain waveform
    """

    import pulseblock.pulse as po

    new_pb = pb.PulseBlock()

    seq_list = res_dict['seq_list']
    snip_list = res_dict['snip_list']

    for snip_idx in range(len(seq_list)):
        snip_name, rep_num = seq_list[snip_idx]

        for rep_idx in range(rep_num):

            # Find wfm_snip corresponding to snip_name
            wfm_snip = None
            for wfm_snip in snip_list:
                if wfm_snip.name == snip_name:
                    break

            new_pb.append_pb(pb_obj=wfm_snip)

            # Add a marker to indicate the block boundary
            if indicate_bounds:
                mrk_ch = list(wfm_snip.dflt_dict.keys())[0]

                new_pb.append(p_obj=po.PTrue(ch=mrk_ch, dur=0), cflct_er=False)

    return new_pb
Beispiel #7
0
    def _gen_p_block(self, debug=False):

        # Technical params

        # safety window between mw_src makes a step and
        # before counter starts accumulation of counts
        safety_window = 0.1 * self._accum_dur

        # Duration of sweep-step pulse
        step_pulse_dur = 0.1 * self._accum_dur  # 200e-6

        # ========== Prepare individual blocks =========

        # ------- first_pb --------
        # First point in the sweep:
        #   mw_src should reset sweep position to start_f,
        #   so there is no need to send step_trig pulse

        first_pb = pb.PulseBlock()

        # long safety window in the beginning
        first_pb.insert(p_obj=po.PFalse(ch='ctr_gate', dur=self._accum_dur))

        # first ctr_gate pulse
        first_pb.append(p_obj=po.PTrue(ch='ctr_gate', dur=self._accum_dur))

        # ------- step_pb --------
        # This pb is repeated for every subsequent sweep step:
        #   send ctr_trig pulse, wait for a safety window and
        #   start accumulating pulses

        step_pb = pb.PulseBlock()

        # step pulse to mw_src
        step_pb.insert(p_obj=po.PTrue(ch='mw_step', dur=step_pulse_dur))

        # ctr_gate pulse
        step_pb.append(p_obj=po.PTrue(
            ch='ctr_gate', dur=self._accum_dur, t0=safety_window))

        # ------- off_pb --------
        # Once sweep is complete, set all outputs to low

        off_pb = pb.PulseBlock()

        off_pb.insert(p_obj=po.PFalse(ch='aom', dur=safety_window))
        off_pb.insert(p_obj=po.PFalse(ch='mw_gate', dur=safety_window))
        off_pb.insert(p_obj=po.PFalse(ch='mw_step', dur=safety_window))
        off_pb.insert(p_obj=po.PFalse(ch='ctr_gate', dur=safety_window))

        # ========== Construct full odmr_pb =========

        odmr_pb = pb.PulseBlock(name='ODMRPulseBlock')

        # Default values
        odmr_pb.dflt_dict = dict(
            aom=po.DFalse(),
            ctr_gate=po.DFalse(),
            mw_gate=po.DFalse(),
            mw_step=po.DFalse(),
        )

        # first_bp
        odmr_pb.insert_pb(pb_obj=first_pb)

        # append step_bp ** (_n_pts-1)
        for _ in np.arange(start=1, stop=self._n_pts):
            odmr_pb.append_pb(pb_obj=step_pb)

        # aom and mw_gate are High during the whole block
        tmp_dur = odmr_pb.dur
        odmr_pb.insert(p_obj=po.PTrue(ch='aom', dur=tmp_dur))
        odmr_pb.insert(p_obj=po.PTrue(ch='mw_gate', dur=tmp_dur))

        # append off_pb
        odmr_pb.append_pb(pb_obj=off_pb)

        if debug:
            return dict(first_pb=first_pb,
                        step_pb=step_pb,
                        off_pb=off_pb,
                        odmr_pb=odmr_pb)
        else:
            return odmr_pb