pygsti.algorithms.do_iterative_mlgst¶
-
pygsti.algorithms.
do_iterative_mlgst
(dataset, startGateset, gateStringSetsToUseInEstimation, maxiter=100000, maxfev=None, tol=1e-06, minProbClip=0.0001, probClipInterval=(-1000000.0, 1000000.0), radius=0.0001, poissonPicture=True, returnMaxLogL=False, returnAll=False, gateStringSetLabels=None, useFreqWeightedChiSq=False, verbosity=0, check=False, memLimit=None, times=None, comm=None, distributeMethod='gatestrings')¶ Performs Iterative Maximum Liklihood Estimation Gate Set Tomography on the dataset.
Parameters: - dataset (DataSet) – The data used to generate MLGST gate estimates
- startGateset (GateSet) – The GateSet used as a starting point for the least-squares optimization.
- gateStringSetsToUseInEstimation (list of lists of (tuples or GateStrings)) – The i-th element is a list of the gate strings to be used in the i-th iteration of MLGST. Each element of these lists is a gate string, specifed as either a GateString object or as a tuple of gate labels (but all must be specified using the same type). e.g. [ [ (), (‘Gx’,) ], [ (), (‘Gx’,), (‘Gy’,) ], [ (), (‘Gx’,), (‘Gy’,), (‘Gx’,’Gy’) ] ]
- maxiter (int, optional) – Maximum number of iterations for the logL optimization.
- maxfev (int, optional) – Maximum number of function evaluations for the logL optimization.
- tol (float, optional) – The tolerance for the logL optimization.
- minProbClip (float, optional) – The minimum probability treated normally in the evaluation of the log-likelihood. A penalty function replaces the true log-likelihood for probabilities that lie below this threshold so that the log-likelihood never becomes undefined (which improves optimizer performance).
- probClipInterval (2-tuple or None, optional) – (min,max) values used to clip the probabilities predicted by gatesets during MLGST’s search for an optimal gateset (if not None). if None, no clipping is performed.
- radius (float, optional) – Specifies the severity of rounding used to “patch” the zero-frequency terms of the log-likelihood.
- poissonPicture (boolean, optional) – Whether the Poisson-picture log-likelihood should be used.
- returnAll (boolean, optional) – If True return a list of gatesets (and maxLogLs if returnMaxLogL == True), one per iteration, instead of the results from just the final iteration.
- gateStringSetLabels (list of strings, optional) – An identification label for each of the gate string sets (used for displaying progress). Must be the same length as gateStringSetsToUseInEstimation.
- useFreqWeightedChiSq (bool, optional) – If True, chi-square objective function uses the 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.
- returnAll – If True return a list of gatesets gateStringSetLabels=None,
- 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.
- memLimit (int, optional) – A rough memory limit in bytes which restricts the amount of intermediate values that are computed and stored.
- times (list, optional) – A list to append timing values to. Appended values are 2-tuples comprised of a descriptive string and a duration in seconds. Default value of None means no timing information should be saved.
- 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: - gateset if returnAll == False and returnMaxLogL == False
- gatesets if returnAll == True and returnMaxLogL == False
- (maxLogL, gateset) if returnAll == False and returnMaxLogL == True
- (maxLogL, gatesets) if returnAll == True and returnMaxLogL == True – where maxLogL is the maximum log-likelihood, and gateset is the GateSet containing the final estimated gates. In cases when returnAll == True, maxLogLs and gatesets are lists whose i-th elements are the maxLogL and gateset corresponding to the results of the i-th iteration.