pygsti.algorithms.fiducialselection.test_fiducial_list#
- test_fiducial_list(model, fid_list, prep_or_meas, score_func='all', return_all=False, threshold=1000000.0, l1_penalty=0.0, op_penalty=0.0, fid_cache=None)#
Tests a prep or measure fiducial list for informational completeness.
- 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.)
return_all (bool, optional (default is False)) – If true, function returns reciprocals of eigenvalues of fiducial score matrix, and the score of the fiducial set as specified by score_func, in addition to a boolean specifying whether or not the fiducial set is informationally complete
threshold (float, optional (default is 1e6)) – Specifies a maximum score for the score matrix, above which the fiducial set is rejected as informationally incomplete.
l1_penalty (float, optional (default is 0.0)) – Coefficient of a penalty linear in the number of fiducials that is added to
score.minor.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.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:
testResult (bool) – Whether or not the specified fiducial list is informationally complete for the provided model, to within the tolerance specified by threshold.
spectrum (array, optional) – The number of fiducials times the reciprocal of the spectrum of the score matrix. Only returned if return_all == True.
score (float, optional) – The score for the fiducial set; only returned if return_all == True.