pygsti.algorithms.fiducialselection.compute_composite_fiducial_score#
- compute_composite_fiducial_score(model, fid_list, prep_or_meas, score_func='all', threshold=1000000.0, return_all=False, op_penalty=0.0, l1_penalty=0.0, gate_penalty=None, fid_cache=None)#
Compute a composite score for a fiducial list.
- Parameters:
model (Model) – The model (associates operation matrices with operation labels).
fid_list (list of Circuits) – List of fiducial circuits to test.
prep_or_meas (string ("prep" or "meas")) – Are we testing preparation or measurement fiducials?
score_func (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.)
threshold (float, optional (default is 1e6)) – Specifies a maximum score for the score matrix, above which the fiducial set is rejected as informationally incomplete.
return_all (bool, optional (default is False)) – Whether the spectrum should be returned along with the score.
op_penalty (float, optional (default is 0.0)) – Coefficient of a penalty linear in the total number of gates in all fiducials that is added to
score.minor.l1_penalty (float, optional (default is 0.0)) – Coefficient of a penalty linear in the number of fiducials that is added to
score.minor.gate_penalty (dict, optional) – A dictionary with keys given by individual gates and values corresponding to the penalty to add for each instance of that gate in the fiducial set.
fid_cache (dict, optional (default is None)) – A dictionary of either effective state preparations or measurement effects used to accelerate the generation of the matrix used for scoring. It’s assumed that the user will pass in the correct cache based on the type of fiducial set being created (if wrong a fall back will revert to redoing all the matrix multiplication again).
- Returns:
score (CompositeScore) – The score of the fiducials.
spectrum (numpy.array, optional) – The eigenvalues of the square of the absolute value of the score matrix.