def runSweeper(devices, para_list): reps = para_list[0] # |1> start = 0 q.z = waveforms.square(amp=q.zpa[V], start=start, length=q.piLen[s] + q.piLen21[s]) q['xy'] = XYnothing(q) addXYgate(q, start, theta=np.pi, phi=0.) start += q.piLen[s] + q.piLen21[s] start += q['qa_start_delay'][s] for _qb in qubits: _qb['experiment_length'] = start q['do_readout'] = True set_qubitsDC(qubits, q['experiment_length']) q.r = readoutPulse(q) # start to run experiment data1 = runQ(qubits, devices) # state 2 start = 0 q.z = waveforms.square(amp=q.zpa['V'], start=start, length=q.piLen['s'] + q.piLen21['s']) q['xy'] = XYnothing(q) addXYgate(q, start, theta=np.pi, phi=0.) start += q.piLen['s'] addXYgate(q, start, theta=np.pi, phi=0., piAmp='piAmp21', fq='f21', piLen='piLen21') start += q.piLen21['s'] start += q['qa_start_delay'][s] data2 = runQ(qubits, devices) # state 0 q.xy = [waveforms.square(amp=0), waveforms.square(amp=0)] data0 = runQ(qubits, devices) result = [] for data in [data0, data1, data2]: result += get_IQ(data) clear_waveforms(qubits) return result
def runSweeper(devices, para_list): freq, specAmp, specLen, bias, zpa = para_list q['xy_mw_fc'] = freq * Hz - sb_freq start = 0 q.z = waveforms.square(amp=zpa, start=start, length=specLen + 100e-9) start += 50e-9 q.xy = [ waveforms.cosine(amp=specAmp, freq=sb_freq['Hz'], start=start, length=specLen), waveforms.sine(amp=specAmp, freq=sb_freq['Hz'], start=start, length=specLen) ] start += specLen + 50e-9 q['bias'] = bias start += 100e-9 start += q['qa_start_delay']['s'] q['experiment_length'] = start q['do_readout'] = True set_qubitsDC(qubits, q['experiment_length']) q.r = readoutPulse(q) data = runQ(qubits, devices)[measure] clear_waveforms(qubits) return processData_1q(data, q)
def runSweeper(devices, para_list): bias, zpa, df, piamp, piLen = para_list # since we only have one uwave source for _qb in qubits: _qb['xy_mw_fc'] = q_copy['xy_mw_fc'] + df * Hz start = 0 q.z = waveforms.square(amp=zpa, start=start, length=piLen + 100e-9) start += 50e-9 q.xy = [ waveforms.cosine(amp=piamp, freq=q.sb_freq, start=start, length=piLen), waveforms.sine(amp=piamp, freq=q.sb_freq, start=start, length=piLen) ] start += piLen + 50e-9 q['bias'] = bias * V # additional readout gap, avoid hdawgs fall affect start += 100e-9 # align qa & hd start start += q['qa_start_delay']['s'] q['experiment_length'] = start q['do_readout'] = True set_qubitsDC(qubits, q['experiment_length']) q.r = readoutPulse(q) data = runQ(qubits, devices)[0] clear_waveforms(qubits) return processData_1q(data, q)
def runSweeper(devices, para_list): freq, bias, zpa, power, mw_power, delay, phase = para_list q['bias'] = Value(bias, 'V') q['readout_amp'] = power * dBm q.power_r = power2amp(power) q['readout_mw_fc'] = (freq - q['demod_freq']) * Hz start = 0 q.z = waveforms.square(amp=zpa) q.xy = [waveforms.square(amp=0), waveforms.square(amp=0)] start += delay start += 100e-9 start += q['qa_start_delay']['s'] for _qb in qubits: _qb['experiment_length'] = start q['do_readout'] = True q.r = readoutPulse(q) set_qubitsDC(qubits, q['experiment_length']) data = runQ([q], devices) _d_ = data[0] amp = np.abs(np.mean(_d_)) / q.power_r phase = np.angle(np.mean(_d_)) Iv = np.real(np.mean(_d_)) Qv = np.imag(np.mean(_d_)) return [amp, phase, Iv, Qv]
def runSweeper(devices, para_list): delay, zpa = para_list start = 0. q.xy = XYnothing(q) addXYgate(q, start, np.pi, 0.) start += q['piLen']['s'] + 50e-9 q.z = waveforms.square(amp=zpa, start=start, length=q.piLen[s] + 100e-9) start += 100e-9 start += q['qa_start_delay'][s] for _q in qubits: _q.r = readoutPulse(_q) _q['experiment_length'] = start _q['do_readout'] = True set_qubitsDC(qubits, q_ref['experiment_length']) data = runQ(qubits, devices) prob = tunneling(qubits, data, level=2) clear_waveforms(qubits) return prob
def runSweeper(devices, para_list): bias, zpa, delay = para_list # ## set device parameter # ----- with pi pulse ----- ### start = 0 q['bias'] = bias q.z = waveforms.square(amp=zpa, start=start, length=delay + q.piLen[s] + 100e-9) start += 10e-9 q.xy = XYnothing(q) addXYgate(q, start, np.pi, 0.) start += q.piLen['s'] + delay start += q['qa_start_delay']['s'] q['experiment_length'] = start set_qubitsDC(qubits, q['experiment_length']) q['do_readout'] = True q.r = readoutPulse(q) # start to run experiment data1 = runQ(qubits, devices) # analyze data and return _d_ = data1[0] # unit: dB; only relative strength; amp1 = np.mean(np.abs(_d_)) / q.power_r phase1 = np.mean(np.angle(_d_)) prob1 = tunneling([q], [_d_], level=2) # ----- without pi pulse ----- ### q.xy = XYnothing(q) # start to run experiment data0 = runQ(qubits, devices) _d_ = data0[0] # analyze data and return amp0 = np.abs(np.mean(_d_)) / q.power_r phase0 = np.angle(np.mean(_d_)) prob0 = tunneling([q], [_d_], level=2) # multiply channel should unfold to a list for return result result = [amp1, phase1, prob1[1], amp0, phase0, prob0[1]] clear_waveforms(qubits) return result
def runSweeper(devices, para_list): # with pi pulse --> |1> ## reps = para_list start = 0 q.z = waveforms.square(amp=q.zpa[V], start=start, length=q.piLen[s] + 100e-9) start += 50e-9 q.xy = XYnothing(q) addXYgate(q, start, np.pi, 0.) start += q['piLen']['s'] + 50e-9 start += 100e-9 start += q['qa_start_delay'][s] for _q in qubits: _q.r = readoutPulse(_q) _q['experiment_length'] = start _q['do_readout'] = True set_qubitsDC(qubits, q['experiment_length']) result = [] # start to run experiment data1 = runQ(qubits, devices)[measure] # no pi pulse --> |0> ## q.xy = XYnothing(q) addXYgate(q, start, 0., 0.) # start to run experiment data0 = runQ(qubits, devices)[measure] prob0 = tunneling([q], [data0], level=2) prob1 = tunneling([q], [data1], level=2) clear_waveforms(qubits) return [prob0[0], prob1[0], prob0[1], prob1[1]]
def runSweeper(devices, para_list): reps = para_list[0] # with pi pulse --> |1> ## start = 0 q.z = waveforms.square(amp=q.zpa[V], start=start, length=q.piLen[s] + 100e-9) start += 50e-9 q['xy'] = XYnothing(q) addXYgate(q, start, theta=np.pi, phi=0.) start += q.piLen[s] + 50e-9 start += 100e-9 start += q['qa_start_delay'][s] for _q in qubits: _q.r = readoutPulse(_q) _q['experiment_length'] = start _q['do_readout'] = True set_qubitsDC(qubits, q['experiment_length']) # start to run experiment data1 = runQ(qubits, devices)[measure] q['xy'] = XYnothing(q) data0 = runQ(qubits, devices)[measure] Is0 = np.real(data0) Qs0 = np.imag(data0) Is1 = np.real(data1) Qs1 = np.imag(data1) result = [Is0, Qs0, Is1, Qs1] clear_waveforms(qubits) return result
def runSweeper(devices, para_list): zpa, df, piamp21, piLen21 = para_list q['piAmp21'] = piamp21 q['piLen21'] = Value(piLen21, 's') q['f21'] = q_copy['f21'] + Value(df, 'Hz') start = 0. q.z = waveforms.square(amp=zpa, start=start, length=q.piLen['s'] + q.piLen21['s']) q['xy'] = XYnothing(q) addXYgate(q, start, theta=np.pi, phi=0.) start += q['piLen']['s'] start += 50e-9 addXYgate(q, start, theta=np.pi, phi=0., piAmp='piAmp21', fq='f21', piLen='piLen21') start += q['piLen21']['s'] start += 100e-9 start += q['qa_start_delay']['s'] q['experiment_length'] = start q['do_readout'] = True set_qubitsDC(qubits, q['experiment_length']) q.r = readoutPulse(q) data = runQ([q], devices) _d_ = data[0] amp = np.abs(np.mean(_d_)) / q.power_r phase = np.angle(np.mean(_d_)) Iv = np.mean(np.real(_d_)) Qv = np.mean(np.imag(_d_)) prob = tunneling([q], [_d_], level=3) # multiply channel should unfold to a list for return result result = [amp, phase, Iv, Qv, prob[0], prob[1], prob[2]] clear_waveforms(qubits) return result
def runSweeper(devices, para_list): start = 0. for i, _qb in enumerate(qubits): _qb.xy = XYnothing(_qb) addXYgate(_qb, start, np.pi * states[i], 0.) start += max(map(lambda q: q['piLen']['s'], qubits)) + 50e-9 for _q in qubits: _q.r = readoutPulse(_q) _q['experiment_length'] = start _q['do_readout'] = True set_qubitsDC(qubits, q_ref['experiment_length']) data = runQ(qubits, devices) prob = tunneling(qubits, data, level=2) clear_waveforms(qubits) return prob
def runSweeper(devices, para_list): repetition, delay, df, fringeFreq, PHASE = para_list # set device parameter q['xy_mw_fc'] = q_copy['xy_mw_fc'] + df * Hz # ----- begin waveform ----- ### start = 0 q.z = waveforms.square(amp=q.zpa[V], start=start, length=delay + 2 * q.piLen[s] + 100e-9) start += 50e-9 q.xy = XYnothing(q) addXYgate(q, start, theta=np.pi / 2., phi=0.) start += delay + q.piLen['s'] addXYgate(q, start, theta=np.pi / 2., phi=PHASE + fringeFreq * delay * 2. * np.pi) start += q.piLen[s] + 50e-9 start += 100e-9 + q['qa_start_delay'][s] q['experiment_length'] = start set_qubitsDC(qubits, q['experiment_length']) q['do_readout'] = True q.r = readoutPulse(q) # start to run experiment data = runQ(qubits, devices) # analyze data and return _d_ = data[0] # unit: dB; only relative strength; amp = np.abs(np.mean(_d_)) / q.power_r phase = np.angle(np.mean(_d_)) Iv = np.mean(np.real(_d_)) Qv = np.mean(np.imag(_d_)) prob = tunneling([q], [_d_], level=2) # multiply channel should unfold to a list for return result result = [amp, phase, Iv, Qv, prob[1]] clear_waveforms(qubits) return result
def runSweeper(devices, para_list): reps = para_list reqs = [] q_ref = qubits[0] for idx_qst in np.arange(3**len(qubits)): start = 0. prepare_state(qubits, start) start += np.max(piLens)['s'] + tbuffer add_tomo_gate(qubits, idx_qst, start) start += np.max(piLens)['s'] + tbuffer start += q_ref['qa_start_delay']['s'] read_pulse(qubits, start) data = runQ(qubits, devices) prob = get_prob(data) reqs.append(prob) clear_waveforms(qubits) return np.hstack(reqs)
def runSweeper(devices, para_list): freq, bias, power, sb_freq, mw_power, delay = para_list q['readout_amp'] = power * dBm q.power_r = power2amp(power) # set microwave source device q['readout_mw_fc'] = (freq - q['demod_freq']) * Hz # write waveforms # with pi pulse --> |1> ## q.xy_sb_freq = (q['f10'] - q['xy_mw_fc'])[Hz] start = 0 q.z = waveforms.square(amp=q.zpa[V], start=start, length=q.piLen[s] + 100e-9) start += 50e-9 q.xy = [ waveforms.cosine(amp=q.piAmp, freq=q.xy_sb_freq, start=start, length=q.piLen[s]), waveforms.sine(amp=q.piAmp, freq=q.xy_sb_freq, start=start, length=q.piLen[s]) ] start += q.piLen[s] + 50e-9 q['bias'] = bias start += delay start += 100e-9 start += q['qa_start_delay'][s] q['experiment_length'] = start set_qubitsDC(qubits, q['experiment_length']) q['do_readout'] = True q.r = readoutPulse(q) # start to run experiment data1 = runQ([q], devices) # no pi pulse --> |0> ## q.xy = [waveforms.square(amp=0), waveforms.square(amp=0)] # start to run experiment data0 = runQ([q], devices) # analyze data and return _d_ = data0[0] # unit: dB; only relative strength; amp0 = np.abs(np.mean(_d_)) / q.power_r phase0 = np.angle(np.mean(_d_)) Iv0 = np.mean(np.real(_d_)) Qv0 = np.mean(np.imag(_d_)) _d_ = data1[0] # unit: dB; only relative strength; amp1 = np.abs(np.mean(_d_)) / q.power_r phase1 = np.angle(np.mean(_d_)) Iv1 = np.mean(np.real(_d_)) Qv1 = np.mean(np.imag(_d_)) # multiply channel should unfold to a list for return result result = [amp0, phase0, Iv0, Qv0] result += [amp1, phase1, Iv1, Qv1] result += [np.abs((Iv1 - Iv0) + 1j * (Qv1 - Qv0))] clear_waveforms(qubits) return result