Skip to content

Instantly share code, notes, and snippets.

@pdc-quantum
Last active January 11, 2022 14:42
Show Gist options
  • Save pdc-quantum/9d51ec6325e222189b83e6f95c9fa3ac to your computer and use it in GitHub Desktop.
Save pdc-quantum/9d51ec6325e222189b83e6f95c9fa3ac to your computer and use it in GitHub Desktop.
Bayesian vs Frequentist Statistical Model for Randomized Benchmarking
import matplotlib.pyplot as plt
with h_model:
az.plot_posterior(trace_h_model, var_names = ["EPC"],
round_to = 4, figsize = [10,6], textsize = 12)
Bayes_legend = "EPC Bayesian: {0:1.3e} ± {1:1.3e}"\
.format(az_summary['mean']['EPC'], az_summary['sd']['EPC'])
LSF_legend = "EPC Frequentist: {0:1.3e} ± {1:1.3e}"\
.format(epc_est, epc_est_err)
plt.axvline(x=az_summary['mean']['EPC'], color='blue', ls="--")
plt.axvline(x=epc_est, color='red', ls=":")
plt.legend(("Posterior density", "$Highest\; density\; interval$ HDI",
Bayes_legend, LSF_legend), fontsize=12)
plt.title(experiment_type +', '+ gate + " " + str(qubits)\
+', '+ system, fontsize=16);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment