コード例 #1
0
def SD1_calibration(verbose=False):
    gates, _311113, ST_anti_12, ST_anti_12_tc_high, ST_anti_56, vSD1_threshold, vSD2_threshold = variables(
    )
    anticrossing = ST_anti_12

    pulse = qc.Station.default.pulse
    TRIG = mk_TRIG()
    EMPTY = pulse.mk_segment()
    var_mgr = variable_mgr()

    anticrossing = list(anticrossing)
    anticrossing[1] = lp.linspace(anticrossing[1] - 1,
                                  anticrossing[1] + 1,
                                  2,
                                  axis=1,
                                  name='vP1',
                                  unit='mV')
    anticrossing[12] = lp.linspace(anticrossing[12] - 3,
                                   anticrossing[12] + 3,
                                   80,
                                   axis=0,
                                   name='vSD1',
                                   unit='mV')
    anticrossing = tuple(anticrossing)

    PSB_read_multi_12(EMPTY, gates, 10, 2e3, _311113, anticrossing, 1)

    seq = [TRIG, EMPTY]

    raw_trace = False
    t_meas = 2e3
    n_qubit = 1
    n_rep = 500

    sequence, minstr, name = run_PSB_exp(
        'SD1_calibration',
        seq,
        t_meas,
        n_rep,
        n_qubit,
        raw_trace,
        phase=[var_mgr.RF_readout_phase, var_mgr.RF_readout_phase_SD2],
        order=[1])
    ds = scan_generic(sequence, minstr, name=name).run()
    data = ds.m1a()
    y = ds.m1.y()
    SD1_winner = 0
    contrast = 0
    threshold = 0
    for x in range(50):
        if data[1][x] - data[0][x] > contrast:
            contrast = data[1][x] - data[0][x]
            threshold = (data[1][x] + data[0][x]) / 2
            SD1_winner = y[x]
    print(SD1_winner)
    var_mgr.SD1_P_on_11 = SD1_winner
    print(contrast)
    print(threshold)
    var_mgr.vSD1_threshold = threshold
    return None
コード例 #2
0
def phase_calib(target, ancillary, gate, undo_gate=None, plot=False):
    '''
	calibrates a single qubit phase for a target qubit

	Args:
		target (int) : qubit number to target (1-6)
		ancillary (list) : qubit that need to be initialized to make this work
		gate (str) : name of the gate to call (e.g, q2.X or q12.cphase )
		undo_gate (str) : name of the gate that cancels the previous gate
	'''
    s = six_dot_sample(qc.Station.default.pulse)

    s.init(target, *ancillary)

    s.wait(100).add(s.manip)
    s.pre_pulse.add(s.manip)
    s.wait(100).add(s.manip)

    gate_set = getattr(s, f'q{target}')
    phase_offset_charac(s.manip, gate_set, get_target(s, gate))

    s.wait(100).add(s.manip)
    if undo_gate is not None:
        get_target(s, undo_gate).add(s.manip)
    s.wait(100).add(s.manip)

    s.read(target)

    sequence, minstr, name = run_qubit_exp(
        f'phase_cal_q{target}, target gate : {gate}', s.segments(),
        s.measurement_manager)
    ds = scan_generic(sequence, minstr, name=name).run()

    input_phases = ds(f'read{target}').x()
    amplitude = ds(f'read{target}').y()

    # get rid of the first part due to heating
    input_phases = input_phases[20:]
    amplitude = amplitude[20:]

    phase, std_error = fit_phase(input_phases, amplitude, plot=plot)

    var_mgr = variable_mgr()

    if not hasattr(var_mgr, f'PHASE_q{target}_{gate.replace(".", "_")}'):
        var_mgr.add_variable(f'Qubit {target}',
                             f'PHASE_q{target}_{gate.replace(".", "_")}',
                             'rad', 0.1, 0)

    old_phase = getattr(var_mgr, f'PHASE_q{target}_{gate.replace(".", "_")}')
    setattr(var_mgr, f'PHASE_q{target}_{gate.replace(".", "_")}',
            round(phase, 3))

    print(
        f'calibrated phase for qubit {target}, ' +
        f'for gate {gate}. \n Old phase : {round(old_phase,2)} \n New Phase : {round(phase,2)} [{round(std_error[0],2)} : {round(std_error[1],2)}]\n'
    )

    return phase
コード例 #3
0
def CROT_calib(pair, target, ancilla, plot=False):
	'''
	calibrates a single qubit phase for a target qubit

	Args:
		target (int) : qubit number to target (1-6)
		ancillary (list) : qubit that need to be initialized to make this work
	'''
	var_mgr = variable_mgr()
	pair = str(int(pair))

	old_crot = getattr(var_mgr, f'crot{pair[target-1]}{pair[ancilla-1]}')
	old_z_crot = getattr(var_mgr, f'z_crot{pair[target-1]}{pair[ancilla-1]}')
	crot_time = getattr(var_mgr, f'pi_crot{pair[target-1]}_m3dbm')
	z_crot_time = getattr(var_mgr, f'pi_z_crot{pair[target-1]}_m3dbm')

	gate_time= min(crot_time,z_crot_time)	

	sequence, minstr, name = CROT_cali_meas(pair, target, ancilla, old_crot, gate_time, 0)
	ds_one = scan_generic(sequence, minstr, name=name).run()
	sequence, minstr, name = CROT_cali_meas(pair, target, ancilla, old_z_crot, gate_time, 1)
	ds_two = scan_generic(sequence, minstr, name=name).run()

	frequency_one = ds_one(f'read{pair[target-1]}').x()
	probabilities_one = ds_one(f'read{pair[target-1]}').y()
	fit_freq_one = fit_resonance(frequency_one, probabilities_one, plot=plot)
	
	frequency_two = ds_two(f'read{pair[target-1]}').x()
	probabilities_two = ds_two(f'read{pair[target-1]}').y()
	fit_freq_two = fit_resonance(frequency_two, probabilities_two, plot=plot)

	z_crot_res = min(fit_freq_one, fit_freq_two)
	crot_res = max(fit_freq_one, fit_freq_two)

	old_z_crot = getattr(var_mgr, f'z_crot{pair[target-1]}{pair[ancilla-1]}')
	setattr(var_mgr, f'z_crot{pair[target-1]}{pair[ancilla-1]}', round(z_crot_res*1e-9,6))
	old_crot = getattr(var_mgr, f'crot{pair[target-1]}{pair[ancilla-1]}')
	setattr(var_mgr, f'crot{pair[target-1]}{pair[ancilla-1]}', round(crot_res*1e-9,6))
	print(f'calibrated z_crot_res for qubit pair {pair}, target {pair[target-1]} '+
		f'Old z_crot_res : {round(old_z_crot,6)} \n New z_crot_res : {round(z_crot_res*1e-9,6)} \n')
	print(f'calibrated crot_res for qubit pair {pair}, target {pair[target-1]} '+
		f'Old crot_res : {round(old_crot,6)} \n New z_crot_res : {round(crot_res*1e-9,6)} \n')
コード例 #4
0
def cphase_ZZ_calib(target, even=False, plot=False):
	'''
	Args:
		qubit_pair (str) : pair of qubits to calibrate cphase for.
	'''
	s = six_dot_sample(qc.Station.default.pulse)

	target = str(int(target))
	s.init(target[0], target[1])

	s.wait(100).add(s.manip)
	s.pre_pulse.add(s.manip)
	s.wait(100).add(s.manip)

	sweep = lp.linspace(-0.2*np.pi,4*np.pi, 100, 'angle', 'rad', 0)/2

	getattr(s,f'q{target[0]}').X90.add(s.manip)
	getattr(s,f'q{target}').cphase.add(s.manip, cphase_angle=sweep, padding = 30, phase_corrections={})
	getattr(s,f'q{target[0]}').X180.add(s.manip)
	getattr(s,f'q{target[1]}').X180.add(s.manip)
	getattr(s,f'q{target}').cphase.add(s.manip, cphase_angle=sweep, padding = 30, phase_corrections={})
	getattr(s,f'q{target[0]}').X90.add(s.manip)

	s.wait(100).add(s.manip)

	s.read(target[0], target[1])

	sequence, minstr, name = run_qubit_exp(f'cphase cal :: {target}', s.segments(), s.measurement_manager)
	ds = scan_generic(sequence, minstr, name=name).run()


	target_ds = target[0]
	input_phases = ds(f'read{target_ds}').x()
	amplitude = ds(f'read{target_ds}').y()

	# get rid of the first part due to heating
	input_phases = input_phases[10:]
	amplitude = amplitude[10:]

	phase, std_error = fit_phase(input_phases, amplitude, plot=plot)

	if even == True:
		cphase_angle = (3*np.pi - phase)/2
	else:
		cphase_angle = (2*np.pi + phase)/2

	var_mgr = variable_mgr()
	setattr(var_mgr, f'J_pi_{target}', cphase_angle)
	
	if not hasattr(var_mgr,f'J_pi_{target}'):
		var_mgr.add_variable(f'cphase{target}',f'J_pi_{target}','rad',0.1,0)

	old_phase = getattr(var_mgr,f'J_pi_{target}')
	setattr(var_mgr,f'J_pi_{target}', round(phase,3))
コード例 #5
0
def calib_J_V_off(target, plot=False):
	'''
	calibrates a single qubit phase for a target qubit

	Args:
		target (int) : qubit pair to target
	'''
	var_mgr = variable_mgr()
	s = six_dot_sample(qc.Station.default.pulse)

	target = str(int(target))
	s.init(target[0], target[1])

	s.wait(100).add(s.manip)
	s.pre_pulse.add(s.manip)
	s.wait(100).add(s.manip)

	gates = globals()[f'J{target}'].gates
	voltages =globals()[f'J{target}'].voltages_gates
	gate_time = lp.linspace(0,getattr(var_mgr, f'time_{target}')*8, 100, axis=0, name='time', unit='ns')
	
	getattr(s,f'q{target[0]}').X90.add(s.manip)
	cphase_basic(s.manip, gates, tuple([0]*len(gates)), voltages, t_gate= gate_time/2, t_ramp=100)
	getattr(s,f'q{target[0]}').X180.add(s.manip)
	getattr(s,f'q{target[1]}').X180.add(s.manip)
	cphase_basic(s.manip, gates, tuple([0]*len(gates)), voltages, t_gate= gate_time/2, t_ramp=100)
	getattr(s,f'q{target[0]}').X90.add(s.manip)

	s.wait(100).add(s.manip)

	s.read(target[0], target[1])

	sequence, minstr, name = run_qubit_exp(f'J_V_off cal :: {target}', s.segments(), s.measurement_manager)
	ds = scan_generic(sequence, minstr, name=name).run()

	time = ds(f'read{target[0]}').x()*1e-9
	probabilities = ds(f'read{target[0]}').y()
	time = time[5:]
	probabilities = probabilities[5:]
	Pi_time = fit_ramsey(time, probabilities, plot=plot)
	J_max = 1/(Pi_time*2)*1e9
	
	J_max_voltage = J_to_voltage(J_max, 0, globals()[f'J{target}'].J_max, globals()[f'J{target}'].alpha)
	J_off = J_max_voltage - 1

	if not hasattr(var_mgr,f'J_V_off{target}'):
		var_mgr.add_variable(f'cphase{target}',f'J_V_off{target}', 'mV',0.1,0)

	old_phase = getattr(var_mgr,f'J_V_off{target}')
	setattr(var_mgr,f'J_V_off{target}', round(J_off,3))

	return J_off
コード例 #6
0
def cphase_ZI_IZ_cal(pair, target, even=True, plot=False):
	'''
	calibrate single qubit phases.

	args:
		pair   : pair of qubit to calibrate
		target : qubit to target with the cnot
		even   : if initial state is even Flase, else True
	'''

	s = six_dot_sample(qc.Station.default.pulse)

	pair = str(int(pair))
	s.init(pair[0], pair[1])

	s.wait(100).add(s.manip)
	s.pre_pulse.add(s.manip)
	s.wait(100).add(s.manip)

	getattr(s, f'q{target}').X90.add(s.manip)
	getattr(s, f'q{pair}').cphase.add(s.manip, padding = 30, phase_corrections={})
	getattr(s, f'q{target}').X90.add(s.manip, phase = lp.linspace(-1,4*np.pi, 80, 'angle', 'rad', 0))

	s.wait(100).add(s.manip)

	s.read(pair[0], pair[1])

	sequence, minstr, name = run_qubit_exp(f'cphase single qubit phase cal :: q{target}', s.segments(), s.measurement_manager)
	ds = scan_generic(sequence, minstr, name=name).run()

	input_phases = ds(f'read{target}').x()
	amplitude = ds(f'read{target}').y()

	# get rid of the first part due to heating
	input_phases = input_phases[10:]
	amplitude = amplitude[10:]

	phase, std_error = fit_phase(input_phases, amplitude, plot=plot)

	phase = -phase
	if even == True:
		phase += np.pi

	var_mgr = variable_mgr()

	if not hasattr(var_mgr, f'PHASE_q{target}_q{pair}_cphase'):
		var_mgr.add_variable(f'cphase{pair}',f'PHASE_q{target}_q{pair}_cphase','rad',0.1,0)

	old_phase = getattr(var_mgr, f'PHASE_q{target}_q{pair}_cphase')
	setattr(var_mgr, f'PHASE_q{target}_q{pair}_cphase', round(phase,3))

	print('setting ' + f'PHASE_q{target}_q{pair}_cphase to {phase}')
コード例 #7
0
def PSB56_calibration(station, plot=False, verbose=False):
    gates, _311113, ST_anti_12, ST_anti_12_tc_high, ST_anti_56, vSD1_threshold, vSD2_threshold = variables(
    )
    var_mgr = variable_mgr()
    anticrossing = ST_anti_56

    s = six_dot_sample(qc.Station.default.pulse)
    s.init56.add(sweep_range=1)
    s.manip.qubit6_MW.add_chirp(0, 50e3, var_mgr.frequency_q6 * 1e9 - 5e6,
                                var_mgr.frequency_q6 * 1e9 + 5e6, 300)
    s.read56.add(sweep_range=1)
    s.measurement_manager.n_rep = 500
    sequence, minstr, name = run_qubit_exp(f'PSB56_calibration', s.segments(),
                                           s.measurement_manager)

    station.MW_source.on()
    ds_on = scan_generic(sequence, minstr, name=name).run()
    station.MW_source.off()
    ds_off = scan_generic(sequence, minstr, name=name).run()

    x = ds_on('read56').x()
    y = ds_on('read56').y()
    contrast = ds_on('read56')() - ds_off('read56')()

    contrast = sp.ndimage.filters.gaussian_filter(contrast, [2, 2],
                                                  mode='constant')
    if plot:
        plt.imshow(contrast)

    var_mgr.PSB_56_P5 = round(x[np.where(contrast == contrast.max())[0][0]], 2)
    var_mgr.PSB_56_P6 = round(y[np.where(contrast == contrast.max())[1][0]], 2)
    print(
        f"Selected point\n\tvP5 :: {var_mgr.PSB_56_P5}\n\tvP6 :: {var_mgr.PSB_56_P6}"
    )

    station.MW_source.on()
    return None
コード例 #8
0
def res_calib(target, plot=False):
    '''
	calibrates a single qubit phase for a target qubit

	Args:
		target (int) : qubit number to target (1-6)
		ancillary (list) : qubit that need to be initialized to make this work
	'''
    s = six_dot_sample(qc.Station.default.pulse)
    var_mgr = variable_mgr()

    s.init(target)

    s.wait(100).add(s.manip)
    s.pre_pulse.add(s.manip)
    s.wait(100).add(s.manip)

    gate_set = getattr(s, f'q{target}')
    old_freq = getattr(var_mgr, f'frequency_q{target}')
    gate_set.X180.add(s.manip,
                      f_qubit=linspace(old_freq * 1e9 - 10e6,
                                       old_freq * 1e9 + 10e6,
                                       100,
                                       axis=0,
                                       name='freq',
                                       unit='Hz'))
    s.wait(100).add(s.manip)
    s.read(target)

    sequence, minstr, name = run_qubit_exp(f'frequency_cal_q{target}',
                                           s.segments(), s.measurement_manager)
    ds = scan_generic(sequence, minstr, name=name).run()

    frequency = ds(f'read{target}').x()
    probabilities = ds(f'read{target}').y()
    resonance = fit_resonance(frequency, probabilities, plot=plot)
    var_mgr = variable_mgr()

    old_res = getattr(var_mgr, f'frequency_q{target}')
    setattr(var_mgr, f'frequency_q{target}', round(resonance * 1e-9, 6))

    print(
        f'calibrated resonance for qubit {target}, ' +
        f'Old resonance : {round(old_res,6)} \n New resonance : {round(resonance*1e-9,6)} \n'
    )
コード例 #9
0
def _allXY_(qubit, plot=False):
	s = six_dot_sample(qc.Station.default.pulse)

	s.init(qubit)

	s.wait(500).add(s.manip)
	s.pre_pulse.add(s.manip)

	s.wait(1000).add(s.manip)
	generate_all_XY(s.manip, getattr(s, f'q{qubit}'), repeat=NREP)
	s.wait(1000).add(s.manip)

	s.read(qubit)

	sequence, minstr, name = run_qubit_exp(f'allXY qubit {qubit}', s.segments(), s.measurement_manager)
	ds = scan_generic(sequence, minstr, name=name).run()
	amplitude = np.average(np.reshape(ds(f'read{qubit}').y(), (NREP,21)), axis=0)

	var_mgr = variable_mgr()
	pulse_length_increment, off_resonance_error = fit_allXY(amplitude, getattr(var_mgr, f'pi_q{qubit}_m3dbm')*1e-9, plot=plot)
	return pulse_length_increment, off_resonance_error
コード例 #10
0
def Pi_calib(target, plot=False):
	'''
	calibrates a single qubit phase for a target qubit

	Args:
		target (int) : qubit number to target (1-6)
		ancillary (list) : qubit that need to be initialized to make this work
	'''
	s = six_dot_sample(qc.Station.default.pulse)
	var_mgr = variable_mgr()

	s.init(target)

	s.wait(100).add(s.manip)
	s.pre_pulse.add(s.manip)
	s.wait(100).add(s.manip)

	gate_set = getattr(s, f'q{target}')
	old_pi = getattr(var_mgr, f'pi_q{target}_m3dbm')
	gate_set.X90.add(s.manip, t_pulse = linspace(0,old_pi*4, 60, 'time', 'ns', 0))
	s.wait(100).add(s.manip)
	s.read(target)

	sequence, minstr, name = run_qubit_exp(f'Pi_cal_q{target}', s.segments(), s.measurement_manager)
	ds = scan_generic(sequence, minstr, name=name).run()

	time = ds(f'read{target}').x()*1e-9
	probabilities = ds(f'read{target}').y()
	time = time[5:]
	probabilities = probabilities[5:]
	Pi_time = fit_ramsey(time, probabilities, plot=plot)
	var_mgr = variable_mgr()

	old_Pi = getattr(var_mgr, f'pi_q{target}_m3dbm')
	setattr(var_mgr, f'pi_q{target}_m3dbm', round(Pi_time,6))

	print(f'calibrated resonance for qubit {target}, '+
		f'Old resonance : {round(old_Pi,6)} \n New resonance : {round(Pi_time,6)} \n')
コード例 #11
0
def CROT_pi_calib(pair, target, ancilla, plot=False):
    '''
	calibrates a single qubit phase for a target qubit

	Args:
		target (int) : qubit number to target (1-6)
		ancillary (list) : qubit that need to be initialized to make this work
	'''
    var_mgr = variable_mgr()
    pair = str(int(pair))

    old_crot = getattr(var_mgr, f'crot{pair[target-1]}{pair[ancilla-1]}')
    old_z_crot = getattr(var_mgr, f'z_crot{pair[target-1]}{pair[ancilla-1]}')
    crot_time = getattr(var_mgr, f'pi_crot{pair[target-1]}_m3dbm')
    z_crot_time = getattr(var_mgr, f'pi_z_crot{pair[target-1]}_m3dbm')

    gate_time = max(crot_time, z_crot_time)

    sequence, minstr, name = CROT_cali_pi_meas(pair, target, ancilla,
                                               [old_z_crot, old_crot],
                                               gate_time, 0)
    ds_one = scan_generic(sequence, minstr, name=name).run()
    sequence, minstr, name = CROT_cali_pi_meas(pair, target, ancilla,
                                               [old_z_crot, old_crot],
                                               gate_time, 1)
    ds_two = scan_generic(sequence, minstr, name=name).run()

    frequency_one = ds_one(f'read{pair[target-1]}').x()
    time_one = ds_one(f'read{pair[target-1]}').y() * 1e-9
    probabilities_one = ds_one(f'read{pair[target-1]}').z()
    index_one = np.argmax(
        [[np.std(probabilities_one[0]),
          np.std(probabilities_one[1])]])
    Pi_time_one = fit_ramsey(time_one[5:],
                             probabilities_one[index_one][5:],
                             plot=plot)

    frequency_two = ds_two(f'read{pair[target-1]}').x()
    time_two = ds_two(f'read{pair[target-1]}').y() * 1e-9
    probabilities_two = ds_two(f'read{pair[target-1]}').z()
    index_two = np.argmax(
        [[np.std(probabilities_two[0]),
          np.std(probabilities_two[1])]])
    Pi_time_two = fit_ramsey(time_two, probabilities_two[index_two], plot=plot)

    if index_one > index_two:
        pi_crot = [Pi_time_two, Pi_time_one]
    else:
        pi_crot = [Pi_time_one, Pi_time_two]
    old_z_crot = getattr(var_mgr, f'pi_z_crot{pair[target-1]}_m3dbm')
    setattr(var_mgr, f'pi_z_crot{pair[target-1]}_m3dbm', round(pi_crot[0]))
    old_crot = getattr(var_mgr, f'pi_crot{pair[target-1]}_m3dbm')
    setattr(var_mgr, f'pi_crot{pair[target-1]}_m3dbm', round(pi_crot[1]))

    print(
        f'calibrated z_crot_pi for qubit pair {pair}, target {pair[target-1]} '
        +
        f'Old z_crot_pi : {round(old_z_crot,6)} \n New z_crot_pi : {round(pi_crot[0])} \n'
    )
    print(
        f'calibrated crot_pi for qubit pair {pair}, target {pair[target-1]} ' +
        f'Old crot_pi : {round(old_crot,6)} \n New crot_pi : {round(pi_crot[1])} \n'
    )
コード例 #12
0
def calib_symm_point(target, even=False, plot=False):
    '''
	Args:
		qubit_pair (str) : pair of qubits to calibrate cphase for.
	'''
    s = six_dot_sample(qc.Station.default.pulse)
    var_mgr = variable_mgr()
    J_off_volt = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

    time = getattr(var_mgr, f'time_{target}')
    target = str(int(target))
    s.init(target[0], target[1])
    gates = globals()[f'J{target}'].gates
    voltages_gates = globals()[f'J{target}'].voltages_gates
    voltages_gates = list(voltages_gates)
    sweep_gate = lp.linspace(-6,
                             6,
                             51,
                             axis=0,
                             name=f'vP{target[0]}',
                             unit='mV')
    step_gate = lp.linspace(-6,
                            6,
                            51,
                            axis=1,
                            name=f'vP{target[1]}',
                            unit='mV')
    voltages_gates[2 * (int(target[0]) - 1) + 1] = sweep_gate
    voltages_gates[2 * (int(target[1]) - 1) + 1] = step_gate
    voltages_gates = tuple(voltages_gates)
    cphase = two_qubit_gate_generic(
        cphase_basic, {
            'gates': gates,
            'v_exchange_pulse_off': J_off_volt,
            'v_exchange_pulse_on': voltages_gates,
            't_gate': time,
            't_ramp': 20
        }, {})

    s.wait(100).add(s.manip)
    s.pre_pulse.add(s.manip)
    s.wait(100).add(s.manip)

    getattr(s, f'q{target[0]}').X90.add(s.manip)
    cphase.add(s.manip)
    getattr(s, f'q{target[0]}').X180.add(s.manip)
    getattr(s, f'q{target[1]}').X180.add(s.manip)
    cphase.add(s.manip)
    getattr(s, f'q{target[0]}').X90.add(s.manip)

    s.wait(100).add(s.manip)

    s.read(target[0])

    sequence, minstr, name = run_qubit_exp(f'symm cal :: {target}',
                                           s.segments(), s.measurement_manager)
    ds = scan_generic(sequence, minstr, name=name).run()

    x_axis = ds(f'read{target[0]}').x()
    y_axis = ds(f'read{target[0]}').y()
    probabilities = ds(f'read{target[0]}').z()
    fit_symmetry(x_axis, y_axis, probabilities, plot)
コード例 #13
0
def calib_J_alpha(target, plot=False):
    '''
	calibrates a single qubit phase for a target qubit

	Args:
		target (int) : qubit pair to target
	'''
    var_mgr = variable_mgr()
    s = six_dot_sample(qc.Station.default.pulse)

    target = str(int(target))
    s.init(target[0], target[1])

    s.wait(100).add(s.manip)
    s.pre_pulse.add(s.manip)
    s.wait(100).add(s.manip)

    gates = globals()[f'J{target}'].gates
    N_J = 5
    voltages_gates = globals()[f'J{target}'].voltages_gates
    voltages_gates = list(voltages_gates)
    sweep_gate = lp.linspace(voltages_gates[2 * (int(target[0]))] / 2,
                             voltages_gates[2 * (int(target[0]))],
                             N_J,
                             axis=1,
                             name=f'vB{target[0]}',
                             unit='mV')
    voltages_gates[2 * (int(target[0]))] = sweep_gate
    voltages_gates = tuple(voltages_gates)

    gate_time = lp.linspace(0,
                            getattr(var_mgr, f'time_{target}') * 10,
                            80,
                            axis=0,
                            name='time',
                            unit='ns')

    getattr(s, f'q{target[0]}').X90.add(s.manip)
    cphase_basic(s.manip,
                 gates,
                 tuple([0] * len(gates)),
                 voltages_gates,
                 t_gate=gate_time / 2,
                 t_ramp=100)
    getattr(s, f'q{target[0]}').X180.add(s.manip)
    getattr(s, f'q{target[1]}').X180.add(s.manip)
    cphase_basic(s.manip,
                 gates,
                 tuple([0] * len(gates)),
                 voltages_gates,
                 t_gate=gate_time / 2,
                 t_ramp=100)
    getattr(s, f'q{target[0]}').X90.add(s.manip)

    s.wait(100).add(s.manip)

    s.read(target[0], target[1])

    sequence, minstr, name = run_qubit_exp(f'J_V cal :: {target}',
                                           s.segments(), s.measurement_manager)
    ds = scan_generic(sequence, minstr, name=name).run()

    time = ds(f'read{target[0]}').y() * 1e-9
    probabilities = ds(f'read{target[0]}').z()
    J_meas = []
    for i in range(N_J):
        time_fit = time[5:]
        probabilities_fit = probabilities[i][5:]
        J_meas += [
            1 / (fit_ramsey(time_fit, probabilities_fit, plot=plot) * 2) * 1e9
        ]
    barrier_percentage = sweep_gate.data / sweep_gate.data.max()
    J_V_off, J_max, alpha = fit_J(barrier_percentage,
                                  np.array(J_meas),
                                  plot=plot)

    if not hasattr(var_mgr, f'J_V_off{target}'):
        var_mgr.add_variable(f'cphase{target}', f'J_V_off{target}', 'mV', 0.1,
                             0)
    if not hasattr(var_mgr, f'J_max{target}'):
        var_mgr.add_variable(f'cphase{target}', f'J_max{target}', 'mV', 0.1, 0)
    if not hasattr(var_mgr, f'J_alpha{target}'):
        var_mgr.add_variable(f'cphase{target}', f'J_alpha{target}', 'mV', 0.1,
                             0)
    setattr(var_mgr, f'J_V_off{target}', round(J_V_off, 3))
    setattr(var_mgr, f'J_max{target}', round(J_max, 3))
    setattr(var_mgr, f'J_alpha{target}', round(alpha, 3))