pygsti.tools.logl

pygsti.tools.logl(gateset, dataset, gatestring_list=None, minProbClip=1e-06, probClipInterval=(-1000000.0, 1000000.0), radius=0.0001, evalTree=None, countVecMx=None, poissonPicture=True, check=False)

The log-likelihood function.

Parameters:
  • gateset (GateSet) – Gateset of parameterized gates
  • dataset (DataSet) – Probability data
  • gatestring_list (list of (tuples or GateStrings), optional) – Each element specifies a gate string to include in the log-likelihood sum. Default value of None implies all the gate strings in dataset should be used.
  • minProbClip (float, optional) – The minimum probability treated normally in the evaluation of the log-likelihood. A penalty function replaces the true log-likelihood for probabilities that lie below this threshold so that the log-likelihood never becomes undefined (which improves optimizer performance).
  • probClipInterval (2-tuple or None, optional) – (min,max) values used to clip the probabilities predicted by gatesets during MLEGST’s search for an optimal gateset (if not None). if None, no clipping is performed.
  • radius (float, optional) – Specifies the severity of rounding used to “patch” the zero-frequency terms of the log-likelihood.
  • evalTree (evaluation tree, optional) – given by a prior call to bulk_evaltree for the same gatestring_list. Significantly speeds up evaluation of log-likelihood, even more so when accompanied by countVecMx (see below).
  • countVecMx (numpy array, optional) – Two-dimensional numpy array whose rows correspond to the gate’s spam labels (i.e. gateset.get_spam_labels()). Each row is contains the dataset counts for that spam label for each gate string in gatestring_list. Use fill_count_vecs(...) to generate this quantity once for multiple evaluations of the log-likelihood function which use the same dataset.
  • poissonPicture (boolean, optional) – Whether the log-likelihood-in-the-Poisson-picture terms should be included in the returned logl value.
  • check (boolean, optional) – If True, perform extra checks within code to verify correctness. Used for testing, and runs much slower when True.
Returns:

The log likelihood

Return type:

float