pygsti.construction.make_rpe_data_set¶
-
pygsti.construction.
make_rpe_data_set
(gatesetOrDataset, stringListD, nSamples, sampleError='binomial', seed=None)¶ Generate a fake RPE DataSet using the probabilities obtained from a gateset. Is a thin wrapper for pygsti.construction.generate_fake_data, changing default behavior of sampleError, and taking a dictionary of gate strings as input.
Parameters: - gatesetOrDataset (GateSet or DataSet object) – If a GateSet, the gate set whose probabilities generate the data. If a DataSet, the data set whose frequencies generate the data.
- stringListD (Dictionary of list of (tuples or GateStrings)) – Each tuple or GateString contains gate labels and specifies a gate sequence whose counts are included in the returned DataSet. The dictionary must have the key ‘totalStrList’; easiest if this dictionary is generated by make_rpe_string_list_d.
- nSamples (int or list of ints or None) – The simulated number of samples for each gate string. This only has effect when sampleError == “binomial” or “multinomial”. If an integer, all gate strings have this number of total samples. If a list, integer elements specify the number of samples for the corresponding gate string. If None, then gatesetOrDataset must be a DataSet, and total counts are taken from it (on a per-gatestring basis).
- sampleError (string, optional) –
What type of sample error is included in the counts. Can be:
- “none” - no sampl error: counts are floating point numbers such that the exact probabilty can be found by the ratio of count / total.
- “round” - same as “none”, except counts are rounded to the nearest integer.
- “binomial” - the number of counts is taken from a binomial distribution. Distribution has parameters p = probability of the gate string and n = number of samples. This can only be used when there are exactly two SPAM labels in gatesetOrDataset.
- “multinomial” - counts are taken from a multinomial distribution. Distribution has parameters p_k = probability of the gate string using the k-th SPAM label and n = number of samples. This should not be used for RPE.
- seed (int, optional) – If not None, a seed for numpy’s random number generator, which is used to sample from the binomial or multinomial distribution.
Returns: A static data set filled with counts for the specified gate strings.
Return type: