From 5e5ec3a47c801161ef30551b5c34ef56d072c0e6 Mon Sep 17 00:00:00 2001 From: Niels Bultink Date: Fri, 4 May 2018 16:14:57 +0200 Subject: [PATCH] adding UHFQC spectroscopy mode integrated into the CCL transmon qubit object --- .../qubit_objects/CCL_Transmon.py | 12 ++++ .../ZurichInstruments/UHFQuantumController.py | 63 +++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/pycqed/instrument_drivers/meta_instrument/qubit_objects/CCL_Transmon.py b/pycqed/instrument_drivers/meta_instrument/qubit_objects/CCL_Transmon.py index 9e26d806c4..b2cc97315f 100644 --- a/pycqed/instrument_drivers/meta_instrument/qubit_objects/CCL_Transmon.py +++ b/pycqed/instrument_drivers/meta_instrument/qubit_objects/CCL_Transmon.py @@ -533,6 +533,10 @@ def add_config_parameters(self): 'or a str (channel name) when using an SPI rack.'), initial_value=1, parameter_class=ManualParameter) + self.add_parameter('cfg_spec_mode', vals=vals.Bool(), + docstring=('Used to activate spec mode in measurements'), + initial_value=False, + parameter_class=ManualParameter) def add_generic_qubit_parameters(self): self.add_parameter('E_c', unit='Hz', @@ -1182,9 +1186,13 @@ def calibrate_mixer_offsets_RO(self, update: bool=True) -> bool: def measure_heterodyne_spectroscopy(self, freqs, MC=None, analyze=True, close_fig=True): + UHFQC=self.instr_acquisition.get_instr() self.prepare_for_continuous_wave() if MC is None: MC = self.instr_MC.get_instr() + # Starting specmode if set in config + if self.cfg_spec_mode(): + UHFQC.spec_mode_on(IF=self.ro_freq_mod(), ro_amp=self.ro_pulse_amp()) # Snippet here to create and upload the CCL instructions CCL = self.instr_CC.get_instr() CCL.stop() @@ -1201,6 +1209,10 @@ def measure_heterodyne_spectroscopy(self, freqs, MC=None, self.int_avg_det_single._set_real_imag(False) MC.set_detector_function(self.int_avg_det_single) MC.run(name='Resonator_scan'+self.msmt_suffix) + # Stopping specmode + if self.cfg_spec_mode(): + UHFQC.spec_mode_off() + self._prep_ro_pulse(upload=True) if analyze: ma.Homodyne_Analysis(label=self.msmt_suffix, close_fig=close_fig) diff --git a/pycqed/instrument_drivers/physical_instruments/ZurichInstruments/UHFQuantumController.py b/pycqed/instrument_drivers/physical_instruments/ZurichInstruments/UHFQuantumController.py index 35b779ac0e..6282510458 100644 --- a/pycqed/instrument_drivers/physical_instruments/ZurichInstruments/UHFQuantumController.py +++ b/pycqed/instrument_drivers/physical_instruments/ZurichInstruments/UHFQuantumController.py @@ -1007,7 +1007,70 @@ def download_transformation_matrix(self, nr_rows=None, nr_cols=None): for j in range(np.shape(matrix)[1]): # looping over the colums matrix[i][j] = self.get('quex_trans_{}_col_{}_real'.format(j, i)) return matrix + + def spec_mode_on(self, acq_length=1/1500, IF=20e6, ro_amp=0.1): + awg_code = """ +const TRIGGER1 = 0x000001; +const WINT_TRIG = 0x000010; +const IAVG_TRIG = 0x000020; +const WINT_EN = 0x1f0000; +setTrigger(WINT_EN); +var loop_cnt = getUserReg(0); +const Fsample = 1.8e9; +const triggerdelay = {}; //seconds + +repeat(loop_cnt) {{ +setTrigger(WINT_EN + WINT_TRIG + TRIGGER1); +wait(5); +setTrigger(WINT_EN); +wait(triggerdelay*Fsample/8 - 5); +}} +wait(1000); +setTrigger(0); + """.format(acq_length) + #setting the internal oscillator to the IF + self.oscs_0_freq(IF) + #setting the integration path to use the oscillator instead of integration functions + self.quex_wint_mode(1) + #just below the + self.quex_wint_length(int(acq_length*0.99*1.8e9)) + #uploading the sequence + self.awg_string(awg_code) + # setting the integration rotation to single sideband + self.quex_rot_0_real(1) + self.quex_rot_0_imag(1) + self.quex_rot_1_real(1) + self.quex_rot_1_imag(-1) + # setting the mixer deskewing to identity + self.quex_deskew_0_col_0(1) + self.quex_deskew_1_col_0(0) + self.quex_deskew_0_col_1(0) + self.quex_deskew_1_col_1(1) + + self.sigouts_0_enables_3(1) + self.sigouts_1_enables_7(1) + # setting + self.sigouts_1_amplitudes_7(ro_amp)#magic scale factor + self.sigouts_0_amplitudes_3(ro_amp) + + def spec_mode_off(self): + # Resetting To regular Mode + # changing int length + self.quex_wint_mode(0) + # Default settings copied + self.quex_rot_0_imag(0) + self.quex_rot_0_real(1) + self.quex_rot_1_imag(0) + self.quex_rot_1_real(1) + # setting to DSB by default + self.quex_deskew_0_col_0(1) + self.quex_deskew_1_col_0(0) + self.quex_deskew_0_col_1(0) + self.quex_deskew_1_col_1(1) + #switching off the modulation tone + self.sigouts_0_enables_3(0) + self.sigouts_1_enables_7(0) class ziShellError(Exception): """Base class for exceptions in this module."""