Skip to content

Instantly share code, notes, and snippets.

@pdc-quantum
Last active January 12, 2022 10:13
Show Gist options
  • Save pdc-quantum/a95510775ce5f3091890c8541f276f9b to your computer and use it in GitHub Desktop.
Save pdc-quantum/a95510775ce5f3091890c8541f276f9b to your computer and use it in GitHub Desktop.
Bayesian vs Frequentist Statistical Model for Randomized Benchmarking
# curve fit
popt, pcov = curve_fit(f = gsp, xdata = x,
ydata = np.mean(counts, axis = 0) / shots,
sigma = np.std(counts, axis = 0) / shots / np.sqrt(num_samples),
absolute_sigma = True,
bounds = ([scale - .1, .9, .9, (1. - scale) - .1],
[scale + .1, 1., 1., (1. - scale) + .1]))
# statistical error on pararameters
perr = np.sqrt(np.diag(pcov))
# estimated error of the interleaved gate EPC
epc_est = scale*(1. - popt[2])
# statistical error on EPC
epc_est_err = scale*perr[2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment