pygsti.algorithms.rbfit.custom_least_squares_fit

pygsti.algorithms.rbfit.custom_least_squares_fit#

custom_least_squares_fit(lengths, asps, n, a=None, b=None, seed=None, rtype='EI')#

Fits RB average success probabilities to the exponential decay a + Bp^m using least-squares fitting.

Parameters:
  • lengths (list) – The RB lengths to fit to (the ‘m’ values in a + Bp^m).

  • asps (list) – The average survival probabilities to fit (the observed P_m values to fit to P_m = a + Bp^m).

  • n (int) – The number of qubits the data was generated from.

  • a (float, optional) – If not None, a value to fix a to.

  • b (float, optional) – If not None, a value to fix b to.

  • seed (list, optional) – Seeds for variables in the fit, in the order [a,b,p] (with a and/or b dropped if it is set to a fixed value).

  • rtype ({'EI','AGI'}, optional) – The RB error rate rescaling convention. ‘EI’ results in RB error rates that are associated with the entanglement infidelity, which is the error probability with stochastic errors (and is equal to the diamond distance). ‘AGI’ results in RB error rates that are associated with average gate infidelity.

Returns:

The fit results. If item with the key ‘success’ is False, the fit has failed.

Return type:

Dict