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


Python Datacube.savetxt方法代码示例

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


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

示例1: measureSpectroscopy

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [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

示例2: spectroscopy

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [as 别名]
def spectroscopy(qubit,frequencies,data = None,ntimes = 20,amplitude = 0.1,variable = "p1x",measureAtReadout = False,delay = 0,f_sb = 0,measure20 = True):
  if data == None:
    data = Datacube()
  if measureAtReadout:
    data.setName("Spectroscopy at Readout - %s" % qubit.name())
  else:
    data.setName("Spectroscopy - %s" % qubit.name())
  measureSpectroscopy(qubit = qubit,frequencies = frequencies,data = data,amplitude = amplitude,measureAtReadout = measureAtReadout,delay = delay,f_sb = f_sb)
  (params,rsquare) = fitQubitFrequency(data,variable)
  if measureAtReadout:
    qubit.parameters()["frequencies.readout.f01"] = params[1]
  else: 
    qubit.parameters()["frequencies.f01"] = params[1]
    qubit.setDriveFrequency(params[1])
  data.setName(data.name()+ " - f01 = %g GHz" % params[1])
  if not measureAtReadout:
    if measure20:
      data02 = Datacube("Spectroscopy of (0->2)_2 transition")
      data.addChild(data02)
      frequencies02 = arange(params[1]-0.2,params[1]-0.05,0.001)
      measureSpectroscopy(qubit = qubit,frequencies = frequencies02,data = data02,amplitude = amplitude*10.0,measureAtReadout = measureAtReadout,delay = delay,f_sb = f_sb)
      (params02,rsquare02) = fitQubitFrequency(data02,variable)
      qubit.parameters()["frequencies.f02"] = params02[1]*2.0
      data.setName(data.name()+" - f02_2 = %g GHz" % params02[1])
  data.savetxt()
  return data
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:28,代码来源:Copie+(2)+de+measure.py

示例3: rabi

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [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

示例4: caractiseQubit

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [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

示例5: measureT1

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [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

示例6: measureRabi

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [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

示例7: rabi02

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [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

示例8: measureRabi

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [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

示例9: rabi12

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [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

示例10: rabi

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [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

示例11: spectroscopy

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [as 别名]
def spectroscopy(qubit,frequencies,data = None,ntimes = 20,amplitude = 0.1,variable = "p1x",measureAtReadout = False,delay = 0,f_sb = 0,measure20 = True,fitFrequency = True,factor20 = 10.0,delayAtReadout = 1500,saveData = True,pulseLength = 500,gaussian=True):
  f_drive = qubit.driveFrequency()
  try:
    if data == None:
      data = Datacube()
    if measureAtReadout:
      data.setName("Spectroscopy at Readout - %s" % qubit.name())
    else:
      data.setName("Spectroscopy - %s" % qubit.name())
    data.parameters()["defaultPlot"]=[["f",variable]]
    measureSpectroscopy(qubit = qubit,frequencies = frequencies,data = data,amplitude = amplitude,measureAtReadout = measureAtReadout,delay = delay,f_sb = f_sb,delayAtReadout = delayAtReadout,pulseLength = pulseLength,gaussian=gaussian)
    if fitFrequency:
      (params,rsquare) = fitQubitFrequency(data,variable)
      if measureAtReadout:
        varname01 = "frequencies.readout.f01"
      else:
        varname01 = "frequencies.f01"
      if rsquare > 0.6:
        print params[1]
        qubit.parameters()[varname01] = params[1]
        data.setName(data.name()+ " - f01 = %g GHz" %  qubit.parameters()[varname01])
      else:
        print "No peak found..."
        data.savetxt()
        return data
    if measure20:
      data02 = Datacube("Spectroscopy of (0->2)_2 transition")
      data.addChild(data02)
      frequencies02 = arange(params[1]-0.18,params[1]-0.05,0.001)
      data02.parameters()["defaultPlot"]=[["f",variable]]
      measureSpectroscopy(qubit = qubit,frequencies = frequencies02,data = data02,amplitude = amplitude*factor20,measureAtReadout = measureAtReadout,delay = delay,f_sb = f_sb,delayAtReadout = delayAtReadout,pulseLength = pulseLength,gaussian=gaussian)
      (params02,rsquare02) = fitQubitFrequency(data02,variable)
      if rsquare02 > 0.5 and params[0] > 0.2:
        if measureAtReadout:
          varname02 = "frequencies.readout.f02"
          varname12 = "frequencies.readout.f12"
        else:
          varname02 = "frequencies.f02"
          varname12 = "frequencies.f12"
        qubit.parameters()[varname02] = params02[1]*2.0
        qubit.parameters()[varname12] = params02[1]*2.0-qubit.parameters()[varname01]
        data.setName(data.name()+" - f02_2 = %g GHz" % (qubit.parameters()[varname02]/2))
    if saveData:
      data.savetxt()
    return data
  finally:
    try:
      qubit.setDriveFrequency(f_drive)
    except:
      pass
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:52,代码来源:measure.py

示例12: T1

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [as 别名]
def T1(qubit,delays,data = None,averaging = 20,variable = "p1x"):
  if data == None:
  	data = Datacube()
  data.setName("T1 - " + qubit.name())
  data.setParameters(instrumentManager.parameters())
  try:
    for delay in delays:
      qubit.loadRabiPulse(phase = math.pi,readout = qubit.parameters()["timing.readout"],delay = delay)
      acqiris.bifurcationMap(ntimes = averaging)
      data.set(delay = delay)
      data.set(**acqiris.Psw())
      data.commit()
  finally:
    params = fitT1Parameters(data,variable)
    data.setName(data.name()+" - T1 = %g ns " % params[2])
    qubit.parameters()["relaxation.t1"] = params[2]
    data.savetxt()
  return data
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:20,代码来源:Copie+(2)+de+measure.py

示例13: measureSpectroscopy

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [as 别名]
def measureSpectroscopy(qubit,frequencies,data = None,ntimes = 20,amplitude = 0.1,variable = "p1x"):
  if data == None:
    data = Datacube()
  data.setName("Spectroscopy - %s" % qubit.name())
  qubit.loadRabiPulse(length = 500,readout = qubit.parameters()["timing.readout"],f_sb = 0)
  qubit.turnOnDrive()
  data.setParameters(instrumentManager.parameters())
  try:
    for f in frequencies:
      qubit.setDriveFrequency(f)
      qubit.setDriveAmplitude(I = amplitude,Q = amplitude)
      acqiris.bifurcationMap(ntimes = ntimes)
      data.set(f = f)
      data.set(**acqiris.Psw())
      data.commit()
  finally:
    (params,rsquare) = fitQubitFrequency(data,variable)
    qubit.parameters()["frequencies.f01"] = params[1]
    qubit.setDriveFrequency(params[1])
    data.setName(data.name()+" - f01 = %g GHz" % params[1])
    data.savetxt()
  return spectroData
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:24,代码来源:Copie+de+measure.py

示例14: T1precis

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [as 别名]
def T1precis(qubit,delays,data = None,averaging = 20,variable = "p1x"):
	print "starting T1precis..."
	if data == None:
		data = Datacube()
	data.setName("T1 - " + qubit.name())
	data.setParameters(instrumentManager.parameters())
	data.parameters()["defaultPlot"]=[["delay",variable]]
	highTdelays=arange(2500,2600,5)
	try:
		for delay in highTdelays:
			qubit.loadRabiPulse(phase = math.pi,readout = qubit.parameters()["timing.readout"],delay = delay)
			acqiris.bifurcationMap(ntimes = averaging)
			data.set(delay=delay)
			data.set(**acqiris.Psw())
			data.commit()
		highTvalue=data.ColumnMean(variable)
		highTValueFound=True
		print "Long time ps=",highTvalue		
	except:
		highTValueFound=False
		raise 
	try:
		for delay in delays:
			qubit.loadRabiPulse(phase = math.pi,readout = qubit.parameters()["timing.readout"],delay = delay)
			acqiris.bifurcationMap(ntimes = averaging)
			data.set(delay=delay)
			data.set(**acqiris.Psw())
			data.commit()
	finally:
		if highTValueFound:
			print "calling fitT1Parametersprecis"
			params = fitT1Parametersprecis(data,variable,highTvalue)
		else:
			params = fitT1Parameters(data,variable)
		data.setName(data.name()+" - T1 = %g ns " % params[1])
		qubit.parameters()["relaxation.t1"] = params[1]
		data.savetxt()
	return data
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:40,代码来源:measure.py

示例15: T1

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import savetxt [as 别名]
def T1(qubit,delays,data = None,averaging = 20,variable = "p1x",gaussian = True,saveData = True,state=1):
  if data == None:
  	data = Datacube()
  data.setName("T1 - " + qubit.name()+" - state "+str(state))
  data.setParameters(instrumentManager.parameters())
  data.parameters()["defaultPlot"]=[["delay",variable]]
  try:
			for delay in delays:
				if state==2:
					loadPi012Pulse(qubit,delay=delay)
				else:
					qubit.loadRabiPulse(phase = math.pi,delay = delay,gaussian = gaussian)
				acqiris.bifurcationMap(ntimes = averaging)
				data.set(delay = delay)
				data.set(**acqiris.Psw())
				data.commit()
  finally:
  	params = fitT1Parameters(data,variable)
  	data.setName(data.name()+" - T1 = %g ns " % params[2])
  	qubit.parameters()["relaxation.t1_%d" % state] = params[2]
  	if saveData:
  		data.savetxt()
  return data
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:25,代码来源:measure.py


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