Skip to content

Commit cedc07a

Browse files
author
Stefania Lazar
committed
Addresses pull request requested changes.
- removes the resonator amplitude sweep and ro dynamic phase measurements + sequence functions. - properly implements the result_logging_mode in UHFQC_correlation_detector. - reverts push-away flux pulse to be nz for the NZBufferedCZPulse.
1 parent 9b1fe79 commit cedc07a

File tree

6 files changed

+36
-330
lines changed

6 files changed

+36
-330
lines changed

pycqed/instrument_drivers/meta_instrument/qubit_objects/QuDev_transmon.py

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -652,64 +652,6 @@ def measure_resonator_spectroscopy(self, freqs, sweep_points_2D=None,
652652
ma.MeasurementAnalysis(close_fig=close_fig, qb_name=self.name,
653653
TwoD=(mode == '2D'))
654654

655-
def measure_resonator_amplitude_sweep(self, freqs, amps,
656-
trigger_separation=3e-6,
657-
upload=True, analyze=True,
658-
close_fig=True, label=None):
659-
""" Varies the frequency of the microwave source to the resonator and
660-
measures the transmittance """
661-
if np.any(freqs < 500e6):
662-
log.warning(('Some of the values in the freqs array might be '
663-
'too small. The units should be Hz.'))
664-
665-
if label is None:
666-
label = 'resonator_amplitude_scan' + self.msmt_suffix
667-
668-
self.prepare(drive=None)
669-
MC = self.instr_mc.get_instr()
670-
671-
hard_sweep_params = {'mod_frequency': {
672-
'values': freqs - self.instr_ro_lo.get_instr().frequency(),
673-
'unit': 'Hz'}}
674-
soft_sweep_params = {'amplitude': {'values': amps, 'unit': 'V'}}
675-
676-
sequences, hard_sweep_points, soft_sweep_points = \
677-
sq.res_amp_sweep_seqs(
678-
qb_name=self.name,
679-
hard_sweep_dict=hard_sweep_params,
680-
soft_sweep_dict=soft_sweep_params,
681-
uhf_name=self.instr_uhf.get_instr().name,
682-
operation_dict=self.get_operation_dict(), upload=False)
683-
684-
hard_sweep_func = awg_swf.SegmentHardSweep(
685-
sequence=sequences[0], upload=upload,
686-
parameter_name=list(hard_sweep_params)[0],
687-
unit=list(hard_sweep_params.values())[0]['unit'])
688-
MC.set_sweep_function(hard_sweep_func)
689-
MC.set_sweep_points(hard_sweep_points)
690-
691-
channels_to_upload = [self.ro_I_channel(), self.ro_Q_channel()]
692-
MC.set_sweep_function_2D(awg_swf.SegmentSoftSweep(
693-
hard_sweep_func, sequences,
694-
list(soft_sweep_params)[0],
695-
list(soft_sweep_params.values())[0]['unit'],
696-
channels_to_upload=channels_to_upload))
697-
MC.set_sweep_points_2D(soft_sweep_points)
698-
MC.set_detector_function(self.int_avg_det)
699-
700-
exp_metadata = {'hard_sweep_params': hard_sweep_params,
701-
'soft_sweep_params': soft_sweep_params}
702-
703-
with temporary_value(self.instr_trigger.get_instr().pulse_period,
704-
trigger_separation):
705-
self.instr_pulsar.get_instr().start(exclude=[self.instr_uhf()])
706-
MC.run(name=label, mode='2D', exp_metadata=exp_metadata)
707-
self.instr_pulsar.get_instr().stop()
708-
709-
if analyze:
710-
ma.MeasurementAnalysis(close_fig=close_fig, qb_name=self.name,
711-
TwoD=True)
712-
713655
def measure_qubit_spectroscopy(self, freqs, sweep_points_2D=None,
714656
sweep_function_2D=None, pulsed=True, trigger_separation=13e-6,
715657
upload=True, analyze=True, close_fig=True, label=None):
@@ -943,7 +885,6 @@ def measure_qscale(self, qscales=None, analyze=True, upload=True, label=None,
943885
if exp_metadata is None:
944886
exp_metadata = {}
945887
exp_metadata.update({'sweep_points_dict': {self.name: qscales},
946-
'preparation_params': prep_params,
947888
'sweep_name': 'Qscale factor',
948889
'sweep_unit': '',
949890
'preparation_params': prep_params,

pycqed/measurement/detector_functions.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -841,19 +841,22 @@ def __init__(self, UHFQC, AWG=None, integration_length=1e-6,
841841
channels: list = [0, 1], correlations: list=[(0, 1)],
842842
result_logging_mode: str='raw',
843843
used_channels=None, value_names=None,
844-
seg_per_point=1, single_int_avg=False, thresholding=False,
844+
seg_per_point=1, single_int_avg=False,
845845
**kw):
846846
super().__init__(
847847
UHFQC, AWG=AWG, integration_length=integration_length,
848848
nr_averages=nr_averages, real_imag=real_imag,
849849
channels=channels,
850850
seg_per_point=seg_per_point, single_int_avg=single_int_avg,
851-
result_logging_mode=result_logging_mode, # FIXME -> do the proper thing (MAR)
851+
result_logging_mode=result_logging_mode,
852852
**kw)
853853

854854
self.result_logging_mode = result_logging_mode
855855
self.correlations = correlations
856856
self.thresholding = self.result_logging_mode == 'digitized'
857+
res_logging_indices = {'lin_trans': 0, 'digitized': 1, 'raw': 2}
858+
self.result_logging_mode_idx = res_logging_indices[
859+
self.result_logging_mode]
857860

858861
self.used_channels = used_channels
859862
if self.used_channels is None:
@@ -868,12 +871,19 @@ def __init__(self, UHFQC, AWG=None, integration_length=1e-6,
868871
self.value_names = value_names
869872

870873
# Note that V^2 is in brackets to prevent confusion with unit prefixes
871-
if not thresholding:
874+
if self.result_logging_mode == 'raw':
872875
self.value_units = ['V']*len(self.value_names) + \
873876
['(V^2)']*len(self.correlations)
874-
else:
875-
self.value_units = ['fraction']*len(self.value_names) + \
877+
self.scaling_factor = 1/(1.8e9*integration_length)
878+
elif self.result_logging_mode == 'lin_trans':
879+
self.value_units = ['a.u']*len(self.value_names) + \
880+
['a.u.']*len(self.correlations)
881+
self.scaling_factor = 1
882+
elif self.result_logging_mode == 'digitized':
883+
self.value_units = ['frac']*len(self.value_names) + \
876884
['normalized']*len(self.correlations)
885+
self.scaling_factor = 1
886+
877887
for corr in correlations:
878888
self.value_names += ['corr ({},{})'.format(corr[0], corr[1])]
879889

@@ -1003,16 +1013,13 @@ def process_data(self, data_raw):
10031013
data = data_raw
10041014
else:
10051015
data = []
1006-
self.scaling_factor = 1 / (1.8e9 * self.integration_length)
1007-
# FIXME: this should be tested
10081016
for n, ch in enumerate(self.used_channels):
10091017
if ch in self.correlation_channels:
10101018
data.append(3 * np.array(data_raw[n]) *
10111019
(self.scaling_factor**2 / self.nr_averages))
10121020
else:
10131021
data.append(np.array(data_raw[n]) *
10141022
(self.scaling_factor / self.nr_averages))
1015-
10161023
return data
10171024

10181025

pycqed/measurement/multi_qubit_module.py

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -3001,81 +3001,3 @@ def measure_pygsti(qubits, f_LO, pygsti_gateset=None,
30013001
title=label, verbosity=2)
30023002

30033003
return MC
3004-
3005-
3006-
def measure_ro_dynamic_phases(pulsed_qubit, measured_qubits,
3007-
hard_sweep_params=None, exp_metadata=None,
3008-
pulse_separation=None, init_state='g',
3009-
upload=True, n_cal_points_per_state=1,
3010-
cal_states='auto', classified=False,
3011-
prep_params=None):
3012-
if not hasattr(measured_qubits, '__iter__'):
3013-
measured_qubits = [measured_qubits]
3014-
qubits = measured_qubits + [pulsed_qubit]
3015-
3016-
if pulse_separation is None:
3017-
pulse_separation = max([qb.acq_length() for qb in qubits])
3018-
3019-
for qb in qubits:
3020-
MC = qb.instr_mc.get_instr()
3021-
qb.prepare(drive='timedomain')
3022-
3023-
if hard_sweep_params is None:
3024-
hard_sweep_params = {
3025-
'phase': {'values': np.tile(np.linspace(0, 2*np.pi, 6)*180/np.pi, 2),
3026-
'unit': 'deg'}
3027-
}
3028-
3029-
cal_states = CalibrationPoints.guess_cal_states(cal_states,
3030-
for_ef=False)
3031-
cp = CalibrationPoints.multi_qubit([qb.name for qb in qubits], cal_states,
3032-
n_per_state=n_cal_points_per_state)
3033-
3034-
if prep_params is None:
3035-
prep_params = measured_qubits[0].preparation_params()
3036-
operation_dict = get_operation_dict(qubits)
3037-
sequences, hard_sweep_points = \
3038-
mqs.ro_dynamic_phase_seq(
3039-
hard_sweep_dict=hard_sweep_params,
3040-
qbp_name=pulsed_qubit.name, qbr_names=[qb.name for qb in
3041-
measured_qubits],
3042-
operation_dict=operation_dict,
3043-
pulse_separation=pulse_separation,
3044-
init_state = init_state, prep_params=prep_params,
3045-
cal_points=cp, upload=False)
3046-
3047-
hard_sweep_func = awg_swf.SegmentHardSweep(
3048-
sequence=sequences, upload=upload,
3049-
parameter_name=list(hard_sweep_params)[0],
3050-
unit=list(hard_sweep_params.values())[0]['unit'])
3051-
MC.set_sweep_function(hard_sweep_func)
3052-
MC.set_sweep_points(hard_sweep_points)
3053-
3054-
det_name = 'int_avg{}_det'.format('_classif' if classified else '')
3055-
det_func = get_multiplexed_readout_detector_functions(
3056-
measured_qubits, nr_averages=max(qb.acq_averages() for qb in measured_qubits)
3057-
)[det_name]
3058-
MC.set_detector_function(det_func)
3059-
3060-
if exp_metadata is None:
3061-
exp_metadata = {}
3062-
3063-
hard_sweep_params = {
3064-
'phase': {'values': np.repeat(np.tile(np.linspace(0, 2 * np.pi, 6) * 180 /
3065-
np.pi,
3066-
2),2),
3067-
'unit': 'deg'}
3068-
}
3069-
exp_metadata.update({'qbnames': [qb.name for qb in qubits],
3070-
'preparation_params': prep_params,
3071-
'cal_points': repr(cp),
3072-
'rotate': len(cal_states) != 0,
3073-
'cal_states_rotations':
3074-
{qb.name: {'g': 0, 'e': 1} for qb in qubits} if
3075-
len(cal_states) != 0 else None,
3076-
'data_to_fit': {qb.name: 'pe' for qb in qubits},
3077-
'hard_sweep_params': hard_sweep_params})
3078-
MC.run('RO_DynamicPhase_{}{}'.format(
3079-
pulsed_qubit.name, ''.join([qb.name for qb in qubits])),
3080-
exp_metadata=exp_metadata)
3081-
tda.MultiQubit_TimeDomain_Analysis(qb_names=[qb.name for qb in measured_qubits])

pycqed/measurement/pulse_sequences/multi_qubit_tek_seq_elts.py

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,122 +1802,6 @@ def pygsti_seq(qb_names, pygsti_listOfExperiments, operation_dict,
18021802
return seq_name
18031803

18041804

1805-
def ro_dynamic_phase_seq(hard_sweep_dict, qbp_name, qbr_names,
1806-
operation_dict,
1807-
pulse_separation, init_state,
1808-
cal_points=True, prep_params=dict(),
1809-
upload=True):
1810-
1811-
"""
1812-
RO cross-dephasing measurement sequence. Measures the dynamic phase induced
1813-
on qbr by a measurement tone on the pulsed qubit (qbp).
1814-
Args:
1815-
qbp_name: pulsed qubit name; RO pulse is applied on this qubit
1816-
qbr_names: ramsey (measured) qubits
1817-
phases: array of phases for the second piHalf pulse on qbr
1818-
operation_dict: contains operation dicts from both qubits;
1819-
!!! Must contain 'RO mux' which is the mux RO pulse only for
1820-
the measured_qubits (qbr_names) !!!
1821-
pulse_separation: separation between the two pi-half pulses, shouls be
1822-
equal to integration length
1823-
cal_points: use cal points
1824-
"""
1825-
1826-
seq_name = 'ro_dynamic_phase_sequence'
1827-
dummy_ro_1 = {'pulse_type': 'GaussFilteredCosIQPulse',
1828-
'I_channel': 'UHF1_ch1',
1829-
'Q_channel': 'UHF1_ch2',
1830-
'amplitude': 0.00001,
1831-
'pulse_length': 50e-09,
1832-
'pulse_delay': 0,
1833-
'mod_frequency': 900.0e6,
1834-
'phase': 0,
1835-
'phi_skew': 0,
1836-
'alpha': 1,
1837-
'gaussian_filter_sigma': 1e-09,
1838-
'nr_sigma': 2,
1839-
'phase_lock': True,
1840-
'basis_rotation': {},
1841-
'operation_type': 'RO'}
1842-
dummy_ro_2 = {'pulse_type': 'GaussFilteredCosIQPulse',
1843-
'I_channel': 'UHF2_ch1',
1844-
'Q_channel': 'UHF2_ch2',
1845-
'amplitude': 0.00001,
1846-
'pulse_length': 50e-09,
1847-
'pulse_delay': 0,
1848-
'mod_frequency': 900.0e6,
1849-
'phase': 0,
1850-
'phi_skew': 0,
1851-
'alpha': 1,
1852-
'gaussian_filter_sigma': 1e-09,
1853-
'nr_sigma': 2,
1854-
'phase_lock': True,
1855-
'basis_rotation': {},
1856-
'operation_type': 'RO'}
1857-
1858-
1859-
1860-
1861-
1862-
# put together n-qubit calibration point pulse lists
1863-
# put together n-qubit ramsey pulse lists
1864-
pulse_list = []
1865-
for j, qbr_name in enumerate(qbr_names):
1866-
pulse_list.append(deepcopy(operation_dict['X90 ' + qbr_name]))
1867-
pulse_list[-1]['name'] = f'x1_{qbr_name}'
1868-
pulse_list[-1]['ref_pulse'] = 'segment_start'
1869-
pulse_list[-1]['refpoint'] = 'start'
1870-
1871-
ro_probe = deepcopy(operation_dict['RO ' + qbp_name])
1872-
pulse_list.append(ro_probe)
1873-
pulse_list[-1]['name'] = f'ro_probe'
1874-
pulse_list[-1]['element_name'] = f'ro_probe'
1875-
pulse_list.append(dummy_ro_1)
1876-
pulse_list[-1]['refpoint'] = 'start'
1877-
pulse_list[-1]['element_name'] = f'ro_probe'
1878-
pulse_list.append(dummy_ro_2)
1879-
pulse_list[-1]['refpoint'] = 'start'
1880-
pulse_list[-1]['element_name'] = f'ro_probe'
1881-
1882-
for j, qbr_name in enumerate(qbr_names):
1883-
pulse_list.append(deepcopy(operation_dict['X90 ' + qbr_name]))
1884-
pulse_list[-1]['name'] = f'x2_{qbr_name}'
1885-
pulse_list[-1]['ref_pulse'] = 'segment_start'
1886-
pulse_list[-1]['refpoint'] = 'start'
1887-
pulse_list[-1]['pulse_delay'] = pulse_separation
1888-
1889-
ro_list = generate_mux_ro_pulse_list(qbr_names+[qbp_name], operation_dict)
1890-
pulse_list += ro_list
1891-
1892-
if init_state == 'e':
1893-
pulse_list.append(deepcopy(operation_dict['X180 ' + qbp_name]))
1894-
pulse_list[-1]['ref_pulse'] = 'segment_start'
1895-
pulse_list[-1]['refpoint'] = 'start'
1896-
pulse_list[-1]['pulse_delay'] = -100e-9
1897-
1898-
params = {f'x2_{qbr_name}.{k}': v['values']
1899-
for k, v in hard_sweep_dict.items() for qbr_name in qbr_names}
1900-
hsl = len(list(hard_sweep_dict.values())[0]['values'])
1901-
params.update({f'ro_probe.amplitude': np.concatenate(
1902-
[ro_probe['amplitude'] * np.ones(hsl // 2), np.zeros(hsl // 2)])})
1903-
1904-
swept_pulses = sweep_pulse_params(pulse_list, params)
1905-
1906-
swept_pulses_with_prep = \
1907-
[add_preparation_pulses(p, operation_dict, [qbp_name], **prep_params)
1908-
for p in swept_pulses]
1909-
seq = pulse_list_list_seq(swept_pulses_with_prep, seq_name, upload=False)
1910-
1911-
if cal_points is not None:
1912-
# add calibration segments
1913-
seq.extend(cal_points.create_segments(operation_dict, **prep_params))
1914-
1915-
log.debug(seq)
1916-
if upload:
1917-
ps.Pulsar.get_instance().program_awgs(seq)
1918-
return seq, np.arange(seq.n_acq_elements())
1919-
1920-
19211805
def generate_mux_ro_pulse_list(qubit_names, operation_dict, element_name='RO',
19221806
ref_point='end', pulse_delay=0.0):
19231807
ro_pulses = []

pycqed/measurement/pulse_sequences/single_qubit_tek_seq_elts.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -834,35 +834,6 @@ def over_under_rotation_seq(qb_name, nr_pi_pulses_array, operation_dict,
834834
return
835835

836836

837-
def res_amp_sweep_seqs(qb_name, hard_sweep_dict, soft_sweep_dict,
838-
uhf_name, operation_dict, upload=True):
839-
seq_name = 'Res_amp_sweep_sequence'
840-
841-
ro_pulse = deepcopy(operation_dict['RO ' + qb_name])
842-
ro_pulse['name'] = 'RO_pulse'
843-
844-
ssl = len(list(soft_sweep_dict.values())[0]['values'])
845-
sequences = []
846-
for i in range(ssl):
847-
ro_p = deepcopy(ro_pulse)
848-
ro_p.update({k: v['values'][i] for k, v in soft_sweep_dict.items()})
849-
pulses = [ro_p]
850-
swept_pulses = sweep_pulse_params(
851-
pulses, {f'RO_pulse.{k}': v['values']
852-
for k, v in hard_sweep_dict.items()})
853-
seq = pulse_list_list_seq(swept_pulses,
854-
seq_name+f'_{i}', upload=False)
855-
sequences.append(seq)
856-
857-
repeat_dict = {uhf_name: (sequences[0].n_acq_elements(), 1)}
858-
859-
if upload:
860-
ps.Pulsar.get_instance().program_awgs(sequences[0],
861-
repeat_dict=repeat_dict)
862-
863-
return sequences, np.arange(sequences[0].n_acq_elements()), np.arange(ssl)
864-
865-
866837
# Helper functions
867838

868839
def pulse_list_list_seq(pulse_list_list, name='pulse_list_list_sequence',

0 commit comments

Comments
 (0)