qick.averager_program

Several helper classes for writing qubit experiments.

Classes

AveragerProgram(cfg)

AveragerProgram class is an abstract base class for programs which do loop over experiments in hardware.

RAveragerProgram(cfg)

RAveragerProgram class, for qubit experiments that sweep over a variable (whose value is stored in expt_pts).

class qick.averager_program.AveragerProgram(cfg)[source]

Bases: qick.qick_asm.QickProgram

AveragerProgram class is an abstract base class for programs which do loop over experiments in hardware. It consists of a template program which takes care of the loop and acquire methods that talk to the processor to stream single shot data in real-time and then reshape and average it appropriately.

Parameters

cfg (dict) – Configuration dictionary

initialize()[source]

Abstract method for initializing the program and can include any instructions that are executed once at the beginning of the program.

body()[source]

Abstract method for the body of the program

make_program()[source]

A template program which repeats the instructions defined in the body() method the number of times specified in self.cfg[“reps”].

acquire_round(soc, threshold=None, angle=[0, 0], readouts_per_experiment=1, save_experiments=[0], load_pulses=True, progress=True, debug=False)[source]

This method optionally loads pulses on to the SoC, configures the ADC readouts, loads the machine code representation of the AveragerProgram onto the SoC, starts the program and streams the data into the Python, returning it as a set of numpy arrays.

config requirements: “reps” = number of repetitions; “adc_freqs” = [freq1, freq2] the downconverting frequencies (in MHz) to be used in the adc_ddc; “adc_lengths” = how many samples to accumulate over for each trigger;

Parameters
  • soc (Qick object) – Qick object

  • threshold (int) – threshold

  • angle (list) – rotation angle

  • readouts_per_experiment (int) – readouts per experiment

  • save_experiments (list) – saved experiments

  • load_pulses (bool) – If true, loads pulses into the tProc

  • progress (bool) – If true, displays progress bar

  • debug (bool) – If true, displays assembly code for tProc program

Returns

  • avg_di (list) - list of lists of averaged accumulated I data for ADCs 0 and 1

  • avg_dq (list) - list of lists of averaged accumulated Q data for ADCs 0 and 1

acquire(soc, threshold=None, angle=[0, 0], readouts_per_experiment=1, save_experiments=[0], load_pulses=True, progress=True, debug=False)[source]

This method optionally loads pulses on to the SoC, configures the ADC readouts, loads the machine code representation of the AveragerProgram onto the SoC, starts the program and streams the data into the Python, returning it as a set of numpy arrays. config requirements: “reps” = number of repetitions; “adc_freqs” = [freq1, freq2] the downconverting frequencies (in MHz) to be used in the adc_ddc; “adc_lengths” = how many samples to accumulate over for each trigger;

Parameters
  • soc (Qick object) – Qick object

  • threshold (int) – threshold

  • angle (list) – rotation angle

  • readouts_per_experiment (int) – readouts per experiment

  • save_experiments (list) – saved experiments

  • load_pulses (bool) – If true, loads pulses into the tProc

  • progress (bool) – If true, displays progress bar

  • debug (bool) – If true, displays assembly code for tProc program

Returns

  • expt_pts (list) - list of experiment points

  • avg_di (list) - list of lists of averaged accumulated I data for ADCs 0 and 1

  • avg_dq (list) - list of lists of averaged accumulated Q data for ADCs 0 and 1

get_single_shots(di, dq, threshold, angle=[0, 0])[source]

This method converts the raw I/Q data to single shots according to the threshold and rotation angle

Parameters
  • di (list) – Raw I data

  • dq (list) – Raw Q data

  • threshold (int) – threshold

  • angle (list) – rotation angle

Returns

  • single_shot_array (array) - Numpy array of single shot data

acquire_decimated(soc, load_pulses=True, progress=True, debug=False)[source]

This method acquires the raw (downconverted and decimated) data sampled by the ADC. This method is slow and mostly useful for lining up pulses or doing loopback tests.

config requirements: “reps” = number of repetitions; “adc_freqs” = [freq1, freq2] the downconverting frequencies (in MHz) to be used in the adc_ddc; “adc_lengths” = how many samples to accumulate over for each trigger;

Parameters
  • soc (Qick object) – Qick object

  • load_pulses (bool) – If true, loads pulses into the tProc

  • progress (bool) – If true, displays progress bar

  • debug (bool) – If true, displays assembly code for tProc program

Returns

  • iq0 (list) - list of lists of averaged decimated I and Q data ADC 0

  • iq1 (list) - list of lists of averaged decimated I and Q data ADC 1

class qick.averager_program.RAveragerProgram(cfg)[source]

Bases: qick.qick_asm.QickProgram

RAveragerProgram class, for qubit experiments that sweep over a variable (whose value is stored in expt_pts). It is an abstract base class similar to the AveragerProgram, except has an outer loop which allows one to sweep a parameter in the real-time program rather than looping over it in software. This can be more efficient for short duty cycles. Acquire gathers data from both ADCs 0 and 1.

Parameters

cfg (dict) – Configuration dictionary

initialize()[source]

Abstract method for initializing the program and can include any instructions that are executed once at the beginning of the program.

body()[source]

Abstract method for the body of the program

update()[source]

Abstract method for updating the program

make_program()[source]

A template program which repeats the instructions defined in the body() method the number of times specified in self.cfg[“reps”].

get_expt_pts()[source]

Method for calculating experiment points (for x-axis of plots) based on the config.

Returns

Numpy array of experiment points

Return type

array

acquire_round(soc, threshold=None, angle=[0, 0], readouts_per_experiment=1, save_experiments=[0], load_pulses=True, progress=True, debug=False)[source]

This method optionally loads pulses on to the SoC, configures the ADC readouts, loads the machine code representation of the AveragerProgram onto the SoC, starts the program and streams the data into the Python, returning it as a set of numpy arrays.

config requirements: “reps” = number of repetitions; “adc_freqs” = [freq1, freq2] the downconverting frequencies (in MHz) to be used in the adc_ddc; “adc_lengths” = how many samples to accumulate over for each trigger;

Parameters
  • soc (Qick object) – Qick object

  • threshold (int) – threshold

  • angle (list) – rotation angle

  • readouts_per_experiment (int) – readouts per experiment

  • save_experiments (list) – saved experiments

  • load_pulses (bool) – If true, loads pulses into the tProc

  • progress (bool) – If true, displays progress bar

  • debug (bool) – If true, displays assembly code for tProc program

Returns

  • avg_di (list) - list of lists of averaged accumulated I data for ADCs 0 and 1

  • avg_dq (list) - list of lists of averaged accumulated Q data for ADCs 0 and 1

get_single_shots(di, dq, threshold, angle=[0, 0])[source]

This method converts the raw I/Q data to single shots according to the threshold and rotation angle

Parameters
  • di (list) – Raw I data

  • dq (list) – Raw Q data

  • threshold (int) – threshold

  • angle (list) – rotation angle

Returns

  • single_shot_array (array) - Numpy array of single shot data

acquire(soc, threshold=None, angle=[0, 0], load_pulses=True, readouts_per_experiment=1, save_experiments=[0], progress=True, debug=False)[source]

This method optionally loads pulses on to the SoC, configures the ADC readouts, loads the machine code representation of the AveragerProgram onto the SoC, starts the program and streams the data into the Python, returning it as a set of numpy arrays. config requirements: “reps” = number of repetitions; “adc_freqs” = [freq1, freq2] the downconverting frequencies (in MHz) to be used in the adc_ddc; “adc_lengths” = how many samples to accumulate over for each trigger;

Parameters
  • soc (Qick object) – Qick object

  • threshold (int) – threshold

  • angle (list) – rotation angle

  • readouts_per_experiment (int) – readouts per experiment

  • save_experiments (list) – saved experiments

  • load_pulses (bool) – If true, loads pulses into the tProc

  • progress (bool) – If true, displays progress bar

  • debug (bool) – If true, displays assembly code for tProc program

Returns

  • expt_pts (list) - list of experiment points

  • avg_di (list) - list of lists of averaged accumulated I data for ADCs 0 and 1

  • avg_dq (list) - list of lists of averaged accumulated Q data for ADCs 0 and 1