deltakit.explorer.analysis.calculate_lambda_and_lambda_stddev#

deltakit.explorer.analysis.calculate_lambda_and_lambda_stddev(distances: ndarray[tuple[int, ...], dtype[int64]] | Sequence[int], lep_per_round: ndarray[tuple[int, ...], dtype[float64]] | Sequence[float], lep_stddev_per_round: ndarray[tuple[int, ...], dtype[float64]] | Sequence[float]) tuple[float, float]#

Calculate the error suppression factor (lambda) and its standard deviation.

Accepts the logical error probability (LEP) per round, which may be approximated as LEP / num_rounds (for small LEP), and equally for lep_stddev.

By providing the logical error probability for increasing code distances, one can obtain an estimate for how error suppression scales with distances. A minimum of three distances is required to calculate lambda. Note that lambda is a “rule of thumb”. This approximation is unreliable near threshold and for low code distances.

Parameters:
  • distances (npt.NDArray[np.int_] | Sequence[int]) – The distances of the code.

  • lep_per_round (npt.NDArray[np.float64] | Sequence[float]) – The logical error probabilities per round.

  • lep_stddev_per_round (npt.NDArray[np.float64] | Sequence[float]) – The standard deviation of the logical error probabilities per round.

Returns:

A tuple consisting of::
  • the exponential error rate suppression factor, Lambda;

  • the standard deviation of the Lambda value;

Return type:

Tuple[float, float]

Examples

Fitting the Lambda value given information for 5, 7, and 9 round of a QEC experiment:

lambda_, lambda_stddev = Analysis.calculate_lambda_and_lambda_stddev(
    distances=[5, 7, 9],
    lep_per_round=[1.992e-04, 4.314e-05, 7.556e-06],
    lep_stddev_per_round=[1.2e-05, 9.3e-06, 3.9e-06],
)
lambda_, lambda_stddev = res.lambda_, res.lambda_stddev