Beispiel #1
0
  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()
##Imports...
import sys
from quantum.qulib import *
from quantum.plotting import *
from numpy.linalg import norm
from pyview.helpers.datamanager import DataManager
from pyview.lib.datacube import *
from pyview.gui.datamanager import startDataManager
import matplotlib

matplotlib.use("module://pyview.gui.mpl.backend_static")
from matplotlib.pylab import *

dataManager = DataManager()
startDataManager()


def integrate(rho, L, ts, dt=0.1):

    t = 0

    rhos = zeros((len(ts), rho.shape[0], rho.shape[1]), dtype=complex128)

    def rungeKuttaIntegrate(rho, L, t, dt):
        L2 = L(t + dt / 2.)
        k1 = dt * L(t) * rho
        k2 = dt * L2 * (rho + k1 / 2.)
        k3 = dt * L2 * (rho + k2 / 2.)
        k4 = dt * L(t + dt) * (rho + k3 / 2.)
        return rho + 1. / 6. * (k1 + 2. * k2 + 2. * k3 + k4)
xlabel("fluxline I voltage [V]")
ylabel("drive frequency [GHz]")

plot(vs,ees[:,2]-ees[:,0],color = 'white',lw = 2,ls = 'solid')
plot(vs,ees[:,1]-ees[:,0],color = 'white',lw = 2,ls = 'solid')

xlim(1.26,1.29)
ylim(5.1,5.15)

figtext(0.02,0.02,gv.survey.filename()[:-4])
figtext(0.02,0.95,"$g = %g Mhz$\ncrosstalk = %g %%" % (g*1000,crosstalk * 100))
show()
##
from pyview.helpers.datamanager import DataManager

dataManager = DataManager()

fit = Datacube("fit")
dataManager.addDatacube(fit)

for i in range(0,len(gv.survey)):

	fit.set(i= i,flux = gv.survey["flux"][i])

	j = argmin(abs(vs-gv.survey["flux"][i]))
	fqb1 = real(ees[j,2]-ees[j,0])
	fqb2 = real(ees[j,1]-ees[j,0])
	print gv.survey["flux"][i],vs[j]
	import scipy.optimize
	import numpy.linalg
	fitfunc = lambda p, x: 1./math.pi*p[0]/((x-p[1])*(x-p[1])/p[3]/p[3]+1)+p[2]+1./math.pi*p[4]/((x-p[5])*(x-p[5])/p[6]/p[6]+1) # Target function
Beispiel #4
0
##curve
from config.instrumentsRSV import *
from matplotlib.pyplot import *
#from pyview.gui.mpl.backend import figure
import numpy
import scipy
from pyview.helpers.datamanager import DataManager
dataManager = DataManager()
instrumentManager=Manager()
vna=instrumentManager.getInstrument('vna')
print vna
coilVoltage=instrumentManager.getInstrument('Yoko1')
print coil


##
def setMyVNAPower(power):
	atten=-20*math.modf(power/20.)[1]
	pow=power+atten-5
	vna.setAttenuation(atten)
	vna.setPower(pow)	
##
data=Datacube('VNAvsCoil1')
dataManager.addDatacube(data)
k=0
voltages=arange(-3,0.1,0.05)
for voltages in voltages:
	print "voltages=%f V"%voltages
	coilVoltage.setVoltage(voltages)
	#time.sleep(4)
	child=vna.getTrace(waitFullSweep=True)
Beispiel #5
0
 def toDataManager(self):
   dataManager = DataManager()
   dataManager.addDatacube(self)
	rhoMatData.setAt(i,errorimage=0)
	if rhoMatData.column("errorimage")[i]!=1:
		print "Plotting..."
		try:
			plotDensityMatrix(densityMatrix,export="film of swap/rhomats/rhomat_%.3d.png" % i,figureTitle = "t = %g ns" % rhoMatData.column("duration")[i])#,figureName="phibell = %s" % str(phibell))
		except:
			print "Failed!"
			print sys.exc_info()
			rhoMatData.setAt(i,errorimage=1)
rhoMatData.savetxt()

##

##
from pyview.helpers.datamanager import DataManager
dataManager = DataManager()3
##
phi_wit=Datacube()
dataManager.addDatacube(phi_wit)
phi_wit.setName("phi_wit")
phi_wit.createColumn("zPulseLength",real(rhoMatData.column("zPulseLength")))
phi_wit.createColumn("phibell",real(rhoMatData.column("phibell")))
phi_wit.createColumn("w_phi_minus",real(rhoMatData.column("w_phi_minus")))
phi_wit.createColumn("w_phi_plus",real(rhoMatData.column("w_phi_plus")))
phi_wit.savetxt()


##

#chshdata=Datacube()
#chshdata.setName("CHSH from rhoMat theory")
##Imports...
import sys
from quantum.qulib import *
from quantum.plotting import *
from numpy.linalg import norm
from pyview.helpers.datamanager import DataManager
from pyview.lib.datacube import *
from pyview.gui.datamanager import startDataManager
import matplotlib

matplotlib.use("module://pyview.gui.mpl.backend_static")
from matplotlib.pylab import *

dataManager = DataManager()
startDataManager()


def integrate(rho,L,ts,dt = 0.1):

	t = 0
	
	rhos = zeros((len(ts),rho.shape[0],rho.shape[1]),dtype = complex128)

	def rungeKuttaIntegrate(rho,L,t,dt):
		L2 = L(t+dt/2.)
		k1 = dt*L(t)*rho
		k2 = dt*L2*(rho+k1/2.)
		k3 = dt*L2*(rho+k2/2.)
		k4 = dt*L(t+dt)*(rho+k3/2.)
		return rho+1./6.*(k1+2.*k2+2.*k3+k4)
import matplotlib
matplotlib.use('module://pyview.gui.mpl.backend')

from numpy import *
from matplotlib.pyplot import *	

import csv

##
from pyview.lib.datacube import Datacube
from pyview.helpers.datamanager import DataManager
import re
filename = "qubit_chip_sonnet_model.csv"
dataManager = DataManager()
file = open(filename,"rb")
content = file.read()
file.close()
lines = content.split("\n")
curves = Datacube("curves")
dataManager.clear()
dataManager.addDatacube(curves)
i = 0
curve = None
while i < len(lines):
	elements = lines[i].split(",")
	if re.search("l1=(\d+\.\d+)",lines[i],re.I):
		if curve != None and len(curve) == 0:
			curves.removeChild(curve)
		print lines[i]
		lq = float(re.search("l1=(\d+\.\d+)",lines[i],re.I).group(1))
		print lq
  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
Beispiel #10
0
ylabel("drive frequency [GHz]")

plot(vs, ees[:, 2] - ees[:, 0], color='white', lw=2, ls='solid')
plot(vs, ees[:, 1] - ees[:, 0], color='white', lw=2, ls='solid')

xlim(1.26, 1.29)
ylim(5.1, 5.15)

figtext(0.02, 0.02, gv.survey.filename()[:-4])
figtext(0.02, 0.95,
        "$g = %g Mhz$\ncrosstalk = %g %%" % (g * 1000, crosstalk * 100))
show()
##
from pyview.helpers.datamanager import DataManager

dataManager = DataManager()

fit = Datacube("fit")
dataManager.addDatacube(fit)

for i in range(0, len(gv.survey)):

    fit.set(i=i, flux=gv.survey["flux"][i])

    j = argmin(abs(vs - gv.survey["flux"][i]))
    fqb1 = real(ees[j, 2] - ees[j, 0])
    fqb2 = real(ees[j, 1] - ees[j, 0])
    print gv.survey["flux"][i], vs[j]
    import scipy.optimize
    import numpy.linalg
    fitfunc = lambda p, x: 1. / math.pi * p[0] / (
##Imports...
import sys
from quantum.qulib import *
from quantum.plotting import *
import matplotlib
from scipy.optimize import fmin_powell
from numpy.linalg import norm
from pyview.helpers.datamanager import DataManager
from pyview.gui.datamanager import startDataManager
dataManager = DataManager() 
##Parameter definitions...
alpha = -2.0*math.pi*0.24
beta = -2.0*math.pi*0.24

gamma10_1 = 0*1.0/353.4
gamma10_2 = 0*1.0/368.7
gammaphi10_1 = 0*1.0/500.0
gammaphi10_2 = 0*1.0/650.0

##Some more definitions...

sm10 = matrix([[0,1,0],[0,0,0],[0,0,0]])
sp10 = matrix([[0,0,0],[1,0,0],[0,0,0]])
sm21 = matrix([[0,0,0],[0,0,1],[0,0,0]])
sp21 = matrix([[0,0,0],[0,0,0],[0,1,0]])
sm20 = matrix([[0,0,1],[0,0,0],[0,0,0]])
sp20 = matrix([[0,0,0],[0,0,0],[1,0,0]])

id3 = matrix([[1,0,0],[0,1,0],[0,0,1]])

sz10 = matrix([[1,0,0],[0,-1,0],[0,0,0]])
Beispiel #12
0
  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
##Imports...
import sys
from quantum.qulib import *
from quantum.plotting import *
import matplotlib
from scipy.optimize import fmin_powell
from numpy.linalg import norm
from pyview.helpers.datamanager import DataManager
from pyview.gui.datamanager import startDataManager
dataManager = DataManager()
##Parameter definitions...
alpha = -2.0 * math.pi * 0.24
beta = -2.0 * math.pi * 0.24

gamma10_1 = 0 * 1.0 / 353.4
gamma10_2 = 0 * 1.0 / 368.7
gammaphi10_1 = 0 * 1.0 / 500.0
gammaphi10_2 = 0 * 1.0 / 650.0

##Some more definitions...

sm10 = matrix([[0, 1, 0], [0, 0, 0], [0, 0, 0]])
sp10 = matrix([[0, 0, 0], [1, 0, 0], [0, 0, 0]])
sm21 = matrix([[0, 0, 0], [0, 0, 1], [0, 0, 0]])
sp21 = matrix([[0, 0, 0], [0, 0, 0], [0, 1, 0]])
sm20 = matrix([[0, 0, 1], [0, 0, 0], [0, 0, 0]])
sp20 = matrix([[0, 0, 0], [0, 0, 0], [1, 0, 0]])

id3 = matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]])

sz10 = matrix([[1, 0, 0], [0, -1, 0], [0, 0, 0]])