pygsti.data.datasetconstruction.aggregate_dataset_outcomes

pygsti.data.datasetconstruction.aggregate_dataset_outcomes#

aggregate_dataset_outcomes(dataset, label_merge_dict, record_zero_counts=True)#

Creates a DataSet which merges certain outcomes in input DataSet.

This is used, for example, to aggregate a 2-qubit, 4-outcome DataSet into a 1-qubit, 2-outcome DataSet.

Parameters:
  • dataset (DataSet object) – The input DataSet whose results will be simplified according to the rules set forth in label_merge_dict

  • label_merge_dict (dictionary) – The dictionary whose keys define the new DataSet outcomes, and whose items are lists of input DataSet outcomes that are to be summed together. For example, if a two-qubit DataSet has outcome labels “00”, “01”, “10”, and “11”, and we want to ‘’aggregate out’’ the second qubit, we could use label_merge_dict = {‘0’:[‘00’,’01’],’1’:[‘10’,’11’]}. When doing this, however, it may be better to use filter_dataset() which also updates the circuits.

  • record_zero_counts (bool, optional) – Whether zero-counts are actually recorded (stored) in the returned (merged) DataSet. If False, then zero counts are ignored, except for potentially registering new outcome labels.

Returns:

merged_dataset – The DataSet with outcomes merged according to the rules given in label_merge_dict.

Return type:

DataSet object