pygsti.algorithms.do_mc2gst_with_model_selection

pygsti.algorithms.do_mc2gst_with_model_selection(dataset, startGateset, dimDelta, 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, memLimit=None, comm=None)

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.
  • dimDelta (integer) – Amount by which to increment or decrement the dimension of current gateset (initially startGateset) to obtain candidate alternative models for performing model selection.
  • 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 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. Defaults to False.
  • 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.
  • 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.
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.