pygsti.protocols.vbdataframe.classify_circuit_shape

pygsti.protocols.vbdataframe.classify_circuit_shape#

classify_circuit_shape(success_probabilities, total_counts, threshold, significance=0.05)#

Utility function for computing “capability regions”, as introduced in “Measuring the Capabilities of Quantum Computers” arXiv:2008.11294.

Returns an integer that classifies the input list of success probabilities (SPs) as either

  • “success”: all SPs above the specified threshold, specified by the int 2.

  • “indeterminate”: some SPs are above and some are below the threshold, specified by the int 1.

  • “fail”: all SPs are below the threshold, specified by the int 0.

This classification is based on a hypothesis test whereby the null hypothesis is “success” or “fail”. That is, the set of success probabilities are designated to be “indeterminate” only if there is statistically significant evidence that at least one success probabilities is above the threshold, and at least one is below. The details of this hypothesis testing are given in the Section 8.B.5 in the Supplement of arXiv:2008.11294.

Parameters:
  • success_probabilities (list) – List of success probabilities, should all be in [0,1].

  • total_counts (list) – The number of samples from which the success probabilities where computed.

  • threshold (float) – The threshold for designating a success probability as “success”.

  • significance (float, optional) – The statistical significance for the hypothesis test.

Returns:

  • int in (2, 1, 0), corresponding to (“success”, “indeterminate”, “fail”) classifications.

  • If the SPs list is length 0 then NaN is returned, and if it contains only NaN elements then

  • 0 is returned. Otherwise, all NaN elements are ignored.