pygsti.algorithms.do_mc2gst¶
-
pygsti.algorithms.
do_mc2gst
(dataset, startGateset, gateStringsToUse, maxiter=100000, maxfev=None, tol=1e-06, cptp_penalty_factor=0, minProbClipForWeighting=0.0001, probClipInterval=(-1000000.0, 1000000.0), useFreqWeightedChiSq=False, regularizeFactor=0, verbosity=0, check=False, check_jacobian=False, gatestringWeights=None, gateLabelAliases=None, memLimit=None, comm=None, distributeMethod='gatestrings')¶ Performs Least-Squares Gate Set Tomography on the dataset.
Parameters: - dataset (DataSet) – The dataset to obtain counts from.
- startGateset (GateSet) – The GateSet used as a starting point for the least-squares optimization.
- gateStringsToUse (list of (tuples or GateStrings)) – Each tuple contains gate labels and specifies a gate string whose probabilities are considered when trying to least-squares-fit the probabilities given in the dataset. e.g. [ (), (‘Gx’,), (‘Gx’,’Gy’) ]
- maxiter (int, optional) – Maximum number of iterations for the chi^2 optimization.
- maxfev (int, optional) – Maximum number of function evaluations for the chi^2 optimization. Defaults to maxiter.
- tol (float, optional) – The tolerance for the chi^2 optimization.
- cptp_penalty_factor (float, optional) – If greater than zero, the least squares optimization also contains CPTP penalty terms which penalize non-CPTP-ness of the gateset being optimized. This factor multiplies these CPTP penalty terms.
- minProbClipForWeighting (float, optional) – Sets the minimum and maximum probability p allowed in the chi^2 weights: N/(p*(1-p)) by clipping probability p values to lie within the interval [ minProbClipForWeighting, 1-minProbClipForWeighting ].
- probClipInterval (2-tuple or None, optional) – (min,max) values used to clip the probabilities predicted by gatesets during MC2GST’s least squares search for an optimal gateset (if not None). if None, no clipping is performed.
- useFreqWeightedChiSq (bool, optional) – If True, objective function uses only an approximate chi^2 weighting: N/(f*(1-f)) where f is the frequency obtained from the dataset, instead of the true chi^2: N/(p*(1-p)) where p is a predicted probability. Defaults to False, and only should use True for backward compatibility.
- regularizeFactor (float, optional) – Multiplicative prefactor of L2-like regularization term that penalizes gateset entries which have absolute value greater than 1. When set to 0, no regularization is applied.
- verbosity (int, optional) – How much detail to send to stdout.
- check (boolean, optional) – If True, perform extra checks within code to verify correctness. Used for testing, and runs much slower when True.
- check_jacobian (boolean, optional) – If True, compare the analytic jacobian with a forward finite difference jacobean and print warning messages if there is disagreement. Defaults to False.
- gatestringWeights (numpy array, optional) – An array of length len(gateStringsToUse). Each element scales the least-squares term of the corresponding gate string in gateStringsToUse. The default is no weight scaling at all.
- gateLabelAliases (dictionary, optional) – Dictionary whose keys are gate label “aliases” and whose values are tuples corresponding to what that gate label should be expanded into before querying the dataset. Defaults to the empty dictionary (no aliases defined) e.g. gateLabelAliases[‘Gx^3’] = (‘Gx’,’Gx’,’Gx’)
- memLimit (int, optional) – A rough memory limit in bytes which restricts the amount of intermediate values that are computed and stored.
- comm (mpi4py.MPI.Comm, optional) – When not None, an MPI communicator for distributing the computation across multiple processors.
- distributeMethod ({“gatestrings”, “deriv”}) – How to distribute calculation amongst processors (only has effect when comm is not None). “gatestrings” will divide the list of gatestrings; “deriv” will divide the columns of the jacobian matrix.
Returns: - errorVec (numpy array) – Minimum error values v = f(x_best), where f(x)**2 is the function being minimized
- gateset (GateSet) – GateSet containing the estimated gates.