本文整理汇总了Python中pyview.lib.datacube.Datacube.setName方法的典型用法代码示例。如果您正苦于以下问题:Python Datacube.setName方法的具体用法?Python Datacube.setName怎么用?Python Datacube.setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyview.lib.datacube.Datacube
的用法示例。
在下文中一共展示了Datacube.setName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rabi02
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [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
示例2: rabi
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [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
示例3: findAnticrossing
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [as 别名]
def findAnticrossing(voltageRead, voltageWrite, searchRange1, searchRange2, cube=None):
if cube == None:
cube = Datacube()
spectro = Datacube()
spectro.setName("Qubit 1 Spectroscopy")
cube.addChild(spectro)
jba.calibrate()
params = getQubitFrequency(mwg, initialRange, variable, spectro)
示例4: rabi12
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [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
示例5: rabi
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [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
示例6: spectroscopy
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [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
示例7: T1
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [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
示例8: spectroscopy
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [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
示例9: measureSpectroscopy
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [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
示例10: T1precis
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [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
示例11: T1
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [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
示例12: setUp
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [as 别名]
def setUp(self):
"""
We create all necessary directories and test datacubes for the IO tests.
"""
self.testCubes = dict()
rc = Datacube()
self.testCubes["real"] = rc
rc.setName("Datacube test: Real data")
rc.setParameters({"test":1,"array":[1,2,3,4],"hash":{"a":1,"b":2}})
for i in range(0,2):
rc.set(x = i,y = i*i, z = i*i*i,r = random.random())
child = Datacube()
child.setName("test {0:d}".format(i))
rc.addChild(child)
rc.commit()
for j in range(0,2):
child.set(x = j,t = j*2-j*j,r = random.random())
child.commit()
self.dataPath = os.path.normpath(os.path.dirname(__file__)+"/data")
if not os.path.exists(self.dataPath):
os.mkdir(self.dataPath)
cx = Datacube(dtype = numpy.complex128)
self.testCubes["complex"] = cx
rc.setName("Datacube test: Complex data")
rc.setParameters({"test":1,"array":[1,2,3,4],"hash":{"a":1,"b":2}})
for i in range(0,2):
cx.set(x = i,y = i*i*1j+4, z = i*i*i*1j,r = 1j*random.random())
child = Datacube(dtype = numpy.complex128)
child.setName("test {0:d}".format(i))
cx.addChild(child)
cx.commit()
for j in range(0,2):
child.set(x = j,t = j*2-j*j*1j,r = 1j*random.random())
child.commit()
示例13: measureSCurve
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [as 别名]
def measureSCurve(self,voltages = None,nLoops = 5,microwaveOff = True,data=None,fspPower=False,corelations=False,**extraInDatacube):
self.notify("status","Measuring S curve...")
def getVoltageBounds(v0,jba,variable,ntimes):
return (0.5,5)
v = v0
jba.setVoltage(v)
jba._acqiris.bifurcationMap(ntimes = nLoops)
p = jba._acqiris.Psw()[variable]
while p > 0.03 and v < v0*2.0:
v*=1.05
jba.setVoltage(v)
jba._acqiris.bifurcationMap(ntimes = nLoops)
p = jba._acqiris.Psw()[variable]
vmax = v
v = v0
jba.setVoltage(v)
jba._acqiris.bifurcationMap(ntimes = nLoops)
p = jba._acqiris.Psw()[variable]
while p < 0.98 and v > v0/2.0:
v/=1.05
jba.setVoltage(v)
jba._acqiris.bifurcationMap(ntimes = nLoops)
p = jba._acqiris.Psw()[variable]
vmin = v
return (vmin*0.95,vmax*1.2)
if fspPower:
self._pulseGenerator._mixer._fsp.setFrequency(self._frequency)
if data==None:
data = Datacube("%s S Curve - f=%f" %(self.name(),self._frequency))
dataManager = DataManager()
dataManager.addDatacube(data)
else:
data.setName("%s S Curve - f=%f" %(self.name(),self._frequency))
if voltages==None:
bounds=[self.center-self.width*1,self.center+self.width*1]
# voltages=linspace(bounds[0],bounds[1],200)
voltages=SmartLoop(bounds[0],(bounds[1]-bounds[0])/50, bounds[1], name="Scurve voltages")
print "entering in loop"
try:
for v in voltages:
print "voltage :",v
self.setAmplitude(v)
data.set(v = v)
print "measuring"
d=self.measure(nLoops=nLoops)
print "got point"
#d=self.getThisMeasure()
#data.set(**d[1])
data.set(**d[-1])
print "in datacube"
#data.set(**extraInDatacube)
print "extra in datacube"
if fspPower:
time.sleep(1)
data.set(fspPower=self._pulseGenerator._mixer._fsp.getValueAtMarker())
#self.notify("histograms",d[2][self.bit][0])
#self.notify("iqdata",(d[2][self.bit][0],d[2][self.bit][1]))
##self.notify("iqP",(d[0][:,0],d[0][:,1],((0,0,0))))
print "commiting"
data.commit()
print "commited"
#self.notify("sCurve",(data.column("v"),data.column("b%i"%self.bit)))
print "first loop over"
#data.sortBy('v')
#data.sortBy("b%i"%self.bit)
#p=data["b%i"%self.bit]
#v=data['v']
#p=p[p>0]
#v=v[p>0]
##p=p[p<1]
#v=v[p<1]
#self.sInterpolateVP=scipy.interpolate.interp1d(p,v)
#data.sortBy('v')
print "first loop over"
except:
raise
finally:
data.savetxt()
self.notify("status","S curve complete.")
self.setAmplitude(self._vMaxAmplitude)
return data
示例14: sCurves
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [as 别名]
def sCurves(qubit,jba,variable = "p1x",data = None,ntimes = 20,optimize = "v20"):
"""
Measures the s curves of the JBA. Assumes that the qubit is alread preset to a pi-pulse.
"""
def getVoltageBounds(v0,jba,variable,ntimes):
v = v0
jba.setVoltage(v)
acqiris.bifurcationMap(ntimes = ntimes)
p = acqiris.Psw()[variable]
while p > 0.03 and v < v0*2.0:
v*=1.05
jba.setVoltage(v)
acqiris.bifurcationMap()
p = acqiris.Psw()[variable]
vmax = v
v = v0
jba.setVoltage(v)
acqiris.bifurcationMap(ntimes = ntimes)
p = acqiris.Psw()[variable]
while p < 0.98 and v > v0/2.0:
v/=1.05
jba.setVoltage(v)
acqiris.bifurcationMap()
p = acqiris.Psw()[variable]
vmin = v
return (vmin*0.95,vmax*1.2)
try:
v0 = jba.voltage()
if data == None:
sData = Datacube()
else:
sData = data
sData.setName("S curves - %s" % qubit.name())
sData.setParameters(instrumentManager.parameters())
s0 = Datacube("S0")
s1 = Datacube("S1")
s2 = Datacube("S2")
sData.addChild(s0)
sData.addChild(s1)
sData.addChild(s2)
qubit.turnOffDrive()
(vmin,vmax) = getVoltageBounds(v0,jba,variable,ntimes)
measureSingleS(voltages = arange(vmin,vmax,0.005),data = s0,jba = jba,ntimes = ntimes)
qubit.turnOnDrive()
loadPi01Pulse(qubit)
measureSingleS(voltages = arange(vmin,vmax,0.005),data = s1,jba = jba,ntimes = ntimes)
failed12 = False
try:
loadPi012Pulse(qubit)
measureSingleS(voltages = arange(vmin,vmax,0.005),data = s2,jba = jba,ntimes = ntimes)
s1.createColumn("contrast20",s2.column(variable)-s0.column(variable))
s1.createColumn("contrast21",s2.column(variable)-s1.column(variable))
qubit.parameters()["readout.v20"] = s1.column("v")[argmax(s1.column("contrast20"))]
qubit.parameters()["readout.v21"] = s1.column("v")[argmax(s1.column("contrast21"))]
except:
failed12 = True
raise
s1.createColumn("contrast10",s1.column(variable)-s0.column(variable))
qubit.parameters()["readout.v10"] = s1.column("v")[argmax(s1.column("contrast10"))]
if optimize == "v20" and not failed12:
imax = argmax(s1.column("contrast20"))
qubit.parameters()["readout.p11"] = s2.column(variable)[imax]
v0 = s1.column("v")[imax]
elif optimize == "v21" and not failed12:
imax = argmax(s1.column("contrast21"))
v0 = s1.column("v")[imax]
else:
imax = argmax(s1.column("contrast10"))
qubit.parameters()["readout.p11"] = s1.column(variable)[imax]
v0 = s1.column("v")[imax]
#To do: Add dialog to ask to which voltage (v10,v20,v21) in
qubit.parameters()["readout.p00"] = 1.0-s0.column(variable)[imax]
return (sData,v0)
finally:
jba.setVoltage(v0)
data.savetxt()
示例15: measureSCurve
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import setName [as 别名]
def measureSCurve(self,voltages = None,ntimes = 10,microwaveOff = True,data=None,fspPower=False,corelations=False,**extraInDatacube):
self.notify("status","Measuring S curve...")
def getVoltageBounds(v0,jba,variable,ntimes):
return (0.5,5)
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)
if fspPower:
self._pulseGenerator._mixer._fsp.setFrequency(self._frequency)
if data==None:
data = Datacube("%s S Curve - f=%f" %(self.name(),self._frequency))
dataManager = DataManager()
dataManager.addDatacube(data)
else:
data.setName("%s S Curve - f=%f" %(self.name(),self._frequency))
if voltages==None:
bounds=[self._vMaxAmplitude-2*max(self._vMaxAmplitude/5,abs(self._sCurveParams[0])),self._vMaxAmplitude+2*max(self._vMaxAmplitude/5,abs(self._sCurveParams[0]))]
voltages=linspace(bounds[0],bounds[1],200)
try:
for v in voltages:
self.setAmplitude(v)
data.set(v = v)
d=self.measure(nLoops=ntimes)
#d=self.getThisMeasure()
data.set(**d[1])
if corelations:
data.set(**d[4])
data.set(**extraInDatacube)
if fspPower:
time.sleep(1)
data.set(fspPower=self._pulseGenerator._mixer._fsp.getValueAtMarker())
#self.notify("histograms",d[2][self.bit][0])
#self.notify("iqdata",(d[2][self.bit][0],d[2][self.bit][1]))
##self.notify("iqP",(d[0][:,0],d[0][:,1],((0,0,0))))
data.commit()
#self.notify("sCurve",(data.column("v"),data.column("b%i"%self.bit)))
data.createColumn("p-0.5",abs(data["b%i"%self.bit]-0.5))
data.sortBy("p-0.5")
self._p50fromS=data['v'][0]
data.sortBy('v')
#data.sortBy("b%i"%self.bit)
#p=data["b%i"%self.bit]
#v=data['v']
#p=p[p>0]
#v=v[p>0]
##p=p[p<1]
#v=v[p<1]
#self.sInterpolateVP=scipy.interpolate.interp1d(p,v)
#data.sortBy('v')
except:
raise
finally:
data.savetxt()
self.notify("status","S curve complete.")
self.setAmplitude(self._vMaxAmplitude)
return data