def setUpClass(self): self.station = station.Station() self.MC = measurement_control.MeasurementControl( 'MC', live_plot_enabled=True, verbose=True) self.MC.station = self.station self.station.add_component(self.MC) self.mock_parabola = DummyParHolder('mock_parabola') self.station.add_component(self.mock_parabola)
def setUpClass(self): self.station = station.Station() self.k0 = ko.DistortionKernel('k0') self.k1 = ko.DistortionKernel('k1') self.station.add_component(self.k0) self.station.add_component(self.k1) self.k0.sampling_rate(1e9) self.k1.sampling_rate(1e9)
def setup_class(cls): cls.station = station.Station() cls.MC = measurement_control.MeasurementControl( 'MC', live_plot_enabled=False, verbose=False) cls.MC.station = cls.station cls.station.add_component(cls.MC) cls.mock_parabola = DummyParHolder('mock_parabola') cls.station.add_component(cls.mock_parabola)
def f_to_parallelize_new(arglist): # cluster wants a list as an argument. # Below the various list items are assigned to their own variable fitted_stepresponse_ty = arglist['fitted_stepresponse_ty'] fluxlutman_args = arglist['fluxlutman_args'] # see function return_instrument_args in czf noise_parameters_CZ_args = arglist['noise_parameters_CZ_args'] # see function return_instrument_args in czf number = arglist['number'] adaptive_pars = arglist['adaptive_pars'] try: MC = Instrument.find_instrument('MC'+'{}'.format(number)) except KeyError: MC = mc.MeasurementControl('MC'+'{}'.format(number), live_plot_enabled=False) from qcodes import station station = station.Station() station.add_component(MC) MC.station =station fluxlutman = flm.AWG8_Flux_LutMan('fluxlutman'+'{}'.format(number)) station.add_component(fluxlutman) noise_parameters_CZ = npCZ.NoiseParametersCZ('noise_parameters_CZ'+'{}'.format(number)) station.add_component(noise_parameters_CZ) fluxlutman, noise_parameters_CZ = czf.return_instrument_from_arglist(fluxlutman,fluxlutman_args,noise_parameters_CZ,noise_parameters_CZ_args) d=ramsey_experiment(fluxlutman=fluxlutman, noise_parameters_CZ=noise_parameters_CZ, fitted_stepresponse_ty=fitted_stepresponse_ty) MC.set_sweep_functions([fluxlutman.cz_length]) MC.set_detector_function(d) MC.set_sweep_points(np.arange(0, adaptive_pars['max_time'], adaptive_pars['time_step'])) exp_metadata = {'detuning': noise_parameters_CZ.detuning(), 'sigma_q1': noise_parameters_CZ.sigma_q1(), 'sigma_q0': noise_parameters_CZ.sigma_q0()} if noise_parameters_CZ.cluster(): dat = MC.run('1D ramsey_new_cluster sigma_q1 {:.0f}, sigma_q0 {:.0f}, detuning {:.0f}'.format(noise_parameters_CZ.sigma_q1()*1e6, noise_parameters_CZ.sigma_q0()*1e6, noise_parameters_CZ.detuning()/1e6), mode='1D',exp_metadata=exp_metadata) else: if adaptive_pars['long_name']: dat = MC.run('1D ramsey_new sigma_q1 {:.0f}, sigma_q0 {:.0f}, detuning {:.0f}'.format(noise_parameters_CZ.sigma_q1()*1e6, noise_parameters_CZ.sigma_q0()*1e6, noise_parameters_CZ.detuning()/1e6), mode='1D',exp_metadata=exp_metadata) else: dat = MC.run('1D ramsey_new', mode='1D',exp_metadata=exp_metadata) fluxlutman.close() noise_parameters_CZ.close() MC.close()
def setUpClass(self): self.station = station.Station() self.datadir = os.path.join(pq.__path__[0], 'tests', 'test_data') self.MC = measurement_control.MeasurementControl( 'MC', live_plot_enabled=False, verbose=False) self.MC.station = self.station self.MC.datadir(self.datadir) a_tools.datadir = self.datadir self.station.add_component(self.MC) self.mock_parabola = DummyParHolder('mock_parabola') self.station.add_component(self.mock_parabola) self.mock_parabola_2 = DummyParHolder('mock_parabola_2') self.station.add_component(self.mock_parabola_2)
def setUpClass(self): self.station = station.Station() self.CCL_qubit = ct.CCLight_Transmon('CCL_qubit') self.MW1 = vmw.VirtualMWsource('MW1') self.MW2 = vmw.VirtualMWsource('MW2') self.MW3 = vmw.VirtualMWsource('MW3') self.SH = sh.virtual_SignalHound_USB_SA124B('SH') self.UHFQC = UHF.UHFQC(name='UHFQC', server='emulator', device='dev2109', interface='1GbE') self.CCL = dummy_CCL('CCL') # self.VSM = Dummy_Duplexer('VSM') self.VSM = Dummy_QuTechVSMModule('VSM') self.MC = measurement_control.MeasurementControl( 'MC', live_plot_enabled=False, verbose=False) self.MC.station = self.station self.station.add_component(self.MC) # Required to set it to the testing datadir test_datadir = os.path.join(pq.__path__[0], 'tests', 'test_output') self.MC.datadir(test_datadir) a_tools.datadir = self.MC.datadir() self.AWG = HDAWG.ZI_HDAWG8(name='DummyAWG8', server='emulator', num_codewords=32, device='dev8026', interface='1GbE') self.AWG8_VSM_MW_LutMan = mwl.AWG8_VSM_MW_LutMan('MW_LutMan_VSM') self.AWG8_VSM_MW_LutMan.AWG(self.AWG.name) self.AWG8_VSM_MW_LutMan.channel_GI(1) self.AWG8_VSM_MW_LutMan.channel_GQ(2) self.AWG8_VSM_MW_LutMan.channel_DI(3) self.AWG8_VSM_MW_LutMan.channel_DQ(4) self.AWG8_VSM_MW_LutMan.mw_modulation(100e6) self.AWG8_VSM_MW_LutMan.sampling_rate(2.4e9) self.ro_lutman = UHFQC_RO_LutMan('RO_lutman', num_res=5, feedline_number=0) self.ro_lutman.AWG(self.UHFQC.name) # Assign instruments self.CCL_qubit.instr_LutMan_MW(self.AWG8_VSM_MW_LutMan.name) self.CCL_qubit.instr_LO_ro(self.MW1.name) self.CCL_qubit.instr_LO_mw(self.MW2.name) self.CCL_qubit.instr_spec_source(self.MW3.name) self.CCL_qubit.instr_acquisition(self.UHFQC.name) self.CCL_qubit.instr_VSM(self.VSM.name) self.CCL_qubit.instr_CC(self.CCL.name) self.CCL_qubit.instr_LutMan_RO(self.ro_lutman.name) self.CCL_qubit.instr_MC(self.MC.name) self.CCL_qubit.instr_SH(self.SH.name) config_fn = os.path.join(pq.__path__[0], 'tests', 'openql', 'test_cfg_CCL.json') self.CCL_qubit.cfg_openql_platform_fn(config_fn) # Setting some "random" initial parameters self.CCL_qubit.ro_freq(5.43e9) self.CCL_qubit.ro_freq_mod(200e6) self.CCL_qubit.freq_qubit(4.56e9) self.CCL_qubit.freq_max(4.62e9) self.CCL_qubit.mw_freq_mod(-100e6) self.CCL_qubit.mw_awg_ch(1) self.CCL_qubit.cfg_qubit_nr(0) self.CCL_qubit.mw_vsm_delay(15) self.CCL_qubit.mw_mixer_offs_GI(.1) self.CCL_qubit.mw_mixer_offs_GQ(.2) self.CCL_qubit.mw_mixer_offs_DI(.3) self.CCL_qubit.mw_mixer_offs_DQ(.4)
def setUpClass(self): self.station = station.Station() self.CCL_qubit = ct.Mock_CCLight_Transmon('CCL_qubit') self.fluxcurrent = flx.virtual_SPI_S4g_FluxCurrent('fluxcurrent', channel_map={ 'FBL_Q1': (0, 0), 'FBL_Q2': (0, 1), }) self.fluxcurrent.FBL_Q1(0) self.fluxcurrent.FBL_Q2(0) self.station.add_component(self.fluxcurrent) self.MW1 = vmw.VirtualMWsource('MW1') self.MW2 = vmw.VirtualMWsource('MW2') self.MW3 = vmw.VirtualMWsource('MW3') self.SH = sh.virtual_SignalHound_USB_SA124B('SH') self.UHFQC = dummy_UHFQC('UHFQC') self.CCL = dummy_CCL('CCL') # self.VSM = Dummy_Duplexer('VSM') self.VSM = Dummy_QuTechVSMModule('VSM') self.MC = measurement_control.MeasurementControl( 'MC', live_plot_enabled=False, verbose=False) self.MC.station = self.station self.station.add_component(self.MC) # Required to set it to the testing datadir test_datadir = os.path.join(pq.__path__[0], 'tests', 'test_output') self.MC.datadir(test_datadir) a_tools.datadir = self.MC.datadir() self.AWG = v8.VirtualAWG8('DummyAWG8') self.AWG8_VSM_MW_LutMan = mwl.AWG8_VSM_MW_LutMan('MW_LutMan_VSM') self.AWG8_VSM_MW_LutMan.AWG(self.AWG.name) self.AWG8_VSM_MW_LutMan.channel_GI(1) self.AWG8_VSM_MW_LutMan.channel_GQ(2) self.AWG8_VSM_MW_LutMan.channel_DI(3) self.AWG8_VSM_MW_LutMan.channel_DQ(4) self.AWG8_VSM_MW_LutMan.mw_modulation(100e6) self.AWG8_VSM_MW_LutMan.sampling_rate(2.4e9) self.ro_lutman = UHFQC_RO_LutMan('RO_lutman', num_res=5, feedline_number=0) self.ro_lutman.AWG(self.UHFQC.name) # Assign instruments self.CCL_qubit.instr_LutMan_MW(self.AWG8_VSM_MW_LutMan.name) self.CCL_qubit.instr_LO_ro(self.MW1.name) self.CCL_qubit.instr_LO_mw(self.MW2.name) self.CCL_qubit.instr_spec_source(self.MW3.name) self.CCL_qubit.instr_acquisition(self.UHFQC.name) self.CCL_qubit.instr_VSM(self.VSM.name) self.CCL_qubit.instr_CC(self.CCL.name) self.CCL_qubit.instr_LutMan_RO(self.ro_lutman.name) self.CCL_qubit.instr_MC(self.MC.name) self.CCL_qubit.instr_FluxCtrl(self.fluxcurrent.name) self.CCL_qubit.instr_SH(self.SH.name) config_fn = os.path.join(pq.__path__[0], 'tests', 'openql', 'test_cfg_CCL.json') self.CCL_qubit.cfg_openql_platform_fn(config_fn) # Setting some "random" initial parameters self.CCL_qubit.ro_freq(5.43e9) self.CCL_qubit.ro_freq_mod(200e6) self.CCL_qubit.freq_qubit(4.56e9) self.CCL_qubit.freq_max(4.62e9) self.CCL_qubit.mw_freq_mod(-100e6) self.CCL_qubit.mw_awg_ch(1) self.CCL_qubit.cfg_qubit_nr(0) self.CCL_qubit.mw_vsm_delay(15) self.CCL_qubit.mw_mixer_offs_GI(.1) self.CCL_qubit.mw_mixer_offs_GQ(.2) self.CCL_qubit.mw_mixer_offs_DI(.3) self.CCL_qubit.mw_mixer_offs_DQ(.4) # self.CCL_qubit.ro_acq_averages(32768) self.device = do.DeviceCCL(name='device') self.CCL_qubit.instr_device(self.device.name)
def f_to_parallelize_new(arglist): # cluster wants a list as an argument. # Below the various list items are assigned to their own variable fitted_stepresponse_ty = arglist['fitted_stepresponse_ty'] fluxlutman_args = arglist[ 'fluxlutman_args'] # see function return_instrument_args in czf noise_parameters_CZ_args = arglist[ 'noise_parameters_CZ_args'] # see function return_instrument_args in czf number = arglist['number'] adaptive_pars = arglist['adaptive_pars'] try: MC = Instrument.find_instrument('MC' + '{}'.format(number)) except KeyError: MC = mc.MeasurementControl('MC' + '{}'.format(number), live_plot_enabled=False) from qcodes import station station = station.Station() station.add_component(MC) MC.station = station fluxlutman = flm.AWG8_Flux_LutMan('fluxlutman' + '{}'.format(number)) station.add_component(fluxlutman) noise_parameters_CZ = npCZ.NoiseParametersCZ('noise_parameters_CZ' + '{}'.format(number)) station.add_component(noise_parameters_CZ) fluxlutman, noise_parameters_CZ = czf.return_instrument_from_arglist( fluxlutman, fluxlutman_args, noise_parameters_CZ, noise_parameters_CZ_args) d = CZ_trajectory_superoperator( fluxlutman=fluxlutman, noise_parameters_CZ=noise_parameters_CZ, fitted_stepresponse_ty=fitted_stepresponse_ty, qois=adaptive_pars.get('qois', 'all')) MC.set_detector_function(d) exp_metadata = { 'double sided': fluxlutman.czd_double_sided(), 'length': fluxlutman.cz_length(), 'distortions': noise_parameters_CZ.distortions(), 'T2_scaling': noise_parameters_CZ.T2_scaling(), 'sigma_q1': noise_parameters_CZ.sigma_q1(), 'sigma_q0': noise_parameters_CZ.sigma_q0() } if adaptive_pars['mode'] == 'adaptive': MC.set_sweep_functions([fluxlutman.cz_theta_f, fluxlutman.cz_lambda_2]) if adaptive_pars['uniform']: loss_per_triangle = adaptive.learner.learner2D.uniform_loss else: loss_per_triangle = None MC.set_adaptive_function_parameters({ 'adaptive_function': adaptive.Learner2D, 'loss_per_triangle': loss_per_triangle, 'goal': lambda l: l.npoints > adaptive_pars['n_points'], 'bounds': [(adaptive_pars['theta_f_min'], adaptive_pars['theta_f_max']), (adaptive_pars['lambda2_min'], adaptive_pars['lambda2_max'])] }) if noise_parameters_CZ.cluster(): dat = MC.run( '2D simulation_new_cluster2 double sided {} - length {:.1f} - distortions {} - waiting {:.2f} - T2_scaling {:.2f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.waiting_at_sweetspot(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='adaptive', exp_metadata=exp_metadata) else: if adaptive_pars['long_name']: dat = MC.run( '2D simulation_new_2 double sided {} - length {:.1f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='adaptive', exp_metadata=exp_metadata) else: dat = MC.run('2D simulation_new_2', exp_metadata=exp_metadata, mode='adaptive') elif adaptive_pars['mode'] == '1D': MC.set_sweep_functions([fluxlutman.cz_theta_f]) MC.set_sweep_points( np.linspace(adaptive_pars['theta_f_min'], adaptive_pars['theta_f_max'], adaptive_pars['n_points'])) if noise_parameters_CZ.cluster(): dat = MC.run( '1D simulation_new_cluster2 double sided {} - length {:.1f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='1D', exp_metadata=exp_metadata) else: if adaptive_pars['long_name']: dat = MC.run( '1D simulation_new_2 double sided {} - length {:.1f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='1D', exp_metadata=exp_metadata) else: dat = MC.run('1D simulation_new_2', exp_metadata=exp_metadata, mode='1D') if adaptive_pars['mode'] == 'cma_optimizer': MC.set_sweep_functions([fluxlutman.cz_theta_f, fluxlutman.cz_lambda_2]) if adaptive_pars['uniform']: loss_per_triangle = adaptive.learner.learner2D.uniform_loss else: loss_per_triangle = None MC.set_adaptive_function_parameters({ 'adaptive_function': cma.fmin, 'x0': adaptive_pars['x0'], 'sigma0': adaptive_pars['sigma0'], # options for the CMA algorithm can be found using # "cma.CMAOptions()" 'options': { 'maxfevals': adaptive_pars['n_points'], # maximum function cals # Scaling for individual sigma's 'cma_stds': [5, 6, 3], 'ftarget': 0.005 }, # Target function value }) if noise_parameters_CZ.cluster(): dat = MC.run( '2D simulation_new_cluster2 double sided {} - length {:.1f} - waiting {:.2f} - T2_scaling {:.2f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.waiting_at_sweetspot(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='adaptive', exp_metadata=exp_metadata) else: if adaptive_pars['long_name']: dat = MC.run( '2D simulation_new_2 double sided {} - length {:.1f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='adaptive', exp_metadata=exp_metadata) else: dat = MC.run('2D simulation_new_2', exp_metadata=exp_metadata, mode='adaptive') fluxlutman.close() noise_parameters_CZ.close() MC.close()
def setUpClass(self): """ This sets up a mock setup using a CCL to control multiple qubits """ self.station = station.Station() self.MW1 = vmw.VirtualMWsource("MW1") self.MW2 = vmw.VirtualMWsource("MW2") self.MW3 = vmw.VirtualMWsource("MW3") self.SH = sh.virtual_SignalHound_USB_SA124B("SH") self.UHFQC_0 = UHF.UHFQC( name="UHFQC_0", server="emulator", device="dev2109", interface="1GbE" ) self.UHFQC_1 = UHF.UHFQC( name="UHFQC_1", server="emulator", device="dev2110", interface="1GbE" ) self.UHFQC_2 = UHF.UHFQC( name="UHFQC_2", server="emulator", device="dev2111", interface="1GbE" ) self.CCL = dummy_CCL('CCL') self.QCC = dummy_QCC('QCC') self.CC = CC('CC', DummyTransport()) self.VSM = Dummy_QuTechVSMModule('VSM') self.MC = measurement_control.MeasurementControl( "MC", live_plot_enabled=False, verbose=False ) self.MC.station = self.station self.station.add_component(self.MC) # Required to set it to the testing datadir test_datadir = os.path.join(pq.__path__[0], "tests", "test_output") self.MC.datadir(test_datadir) a_tools.datadir = self.MC.datadir() self.AWG_mw_0 = HDAWG.ZI_HDAWG8( name="AWG_mw_0", server="emulator", num_codewords=32, device="dev8026", interface="1GbE", ) self.AWG_mw_1 = HDAWG.ZI_HDAWG8( name="AWG_mw_1", server="emulator", num_codewords=32, device="dev8027", interface="1GbE", ) self.AWG_flux_0 = HDAWG.ZI_HDAWG8( name="AWG_flux_0", server="emulator", num_codewords=32, device="dev8028", interface="1GbE", ) if 0: # FIXME: PR #658: test broken by commit bd19f56 self.mw_lutman = mwl.AWG8_VSM_MW_LutMan("MW_LutMan_VSM") self.mw_lutman.AWG(self.AWG_mw_0.name) self.mw_lutman.channel_GI(1) self.mw_lutman.channel_GQ(2) self.mw_lutman.channel_DI(3) self.mw_lutman.channel_DQ(4) else: # FIXME: workaround self.mw_lutman = mwl.AWG8_MW_LutMan("MW_LutMan") self.mw_lutman.channel_I(1) self.mw_lutman.channel_Q(2) self.mw_lutman.mw_modulation(100e6) self.mw_lutman.sampling_rate(2.4e9) self.ro_lutman_0 = UHFQC_RO_LutMan( "ro_lutman_0", feedline_number=0, feedline_map="S17", num_res=9 ) self.ro_lutman_0.AWG(self.UHFQC_0.name) self.ro_lutman_1 = UHFQC_RO_LutMan( "ro_lutman_1", feedline_number=1, feedline_map="S17", num_res=9 ) self.ro_lutman_1.AWG(self.UHFQC_1.name) self.ro_lutman_2 = UHFQC_RO_LutMan( "ro_lutman_2", feedline_number=2, feedline_map="S17", num_res=9 ) self.ro_lutman_2.AWG(self.UHFQC_2.name) # Assign instruments qubits = [] for q_idx in range(17): q = ct.CCLight_Transmon("q{}".format(q_idx)) qubits.append(q) q.instr_LutMan_MW(self.mw_lutman.name) q.instr_LO_ro(self.MW1.name) q.instr_LO_mw(self.MW2.name) q.instr_spec_source(self.MW3.name) if q_idx in [13, 16]: q.instr_acquisition(self.UHFQC_0.name) q.instr_LutMan_RO(self.ro_lutman_0.name) elif q_idx in [1, 4, 5, 7, 8, 10, 11, 14, 15]: q.instr_acquisition(self.UHFQC_1.name) q.instr_LutMan_RO(self.ro_lutman_1.name) elif q_idx in [0, 2, 3, 6, 9, 12]: q.instr_acquisition(self.UHFQC_2.name) q.instr_LutMan_RO(self.ro_lutman_2.name) q.instr_VSM(self.VSM.name) q.instr_CC(self.CCL.name) q.instr_MC(self.MC.name) q.instr_SH(self.SH.name) config_fn = os.path.join(pq.__path__[0], "tests", "test_cfg_CCL.json") q.cfg_openql_platform_fn(config_fn) # Setting some "random" initial parameters q.ro_freq(5.43e9 + q_idx * 50e6) q.ro_freq_mod(200e6) q.freq_qubit(4.56e9 + q_idx * 50e6) q.freq_max(4.62e9 + q_idx * 50e6) q.mw_freq_mod(-100e6) q.mw_awg_ch(1) q.cfg_qubit_nr(q_idx) # q.mw_vsm_delay(15) q.mw_mixer_offs_GI(0.1) q.mw_mixer_offs_GQ(0.2) q.mw_mixer_offs_DI(0.3) q.mw_mixer_offs_DQ(0.4) # Set up the device object and set required params self.device = do.DeviceCCL("device") self.device.qubits([q.name for q in qubits]) self.device.instr_CC(self.CCL.name) self.device.instr_AWG_mw_0(self.AWG_mw_0.name) self.device.instr_AWG_mw_1(self.AWG_mw_1.name) self.device.instr_AWG_flux_0(self.AWG_flux_0.name) self.device.ro_lo_freq(6e9) # Fixed by design self.dio_map_CCL = {"ro_0": 1, "ro_1": 2, "flux_0": 3, "mw_0": 4, "mw_1": 5} # Fixed by design self.dio_map_QCC = { "ro_0": 1, "ro_1": 2, "ro_2": 3, "mw_0": 4, "mw_1": 5, "flux_0": 6, "flux_1": 7, "flux_2": 8, "mw_2": 9, "mw_3": 10, "mw_4": 11, } # Modular, arbitrary example here self.dio_map_CC = { "ro_0": 0, "ro_1": 1, "ro_2": 2, "mw_0": 3, "mw_1": 4, "flux_0": 6, "flux_1": 7, "flux_2": 8, } self.device.dio_map(self.dio_map_CCL)
def setUpClass(self): """ This sets up a mock setup using a CCL to control multiple qubits """ self.station = station.Station() self.MW1 = vmw.VirtualMWsource('MW1') self.MW2 = vmw.VirtualMWsource('MW2') self.MW3 = vmw.VirtualMWsource('MW3') self.SH = sh.virtual_SignalHound_USB_SA124B('SH') self.UHFQC_0 = UHF.UHFQC(name='UHFQC_0', server='emulator', device='dev2109', interface='1GbE') self.UHFQC_1 = UHF.UHFQC(name='UHFQC_1', server='emulator', device='dev2110', interface='1GbE') self.UHFQC_2 = UHF.UHFQC(name='UHFQC_2', server='emulator', device='dev2111', interface='1GbE') self.CCL = dummy_CCL('CCL') self.QCC = dummy_QCC('QCC') self.CC = QuTechCC('CC', DummyTransport()) self.VSM = Dummy_Duplexer('VSM') self.MC = measurement_control.MeasurementControl( 'MC', live_plot_enabled=False, verbose=False) self.MC.station = self.station self.station.add_component(self.MC) # Required to set it to the testing datadir test_datadir = os.path.join(pq.__path__[0], 'tests', 'test_output') self.MC.datadir(test_datadir) a_tools.datadir = self.MC.datadir() self.AWG_mw_0 = HDAWG.ZI_HDAWG8(name='AWG_mw_0', server='emulator', num_codewords=32, device='dev8026', interface='1GbE') self.AWG_mw_1 = HDAWG.ZI_HDAWG8(name='AWG_mw_1', server='emulator', num_codewords=32, device='dev8027', interface='1GbE') self.AWG_flux_0 = HDAWG.ZI_HDAWG8(name='AWG_flux_0', server='emulator', num_codewords=32, device='dev8028', interface='1GbE') self.AWG8_VSM_MW_LutMan = mwl.AWG8_VSM_MW_LutMan('MW_LutMan_VSM') self.AWG8_VSM_MW_LutMan.AWG(self.AWG_mw_0.name) self.AWG8_VSM_MW_LutMan.channel_GI(1) self.AWG8_VSM_MW_LutMan.channel_GQ(2) self.AWG8_VSM_MW_LutMan.channel_DI(3) self.AWG8_VSM_MW_LutMan.channel_DQ(4) self.AWG8_VSM_MW_LutMan.mw_modulation(100e6) self.AWG8_VSM_MW_LutMan.sampling_rate(2.4e9) self.ro_lutman_0 = UHFQC_RO_LutMan('ro_lutman_0', feedline_number=0, feedline_map='S17', num_res=9) self.ro_lutman_0.AWG(self.UHFQC_0.name) self.ro_lutman_1 = UHFQC_RO_LutMan('ro_lutman_1', feedline_number=1, feedline_map='S17', num_res=9) self.ro_lutman_1.AWG(self.UHFQC_1.name) self.ro_lutman_2 = UHFQC_RO_LutMan('ro_lutman_2', feedline_number=2, feedline_map='S17', num_res=9) self.ro_lutman_2.AWG(self.UHFQC_2.name) # Assign instruments qubits = [] for q_idx in range(17): q = ct.CCLight_Transmon('q{}'.format(q_idx)) qubits.append(q) q.instr_LutMan_MW(self.AWG8_VSM_MW_LutMan.name) q.instr_LO_ro(self.MW1.name) q.instr_LO_mw(self.MW2.name) q.instr_spec_source(self.MW3.name) if q_idx in [13, 16]: q.instr_acquisition(self.UHFQC_0.name) q.instr_LutMan_RO(self.ro_lutman_0.name) elif q_idx in [1, 4, 5, 7, 8, 10, 11, 14, 15]: q.instr_acquisition(self.UHFQC_1.name) q.instr_LutMan_RO(self.ro_lutman_1.name) elif q_idx in [0, 2, 3, 6, 9, 12]: q.instr_acquisition(self.UHFQC_2.name) q.instr_LutMan_RO(self.ro_lutman_2.name) q.instr_VSM(self.VSM.name) q.instr_CC(self.CCL.name) q.instr_MC(self.MC.name) q.instr_SH(self.SH.name) config_fn = os.path.join(pq.__path__[0], 'tests', 'test_cfg_CCL.json') q.cfg_openql_platform_fn(config_fn) # Setting some "random" initial parameters q.ro_freq(5.43e9 + q_idx * 50e6) q.ro_freq_mod(200e6) q.freq_qubit(4.56e9 + q_idx * 50e6) q.freq_max(4.62e9 + q_idx * 50e6) q.mw_freq_mod(-100e6) q.mw_awg_ch(1) q.cfg_qubit_nr(q_idx) # q.mw_vsm_delay(15) q.mw_mixer_offs_GI(.1) q.mw_mixer_offs_GQ(.2) q.mw_mixer_offs_DI(.3) q.mw_mixer_offs_DQ(.4) # Set up the device object and set required params self.device = do.DeviceCCL('device') self.device.qubits([q.name for q in qubits]) self.device.instr_CC(self.CCL.name) self.device.instr_AWG_mw_0(self.AWG_mw_0.name) self.device.instr_AWG_mw_1(self.AWG_mw_1.name) self.device.instr_AWG_flux_0(self.AWG_flux_0.name) self.device.ro_lo_freq(6e9)
def f_to_parallelize_v2(arglist): # cluster wants a list as an argument. # Below the various list items are assigned to their own variable fitted_stepresponse_ty = arglist["fitted_stepresponse_ty"] fluxlutman_args = arglist[ "fluxlutman_args"] # see function return_instrument_args in czf_v2 fluxlutman_static_args = arglist[ "fluxlutman_static_args"] # see function return_instrument_args in czf_v2 sim_control_CZ_args = arglist[ "sim_control_CZ_args"] # see function return_instrument_args in czf_v2 number = arglist["number"] adaptive_pars = arglist["adaptive_pars"] additional_pars = arglist["additional_pars"] live_plot_enabled = arglist["live_plot_enabled"] exp_metadata = arglist["exp_metadata"] #which_gate = arglist["which_gate"] try: MC = Instrument.find_instrument("MC" + "{}".format(number)) except KeyError: MC = mc.MeasurementControl("MC" + "{}".format(number), live_plot_enabled=live_plot_enabled) from qcodes import station station = station.Station() station.add_component(MC) MC.station = station fluxlutman = flm.HDAWG_Flux_LutMan("fluxlutman" + "{}".format(number)) station.add_component(fluxlutman) fluxlutman_static = flm.HDAWG_Flux_LutMan("fluxlutman_static" + "{}".format(number)) station.add_component(fluxlutman_static) sim_control_CZ = scCZ_v2.SimControlCZ_v2("sim_control_CZ" + "{}".format(number)) station.add_component(sim_control_CZ) fluxlutman = czf_v2.return_instrument_from_arglist_v2( fluxlutman, fluxlutman_args) fluxlutman_static = czf_v2.return_instrument_from_arglist_v2( fluxlutman_static, fluxlutman_static_args) sim_control_CZ = czf_v2.return_instrument_from_arglist_v2( sim_control_CZ, sim_control_CZ_args) sim_control_CZ.set_cost_func() which_gate = sim_control_CZ.which_gate() d = CZ_trajectory_superoperator( fluxlutman=fluxlutman, fluxlutman_static=fluxlutman_static, sim_control_CZ=sim_control_CZ, fitted_stepresponse_ty=fitted_stepresponse_ty, qois=additional_pars['qois'], ) MC.set_detector_function(d) if exp_metadata["mode"] == "adaptive": MC.set_sweep_functions([ getattr(fluxlutman, "vcz_amp_sq_{}".format(which_gate)), getattr(fluxlutman, "vcz_amp_fine_{}".format(which_gate)), ]) MC.set_adaptive_function_parameters(adaptive_pars) if sim_control_CZ.cluster(): dat = MC.run( additional_pars["label"] + "_cluster", mode="adaptive", exp_metadata=exp_metadata, ) else: if additional_pars["long_name"]: dat = MC.run( additional_pars["label"], mode="adaptive", exp_metadata=exp_metadata, ) else: dat = MC.run( "2D_simulations_v2", mode="adaptive", exp_metadata=exp_metadata, ) elif exp_metadata["mode"] == "contour_scan": from pycqed.analysis_v2.tools import contours2d as c2d from pycqed.measurement import sweep_functions as swf timestamp = sim_control_CZ.timestamp_for_contour() coha_for_contour = ma2.Conditional_Oscillation_Heatmap_Analysis( t_start=timestamp, t_stop=timestamp, close_figs=True, extract_only=False, plt_orig_pnts=True, plt_contour_L1=False, plt_contour_phase=True, plt_optimal_values=True, plt_optimal_values_max=1, find_local_optimals=True, plt_clusters=False, cluster_from_interp=False, clims={ "Cost func": [0., 100], "missing fraction": [0, 30], "offset difference": [0, 30] }, target_cond_phase=180, phase_thr=15, L1_thr=5, clustering_thr=0.15, gen_optima_hulls=True, hull_L1_thr=10, hull_phase_thr=20, plt_optimal_hulls=True, save_cond_phase_contours=[180], ) c_180 = coha_for_contour.proc_data_dict["quantities_of_interest"][ "cond_phase_contours"]["180"]["0"] hull = coha_for_contour.proc_data_dict["quantities_of_interest"][ "hull_vertices"]["0"] c_180_in_hull = c2d.pnts_in_hull(pnts=c_180, hull=hull) if c_180_in_hull[0][0] > c_180_in_hull[-1][0]: c_180_in_hull = np.flip(c_180_in_hull, axis=0) swf_2d_contour = swf.SweepAlong2DContour( getattr(fluxlutman, "vcz_amp_sq_{}".format(which_gate)), getattr(fluxlutman, "vcz_amp_fine_{}".format(which_gate)), c_180_in_hull) MC.set_sweep_function(swf_2d_contour) MC.set_sweep_points(np.linspace(0, 1, 40)) if sim_control_CZ.cluster(): dat = MC.run( additional_pars["label"] + "_cluster", mode="1D", exp_metadata=exp_metadata, ) else: if additional_pars["long_name"]: dat = MC.run( additional_pars["label"], mode="1D", exp_metadata=exp_metadata, ) else: dat = MC.run( "contour_scan", mode="1D", exp_metadata=exp_metadata, ) elif exp_metadata["mode"] == "fluxbias_scan": MC.set_sweep_function(getattr(sim_control_CZ, "fluxbias_mean")) MC.set_sweep_points(np.arange(-3000e-6, 3001e-6, 50e-6)) if sim_control_CZ.cluster(): dat = MC.run( additional_pars["label"] + "_cluster", mode="1D", exp_metadata=exp_metadata, ) else: if additional_pars["long_name"]: dat = MC.run( additional_pars["label"], mode="1D", exp_metadata=exp_metadata, ) else: dat = MC.run( "contour_scan", mode="1D", exp_metadata=exp_metadata, ) elif exp_metadata["mode"] == "fluxbias_scan_q1": MC.set_sweep_function(getattr(sim_control_CZ, "fluxbias_mean_q1")) MC.set_sweep_points(np.arange(20000e-6, 30001e-6, 10000e-6)) if sim_control_CZ.cluster(): dat = MC.run( additional_pars["label"] + "_cluster", mode="1D", exp_metadata=exp_metadata, ) else: if additional_pars["long_name"]: dat = MC.run( additional_pars["label"], mode="1D", exp_metadata=exp_metadata, ) else: dat = MC.run( "contour_scan", mode="1D", exp_metadata=exp_metadata, ) fluxlutman.close() fluxlutman_static.close() sim_control_CZ.close() MC.close()
from pycqed.measurement import measurement_control from pycqed.instrument_drivers.virtual_instruments.pyqx.qx_client import \ qx_client from pycqed.measurement.detector_functions import QX_Hard_Detector from pycqed.measurement.demonstrator_helper.detectors import \ Quantumsim_Two_QB_Hard_Detector from pycqed.measurement import sweep_functions as swf from tess.TessConnect import TessConnection from qcodes import station tc = TessConnection() tc.connect("simulate") st = station.Station() # Connect to the qx simulator MC = measurement_control.MeasurementControl( 'MC', live_plot_enabled=False, verbose=True) datadir = os.path.abspath(os.path.join( os.path.dirname(pq.__file__), os.pardir, 'simulator_data')) MC.datadir(datadir) MC.station = st st.add_component(MC) def simulate_qasm_file(file_url: str, config_json: str): file_path = _retrieve_file_from_url(file_url) options = json.loads(config_json)
def f_to_parallelize_new(arglist): # cluster wants a list as an argument. # Below the various list items are assigned to their own variable fitted_stepresponse_ty = arglist['fitted_stepresponse_ty'] fluxlutman_args = arglist[ 'fluxlutman_args'] # see function return_instrument_args in czf noise_parameters_CZ_args = arglist[ 'noise_parameters_CZ_args'] # see function return_instrument_args in czf number = arglist['number'] adaptive_pars = arglist['adaptive_pars'] try: MC = Instrument.find_instrument('MC' + '{}'.format(number)) except KeyError: MC = mc.MeasurementControl('MC' + '{}'.format(number), live_plot_enabled=False) from qcodes import station station = station.Station() station.add_component(MC) MC.station = station fluxlutman = flm.AWG8_Flux_LutMan('fluxlutman' + '{}'.format(number)) station.add_component(fluxlutman) noise_parameters_CZ = npCZ.NoiseParametersCZ('noise_parameters_CZ' + '{}'.format(number)) station.add_component(noise_parameters_CZ) fluxlutman, noise_parameters_CZ = czf.return_instrument_from_arglist( fluxlutman, fluxlutman_args, noise_parameters_CZ, noise_parameters_CZ_args) d = CZ_trajectory_superoperator( fluxlutman=fluxlutman, noise_parameters_CZ=noise_parameters_CZ, fitted_stepresponse_ty=fitted_stepresponse_ty, qois=adaptive_pars.get('qois', 'all')) MC.set_detector_function(d) exp_metadata = { 'double sided': fluxlutman.czd_double_sided(), 'length': fluxlutman.cz_length(), 'distortions': noise_parameters_CZ.distortions(), 'T2_scaling': noise_parameters_CZ.T2_scaling(), 'sigma_q1': noise_parameters_CZ.sigma_q1(), 'sigma_q0': noise_parameters_CZ.sigma_q0() } if adaptive_pars['mode'] == 'adaptive': MC.set_sweep_functions([fluxlutman.cz_theta_f, fluxlutman.cz_lambda_2]) if adaptive_pars['uniform']: loss_per_triangle = adaptive.learner.learner2D.uniform_loss else: loss_per_triangle = None MC.set_adaptive_function_parameters({ 'adaptive_function': adaptive.Learner2D, 'loss_per_triangle': loss_per_triangle, 'goal': lambda l: l.npoints > adaptive_pars['n_points'], 'bounds': [(adaptive_pars['theta_f_min'], adaptive_pars['theta_f_max']), (adaptive_pars['lambda2_min'], adaptive_pars['lambda2_max'])] }) if noise_parameters_CZ.cluster(): dat = MC.run( '2D simulation_new_cluster2 double sided {} - length {:.0f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='adaptive', exp_metadata=exp_metadata) else: if adaptive_pars['long_name']: dat = MC.run( '2D simulation_new_2 double sided {} - length {:.0f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='adaptive', exp_metadata=exp_metadata) else: dat = MC.run('2D simulation_new_2', exp_metadata=exp_metadata, mode='adaptive') elif adaptive_pars['mode'] == '1D': MC.set_sweep_functions([fluxlutman.cz_theta_f]) MC.set_sweep_points( np.linspace(adaptive_pars['theta_f_min'], adaptive_pars['theta_f_max'], adaptive_pars['n_points'])) if noise_parameters_CZ.cluster(): dat = MC.run( '1D simulation_new_cluster2 double sided {} - length {:.0f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='1D', exp_metadata=exp_metadata) else: if adaptive_pars['long_name']: dat = MC.run( '1D simulation_new_2 double sided {} - length {:.0f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='1D', exp_metadata=exp_metadata) else: dat = MC.run('1D simulation_new_2', exp_metadata=exp_metadata, mode='1D') elif adaptive_pars['mode'] == 'spectral_tomo': MC.set_sweep_functions([noise_parameters_CZ.T1_q0]) MC.set_sweep_points( np.logspace(adaptive_pars['theta_f_min'], adaptive_pars['theta_f_max'], adaptive_pars['n_points'])) if noise_parameters_CZ.cluster(): dat = MC.run( '1D sim_spectral_tomo double sided {} - length {:.0f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='1D', exp_metadata=exp_metadata) else: if adaptive_pars['long_name']: dat = MC.run( '1D sim_spectral_tomo double sided {} - length {:.0f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='1D', exp_metadata=exp_metadata) else: dat = MC.run('1D sim_spectral_tomo', exp_metadata=exp_metadata, mode='1D') elif adaptive_pars['mode'] == 'spectral_tomo_nonmarkovian': MC.set_sweep_functions([noise_parameters_CZ.repetitions]) MC.set_sweep_points(np.arange(0, adaptive_pars['n_points'], 1)) if noise_parameters_CZ.cluster(): dat = MC.run( '1D sim_spectral_tomo_nonmarkovian double sided {} - length {:.0f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='1D', exp_metadata=exp_metadata) else: if adaptive_pars['long_name']: dat = MC.run( '1D sim_spectral_tomo_nonmarkovian double sided {} - length {:.0f} - distortions {} - T2_scaling {:.1f} - sigma_q1 {:.0f}, sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.distortions(), noise_parameters_CZ.T2_scaling(), noise_parameters_CZ.sigma_q1() * 1e6, noise_parameters_CZ.sigma_q0() * 1e6), mode='1D', exp_metadata=exp_metadata) else: dat = MC.run('1D sim_spectral_tomo_nonmarkovian', exp_metadata=exp_metadata, mode='1D') elif adaptive_pars['mode'] == 'time_series': MC.set_sweep_functions( [noise_parameters_CZ.detuning] ) # random sweep function never used in this file. Put it just because I need to put one MC.set_sweep_points(np.array([-1])) if noise_parameters_CZ.cluster(): dat = MC.run( '1D time_series_cluster double sided {} - length {:.0f} - sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.sigma_q0() * 1e6), mode='1D', exp_metadata=exp_metadata) else: if adaptive_pars['long_name']: dat = MC.run( '1D time_series double sided {} - length {:.0f} - sigma_q0 {:.0f}' .format(fluxlutman.czd_double_sided(), fluxlutman.cz_length() * 1e9, noise_parameters_CZ.sigma_q0() * 1e6), mode='1D', exp_metadata=exp_metadata) else: dat = MC.run('1D time_series', exp_metadata=exp_metadata, mode='1D') fluxlutman.close() noise_parameters_CZ.close() MC.close()
def setUpClass(self): """ This sets up a mock setup using a CCL to control multiple qubits """ self.station = station.Station() self.CCL_qubit = ct.CCLight_Transmon('CCL_qubit') self.MW1 = vmw.VirtualMWsource('MW1') self.MW2 = vmw.VirtualMWsource('MW2') self.MW3 = vmw.VirtualMWsource('MW3') self.SH = sh.virtual_SignalHound_USB_SA124B('SH') self.UHFQC = dummy_UHFQC('UHFQC') self.CCL = dummy_CCL('CCL') self.QCC = dummy_QCC('QCC') self.VSM = Dummy_Duplexer('VSM') self.MC = measurement_control.MeasurementControl( 'MC', live_plot_enabled=False, verbose=False) self.MC.station = self.station self.station.add_component(self.MC) # Required to set it to the testing datadir test_datadir = os.path.join(pq.__path__[0], 'tests', 'test_output') self.MC.datadir(test_datadir) a_tools.datadir = self.MC.datadir() self.AWG_mw_0 = v8.VirtualAWG8('AWG_mw_0') self.AWG_mw_1 = v8.VirtualAWG8('AWG_mw_1') self.AWG_flux_0 = v8.VirtualAWG8('AWG_flux_0') self.AWG8_VSM_MW_LutMan = mwl.AWG8_VSM_MW_LutMan('MW_LutMan_VSM') self.AWG8_VSM_MW_LutMan.AWG(self.AWG_mw_0.name) self.AWG8_VSM_MW_LutMan.channel_GI(1) self.AWG8_VSM_MW_LutMan.channel_GQ(2) self.AWG8_VSM_MW_LutMan.channel_DI(3) self.AWG8_VSM_MW_LutMan.channel_DQ(4) self.AWG8_VSM_MW_LutMan.mw_modulation(100e6) self.AWG8_VSM_MW_LutMan.sampling_rate(2.4e9) self.ro_lutman = UHFQC_RO_LutMan('RO_lutman', num_res=5) self.ro_lutman.AWG(self.UHFQC.name) # Assign instruments self.CCL_qubit.instr_LutMan_MW(self.AWG8_VSM_MW_LutMan.name) self.CCL_qubit.instr_LO_ro(self.MW1.name) self.CCL_qubit.instr_LO_mw(self.MW2.name) self.CCL_qubit.instr_spec_source(self.MW3.name) self.CCL_qubit.instr_acquisition(self.UHFQC.name) self.CCL_qubit.instr_VSM(self.VSM.name) self.CCL_qubit.instr_CC(self.CCL.name) self.CCL_qubit.instr_LutMan_RO(self.ro_lutman.name) self.CCL_qubit.instr_MC(self.MC.name) self.CCL_qubit.instr_SH(self.SH.name) config_fn = os.path.join(pq.__path__[0], 'tests', 'test_cfg_CCL.json') self.CCL_qubit.cfg_openql_platform_fn(config_fn) # Setting some "random" initial parameters self.CCL_qubit.ro_freq(5.43e9) self.CCL_qubit.ro_freq_mod(200e6) self.CCL_qubit.freq_qubit(4.56e9) self.CCL_qubit.freq_max(4.62e9) self.CCL_qubit.mw_freq_mod(-100e6) self.CCL_qubit.mw_awg_ch(1) self.CCL_qubit.cfg_qubit_nr(0) self.CCL_qubit.mw_vsm_delay(15) self.CCL_qubit.mw_mixer_offs_GI(.1) self.CCL_qubit.mw_mixer_offs_GQ(.2) self.CCL_qubit.mw_mixer_offs_DI(.3) self.CCL_qubit.mw_mixer_offs_DQ(.4) # Set up the device object and set required params self.device = do.DeviceCCL('device') self.device.qubits([self.CCL_qubit.name]) self.device.instr_CC(self.CCL.name) self.device.instr_AWG_mw_0(self.AWG_mw_0.name) self.device.instr_AWG_mw_1(self.AWG_mw_1.name) self.device.instr_AWG_flux_0(self.AWG_flux_0.name)
def f_to_parallelize_v2(arglist): # cluster wants a list as an argument. # Below the various list items are assigned to their own variable fitted_stepresponse_ty = arglist["fitted_stepresponse_ty"] fluxlutman_args = arglist[ "fluxlutman_args"] # see function return_instrument_args in czf_v2 fluxlutman_static_args = arglist[ "fluxlutman_static_args"] # see function return_instrument_args in czf_v2 sim_control_CZ_args = arglist[ "sim_control_CZ_args"] # see function return_instrument_args in czf_v2 number = arglist["number"] additional_pars = arglist["additional_pars"] live_plot_enabled = arglist["live_plot_enabled"] exp_metadata = arglist["exp_metadata"] #which_gate = arglist["which_gate"] try: MC = Instrument.find_instrument("MC" + "{}".format(number)) except KeyError: MC = mc.MeasurementControl("MC" + "{}".format(number), live_plot_enabled=live_plot_enabled) from qcodes import station station = station.Station() station.add_component(MC) MC.station = station fluxlutman = flm.HDAWG_Flux_LutMan("fluxlutman" + "{}".format(number)) station.add_component(fluxlutman) fluxlutman_static = flm.HDAWG_Flux_LutMan("fluxlutman_static" + "{}".format(number)) station.add_component(fluxlutman_static) sim_control_CZ = scCZ_v2.SimControlCZ_v2("sim_control_CZ" + "{}".format(number)) station.add_component(sim_control_CZ) fluxlutman = czf_v2.return_instrument_from_arglist_v2( fluxlutman, fluxlutman_args) fluxlutman_static = czf_v2.return_instrument_from_arglist_v2( fluxlutman_static, fluxlutman_static_args) sim_control_CZ = czf_v2.return_instrument_from_arglist_v2( sim_control_CZ, sim_control_CZ_args) sim_control_CZ.set_cost_func() which_gate = sim_control_CZ.which_gate() d = Ramsey_experiment( fluxlutman=fluxlutman, fluxlutman_static=fluxlutman_static, sim_control_CZ=sim_control_CZ, fitted_stepresponse_ty=fitted_stepresponse_ty, qois="all", ) MC.set_detector_function(d) if additional_pars["mode"] == "1D_ramsey": MC.set_sweep_functions([sim_control_CZ.scanning_time]) MC.set_sweep_points( np.arange(0, additional_pars['max_time'], additional_pars['time_step'])) if sim_control_CZ.cluster(): dat = MC.run( "1D ramsey_v2_cluster double sided {} - sigma_q0 {:.0f} - detuning {:.0f}" .format(sim_control_CZ.get("czd_double_sided"), sim_control_CZ.sigma_q0() * 1e6, sim_control_CZ.detuning() / 1e6), mode="1D", exp_metadata=exp_metadata, ) else: if additional_pars["long_name"]: dat = MC.run( "1D ramsey_v2 double sided {} - sigma_q0 {:.0f} - detuning {:.0f}" .format(sim_control_CZ.get("czd_double_sided"), sim_control_CZ.sigma_q0() * 1e6, sim_control_CZ.detuning() / 1e6), mode="1D", exp_metadata=exp_metadata, ) else: dat = MC.run("1D ramsey_v2", exp_metadata=exp_metadata, mode="1D") fluxlutman.close() fluxlutman_static.close() sim_control_CZ.close() MC.close()