pygsti.objects.MultiDataSet¶
-
class
pygsti.objects.
MultiDataSet
(countsDict=None, gateStrings=None, gateStringIndices=None, spamLabels=None, spamLabelIndices=None, fileToLoadFrom=None)¶ The MultiDataSet class allows for the combined access and storage of several static DataSets that contain the same gate strings (in the same order). It is designed to behave similarly to a dictionary of DataSets, so that a DataSet is obtained by (Note that datasetName may be a tuple):
dataset = multiDataset[datasetName]
-
__init__
(countsDict=None, gateStrings=None, gateStringIndices=None, spamLabels=None, spamLabelIndices=None, fileToLoadFrom=None) Initialize a MultiDataSet.
Parameters: - countsDict (ordered dictionary, optional) – Keys specify dataset names. Values are 2D numpy arrays which specify counts. Rows of the arrays correspond to gate strings and columns to spam labels.
- gateStrings (list of (tuples or GateStrings), optional) – Each element is a tuple of gate labels or a GateString object. Indices for these strings are assumed to ascend from 0. These indices must correspond to rows/elements of counts (above). Only specify this argument OR gateStringIndices, not both.
- gateStringIndices (ordered dictionary, optional) – An OrderedDict with keys equal to gate strings (tuples of gate labels) and values equal to integer indices associating a row/element of counts with the gate string. Only specify this argument OR gateStrings, not both.
- spamLabels (list of strings, optional) – Specifies the set of spam labels for the DataSet. Indices for the spam labels are assumed to ascend from 0, starting with the first element of this list. These indices will index columns of the counts array/list. Only specify this argument OR spamLabelIndices, not both.
- spamLabelIndices (ordered dictionary, optional) – An OrderedDict with keys equal to spam labels (strings) and value equal to integer indices associating a spam label with a column of counts. Only specify this argument OR spamLabels, not both.
- fileToLoadFrom (string or file object, optional) – Specify this argument and no others to create a MultiDataSet by loading from a file (just like using the load(...) function).
Methods
__init__
([countsDict, gateStrings, ...])Initialize a MultiDataSet. add_dataset
(datasetName, dataset)Add a DataSet to this MultiDataSet. add_dataset_counts
(datasetName, datasetCounts)Directly add a full set of counts for a specified dataset. copy
()Make a copy of this MultiDataSet get_datasets_sum
(*datasetNames)Generate a new DataSet by combining the counts of multiple member Datasets. get_spam_labels
()Get the spam labels of this MultiDataSet. has_key
(datasetName)Test whether this MultiDataSet contains a given dataset name iteritems
()Iterator over (dataset name, DataSet) pairs itervalues
()Iterator over DataSets corresponding to each dataset name keys
()Returns a list of the keys (dataset names) of this MultiDataSet load
(fileOrFilename)Load MultiDataSet from a file, clearing any data is contained previously. save
(fileOrFilename)Save this MultiDataSet to a file. -