level2_probability

level2_probability(data, outcome)[source]

Return the outcome probability mean and variance.

Parameters:
  • data (Dict[str, any]) – A data dict containing count data.

  • outcome (str) – bitstring for desired outcome probability.

Returns:

(p_mean, p_var) of the probability mean and variance

estimated from the counts.

Return type:

tuple

Note

This assumes a binomial distribution where \(K\) counts of the desired outcome from \(N\) shots the mean probability is \(p = K / N\) and the variance is \(\sigma^2 = p (1-p) / N\).