fit_unitarity_results

forest.benchmarking.randomized_benchmarking.fit_unitarity_results(depths: Sequence[int], expectations: Sequence[Sequence[float]], std_errs: Sequence[Sequence[float]], param_guesses: tuple = None) → lmfit.model.ModelResult

Fits the results of a unitarity experiment by first calculating shifted purities and subsequently passing these on to the standard decay fit.

The estimate for the unitarity (the decay) can be found in the returned fit.params[‘decay’]

Parameters:
  • depths – the depth of each sequence over which a decay will be fitted
  • expectations – the groups of 4**(num_qubits) - 1 expectations estimated for each sequence
  • std_errs – the groups of std_errs for each expectation estimate
  • param_guesses – guesses for the (amplitude, decay, baseline) parameters
Returns:

a ModelResult fit with estimates of the Model parameters, including the ‘decay’, which is the unitarity parameter. Note that [ECN] parameterizes the decay differently; effectively, the ‘amplitude’ reported here absorbs a factor 1/unitarity. Comparing to ‘B’ in equation 8), fit.params[‘amplitude’] = B / fit.params[‘decay’]