pygsti.do_iterative_mc2gst

pygsti.do_iterative_mc2gst(dataset, startGateset, gateStringSetsToUseInEstimation, maxiter=100000, maxfev=None, tol=1e-06, cptp_penalty_factor=0, minProbClipForWeighting=0.0001, probClipInterval=(-1000000.0, 1000000.0), useFreqWeightedChiSq=False, regularizeFactor=0, returnErrorVec=False, returnAll=False, gateStringSetLabels=None, verbosity=0, check=False, check_jacobian=False, gatestringWeightsDict=None, memLimit=None, times=None, comm=None, distributeMethod='gatestrings')

Performs Iterative Minimum Chi^2 Gate Set Tomography on the dataset.

Parameters:
  • dataset (DataSet) – The data used to generate MC2GST 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 MC2GST. 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 chi^2 optimization.
  • maxfev (int, optional) – Maximum number of function evaluations for the chi^2 optimization.
  • tol (float, optional) – The tolerance for the chi^2 optimization.
  • cptp_penalty_factor (float, optional) – If greater than zero, the 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.
  • returnErrorVec (bool, optional) – If True, return (errorVec, gateset), or (errorVecs, gatesets) if returnAll == True, instead of just the gateset or gatesets.
  • returnAll (bool, optional) – If True return a list of gatesets (and errorVecs if returnErrorVec == 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.
  • 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.
  • gatestringWeightsDict (dictionary, optional) – A dictionary with keys == gate strings and values == multiplicative scaling factor for the corresponding gate string. The default is no weight scaling at all.
  • 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 returnErrorVec == False
  • gatesets if returnAll == True and returnErrorVec == False
  • (errorVec, gateset) if returnAll == False and returnErrorVec == True
  • (errorVecs, gatesets) if returnAll == True and returnErrorVec == True – where errorVec is a numpy array of minimum error values v = f(x_min), where f(x)**2 is the function being minimized, gateset is the GateSet containing the final estimated gates. In cases when returnAll == True, gatesets and errorVecs are lists whose i-th elements are the errorVec and gateset corresponding to the results of the i-th iteration.