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


Python Datacube.parameters()["rabiFit"]方法代码示例

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


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

示例1: rabi

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

示例2: rabi

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


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