当前位置: 首页>>代码示例>>Python>>正文


Python Datacube.commit方法代码示例

本文整理汇总了Python中pyview.lib.datacube.Datacube.commit方法的典型用法代码示例。如果您正苦于以下问题:Python Datacube.commit方法的具体用法?Python Datacube.commit怎么用?Python Datacube.commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyview.lib.datacube.Datacube的用法示例。


在下文中一共展示了Datacube.commit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: measureT1

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
 def measureT1(self,tstart,tstop,tstep,accurate=False,name=None,data=None):
 
   
   newData=False
   if data==None:
     newData=True
     if name==None:name='T1 %s'%self.name()
     data=Datacube(name)
     dataManager.addDatacube(data)
   data.setParameters(instrumentManager.parameters())
   self._pulseGenerator._MWSource.turnOn()
   self._pulseGenerator._MWSource.setPower(self._rabiPower)
   self._pulseGenerator._MWSource.setFrequency(self._f01)
   print tstart,tstop, tstep
   if accurate:
     delays=numpy.concatenate([numpy.arange(tstart,tstart+(tstop-tstart)*0.3,tstep),numpy.arange(tstart+(tstop-tstart)*0.9,tstop,max(1,int(tstep/2)))],axis=0)
   else:
     delays=numpy.arange(tstart,tstop,tstep)
   
   try:
     for delay in delays:
       self._pulseGenerator.generatePulse(duration=self._rabiDuration,frequency=self._f01,DelayFromZero=register['repetitionPeriod']/2-self._rabiDuration-delay,useCalibration=False)
       self._pulseGenerator.sendPulse()
       data.set(delay=delay)
       data.set(p=self._jba.takePoint())
       data.commit()
   except:
     raise
   finally:
     data.setParameters(instrumentManager.parameters())
     p=fitT1Parameters(data,variable = "p")
     if newData:data.savetxt()
     self._t1=p[2]
     return data
开发者ID:manipp4,项目名称:qubit_setup,代码行数:36,代码来源:new_qubit.py

示例2: measureRabi

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
  def measureRabi(self,tstart,tstop,tstep,power=None,name=None,data=None):
    newData=False
    if data==None:
      newData=True
      if name==None:name='rabi %s'%self.name()
      data=Datacube(name)
      dataManager.addDatacube(data)
    durations=numpy.arange(tstart,tstop,tstep)
    if power==None:
      power=self._rabiPower


    self._pulseGenerator._MWSource.turnOn()
    self._pulseGenerator._MWSource.setPower(power)
    self._pulseGenerator._MWSource.setFrequency(self._f01)

    try:
      for duration in durations:
        self._pulseGenerator.generatePulse(duration=duration,frequency=self._f01,DelayFromZero=register['repetitionPeriod']/2-duration-10,useCalibration=False)
        self._pulseGenerator.sendPulse()
        data.set(duration=duration)
        data.set(p=self._jba.takePoint())
        data.commit()
    except:
      raise
    finally:
      data.setParameters(instrumentManager.parameters())
      self._rabiPower=power
      if newData:data.savetxt()
      p,o2=fitRabiFrequency(data,yVariable = "p",xVariable = "duration")
      self._rabiDuration=p[1]/2
      return data
开发者ID:manipp4,项目名称:qubit_setup,代码行数:34,代码来源:new_qubit.py

示例3: caractiseQubit

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
 def caractiseQubit(self,data=None,frequencies=[8.5,9.5]):
   if data==None:
     data=Datacube('caracterisation %s'%self.name())
     dataManager.addDatacube(data)
   acqiris.setNLoops(1)
   self._jba.calibrate(bounds=[2,3,25])
   acqiris.setNLoops(10)
   spectro=Datacube('spectro')
   data.addChild(spectro)
   self.measureSpectroscopy(fstart=frequencies[0],fstop=frequencies[1],fstep=0.002,power=-27.,data=spectro)
   data.set(f01=self._f01)
   rabi=Datacube('rabi')
   data.addChild(rabi)
   self.measureRabi(tstart=0,tstop=60,tstep=2.,data=rabi)
   data.set(rabiPi=self._rabiDuration)
   scurves=Datacube('sCurves')
   data.addChild(scurves)
   self.measureSCurves(data=scurves,ntimes=10)
   t1=Datacube('t1')
   data.addChild(t1)
   self.measureT1(tstart=0,tstop=500,tstep=4,data=t1)
   data.set(t1=self._t1)
   frequencies=[self._f01-0.25,self._f01+0.05]
   data.commit()
   data.savetxt()
开发者ID:manipp4,项目名称:qubit_setup,代码行数:27,代码来源:new_qubit.py

示例4: measureSpectroscopy

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
 def measureSpectroscopy(self,fstart,fstop,fstep,power=0.,name=None,data=None):
   duration=2000
   newData=False
   if data==None:
     newData=True
     if name==None:name='Spectro %s'%self.name()
     data=Datacube(name)
     dataManager.addDatacube(data)
   print fstart,fstop,fstep
   frequencies=numpy.arange(fstart,fstop,fstep)
   self._pulseGenerator._MWSource.turnOn()
   self._pulseGenerator._MWSource.setPower(power)
   self._pulseGenerator.generatePulse(duration=duration,frequency=fstart,DelayFromZero=register['repetitionPeriod']/2-duration-15,useCalibration=False)
   self._pulseGenerator.sendPulse()
   try:
     for f in frequencies:
       print f
       self._pulseGenerator._MWSource.setFrequency(f)
       data.set(f=f)
       data.set(**self._jba.measure()[1])
       data.commit()
   except:
     raise
   finally:
     data.setParameters(instrumentManager.parameters())
     if newData:data.savetxt()
     try:
       p,o2=fitQubitFrequency(data,variable = "b1")#,f0=self._f01)
       self._f01=p[1]
     finally:
       return data
开发者ID:manipp4,项目名称:qubit_setup,代码行数:33,代码来源:new_qubit.py

示例5: rabi02

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
def rabi02(qubit,durations,data = None,variable ="p1x",f_sb = -0.1,amplitude = 1.0,averaging = 20,delay = 0,callback = None):

  from instruments.qubit import PulseSequence

  if data == None:
    data = Datacube()
  data.setParameters(instrumentManager.parameters())
  data.setName("Rabi Sequence 02 - %s" % qubit.name())
  f_sb_12 = f_sb-qubit.parameters()["frequencies.f02"]+qubit.parameters()["frequencies.f01"]*2
  qubit.setDriveFrequency(qubit.parameters()["frequencies.f01"]+f_sb)
  qubit.setDriveAmplitude(I = amplitude,Q = amplitude)
  pi12Length = len(qubit.generateRabiPulse(phase = qubit.parameters()["pulses.xy.t_pi12"],f_sb = f_sb))
  try:
    for duration in durations:
      pulseLength = len(qubit.generateRabiPulse(length = duration,f_sb = f_sb_12))
      seq = PulseSequence()
      seq.addPulse(qubit.generateRabiPulse(length = duration,delay = qubit.parameters()["timing.readout"]-pulseLength-pi12Length,f_sb = f_sb))
      seq.addPulse(qubit.generateRabiPulse(length = qubit.parameters()["pulses.xy.t_pi12"],delay = qubit.parameters()["timing.readout"]-pi12Length,f_sb = f_sb_12))
      qubit.loadWaveform(seq.getWaveform(),readout = qubit.parameters()["timing.readout"])
      if callback != None:
        callback(duration)
      acqiris.bifurcationMap(ntimes = averaging)
      data.set(duration = duration)
      data.set(**acqiris.Psw())
      data.commit()
  finally:
    data.savetxt()
  return data
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:30,代码来源:Copie+(2)+de+measure.py

示例6: _attenuatorRangeCheck

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
 def _attenuatorRangeCheck(self,voltages):
   ps = []
   max = 0
   maxVoltage = 0
   self.variances = zeros((len(voltages),2))
   self.variances[:,0] = voltages
   data = Datacube("Variance")
   for i in range(0,len(voltages)):
     if self.stopped():
       self._stopped = False
       raise Exception("Got stopped!")
     v = voltages[i] 
     self._attenuator.setVoltage(v)
     self._acqiris.bifurcationMap(ntimes = 10)
     trends = self._acqiris.trends()
     varsum =cov(trends[self._params["acqirisChannel"]])+cov(trends[self._params["acqirisChannel"]+1])
     data.set(v = v)
     data.set(varsum=varsum)
     data.commit()
     self.notify("variance",(data.column("v"),data.column("varsum")))
     self.notify("status","Variance at %g V: %g" % (v,varsum))
     print "Variance: %f" % varsum
     self.variances[i,1] = varsum
     ps.append(varsum)
     if varsum > max:
       max = varsum
       maxVoltage = voltages[i]
   return (ps,max,maxVoltage)
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:30,代码来源:jba.py

示例7: calibrateSidebandMixing

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
 def calibrateSidebandMixing(self,frequencyRange = None,sidebandRange = arange(-0.5,0.51,0.1)):
   """
   Calibrate the IQ mixer sideband generation.
   """
   if frequencyRange==None:
     frequencyRange=[self._mwg.frequency()]
   try:
     self.setup()
     params = dict()
     params["power"] = self._mwg.power()
     params["channels"] = self._awgChannels
     params["mwg"] = self._mwg.name()
     params["awg"] = self._awg.name()
     params["fsp"] = self._fsp.name()
     self.sidebandCalibrationData().setParameters(params)
     self._mwg.turnOn()
     channels = self._awgChannels
     self.loadSidebandWaveforms()
     for f_c in frequencyRange:
       #We round the center frequency to an accuracy of 1 MHz
       f_c = round(f_c,3)
       self._mwg.setFrequency(f_c)
       self._awg.setAmplitude(channels[0],4.5)
       self._awg.setAmplitude(channels[1],4.5)
       self._awg.setOffset(channels[0],self.iOffset(f_c))
       self._awg.setOffset(channels[1],self.qOffset(f_c))
       data = Datacube("f_c = %g GHz" % f_c)
       rowsToDelete = []
       try:
         for i in range(0,len(self._sidebandCalibrationData.column("f_c"))):
          if abs(self._sidebandCalibrationData.column("f_c")[i]-f_c) < 0.1:
             rowsToDelete.append(i)
       except:
         pass
       self._sidebandCalibrationData.removeRows(rowsToDelete)
       self._sidebandCalibrationData.addChild(data, f_c=f_c)
       self._sidebandCalibrationData.set(f_c = f_c)
       self._sidebandCalibrationData.commit()
       for f_sb in sidebandRange: 
         print "f_c = %g GHz, f_sb = %g GHz" % (f_c,f_sb)
         self._fsp.write("SENSE1:FREQUENCY:CENTER %f GHZ" % (f_c+f_sb))
         result = scipy.optimize.fmin_powell(lambda x,*args: self.measureSidebandPower(x,*args),[0,0],args = [f_sb],full_output = 1,xtol = 0.00001,ftol = 1e-4,maxiter = 2)
         params = result[0]
         value = result[1]
         print "f_c = %g GHz, f_sb = %g GHz, c = %g, phi = %g rad" % (f_c,f_sb,params[0],params[1])
         self.loadSidebandCalibrationWaveform(f_sb = f_sb,c = params[0],phi = params[1])
         for i in [-3,-2,-1,0,1,2,3]:
           self._fsp.write("SENSE1:FREQUENCY:CENTER %f GHZ" % (f_c+f_sb*i))
           if i < 0:
             suppl = "m"
           else:
             suppl = ""
           data.set(**{"p_sb%s%d" % (suppl,abs(i)) : self.measureAveragePower()})
         data.set(f_c = f_c,f_sb = f_sb,c = params[0],phi = params[1])
         data.commit()
       self._sidebandCalibrationData.sortBy("f_c")
       self._sidebandCalibrationData.savetxt()
   finally:
     self.teardown()
   return self._sidebandCalibrationData.filename()
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:62,代码来源:iq_level_optimization.py

示例8: _findAmplitude

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
 def _findAmplitude(self,voltages,frequency,shape):
   """
   Only used by function calibrate.
   Measure and find the amplitude where the JBA is bi-evaluated, go to this point, and store this amplitude
   """
   ps = []
   max = 0
   maxVoltage = 0
   self.variances = zeros((len(voltages),2))
   self.variances[:,0] = voltages
   data = Datacube("Variance")
   for i in range(0,len(voltages)):
     if self.stopped():
       self._stopped = False
       raise Exception("Got stopped!")
     v = voltages[i] 
     self.init()
     self.frequency(frequency=frequency,shape=v*shape)
     (av,trends, fr)=self.analyse()
     varsum =cov(trends[0,:,0])+cov(trends[1,:,0])
     data.set(v = v)
     data.set(varsum=varsum)
     data.commit()
     self.notify("variance",(data.column("v"),data.column("varsum")))
     self.notify("status","Variance at %g V: %g" % (v,varsum))
     print "Variance at v = %f : %f" % (v,varsum)
     self.variances[i,1] = varsum
     ps.append(varsum)
     if varsum > max:
       max = varsum
       maxVoltage = voltages[i]
   self.frequency(frequency=frequency,shape=maxVoltage*shape)
   return (ps,max,maxVoltage,data)
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:35,代码来源:jba_sb.py

示例9: rabi

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
def rabi(qubit,durations,data = None,variable ="p1x",f_sb = -0.1,amplitude = 1.0,averaging = 20,delay = 0,callback = None):
  if data == None:
    data = Datacube()
  data.setParameters(instrumentManager.parameters())
  data.setName("Rabi Sequence - %s" % qubit.name())
  qubit.setDriveFrequency(qubit.parameters()["frequencies.f01"]+f_sb)
  qubit.setDriveAmplitude(I = amplitude,Q = amplitude)
  qubit.turnOnDrive()
  try:
    for duration in durations:
      qubit.loadRabiPulse(length = duration,readout = qubit.parameters()["timing.readout"],f_sb = f_sb)
      if callback != None:
        callback(duration)
      acqiris.bifurcationMap(ntimes = averaging)
      data.set(duration = duration)
      data.set(**acqiris.Psw())
      data.commit()
  finally:
    try:
      params = fitRabiFrequency(data,variable)
      qubit.parameters()["pulses.xy.t_pi"] = params[1]/2.0-params[4]
      qubit.parameters()["pulses.xy.drive_amplitude"] = amplitude
      qubit.parameters()["pulses.xy.f_sb"] = f_sb
      data.parameters()["rabiFit"] = params
      qubit.loadRabiPulse(phase = math.pi,readout = qubit.parameters()["timing.readout"],f_sb = f_sb)
    except:
      pass
    data.savetxt()
  return data
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:31,代码来源:Copie+(2)+de+measure.py

示例10: calibrateAmplitudeAndOffset

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
 def calibrateAmplitudeAndOffset(self,f):
   """
   Only used when this pulse Analyser has to be used as real analyser, not when using it to see bifurcation
   """
   rowData=Datacube()
   for phi in arange(0,2*math.pi,math.pi/30):
     print "calibration : phi = %f deg" % (phi/math.pi*180)    
     self._pulseGenerator.clearPulse()
     self.clear()
     self._pulseGenerator.generatePulse(duration=20000, frequency=f, amplitude=0.6, DelayFromZero=0,useCalibration=True, phase=phi)
     self.addFrequency(f=f,useCorrection=False)    	
     self._pulseGenerator.sendPulse()
     time.sleep(0.5)
     (av, co, fr)= self.analyse()
     rowData.set(I=av[0,0], Q=av[1,0],phi=phi)          	
     rowData.commit()
   #I0=2/ptp(rowData['I'])
   #Q0=2/ptp(rowData['Q'])
   (I,Q,phi,dphi)=scipy.optimize.fmin_powell(lambda (I,Q,phi0,dphi): sum((I*rowData['I'] - sin(rowData['phi']+phi0+dphi))**2)+sum((Q*rowData['Q'] - cos(rowData['phi']+phi0))**2),(1,1,0,0))
   print (I,Q,phi,dphi)
   f_c=self._MWSource.frequency()
   df=f-f_c
   index=self._calibration.search(f_sb=df,f_c=f_c)
   if index!=None:
     self._calibration.removeRow(index)
   self._calibration.set(I=I,Q=Q,phi=dphi,f_c=f_c,f_sb=df)
   self._calibration.commit()
   self._calibration.savetxt()
   register['%s Cal'% self._name]=self._calibration.filename()
   return rowData
开发者ID:manipp4,项目名称:qubit_setup,代码行数:32,代码来源:pulse_analyser.py

示例11: measureRabi

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
  def measureRabi(self,durations,data=None,rabiParameters=None, dataParameters=None):
    """
    Measure a rabi, will use what is in dictionnary if power/frequency/useCalibration/nLoops are not set
    Fit and save the period in the Qubit dictionnary under piRabiTime
    Return the datacube and rabiPeriod
    """

    if dataParameters==None:
      dataParameters=dict()
      dataParameters['addToDataManager']=True
      dataParameters['save']=True

    if rabiParameters==None:
      if self._params.has_key('rabiParameters'):
        rabiParameters=self._params['rabiParameters']
      else: raise Exception("Unable to find rabi parameters... Exiting... ")

    useCalibration=rabiParameters['useCalibration']
    frequency=rabiParameters['frequency']
    if frequency=="f01":frequency=self.frequency01()

    power=rabiParameters['power']
    nLoops=rabiParameters['nLoops']

    if rabiParameters.has_key('remember'):
      if rabiParameters['remember']: self._params['rabiParameters']=rabiParameters

    if self._params.has_key('offsetDelay'):
      offsetDelay=self._params['offsetDelay']
    else: offsetDelay=20

    if data==None:
      data=Datacube("Rabi %s dBm"%power)
      if dataParameters['addToDataManager']:data.toDataManager()


    if power !="stay":self._pulseGenerator._MWSource.setPower(power)
    self._pulseGenerator._MWSource.turnOn()
    for duration in durations:
      self.clearPulses()
      self.generateRabiPulse(duration=duration, frequency=frequency, offsetDelay=offsetDelay,useCalibration=rabiParameters['useCalibration'])
      result=self._jba.measure(nLoops=nLoops,fast=True)[0]
      data.set(**result)
      data.set(duration=duration)
      data.commit() 

    #Fit
    try:
      columnName="b%i"%self._jba.bit
      period= estimatePeriod(data['duration'],data[columnName])
      [y0,dy,piRabi,t10],yfit=fitRabi(data['duration'],data[columnName],period=period)
      data.createColumn("%sfit"%columnName,yfit)
    except:
      print 'fit error'
      piRabi=0
    if dataParameters['save']:data.savetxt()
    self._params['piRabiTime']=piRabi

    return data,piRabi
开发者ID:manipp4,项目名称:qubit_setup,代码行数:61,代码来源:qubit.py

示例12: rabi12

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
def rabi12(qubit,durations,data = None,variable ="p1x",averaging = 20,delay = 0,callback = None,saveData = True):

  from instruments.qubit import PulseSequence

  if data == None:
    data = Datacube()
  
  data.setParameters(instrumentManager.parameters())
  data.setName("Rabi Sequence 12 - %s" % qubit.name())

  amplitude = qubit.parameters()["pulses.xy.drive_amplitude"]
  f_sb = qubit.parameters()["pulses.xy.f_sb"]
  f_carrier = qubit.parameters()["frequencies.f01"]+f_sb
  f_sb_12 = -(qubit.parameters()["frequencies.f12"]-f_carrier)
  
  print f_sb_12

  qubit.setDriveFrequency(f_carrier)
  qubit.setDriveAmplitude(I = amplitude,Q = amplitude)

  failed = False
  data.parameters()["defaultPlot"] = [["duration",variable],["duration","%s_fit" % variable]]
  try:
    for duration in durations:
      seq = PulseSequence()
      seq.addPulse(qubit.generateRabiPulse(phase = math.pi,f_sb = f_sb))
      seq.addPulse(qubit.generateRabiPulse(length = duration,f_sb = f_sb_12))
      seq.addPulse(qubit.generateRabiPulse(phase = math.pi,f_sb = f_sb))
      qubit.loadWaveform(seq.getWaveform(endAt = qubit.parameters()["timing.readout"]),readout = qubit.parameters()["timing.readout"])
      if callback != None:
        callback(duration)
      acqiris.bifurcationMap(ntimes = averaging)
      data.set(duration = duration)
      data.set(**acqiris.Psw())
      data.commit()
  except StopThread:
    pass
  except:
    print "Failed!"
    failed = True
    import traceback
    traceback.print_exc()
  finally:
    if len(data) == 0:
      return
    if failed:
      raise
    (params,rsquare) = fitRabi12Frequency(data,variable)
    qubit.parameters()["pulses.xy.t_pi12"] = params[1]/2.0
    qubit.parameters()["pulses.xy.drive_amplitude12"] = amplitude
    qubit.parameters()["pulses.xy.f_sb12"] = f_sb_12
    data.parameters()["rabiFit12"] = params
    if saveData:
      data.savetxt()
  return data
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:57,代码来源:measure.py

示例13: measureSCurve

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
  def measureSCurve(self,voltages = None,ntimes = 40,microwaveOff = True):
    self.notify("status","Measuring S curve...")
    def getVoltageBounds(v0,jba,variable,ntimes):
      v = v0
      jba.setVoltage(v)
      jba._acqiris.bifurcationMap(ntimes = ntimes)
      p = jba._acqiris.Psw()[variable]
      
      while p > 0.03 and v < v0*2.0:
        v*=1.05
        jba.setVoltage(v)
        jba._acqiris.bifurcationMap(ntimes = ntimes)
        p = jba._acqiris.Psw()[variable]
      vmax = v
      
      v = v0
      jba.setVoltage(v)
      jba._acqiris.bifurcationMap(ntimes = ntimes)
      p = jba._acqiris.Psw()[variable]
      
      while p < 0.98 and v > v0/2.0:
        v/=1.05
        jba.setVoltage(v)
        jba._acqiris.bifurcationMap(ntimes = ntimes)
        p = jba._acqiris.Psw()[variable]
      vmin = v
      return (vmin*0.95,vmax*1.2)

    try:
      v0 = self.voltage()
      state = self._qubitmwg.output()
      self._attenuator.turnOn()
      data = Datacube("S Curve")
      dataManager = DataManager()
      dataManager.addDatacube(data)
      if microwaveOff:
        self._qubitmwg.turnOff()
      if voltages == None:
        self.notify("status","Searching for proper voltage range...")
        (vmin,vmax) = getVoltageBounds(v0,self,self._params["variable"],ntimes)
        voltages = arange(vmin,vmax,0.005)
        self.notify("status","Measuring S curve in voltage range  [%g - %g]..." % (vmin,vmax))
      for v in voltages:
        self.setVoltage(v)
        self._acqiris.bifurcationMap(ntimes = ntimes)
        data.set(v = v)
        data.set(**(self._acqiris.Psw()))
        data.commit()
        self.notify("sCurve",(data.column("v"),data.column(self._params["variable"])))
    finally:
      self.notify("status","S curve complete.")
      self.setVoltage(v0)
      if state:
        self._qubitmwg.turnOn()
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:56,代码来源:jba.py

示例14: rabi

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
def rabi(qubit,durations,data = None,variable ="p1x",f_sb = -0.1,amplitude = 1.0,averaging = 20,delay = 0,use12Pulse = False,callback = None,angle = 0,compositePulse = False,gaussian = True,flank = 3,saveData = True):
  if data == None:
    data = Datacube()
  data.setParameters(instrumentManager.parameters())
  data.parameters()["defaultPlot"]=[["duration",variable]]

  data.setName("Rabi Sequence - %s" % qubit.name())
  qubit.setDriveFrequency(qubit.parameters()["frequencies.f01"]+f_sb)
  qubit.setDriveAmplitude(I = amplitude,Q = amplitude)
  qubit.turnOnDrive()
  try:
    for duration in durations:
      if compositePulse:
        seq = PulseSequence()
        seq.addPulse(qubit.generateRabiPulse(angle = angle,length = duration/2.0,f_sb = f_sb,sidebandDelay = seq.position(),gaussian = gaussian))
        seq.addWait(0)
        seq.addPulse(qubit.generateRabiPulse(angle = angle,length = duration/2.0,f_sb = f_sb,sidebandDelay = seq.position(),gaussian = gaussian))
        qubit.loadWaveform(seq.getWaveform(endAt = qubit.parameters()["timing.readout"]-delay),readout = qubit.parameters()["timing.readout"])
      else:
        seq = PulseSequence()
        seq.addPulse(qubit.generateRabiPulse(angle = angle,length = duration,f_sb = f_sb,sidebandDelay = seq.position(),gaussian = gaussian))
        if use12Pulse:
          f_carrier = qubit.parameters()["frequencies.f01"]+f_sb
          f_sb_12 = -(qubit.parameters()["frequencies.f12"]-f_carrier)
          t_pi_12 = qubit.parameters()["pulses.xy.t_pi12"]
          seq.addPulse(qubit.generateRabiPulse(angle = angle,length = t_pi_12,f_sb = f_sb_12,sidebandDelay = seq.position()))
        qubit.loadWaveform(seq.getWaveform())#endAt = qubit.parameters()["timing.readout"]-delay),readout = qubit.parameters()["timing.readout"])
        
      if callback != None:
        callback(duration)
      acqiris.bifurcationMap(ntimes = averaging)
      data.set(duration = duration)
      data.set(**acqiris.Psw())
      data.commit()
  except:
    import traceback
    traceback.print_exc()
  finally:
    (params,rsquare) = fitRabiFrequency(data,variable,withOffset = True)
    if rsquare > 0.5:
      qubit.parameters()["pulses.xy.t_pi"] = float(params[1]/2.0)
      qubit.parameters()["pulses.xy.drive_amplitude"] = float(amplitude)
      qubit.parameters()["pulses.xy.f_sb"] = float(f_sb)
      data.parameters()["rabiFit"] = params
      qubit.loadRabiPulse(flank = flank,angle = angle,phase = math.pi,readout = qubit.parameters()["timing.readout"],f_sb = f_sb)
    else:
      print "Rabi fit is not good, resetting parameters..."
      qubit.parameters()["pulses.xy.t_pi"] = None
      qubit.parameters()["pulses.xy.drive_amplitude"] = None
      qubit.parameters()["pulses.xy.f_sb"] = None
    if saveData:
      data.savetxt()
  return data
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:55,代码来源:measure.py

示例15: ramsey

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import commit [as 别名]
def ramsey(delays,cube = None,ntimes = 20,length = 20):
	if cube == None:
		ramseyData = Datacube()
	else:
		ramseyData = cube
	ramseyData.setParameters(instruments.parameters())
	for delay in delays:
		generateRamseyWaveform(length = length,delay = delay)
		acqiris.bifurcationMap(ntimes = ntimes)
		ramseyData.set(delay = delay,**acqiris.Psw())
		ramseyData.commit()
	return rabiData
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:14,代码来源:Copie+(2)+de+measure.py


注:本文中的pyview.lib.datacube.Datacube.commit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。