def initialize(self, name, MWSource, AWG,AWGChannel, fsp): """ Initialize instrument, and create calibration files if needed """ instrumentManager=Manager() self._name=name self._MWSource=instrumentManager.getInstrument(MWSource) self._fsp=instrumentManager.getInstrument(fsp) self._AWG=instrumentManager.getInstrument(AWG) self._params=dict() self._params["MWSource"]=MWSource self._params["AFG"]=AWG self._params["AWGChannel"]=AWGChannel self._params["fsp"]=fsp self._calibration=OffsetOptimization(fsp=self._fsp, awg=self._AWG, mwg=self._MWSource, channels=self._params["AWGChannel"]) try: self._calibration._offsetCalibrationData=Datacube() self._calibration._offsetCalibrationData.loadtxt(register["%s OffsetCal" % self._name], loadChildren=True) except: print "No calibration data found for mixer %s" % self._name try: print "creating new one..." self.reInitCalibration() print "creation succesful, continue" except: print "creation failed" raise
def initialize(self, name, generator, analyser,magnitudeButton='formAmplitude'): """ Initialize instrument, and define default shape in self.shape """ instrumentManager=Manager() self._pulseGenerator=instrumentManager.getInstrument(generator) self._pulseAnalyser=instrumentManager.getInstrument(analyser) self._params=dict() self._params["pulseGenerator"]=generator self._params["pulseAnalyser"]=analyser self._change=True self._magnitudeButton=magnitudeButton self.data=Datacube() try: self._variableAttenuator=instrumentManager.getInstrument('jba_att') except: pass self._shapeParams=dict() self._shapeParams["risingTime"] = 10 self._shapeParams["plateauLength"] = 200 self._shapeParams["latchLength"] = 1000 self._shapeParams["plateau"] = 0.85 self.generateShape() self.bit=int(self.name()[-1])-1 self._phase=0
def initialize(self, name, formGenerator, AWGChannels, modulationMode=None, MWSource=None, mixer=None, formGeneratorType = 'AWG'): """ Initialise the instrument at instantiation """ instrumentManager=Manager() self._MWSource=instrumentManager.getInstrument(MWSource) if MWSource!=None else None # optional microwave source attached to this pulse generator self._mixer=instrumentManager.getInstrument(mixer) if mixer!=None else None # optional mixer attached to this pulse generator self._AWG=instrumentManager.getInstrument(formGenerator) # hardware generator attached to this pulse generator self._formGeneratorType=formGeneratorType # type of generators in AWG, AFG, NOne, ... self._params=dict() # dictionary of parameters self._params["MWSource"]=MWSource self._params["formGenerator"]=formGenerator # confusion here: should be change for formGenerator self._params["modulationMode"]=modulationMode self._params["AWGChannels"]=AWGChannels self._params["mixer"]=mixer self.pulses=dict() # Obsolete. Replaced by pulseList. Mainted for compatinbbility reasons self._params["pulses"]=self.pulses self.markersDict=dict() # Obsolete. Replaced by markersList. Mainted for compatinbbility reasons self._params["markersDict"]=self.markersDict self.totalPulse=numpy.zeros(self.numberOfPoints(),dtype = numpy.complex128) # Obsolete. self.index=0 # Obsolete. self.indexMarker=0 # Obsolete. self.pulseList=() # List of pulses (object of class pulse) self.markersList1=() # List of markers (object of class marker) self.markerArray1=zeros(self.numberOfPoints(),dtype=numpy.int8) # An array of zeros into which the markers will be concatented self.markersChannels= 2 if self._params["modulationMode"]=='IQMixer' else 1 # total number of markers attached to this pulse generator #self._AWG.markersPerChannel()* if self.markersChannels==2: self.markersList2=() # List of markers (object of class marker) self.markerArray2=zeros(self.numberOfPoints(),dtype=numpy.int8) # An array of zeros into which the markers will be concatented return
def initialize(self,name, jba, pulseGenerator): manager=Manager() if not hasattr(self,'_params'): self._params = dict() self._params['jba']=jba self._jba=manager.getInstrument(jba) self._params['pulseGenerator']=pulseGenerator self._pulseGenerator=manager.getInstrument(pulseGenerator)
def initialize(self, name, generator, analyser): """ Initialize instrument """ instrumentManager=Manager() self._pulseGenerator=instrumentManager.getInstrument(generator) self._pulseAnalyser=instrumentManager.getInstrument(analyser) self._params=dict() self._params["pulseGenerator"]=generator self._params["pulseAnalyser"]=analyser self._change=True
def initialize(self,name, jba, pulseGenerator): manager=Manager() if not hasattr(self,'_params'): print("reseting self._params dictionnary") self._params = dict() self._params['jba']=jba self._jba=manager.getInstrument(jba) self._params['pulseGenerator']=pulseGenerator self._pulseGenerator=manager.getInstrument(pulseGenerator) self.gaussianParameters={'sigma':10,'maxHeight':1,'cutOff':2}
def initialize(self, name, MWSource, IQMixer, AWG, AWGChannels): """ Initialise the instrument """ instrumentManager=Manager() self._MWSource=instrumentManager.getInstrument(MWSource) self._IQMixer=instrumentManager.getInstrument(IQMixer) self._AWG=instrumentManager.getInstrument(AWG) self._params=dict() self._params["MWSource"]=MWSource self._params["IQMixer"]=IQMixer self._params["AWG"]=AWG self._params["AWGChannels"]=AWGChannels self.totalPulse=numpy.zeros(register['repetitionPeriod'],dtype = numpy.complex128) return
def initialize(self, name, acqiris, MWSource,pulse_generator): """ Initialize the instrument """ instrumentManager=Manager() self._name=name self._acqiris=instrumentManager.getInstrument(acqiris) self._MWSource=instrumentManager.getInstrument(MWSource) self._pulse_generator=instrumentManager.getInstrument(pulse_generator) self._params=dict() self._params["acqiris"]=acqiris self._params["MWSource"]=MWSource self._frequencies=zeros(0) try: self._calibration=Datacube() self._calibration.setName('analyser IQ mixer Calibration') self._calibration.loadtxt(register.parameters()['%s Cal'% self._name]) except: pass self._Ilist=[] self._Qlist=[] self._philist=[]
def initialize(self,**kwargs): manager = Manager() defaultParams = {'acqirisChannel' : 0,'variable' : "p1x",'muwave' : "cavity1mwg",'attenuator' : "AttS2",'acqiris' : "acqiris",'qubitmwg' : "qubit1mwg",'polarity' : 1,'afg' : "afg3",'waveform' : "USER1",'internalDelay' : 243,'returnDelay' : 57,'acquisitionTime' : 400,'sampleInterval' : 3e-9,'trigSlope' : 0,'safetyMargin' : 100} self._params = kwargs for key in defaultParams.keys(): if not key in self._params: self._params[key] = defaultParams[key] self._muwave = manager.getInstrument(self._params["muwave"]) self._register = manager.getInstrument("register") self._acqiris = manager.getInstrument(self._params["acqiris"]) self._afg = manager.getInstrument(self._params["afg"]) self._attenuator = manager.getInstrument(self._params["attenuator"]) self._qubitmwg = manager.getInstrument(self._params["qubitmwg"])
import scipy import scipy.interpolate from pyview.lib.classes import * from pyview.helpers.instrumentsmanager import Manager if 'macros.iq_level_optimization' in sys.modules: reload(sys.modules["macros.iq_level_optimization"]) from macros.qubit_functions import * if 'macros.qubit_functions' in sys.modules: reload(sys.modules["macros.qubit_functions"]) instrumentManager=Manager() from macros.iq_level_optimization import IqOptimization from pyview.lib.datacube import Datacube from pyview.helpers.datamanager import DataManager dataManager=DataManager() register=instrumentManager.getInstrument("register") class WaveformException(Exception): pass class QubitException(Exception): pass def gaussianFilter(x,cutoff = 0.5): return numpy.exp(-numpy.power(numpy.fabs(numpy.real(x))/cutoff,2.0) ) def gaussianPulse(length = 500,delay = 0,flank = 4,normalize = True,resolution = 1,filterFrequency = 0.2): waveform = numpy.zeros((math.ceil(flank*2)+1+int(math.ceil(length))+math.ceil(delay))*int(1.0/resolution),dtype = numpy.complex128) if length == 0: return waveform for i in range(0,len(waveform)): t = float(i)*resolution