pygsti.algorithms.germselection.find_germs_integer_slack#
- find_germs_integer_slack(model_list, germs_list, randomize=True, randomization_strength=0.001, num_copies=None, seed=0, l1_penalty=0.01, op_penalty=0, initial_weights=None, score_func='all', max_iter=100, fixed_slack=False, slack_frac=False, return_all=False, tol=1e-06, check=False, force='singletons', force_score=1e+100, threshold=1000000.0, verbosity=1, float_type=None)#
Find a locally optimal subset of the germs in germs_list.
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 fixed_slack or slack_frac.
- Parameters:
model_list (Model or list of Model) – The list of Models to be tested. To ensure that the returned germ set is amplficationally complete, it is a good idea to score potential germ sets against a collection (~5-10) of similar models. The user may specify a single Model and a number of unitarily close copies to be made (set by the kwarg num_copies), or the user may specify their own list of Models, each of which in turn may or may not be randomized (set by the kwarg randomize).
germs_list (list of Circuit) – List of all germ circuits to consider.
randomize (Bool, optional) – Whether or not the input Model(s) are first subject to unitary randomization. If
False, the user should perform the unitary randomization themselves. Note: If the Model(s) are perfect (e.g.std1Q_XYI.target_model()), then the germ selection output should not be trusted, due to accidental degeneracies in the Model. If the Model(s) include stochastic (non-unitary) error, then germ selection will fail, as we score amplificational completeness in the limit of infinite sequence length (so any stochastic noise will completely depolarize any sequence in that limit). Default isTrue.randomization_strength (float, optional) – The strength of the unitary noise used to randomize input Model(s); is passed to
randomize_with_unitary(). Default is1e-3.num_copies (int, optional) – The number of Model copies to be made of the input Model (prior to unitary randomization). If more than one Model is passed in, num_copies should be
None. If only one Model is passed in and num_copies isNone, no extra copies are made.seed (float, optional) – The starting seed used for unitary randomization. If multiple Models are to be randomized,
model_list[i]is randomized withseed + i. Default is 0.l1_penalty (float, optional) – How strong the penalty should be for increasing the germ set list by a single germ. Default is 1e-2.
op_penalty (float, optional) – How strong the penalty should be for increasing a germ in the germ set list by a single gate. Default is 0.
initial_weights (list-like) – List or array of either booleans or (0 or 1) integers specifying which germs in germ_list comprise the initial germ set. If
None, then starting point includes all germs.score_func (string) – Label to indicate how a germ set is scored. See
list_score()for details.max_iter (int, optional) – The maximum number of iterations before giving up.
fixed_slack (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 fixed_slack. You must specify either fixed_slack or slack_frac.slack_frac (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* `fixed_slack or slack_frac.return_all (bool, optional) – If
True, return the finalweightsvector 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.
force (str or list, optional) – A list of Circuits which must be included in the final germ set. If set to the special string “singletons” then all length-1 strings will be included. Setting to None is the same as an empty list.
force_score (float, optional (default is 1e100)) – When force designates a non-empty set of circuits, the score to assign any germ set that does not contain each and every required germ.
threshold (float, optional (default is 1e6)) – Specifies a maximum score for the score matrix, above which the germ set is rejected as amplificationally incomplete.
verbosity (int, optional) – Integer >= 0 indicating the amount of detail to print.
float_type (numpy dtype object, optional) – Numpy data type to use for floating point arrays. Automatically resolved based on whether the model’s basis is real-valued. Can be manually specified by user, which can be useful for controlling memory footprint.
See also
Model,Circuit