deltakit.explorer.analysis.calculate_lep_and_lep_stddev#

deltakit.explorer.analysis.calculate_lep_and_lep_stddev(fails: ndarray[tuple[Any, ...], dtype[int64]] | Sequence[int] | int, shots: ndarray[tuple[Any, ...], dtype[int64]] | Sequence[int] | int) tuple[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]]]#

Calculate the logical error probability (lep) and its standard deviation.

Parameters:
  • fails – The number of logical failures.

  • shots – The number of shots the experiment was run for.

Returns:

A tuple consisting of the logical error probability and its standard deviation.

Raises:

ValueError – When inputs do not match lengths or have non-positive entries.

Examples

Calculating logical error probability and standard deviation given number of fails, and number of shots:

>>> lep, lep_stddev = analysis.calculate_lep_and_lep_stddev(
...     fails=[498, 151, 34],
...     shots=[500000] * 3,
... )