pygsti.algorithms.optimize_integer_germs_slack¶
-
pygsti.algorithms.
optimize_integer_germs_slack
(gateset, germsList, initialWeights=None, maxIter=100, fixedSlack=False, slackFrac=False, returnAll=False, tol=1e-06, check=False, verbosity=1)¶ Find a locally optimal subset of the germs in germsList.
Locally optimal here means that no single germ can be excluded without making the smallest non-gauge eigenvalue of the Jacobian.H*Jacobian matrix smaller, i.e. less amplified, 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).
- germsList (list of GateStrings) – List of all germs gate sequences to consider.
- initialWeights (list-like) – List or array of either booleans or (0 or 1) integers specifying which germs in germList comprise the initial germ set. If None, then starting point includes all germs.
- maxIter (int, optional) – The maximum number of iterations before giving up.
- fixedSlack (float, optional) – If not None, a floating point number which specifies that excluding a germ is allowed to increase 1.0/smallest-non-gauge-eigenvalue by fixedSlack. You must specify either fixedSlack or slackFrac.
- slackFrac (float, optional) – If not None, a floating point number which specifies that excluding a germ is allowed to increase 1.0/smallest-non-gauge-eigenvalue by fixedFrac*100 percent. 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 germ list (see below).
- tol (float, optional) – Tolerance used for eigenvector degeneracy testing in twirling operation.
- check (bool, optional) – Whether to perform internal consistency checks, at the expense of making the function slower.
- verbosity (int, optional) – Integer >= 0 indicating the amount of detail to print.
Returns: - finalGermList (list) – Sublist of germList specifying the final, optimal, set of germs.
- weights (array) – Integer array, of length len(germList), containing 0s and 1s to indicate which elements of germList were chosen as finalGermList. Only returned when returnAll == True.
- scoreDictionary (dict) – Dictionary with keys == tuples of 0s and 1s of length len(germList), specifying a subset of germs, and values == 1.0/smallest-non-gauge- eigenvalue “scores”.