pygsti.algorithms.optimize_integer_fiducials_slack¶
-
pygsti.algorithms.
optimize_integer_fiducials_slack
(gateset, fidList, prepOrMeas=None, initialWeights=None, scoreFunc='all', maxIter=100, fixedSlack=False, slackFrac=False, returnAll=False, forceEmpty=True, forceEmptyScore=1e+100, fixedNum=None, verbosity=1)¶ Find a locally optimal subset of the fiducials in fidList.
Locally optimal here means that no single fiducial can be excluded without increasing the sum of the reciprocals of the singular values of the “score matrix” (the matrix whose columns are the fiducials acting on the preparation, or the transpose of the measurement acting on the fiducials), by more than a fixed or variable amount of “slack”, as specified by fixedSlack or slackFrac.
Parameters: - gateset (GateSet) – The gate set (associates gate matrices with gate labels).
- fidList (list of GateStrings) – List of all fiducials gate sequences to consider.
- initialWeights (list-like) – List or array of either booleans or (0 or 1) integers specifying which fiducials in fidList comprise the initial fiduial set. If None, then starting point includes all fiducials.
- scoreFunc (str (‘all’ or ‘worst’), optional (default is ‘all’)) – Sets the objective function for scoring a fiducial set. If ‘all’, score is (number of fiducials) * sum(1/Eigenvalues of score matrix). If ‘worst’, score is (number of fiducials) * 1/min(Eigenvalues of score matrix). Note: Choosing ‘worst’ corresponds to trying to make the optimizer make the “worst” direction (the one we are least sensitive to in Hilbert-Schmidt space) as minimally bad as possible. Choosing ‘all’ corresponds to trying to make the optimizer make us as sensitive as possible to all directions in Hilbert-Schmidt space. (Also note- because we are using a simple integer program to choose fiducials, it is possible to get stuck in a local minimum, and choosing one or the other objective function can help avoid such minima in different circumstances.)
- maxIter (int, optional) – The maximum number of iterations before stopping.
- fixedSlack (float, optional) – If not None, a floating point number which specifies that excluding a fiducial is allowed to increase the fiducial set score additively by fixedSlack. You must specify either fixedSlack or slackFrac.
- slackFrac (float, optional) – If not None, a floating point number which specifies that excluding a fiducial is allowed to increase the fiducial set score multiplicatively by (1+slackFrac). You must specify either fixedSlack or slackFrac.
- returnAll (bool, optional) – If True, return the final “weights” vector and score dictionary in addition to the optimal fiducial list (see below).
- forceEmpty (bool, optional (default is True)) – Whether or not to force all fiducial sets to contain the empty gate string as a fiducial. IMPORTANT: This only works if the first element of fidList is the empty gate string.
- forceEmptyScore (float, optional (default is 1e100)) – When forceEmpty is True, what score to assign any fiducial set that does not contain the empty gate string as a fiducial.
- forceMin (bool, optional (default is False)) – If True, forces fiducial selection to choose a fiducial set that is at least as large as forceMinNum.
- forceMinNum (int, optional (default is None)) – If not None, and forceMin == True, the minimum size of the returned fiducial set.
- forceMinScore (float, optional (default is 1e100)) – When forceMin is True, what score to assign any fiducial set that does not contain at least forceMinNum fiducials.
- verbosity (int, optional) – Integer >= 0 indicating the amount of detail to print.
Returns: - finalFidList (list) – Sublist of fidList specifying the final, optimal, set of fiducials.
- weights (array) – Integer array, of length len(fidList), containing 0s and 1s to indicate which elements of fidList were chosen as finalFidList. Only returned when returnAll == True.
- scoreDictionary (dict) – Dictionary with keys == tuples of 0s and 1s of length len(fidList), specifying a subset of fiducials, and values == 1.0/smallest-non-gauge- eigenvalue “scores”.