From 41c436abf5ffedd7014ff1c3bc3f747f844fea88 Mon Sep 17 00:00:00 2001 From: Marios Samiotis Date: Wed, 6 Nov 2024 14:14:34 +0100 Subject: [PATCH] PycQED is now stable (both offline and online) Hurray!! --- .../meta_instrument/HAL/HAL_ShimMQ.py | 66 +++++--------- .../meta_instrument/HAL_Device.py | 31 ++++--- .../inspire_dependency_graph.py | 9 +- .../config_cc_s7_direct_iq.json.in | 90 +++++++++++++++++++ .../openql_experiments/multi_qubit_oql.py | 19 ++-- 5 files changed, 146 insertions(+), 69 deletions(-) diff --git a/pycqed/instrument_drivers/meta_instrument/HAL/HAL_ShimMQ.py b/pycqed/instrument_drivers/meta_instrument/HAL/HAL_ShimMQ.py index 8a0c97d06..65df5c5eb 100644 --- a/pycqed/instrument_drivers/meta_instrument/HAL/HAL_ShimMQ.py +++ b/pycqed/instrument_drivers/meta_instrument/HAL/HAL_ShimMQ.py @@ -8,7 +8,6 @@ import logging import warnings -import itertools from collections import OrderedDict import numpy as np from deprecated import deprecated @@ -230,10 +229,8 @@ def prepare_for_timedomain( self.prepare_readout(qubits=qubits, reduced=reduced) if reduced: return - if bypass_flux is False: self.prepare_fluxing(qubits=qubits) - self.prepare_timing() for qb_name in qubits: @@ -244,7 +241,6 @@ def prepare_for_timedomain( # self._prep_td_configure_VSM() - # FIXME: setup dependent def prepare_for_inspire(self): # LDC. Trying to ensure readout is digitized, uses optimal weights, and does single shots w/o averaging @@ -281,8 +277,6 @@ def prepare_for_inspire(self): name = 'System_snapshot' MC._set_measurement_name(name) - # FIXME: Replace absolute data directory path - # MC.datadir('D:\Experiments\Demonstrator_Execute_Data\Data') ###################### with measurement_control.h5d.Data( name=MC._get_measurement_name(), datadir=MC.datadir() @@ -571,14 +565,6 @@ def _add_tim_parameters(self): ) def _add_ro_parameters(self): - # FIXME: no longer used, now in UHFQC_RO_LutMan.LO_freq - # self.add_parameter( - # 'ro_lo_freq', - # unit='Hz', - # docstring='Frequency of the common LO for all RO pulses.', - # parameter_class=ManualParameter - # ) - # actually, it should be possible to build the integration # weights obeying different settings for different # qubits, but for now we use a fixed common value. @@ -674,6 +660,15 @@ def _add_ro_parameters(self): initial_value = False, ) + # ADDED BY RDC 22-03-2023 + self.add_parameter( + "use_online_settings", + docstring="If True, it uses HAL_ShimMQ.py lines for Quantum Inspire", + parameter_class=ManualParameter, + vals=vals.Bool(), + initial_value = False, + ) + def _add_parameters(self): self._add_instr_parameters() self._add_tim_parameters() @@ -738,20 +733,6 @@ def _set_dio_map(self, dio_map_dict): # private functions: prepare ########################################################################## - # FIXME: unused - # def _grab_instruments_from_qb(self): - # """ - # initialize instruments that should only exist once from the first - # qubit. Maybe must be done in a more elegant way (at least check - # uniqueness). - # """ - # - # qb = self.find_instrument(self.qubits()[0]) - # self.instr_MC(qb.instr_MC()) - # self.instr_VSM(qb.instr_VSM()) - # self.instr_CC(qb.instr_CC()) - # self.cfg_openql_platform_fn(qb.cfg_openql_platform_fn()) - def _prep_ro_sources(self, qubits): """ turn on and configure the RO LO's of all qubits to be measured and @@ -978,33 +959,26 @@ def _prep_ro_pulses(self, qubits): ro_lm.set("M_down_length1_R{}".format(res_nr), qb.ro_pulse_down_length1()) ro_lm.set("M_down_amp1_R{}".format(res_nr), qb.ro_pulse_down_amp1()) ro_lm.set("M_down_phi1_R{}".format(res_nr), qb.ro_pulse_down_phi1()) - # Addede by LDC on 2022/09/16 - # ro_lm.set("M_final_length_R{}".format(res_nr), qb.ro_pulse_final_length()) - # ro_lm.set("M_final_amp_R{}".format(res_nr), qb.ro_pulse_final_amp()) - # ro_lm.set("M_final_delay_R{}".format(res_nr), qb.ro_pulse_final_delay()) - for ro_lm in ro_lms: - # list comprehension should result in a list with each individual resonator + the combination of all simultaneously + # list comprehension should result in a list with each + # individual resonator + the combination of all simultaneously # resonator_combs = [[r] for r in resonators_in_lm[ro_lm.name]] + \ # [resonators_in_lm[ro_lm.name]] - - # list comprehension should result in a list with the combination of all simultaneously - # resonator_combs = [resonators_in_lm[ro_lm.name]] - # log.info('Setting resonator combinations for {} to {}'.format( - # ro_lm.name, resonator_combs)) - - # should result in a list with all the possible combinations of resonators - resonator_combs = [] - for L in range(1, len(resonators_in_lm[ro_lm.name])+1): - for subset in itertools.combinations(resonators_in_lm[ro_lm.name],L): - resonator_combs.append(list(subset)) + resonator_combs = [resonators_in_lm[ro_lm.name]] + log.info('Setting resonator combinations for {} to {}'.format( + ro_lm.name, resonator_combs)) # FIXME: temporary fix so device object doesnt mess with # the resonator combinations. Better strategy should be implemented - # ro_lm.resonator_combinations(resonator_combs) + if self.use_online_settings() == False: + ro_lm.resonator_combinations(resonator_combs) + else: + pass + ro_lm.load_DIO_triggered_sequence_onto_UHFQC() + # FIXME: unused def _prep_ro_instantiate_detectors(self): """ Instantiate acquisition detectors. diff --git a/pycqed/instrument_drivers/meta_instrument/HAL_Device.py b/pycqed/instrument_drivers/meta_instrument/HAL_Device.py index ab2182476..71e390ec4 100644 --- a/pycqed/instrument_drivers/meta_instrument/HAL_Device.py +++ b/pycqed/instrument_drivers/meta_instrument/HAL_Device.py @@ -1545,6 +1545,7 @@ def measure_ssro_multi_qubit( analyze=True, shots_per_meas: int = 2 ** 16, label='Mux_SSRO', + return_analysis=True, disable_metadata: bool = False, MC=None): """ @@ -1655,7 +1656,11 @@ def measure_ssro_multi_qubit( threshold = a.qoi[label]['threshold_raw'] # LDC turning off this update for now. 2022/06/28 # self.find_instrument(qubit).ro_acq_threshold(threshold) - return a.plot_dicts['cross_fid_matrix_post']['prob_matrix'] + + if return_analysis: + return a.plot_dicts['cross_fid_matrix_post']['prob_matrix'] + else: + return True def measure_ssro_single_qubit( @@ -5668,15 +5673,16 @@ def measure_T1_TLS( if MC is None: MC = self.instr_MC.get_instr() - for qubit in q_parks: - QUBIT = self.find_instrument(qubit) - flux_lm_QUBIT = self.find_instrument(QUBIT.instr_LutMan_Flux()) - flux_lm_QUBIT.sq_length(q0_pulse_length) - flux_lm_QUBIT.park_length(q0_pulse_length) - flux_lm_QUBIT.sq_amp(0.25) - flux_lm_QUBIT.park_amp(0.25) - flux_lm_QUBIT.cfg_awg_channel_amplitude(0.3) - self.prepare_for_timedomain(qubits = q_parks, bypass_flux = False) + if len(q_parks)>0: + for qubit in q_parks: + QUBIT = self.find_instrument(qubit) + flux_lm_QUBIT = self.find_instrument(QUBIT.instr_LutMan_Flux()) + flux_lm_QUBIT.sq_length(q0_pulse_length) + flux_lm_QUBIT.park_length(q0_pulse_length) + flux_lm_QUBIT.sq_amp(0.25) + flux_lm_QUBIT.park_amp(0.25) + flux_lm_QUBIT.cfg_awg_channel_amplitude(0.3) + self.prepare_for_timedomain(qubits = q_parks, bypass_flux = False) Q0 = self.find_instrument(q0) flux_lm_Q0 = self.find_instrument(Q0.instr_LutMan_Flux()) @@ -5697,8 +5703,9 @@ def measure_T1_TLS( q0_idx = Q0.cfg_qubit_nr() q_parks_idx = [] - for q in q_parks: - q_parks_idx.append(self.find_instrument(q).cfg_qubit_nr()) + if len(q_parks)>0: + for q in q_parks: + q_parks_idx.append(self.find_instrument(q).cfg_qubit_nr()) p = mqo.T1_TLS( q0_idx = q0_idx, diff --git a/pycqed/instrument_drivers/meta_instrument/inspire_dependency_graph.py b/pycqed/instrument_drivers/meta_instrument/inspire_dependency_graph.py index 4e4991584..9f2bf5837 100644 --- a/pycqed/instrument_drivers/meta_instrument/inspire_dependency_graph.py +++ b/pycqed/instrument_drivers/meta_instrument/inspire_dependency_graph.py @@ -280,7 +280,10 @@ def create_dep_graph(self, self.add_node('Cross Fidelity', calibrate_function=self.device.name + '.measure_ssro_multi_qubit', - calibrate_function_args={'qubits': qubit_list, 'initialize': True, 'disable_metadata': True}) + calibrate_function_args={'qubits': qubit_list, + 'initialize': True, + 'return_analysis': False, + 'disable_metadata': True}) ######################### # Create all dependencies @@ -681,7 +684,7 @@ def create_dep_graph(self, if CZindex==0: pair=['NW', 'W', 'C'] flux_lm_C = self.device.find_instrument('flux_lm_C') - flux_lm_C.cfg_awg_channel_amplitude(0.32) + flux_lm_C.cfg_awg_channel_amplitude(0.4) self.device.prepare_for_timedomain(qubits = ['C'], bypass_flux = False) elif CZindex==1: pair=['NW', 'C', 'W'] @@ -690,7 +693,7 @@ def create_dep_graph(self, elif CZindex==3: pair=['NE', 'E', 'C'] flux_lm_C = self.device.find_instrument('flux_lm_C') - flux_lm_C.cfg_awg_channel_amplitude(0.392) + flux_lm_C.cfg_awg_channel_amplitude(0.4) self.device.prepare_for_timedomain(qubits = ['C'], bypass_flux = False) elif CZindex==4: pair=['W', 'SW'] diff --git a/pycqed/measurement/openql_experiments/config_cc_s7_direct_iq.json.in b/pycqed/measurement/openql_experiments/config_cc_s7_direct_iq.json.in index f04b18a75..4e29639b7 100644 --- a/pycqed/measurement/openql_experiments/config_cc_s7_direct_iq.json.in +++ b/pycqed/measurement/openql_experiments/config_cc_s7_direct_iq.json.in @@ -232,6 +232,96 @@ "my90 %0": ["rym90 %0"], "mx90 %0": ["rxm90 %0"], + "swap q0, q2": ["ry270 q2", "barrier q0,q2,q3", "sf_cz_sw q0", "sf_cz_ne q2", "sf_park q3", "barrier q0,q2,q3", "phase_corr_sw q0", "phase_corr_ne q2", "phase_corr_park q3", "barrier q0,q2,q3", "ry90 q2", + "ry270 q0", "barrier q0,q2,q3", "sf_cz_sw q0", "sf_cz_ne q2", "sf_park q3", "barrier q0,q2,q3", "phase_corr_sw q0", "phase_corr_ne q2", "phase_corr_park q3", "barrier q0,q2,q3", "ry90 q0", + "ry270 q2", "barrier q0,q2,q3", "sf_cz_sw q0", "sf_cz_ne q2", "sf_park q3", "barrier q0,q2,q3", "phase_corr_sw q0", "phase_corr_ne q2", "phase_corr_park q3", "barrier q0,q2,q3", "ry90 q2"], + + "swap q2, q0": ["ry270 q2", "barrier q0,q2,q3", "sf_cz_sw q0", "sf_cz_ne q2", "sf_park q3", "barrier q0,q2,q3", "phase_corr_sw q0", "phase_corr_ne q2", "phase_corr_park q3", "barrier q0,q2,q3", "ry90 q2", + "ry270 q0", "barrier q0,q2,q3", "sf_cz_sw q0", "sf_cz_ne q2", "sf_park q3", "barrier q0,q2,q3", "phase_corr_sw q0", "phase_corr_ne q2", "phase_corr_park q3", "barrier q0,q2,q3", "ry90 q0", + "ry270 q2", "barrier q0,q2,q3", "sf_cz_sw q0", "sf_cz_ne q2", "sf_park q3", "barrier q0,q2,q3", "phase_corr_sw q0", "phase_corr_ne q2", "phase_corr_park q3", "barrier q0,q2,q3", "ry90 q2"], + + "swap q0, q3": ["ry270 q3", "barrier q0,q2,q3", "sf_cz_se q0", "sf_cz_nw q3", "sf_park q2", "barrier q0,q2,q3", "phase_corr_se q0", "phase_corr_nw q3", "phase_corr_park q2", "barrier q0,q2,q3", "ry90 q3", + "ry270 q0", "barrier q0,q2,q3", "sf_cz_se q0", "sf_cz_nw q3", "sf_park q2", "barrier q0,q2,q3", "phase_corr_se q0", "phase_corr_nw q3", "phase_corr_park q2", "barrier q0,q2,q3", "ry90 q0", + "ry270 q3", "barrier q0,q2,q3", "sf_cz_se q0", "sf_cz_nw q3", "sf_park q2", "barrier q0,q2,q3", "phase_corr_se q0", "phase_corr_nw q3", "phase_corr_park q2", "barrier q0,q2,q3", "ry90 q3"], + + "swap q3, q0": ["ry270 q3", "barrier q0,q2,q3", "sf_cz_se q0", "sf_cz_nw q3", "sf_park q2", "barrier q0,q2,q3", "phase_corr_se q0", "phase_corr_nw q3", "phase_corr_park q2", "barrier q0,q2,q3", "ry90 q3", + "ry270 q0", "barrier q0,q2,q3", "sf_cz_se q0", "sf_cz_nw q3", "sf_park q2", "barrier q0,q2,q3", "phase_corr_se q0", "phase_corr_nw q3", "phase_corr_park q2", "barrier q0,q2,q3", "ry90 q0", + "ry270 q3", "barrier q0,q2,q3", "sf_cz_se q0", "sf_cz_nw q3", "sf_park q2", "barrier q0,q2,q3", "phase_corr_se q0", "phase_corr_nw q3", "phase_corr_park q2", "barrier q0,q2,q3", "ry90 q3"], + + "swap q1, q3": ["ry270 q3", "barrier q1,q3,q4", "sf_cz_sw q1", "sf_cz_ne q3", "sf_park q4", "barrier q1,q3,q4", "phase_corr_sw q1", "phase_corr_ne q3", "phase_corr_park q4", "barrier q1,q3,q4", "ry90 q3", + "ry270 q1", "barrier q1,q3,q4", "sf_cz_sw q1", "sf_cz_ne q3", "sf_park q4", "barrier q1,q3,q4", "phase_corr_sw q1", "phase_corr_ne q3", "phase_corr_park q4", "barrier q1,q3,q4", "ry90 q1", + "ry270 q3", "barrier q1,q3,q4", "sf_cz_sw q1", "sf_cz_ne q3", "sf_park q4", "barrier q1,q3,q4", "phase_corr_sw q1", "phase_corr_ne q3", "phase_corr_park q4", "barrier q1,q3,q4", "ry90 q3"], + + "swap q3, q1": ["ry270 q3", "barrier q1,q3,q4", "sf_cz_sw q1", "sf_cz_ne q3", "sf_park q4", "barrier q1,q3,q4", "phase_corr_sw q1", "phase_corr_ne q3", "phase_corr_park q4", "barrier q1,q3,q4", "ry90 q3", + "ry270 q1", "barrier q1,q3,q4", "sf_cz_sw q1", "sf_cz_ne q3", "sf_park q4", "barrier q1,q3,q4", "phase_corr_sw q1", "phase_corr_ne q3", "phase_corr_park q4", "barrier q1,q3,q4", "ry90 q1", + "ry270 q3", "barrier q1,q3,q4", "sf_cz_sw q1", "sf_cz_ne q3", "sf_park q4", "barrier q1,q3,q4", "phase_corr_sw q1", "phase_corr_ne q3", "phase_corr_park q4", "barrier q1,q3,q4", "ry90 q3"], + + "swap q1, q4": ["ry270 q4", "barrier q1,q3,q4", "sf_cz_se q1", "sf_cz_nw q4", "sf_park q3", "barrier q1,q3,q4", "phase_corr_se q1", "phase_corr_nw q4", "phase_corr_park q3", "barrier q1,q3,q4", "ry90 q4", + "ry270 q1", "barrier q1,q3,q4", "sf_cz_se q1", "sf_cz_nw q4", "sf_park q3", "barrier q1,q3,q4", "phase_corr_se q1", "phase_corr_nw q4", "phase_corr_park q3", "barrier q1,q3,q4", "ry90 q1", + "ry270 q4", "barrier q1,q3,q4", "sf_cz_se q1", "sf_cz_nw q4", "sf_park q3", "barrier q1,q3,q4", "phase_corr_se q1", "phase_corr_nw q4", "phase_corr_park q3", "barrier q1,q3,q4", "ry90 q4"], + + "swap q4, q1": ["ry270 q4", "barrier q1,q3,q4", "sf_cz_se q1", "sf_cz_nw q4", "sf_park q3", "barrier q1,q3,q4", "phase_corr_se q1", "phase_corr_nw q4", "phase_corr_park q3", "barrier q1,q3,q4", "ry90 q4", + "ry270 q1", "barrier q1,q3,q4", "sf_cz_se q1", "sf_cz_nw q4", "sf_park q3", "barrier q1,q3,q4", "phase_corr_se q1", "phase_corr_nw q4", "phase_corr_park q3", "barrier q1,q3,q4", "ry90 q1", + "ry270 q4", "barrier q1,q3,q4", "sf_cz_se q1", "sf_cz_nw q4", "sf_park q3", "barrier q1,q3,q4", "phase_corr_se q1", "phase_corr_nw q4", "phase_corr_park q3", "barrier q1,q3,q4", "ry90 q4"], + + "swap q2, q5": ["ry270 q5", "barrier q2,q5", "sf_cz_se q2", "sf_cz_nw q5", "barrier q2,q5", "phase_corr_se q2", "phase_corr_nw q5", "barrier q2,q5", "ry90 q5", + "ry270 q2", "barrier q2,q5", "sf_cz_se q2", "sf_cz_nw q5", "barrier q2,q5", "phase_corr_se q2", "phase_corr_nw q5", "barrier q2,q5", "ry90 q2", + "ry270 q5", "barrier q2,q5", "sf_cz_se q2", "sf_cz_nw q5", "barrier q2,q5", "phase_corr_se q2", "phase_corr_nw q5", "barrier q2,q5", "ry90 q5"], + + "swap q5, q2": ["ry270 q5", "barrier q2,q5", "sf_cz_se q2", "sf_cz_nw q5", "barrier q2,q5", "phase_corr_se q2", "phase_corr_nw q5", "barrier q2,q5", "ry90 q5", + "ry270 q2", "barrier q2,q5", "sf_cz_se q2", "sf_cz_nw q5", "barrier q2,q5", "phase_corr_se q2", "phase_corr_nw q5", "barrier q2,q5", "ry90 q2", + "ry270 q5", "barrier q2,q5", "sf_cz_se q2", "sf_cz_nw q5", "barrier q2,q5", "phase_corr_se q2", "phase_corr_nw q5", "barrier q2,q5", "ry90 q5"], + + "swap q3, q5": ["ry270 q5", "barrier q3,q5,q6", "sf_cz_sw q3", "sf_cz_ne q5", "sf_park q6", "barrier q3,q5,q6", "phase_corr_sw q3", "phase_corr_ne q5", "phase_corr_park q6", "barrier q3,q5,q6", "ry90 q5", + "ry270 q3", "barrier q3,q5,q6", "sf_cz_sw q3", "sf_cz_ne q5", "sf_park q6", "barrier q3,q5,q6", "phase_corr_sw q3", "phase_corr_ne q5", "phase_corr_park q6", "barrier q3,q5,q6", "ry90 q3", + "ry270 q5", "barrier q3,q5,q6", "sf_cz_sw q3", "sf_cz_ne q5", "sf_park q6", "barrier q3,q5,q6", "phase_corr_sw q3", "phase_corr_ne q5", "phase_corr_park q6", "barrier q3,q5,q6", "ry90 q5"], + + "swap q5, q3": ["ry270 q5", "barrier q3,q5,q6", "sf_cz_sw q3", "sf_cz_ne q5", "sf_park q6", "barrier q3,q5,q6", "phase_corr_sw q3", "phase_corr_ne q5", "phase_corr_park q6", "barrier q3,q5,q6", "ry90 q5", + "ry270 q3", "barrier q3,q5,q6", "sf_cz_sw q3", "sf_cz_ne q5", "sf_park q6", "barrier q3,q5,q6", "phase_corr_sw q3", "phase_corr_ne q5", "phase_corr_park q6", "barrier q3,q5,q6", "ry90 q3", + "ry270 q5", "barrier q3,q5,q6", "sf_cz_sw q3", "sf_cz_ne q5", "sf_park q6", "barrier q3,q5,q6", "phase_corr_sw q3", "phase_corr_ne q5", "phase_corr_park q6", "barrier q3,q5,q6", "ry90 q5"], + + "swap q3, q6": ["ry270 q6", "barrier q3,q5,q6", "sf_cz_se q3", "sf_cz_nw q6", "sf_park q5", "barrier q3,q5,q6", "phase_corr_se q3", "phase_corr_nw q6", "phase_corr_park q5", "barrier q3,q5,q6", "ry90 q6", + "ry270 q3", "barrier q3,q5,q6", "sf_cz_se q3", "sf_cz_nw q6", "sf_park q5", "barrier q3,q5,q6", "phase_corr_se q3", "phase_corr_nw q6", "phase_corr_park q5", "barrier q3,q5,q6", "ry90 q3", + "ry270 q6", "barrier q3,q5,q6", "sf_cz_se q3", "sf_cz_nw q6", "sf_park q5", "barrier q3,q5,q6", "phase_corr_se q3", "phase_corr_nw q6", "phase_corr_park q5", "barrier q3,q5,q6", "ry90 q6"], + + "swap q6, q3": ["ry270 q6", "barrier q3,q5,q6", "sf_cz_se q3", "sf_cz_nw q6", "sf_park q5", "barrier q3,q5,q6", "phase_corr_se q3", "phase_corr_nw q6", "phase_corr_park q5", "barrier q3,q5,q6", "ry90 q6", + "ry270 q3", "barrier q3,q5,q6", "sf_cz_se q3", "sf_cz_nw q6", "sf_park q5", "barrier q3,q5,q6", "phase_corr_se q3", "phase_corr_nw q6", "phase_corr_park q5", "barrier q3,q5,q6", "ry90 q3", + "ry270 q6", "barrier q3,q5,q6", "sf_cz_se q3", "sf_cz_nw q6", "sf_park q5", "barrier q3,q5,q6", "phase_corr_se q3", "phase_corr_nw q6", "phase_corr_park q5", "barrier q3,q5,q6", "ry90 q6"], + + "swap q4, q6": ["ry270 q6", "barrier q4,q6", "sf_cz_sw q4", "sf_cz_ne q6", "barrier q4,q6", "phase_corr_sw q4", "phase_corr_ne q6", "barrier q4,q6", "ry90 q6", + "ry270 q4", "barrier q4,q6", "sf_cz_sw q4", "sf_cz_ne q6", "barrier q4,q6", "phase_corr_sw q4", "phase_corr_ne q6", "barrier q4,q6", "ry90 q4", + "ry270 q6", "barrier q4,q6", "sf_cz_sw q4", "sf_cz_ne q6", "barrier q4,q6", "phase_corr_sw q4", "phase_corr_ne q6", "barrier q4,q6", "ry90 q6"], + + "swap q6, q4": ["ry270 q6", "barrier q4,q6", "sf_cz_sw q4", "sf_cz_ne q6", "barrier q4,q6", "phase_corr_sw q4", "phase_corr_ne q6", "barrier q4,q6", "ry90 q6", + "ry270 q4", "barrier q4,q6", "sf_cz_sw q4", "sf_cz_ne q6", "barrier q4,q6", "phase_corr_sw q4", "phase_corr_ne q6", "barrier q4,q6", "ry90 q4", + "ry270 q6", "barrier q4,q6", "sf_cz_sw q4", "sf_cz_ne q6", "barrier q4,q6", "phase_corr_sw q4", "phase_corr_ne q6", "barrier q4,q6", "ry90 q6"], + + + //"cnot %0 %1": ["ry270 %1", "cz %0 %1", "ry90 %1"], + "cnot q0, q2": ["ry270 q2", "barrier q0,q2,q3", "sf_cz_sw q0", "sf_cz_ne q2", "sf_park q3", "barrier q0,q2,q3", "phase_corr_sw q0", "phase_corr_ne q2", "phase_corr_park q3", "barrier q0,q2,q3", "ry90 q2"], + "cnot q2, q0": ["ry270 q0", "barrier q0,q2,q3", "sf_cz_sw q0", "sf_cz_ne q2", "sf_park q3", "barrier q0,q2,q3", "phase_corr_sw q0", "phase_corr_ne q2", "phase_corr_park q3", "barrier q0,q2,q3", "ry90 q0"], + + "cnot q0, q3": ["ry270 q3", "barrier q0,q2,q3", "sf_cz_se q0", "sf_cz_nw q3", "sf_park q2", "barrier q0,q2,q3", "phase_corr_se q0", "phase_corr_nw q3", "phase_corr_park q2", "barrier q0,q2,q3", "ry90 q3"], + "cnot q3, q0": ["ry270 q0", "barrier q0,q2,q3", "sf_cz_se q0", "sf_cz_nw q3", "sf_park q2", "barrier q0,q2,q3", "phase_corr_se q0", "phase_corr_nw q3", "phase_corr_park q2", "barrier q0,q2,q3", "ry90 q0"], + + "cnot q1, q3": ["ry270 q3", "barrier q1,q3,q4", "sf_cz_sw q1", "sf_cz_ne q3", "sf_park q4", "barrier q1,q3,q4", "phase_corr_sw q1", "phase_corr_ne q3", "phase_corr_park q4", "barrier q1,q3,q4", "ry90 q3"], + "cnot q3, q1": ["ry270 q1", "barrier q1,q3,q4", "sf_cz_sw q1", "sf_cz_ne q3", "sf_park q4", "barrier q1,q3,q4", "phase_corr_sw q1", "phase_corr_ne q3", "phase_corr_park q4", "barrier q1,q3,q4", "ry90 q1"], + + "cnot q1, q4": ["ry270 q4", "barrier q1,q3,q4", "sf_cz_se q1", "sf_cz_nw q4", "sf_park q3", "barrier q1,q3,q4", "phase_corr_se q1", "phase_corr_nw q4", "phase_corr_park q3", "barrier q1,q3,q4", "ry90 q4"], + "cnot q4, q1": ["ry270 q1", "barrier q1,q3,q4", "sf_cz_se q1", "sf_cz_nw q4", "sf_park q3", "barrier q1,q3,q4", "phase_corr_se q1", "phase_corr_nw q4", "phase_corr_park q3", "barrier q1,q3,q4", "ry90 q1"], + + "cnot q2, q5": ["ry270 q5", "barrier q2,q5", "sf_cz_se q2", "sf_cz_nw q5", "barrier q2,q5", "phase_corr_se q2", "phase_corr_nw q5", "barrier q2,q5", "ry90 q5"], + "cnot q5, q2": ["ry270 q2", "barrier q2,q5", "sf_cz_se q2", "sf_cz_nw q5", "barrier q2,q5", "phase_corr_se q2", "phase_corr_nw q5", "barrier q2,q5", "ry90 q2"], + + "cnot q3, q5": ["ry270 q5", "barrier q3,q5,q6", "sf_cz_sw q3", "sf_cz_ne q5", "sf_park q6", "barrier q3,q5,q6", "phase_corr_sw q3", "phase_corr_ne q5", "phase_corr_park q6", "barrier q3,q5,q6", "ry90 q5"], + "cnot q5, q3": ["ry270 q3", "barrier q3,q5,q6", "sf_cz_sw q3", "sf_cz_ne q5", "sf_park q6", "barrier q3,q5,q6", "phase_corr_sw q3", "phase_corr_ne q5", "phase_corr_park q6", "barrier q3,q5,q6", "ry90 q3"], + + "cnot q3, q6": ["ry270 q6", "barrier q3,q5,q6", "sf_cz_se q3", "sf_cz_nw q6", "sf_park q5", "barrier q3,q5,q6", "phase_corr_se q3", "phase_corr_nw q6", "phase_corr_park q5", "barrier q3,q5,q6", "ry90 q6"], + "cnot q6, q3": ["ry270 q3", "barrier q3,q5,q6", "sf_cz_se q3", "sf_cz_nw q6", "sf_park q5", "barrier q3,q5,q6", "phase_corr_se q3", "phase_corr_nw q6", "phase_corr_park q5", "barrier q3,q5,q6", "ry90 q3"], + + "cnot q4, q6": ["ry270 q6", "barrier q4,q6", "sf_cz_sw q4", "sf_cz_ne q6", "barrier q4,q6", "phase_corr_sw q4", "phase_corr_ne q6", "barrier q4,q6", "ry90 q6"], + "cnot q6, q4": ["ry270 q4", "barrier q4,q6", "sf_cz_sw q4", "sf_cz_ne q6", "barrier q4,q6", "phase_corr_sw q4", "phase_corr_ne q6", "barrier q4,q6", "ry90 q4"], + "cz q0, q2": ["barrier q0,q2,q3", "sf_cz_sw q0", "sf_cz_ne q2", "sf_park q3", "barrier q0,q2,q3", "phase_corr_sw q0", "phase_corr_ne q2", "phase_corr_park q3", "barrier q0,q2,q3"], "cz q2, q0": ["barrier q0,q2,q3", "sf_cz_sw q0", "sf_cz_ne q2", "sf_park q3", "barrier q0,q2,q3", "phase_corr_sw q0", "phase_corr_ne q2", "phase_corr_park q3", "barrier q0,q2,q3"], diff --git a/pycqed/measurement/openql_experiments/multi_qubit_oql.py b/pycqed/measurement/openql_experiments/multi_qubit_oql.py index 7f8198c9c..7b575258e 100644 --- a/pycqed/measurement/openql_experiments/multi_qubit_oql.py +++ b/pycqed/measurement/openql_experiments/multi_qubit_oql.py @@ -3750,8 +3750,9 @@ def T1_TLS(q0_idx: int, for i, time in enumerate(times[:-5]): k = p.create_kernel('T1_TLS_{}'.format(i)) k.prepz(q0_idx) - for q_park in q_parks_idx: - k.prepz(q_park) + if len(q_parks_idx)>0: + for q_park in q_parks_idx: + k.prepz(q_park) k.barrier([]) # alignment workaround k.gate('rx180', [q0_idx]) @@ -3761,18 +3762,20 @@ def T1_TLS(q0_idx: int, k.measure(q0_idx) p.add_kernel(k) else: - k.gate('sf_square', [q0_idx]) - for q_park in q_parks_idx: - k.gate('sf_square', [q_park]) # square pulse + k.gate('sf_square', [q0_idx]) + if len(q_parks_idx)>0: + for q_park in q_parks_idx: + k.gate('sf_square', [q_park]) # square pulse k.barrier([]) # alignment workaround wait_nanoseconds = int(round(time/1e-9)) k.gate("wait", [q0_idx], wait_nanoseconds) k.barrier([]) # alignment workaround - k.gate('sf_square', [q0_idx]) - for q_park in q_parks_idx: - k.gate('sf_square', [q_park]) # square pulse + k.gate('sf_square', [q0_idx]) + if len(q_parks_idx)>0: + for q_park in q_parks_idx: + k.gate('sf_square', [q_park]) # square pulse k.barrier([]) # alignment workaround k.measure(q0_idx)