Ejemplo n.º 1
0
def Cal_CORPSE_pitwo(m,p_dict,readout,fit_guess,lt1,ssro_dict):
    p_dict['nr_of_pulses']=1.
    m.par['sweep_par_name'] = 'Amplitude of Pi/2 CORPSE'
    m.start_measurement(cal.DSC_pi_over_two_pulse_amp,p_dict,lt1=lt1,ssro_dict=ssro_dict)
    
    dp=get_datapath()
    path = lde_calibration.find_newest_data(dp,string=m.name)
    fit_dict = lde_calibration.pi_over_two_calibration(path,readout,fit_guess,new_fig=True,close_fig=True)

    return fit_dict
Ejemplo n.º 2
0
    def Calibrate_pi(self,m,name,lt1,ssro_dict={}):
        datafolder= 'D:/measuring/data/'
        date = dtime.strftime('%Y') + dtime.strftime('%m') + dtime.strftime('%d')
        datapath = datafolder+date + '/'
        
        
        min_pulse_amp =             0.0
        max_pulse_amp =             0.85
        #if lt1:
        #    max_pulse_amp = 0.65
        amplitude = np.linspace(min_pulse_amp,max_pulse_amp,self.nr_of_datapoints)
        
        pulse_dict = {
                "Pi":{"duration": 50., "amplitude":0.58},
                    "init_state_pulse": {"duration":29. , "amplitude":0.7,  
                                    "Do_Pulse": False},
                    "time_between_pulses": 10.,
                    "nr_of_pulses": 1.,
                    "duty_cycle_time": 100.,
                    
                    }
        if lt1:
            pulse_dict["Pi"]["duration"] = 56.
        ### Calibrate Single pi pulse
        single_pi = PulseCalibration(name='Single_Pi_amp')
        self.start_measurement(single_pi,cal.Pi_Pulse_amp,amplitude,pulse_dict,lt1=lt1,ssro_dict=ssro_dict,name='Single_Pi_amp')
        self.par['sweep_par_name'] = 'Pi Pulse amp'
        path = lde_calibration.find_newest_data(datapath,string='Single_Pi_amp')
        rabi_dict = lde_calibration.rabi_calibration(path,close_fig=True)
        fit_amp = rabi_dict["minimum"]
        ms0_readout = rabi_dict["Amplitude"] + rabi_dict["offset"]
        ms1_readout=50.
        
        
        ##### For Calibration of 5 Pi pulses
        pulse_dict["nr_of_pulses"] = 5
        pulse_dict["duty_cycle_time"] = 500
        min_pulse_amp=fit_amp-0.1
        max_pulse_amp=fit_amp+0.1
        if lt1:
            min_pulse_amp=fit_amp-0.3
            max_pulse_amp=fit_amp+0.1
        amplitude = np.linspace(min_pulse_amp,max_pulse_amp,self.nr_of_datapoints)
        Five_pi = PulseCalibration(name='5_Pi_amp')
        self.start_measurement(Five_pi,cal.Pi_Pulse_amp,amplitude,pulse_dict,lt1=lt1,name='5_Pi_amp')
        path = lde_calibration.find_newest_data(datapath,string='5_Pi_amp')
        fit_amp = lde_calibration.rabi_calibration(path,new_fig=True,close_fig=True)
        fit_amp=fit_amp["minimum"]
        Cal_dict={}
        Cal_dict["Pi"] = fit_amp
        
        ##### For Calibration of 8 Pi pulses
        #pulse_dict["nr_of_pulses"] = 8
        #pulse_dict["duty_cycle_time"] = 500
        #min_pulse_amp=fit_amp-0.1
        #max_pulse_amp=fit_amp+0.1
        #amplitude = np.linspace(min_pulse_amp,max_pulse_amp,self.nr_of_datapoints)
        #Five_pi = PulseCalibration(name='8_Pi_amp')
        #self.start_measurement(Five_pi,cal.Pi_Pulse_amp,amplitude,pulse_dict,lt1=lt1,name='8_Pi_amp')
        #path = lde_calibration.find_newest_data(datapath,string='8_Pi_amp')
        #fit_amp = lde_calibration.rabi_calibration(path,new_fig=True,close_fig=True)
        #fit_amp=fit_amp["minimum"]
        
        ### Cal CORPSE Pi/2
        pulse_dict['nr_of_pulses']=1.
        pulse_dict["Pi"]["duration"] = 25.
        if lt1:
            pulse_dict["Pi"]["duration"] = 28.
        min_pulse_amp=fit_amp-0.1
        max_pulse_amp=fit_amp+0.1
        if lt1:
            min_pulse_amp = fit_amp - 0.12
            max_pulse_amp = fit_amp + 0.1
        amplitude = np.linspace(min_pulse_amp,max_pulse_amp,self.nr_of_datapoints)
        pi_over_two = PulseCalibration(name='_pi_over_two')
        dp = self.get_datapath()
        self.start_measurement(pi_over_two,cal.Pi_Pulse_amp,
                amplitude,pulse_dict,lt1=lt1,ssro_dict=ssro_dict,name='pi_over_two')

        path = lde_calibration.find_newest_data(datapath,string='pi_over_two')
        b= 2*np.pi*rabi_dict["Amplitude"]*rabi_dict["freq"]
        a = rabi_dict["offset"]+rabi_dict["Amplitude"]
        pi_over_two_dict = lde_calibration.pi_over_two_calibration(path,[ms0_readout,ms1_readout],[a,b],new_fig=True,close_fig=True)
        Cal_dict["Pi2"] = pi_over_two_dict 

        return Cal_dict
Ejemplo n.º 3
0
def Cal_all_CORPSE(nr_of_datapoints,lt1=False,ESR=None,SSRO=False):
        p_dict = {
                    "Pi":{  "duration": 58., 
                            "amplitude":0.4845
                          },

                    "init_state_pulse": {"duration":0., 
                            "amplitude":0.,  
                            "Do_Pulse": False},

                    "time_between_pulses": 10.,

                    "duty_cycle_time": 100.,
                     }
        
        ## Calibrate SSRO

        if SSRO:
            ssro_dict = Cal_SSRO(lt1)
        else:
            ssro_dict={}


        ## Calibrate ESR

        if ESR:
            ESR_dict={}
            ESR_dict['freq'] = ESR
        else:    
            ESR_dict={}
            ESR_dict['freq'] = Cal_ESR(lt1)
        
        f_drive=ESR_dict['freq']
        
        
        ##Calibrate single Pi pulse

        name = 'Cal_Single_Pi'
        m = PulseCalibration(name)
        
        min_pulse_amp =             0.0
        max_pulse_amp =             0.85
        m.par['sweep_par'] = np.linspace(min_pulse_amp,max_pulse_amp,nr_of_datapoints)
        m.par['sweep_length'] = nr_of_datapoints
        m.f_drive=f_drive

        Pi_dict = Cal_regular_pi_pulse(m,p_dict,lt1,ssro_dict)
        ms0_readout = Pi_dict["Amplitude"] + Pi_dict["offset"]


        ## Cal 1 CORPSE

        name = 'Cal_CORPSE_1_Pi'
        m = PulseCalibration(name)
        
        nr_of_pulses=1.
        pulse_dict["time_between_CORPSE"] = 10.
        fit_amp = Pi_dict["minimum"]
        min_pulse_amp=fit_amp-0.15
        max_pulse_amp=fit_amp+0.15
        
        m.par['sweep_par'] = np.linspace(min_pulse_amp,max_pulse_amp,nr_of_datapoints)
        m.par['sweep_length'] = nr_of_datapoints
        m.f_drive=f_drive
        

        CORPSE_Pi_dict = Cal_CORPSE_pulse(m,nr_of_pulses,p_dict,lt1,ssro_dict)

        ms1_readout = CORPSE_Pi_dict["lowest_meas_value"]


        ##Calibrate 5 CORPSE

        name = 'Cal_CORPSE_5_Pi'
        m = PulseCalibration(name)

        nr_of_pulses= 5.
        fit_amp=CORPSE_Pi_dict["minimum"]
        min_pulse_amp=fit_amp-0.1
        max_pulse_amp=fit_amp+0.1
        
        m.par['sweep_par'] = np.linspace(min_pulse_amp,max_pulse_amp,nr_of_datapoints)
        m.par['sweep_length'] = nr_of_datapoints
        m.f_drive=f_drive

        CORPSE_5_Pi_dict = Cal_CORPSE_pulse(m,nr_of_pulses,p_dict,lt1,ssro_dict)
 
        ## Calibrate CORPSE pi/2

        name = 'Cal_CORPSE_Pi2'
        m = PulseCalibration(name)

        nr_of_pulses= 5.
        fit_amp=CORPSE_5_Pi_dict["minimum"]
        min_pulse_amp=fit_amp-0.1
        max_pulse_amp=fit_amp+0.1
        #if lt1:
        #    min_pulse_amp = fit_amp - 0.12
        #    max_pulse_amp = fit_amp + 0.1
        m.par['sweep_par'] = np.linspace(min_pulse_amp,max_pulse_amp,self.nr_of_datapoints)

        b= 2*np.pi*Pi_dict["Amplitude"]*Pi_dict["freq"]
        a = Pi_dict["offset"]+Pi_dict["Amplitude"]
   
        CORPSE_pi2_dict = lde_calibration.pi_over_two_calibration(m,p_dict,[ms0_readout,ms1_readout],[a,b],lt1,ssro_dict={})        
    
        print 'ms0_readout:'
        print ms0_readout
        print 'ms1_readout:'
        print ms1_readout

        print 'CORPSE Pi amp :'
        print CORPSE_5_Pi_dict['minimum']
        print 'CORPSE Pi/2 amp :'
        print CORPSE_Pi2_dict['minimum']

        Cal_dict={"SSRO":ssro_dict,
                  "ESR":{"freq":f_fit},
                  "MW":rabi_dict,
                  "MW_CORPSE":CORPSE_dict,
                  "MW_Five_CORPSE": CORPSE_5_Pi_dict ,
                  "MW_CORPSE_pi_over_two":CORPSE_pi2_dict
                   }

        return Cal_dict
Ejemplo n.º 4
0
    fit_dict = lde_calibration.rabi_calibration(path,close_fig=True)
    
    return fit_dict

    
def Cal_regular_pi2_pulse(m,p_dict,[ms0,ms1],[a,b],lt1,ssro_dict={}):
    pulse_dict['nr_of_pulses']=1.
>>>>>>> 54c8270ec6ded7035f530c75005cf8bbd74414e7
    m.par['sweep_par_name'] = 'Amplitude of Pi/2'
    m.start_measurement(cal.Pi_Pulse_amp,p_dict,lt1=lt1,ssro_dict=ssro_dict)
    
    
    dp=get_datapath()
<<<<<<< HEAD
    path = lde_calibration.find_newest_data(dp,string=m.name)
    fit_dict = lde_calibration.pi_over_two_calibration(path,readout,fit_guess,new_fig=True,close_fig=True)

    return fit_dict

def Cal_CORPSE_pulse(m,nr_of_pulses,p_dict,lt1,ssro_dict):        
    p_dict['nr_of_pulses'] = nr_of_pulses
    m.par['sweep_par_name'] = 'Amplitude of %d Pi CORPSE pulses' % nr_of_pulses 
    m.start_measurement(cal.DSC_pulse_amp,p_dict,lt1=lt1,ssro_dict=ssro_dict)
    
    dp=get_datapath()
    path = lde_calibration.find_newest_data(dp,string=m.name)
=======
    path = lde_calibration.find_newest_data(dp,string=m.name())
    fit_dict = lde_calibration.pi_over_two_calibration(path,[ms0_readout,ms1_readout],[a,b],new_fig=True,close_fig=True)

    return fit_dict
    def Calibrate(self, m, name, lt1):
        datafolder = "D:/measuring/data/"
        date = dtime.strftime("%Y") + dtime.strftime("%m") + dtime.strftime("%d")
        datapath = datafolder + date + "/"

        min_pulse_amp = 0.0
        max_pulse_amp = 0.85
        # if lt1:
        #    max_pulse_amp = 0.65
        amplitude = np.linspace(min_pulse_amp, max_pulse_amp, self.nr_of_datapoints)

        pulse_dict = {
            "Pi": {"duration": 58.0, "amplitude": 0.4845},
            "Pi_2": {"duration": 29.0, "amplitude": 0.7},
            "init_state_pulse": {"duration": 29.0, "amplitude": 0.7, "Do_Pulse": False},
            "time_between_pulses": 10.0,
            "nr_of_pulses": 1.0,
            "duty_cycle_time": 100.0,
            "time_between_CORPSE": 20.0,
        }

        ### Calibrate SSRO
        # name='SIL9_LT2'
        # m = ssro_ADwin(name)
        # par=m.setup()
        # m.measure(m,name,par)

        # ssro_ADwin.ssro_ADwin_Cal(lt1=lt1)

        path = lde_calibration.find_newest_data(datapath, string="ADwin_SSRO")
        ssro_dict = lde_calibration.ssro_calibration(path)
        # self.par['RO_duration'] = int(round(ssro_dict["t_max"]))

        ### Calibrate ESR freq
        # esr.measure_esr(lt1=lt1)
        path = lde_calibration.find_newest_data(datapath, string="ESR")
        f_fit = lde_calibration.esr_calibration(path)
        if lt1:
            f_fit = 2.82878e9  # WE measured this more accurate
        else:
            f_fit = 2.82877e9 - 0.418e6
        self.f_drive = f_fit

        self.microwaves.set_frequency(self.f_drive)

        # plt=qt.Plot2D(name='MWCal',clear=True)

        ### Calibrate Single pi pulse
        single_pi = PulseCalibration(name="Single_Pi_amp")
        # self.start_measurement(single_pi,cal.Pi_Pulse_amp,amplitude,pulse_dict,lt1=lt1,ssro_dict=ssro_dict,name='Single_Pi_amp')
        self.par["sweep_par_name"] = "Pi Pulse amp"
        path = lde_calibration.find_newest_data(datapath, string="Single_Pi_amp")
        rabi_dict = lde_calibration.rabi_calibration(path, close_fig=True)
        fit_amp = rabi_dict["minimum"]
        ms0_readout = rabi_dict["Amplitude"] + rabi_dict["offset"]

        ### Cal 1 CORPSE Pulse
        min_pulse_amp = fit_amp - 0.15
        max_pulse_amp = fit_amp + 0.15
        # if lt1:
        #    min_pulse_amp = fit_amp-0.25
        #    max_pulse_amp = fit_amp+0.05
        amplitude = np.linspace(min_pulse_amp, max_pulse_amp, self.nr_of_datapoints)
        pulse_dict["istate_pulse"] = {"duration": 0, "amplitude": 0, "Do_Pulse": False}
        pulse_dict["time_between_CORPSE"] = 10.0
        pulse_dict["nr_of_pulses"] = 1.0
        CORPSE = PulseCalibration(name="CORPSE_amp")
        # self.start_measurement(CORPSE,cal.DSC_pulse_amp,amplitude,pulse_dict,lt1=lt1,ssro_dict=ssro_dict,name='CORPSE_amp')
        path = lde_calibration.find_newest_data(datapath, string="CORPSE_amp")
        CORPSE_dict = lde_calibration.rabi_calibration(path, new_fig=True, close_fig=True)
        ms1_readout = CORPSE_dict["lowest_meas_value"]

        ### Cal 5 Corpse pulses
        fit_amp = CORPSE_dict["minimum"]
        min_pulse_amp = fit_amp - 0.1
        max_pulse_amp = fit_amp + 0.1
        amplitude = np.linspace(min_pulse_amp, max_pulse_amp, self.nr_of_datapoints)
        Five_CORPSE = PulseCalibration(name="Five_CORPSE_amp")
        pulse_dict["nr_of_pulses"] = 5.0
        # self.start_measurement(Five_CORPSE,cal.DSC_pulse_amp,amplitude,pulse_dict,lt1=lt1,ssro_dict=ssro_dict,name='Five_CORPSE_amp')
        path = lde_calibration.find_newest_data(datapath, string="Five_CORPSE_amp")
        Five_CORPSE_dict = lde_calibration.rabi_calibration(path, new_fig=True, close_fig=True)
        fit_amp = Five_CORPSE_dict["minimum"]

        ### Cal CORPSE Pi/2
        pulse_dict["nr_of_pulses"] = 1.0
        min_pulse_amp = fit_amp - 0.1
        max_pulse_amp = fit_amp + 0.1
        if lt1:
            min_pulse_amp = fit_amp - 0.12
            max_pulse_amp = fit_amp + 0.1
        amplitude = np.linspace(min_pulse_amp, max_pulse_amp, self.nr_of_datapoints)
        CORPSE_pi_over_two = PulseCalibration(name="CORPSE_pi_over_two")
        # self.start_measurement(CORPSE_pi_over_two,cal.DSC_pi_over_two_pulse_amp,
        #         amplitude,pulse_dict,lt1=lt1,ssro_dict=ssro_dict,name='CORPSE_pi_over_two')

        path = lde_calibration.find_newest_data(datapath, string="CORPSE_pi_over_two")
        b = 2 * np.pi * rabi_dict["Amplitude"] * rabi_dict["freq"]
        a = rabi_dict["offset"] + rabi_dict["Amplitude"]

        pi_over_two_dict = lde_calibration.pi_over_two_calibration(
            path, [ms0_readout, ms1_readout], [a, b], new_fig=True, close_fig=True
        )  ### Cal CORPSE Pi/2

        print "ms0_readout:"
        print ms0_readout
        print "ms1_readout:"
        print ms1_readout

        Cal_dict = {
            "SSRO": ssro_dict,
            "ESR": {"freq": f_fit},
            "MW": rabi_dict,
            "MW_CORPSE": CORPSE_dict,
            "MW_Five_CORPSE": Five_CORPSE_dict,
            "MW_CORPSE_pi_over_two": pi_over_two_dict,
        }

        return Cal_dict