2020-02-10 19:10:51 +00:00
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
import matplotlib
|
|
|
|
import numpy as np
|
|
|
|
import json
|
|
|
|
|
2020-03-30 07:59:57 +00:00
|
|
|
matplotlib.rc('font', **{'family': 'serif', 'serif': ['Computer Modern']})
|
|
|
|
matplotlib.rc('text', usetex=True)
|
|
|
|
|
2020-02-10 19:10:51 +00:00
|
|
|
matplotlib.rcParams.update({'errorbar.capsize': 2})
|
|
|
|
|
|
|
|
results_naive = np.genfromtxt("qbit_scaling_naive.csv")
|
|
|
|
results_graph = np.genfromtxt("qbit_scaling_graph.csv")
|
|
|
|
with open("qbit_scaling_meta.json") as fin:
|
|
|
|
meta = json.load(fin)
|
|
|
|
|
|
|
|
|
|
|
|
h0 = plt.errorbar(results_naive[:, 0], results_naive[:, 2], results_naive[:, 3]
|
2020-03-27 14:38:43 +00:00
|
|
|
, label=f"Dense Vector Simulator $N_c={int(results_naive[:, 1][0])}$ Circuits"
|
2020-02-10 19:10:51 +00:00
|
|
|
, marker="o"
|
|
|
|
, color="black")
|
|
|
|
h1 = plt.errorbar(results_graph[:, 0], results_graph[:, 2], results_graph[:, 3]
|
2020-03-27 14:38:43 +00:00
|
|
|
, label=f"Graphical Simulator $N_c={int(results_graph[:, 1][0])}$ Circuits"
|
2020-02-10 19:10:51 +00:00
|
|
|
, marker="^"
|
|
|
|
, color="black")
|
|
|
|
|
|
|
|
plt.yscale("log")
|
|
|
|
plt.legend(handles=[h0, h1])
|
|
|
|
plt.xlabel("Number of Qbits $N_q$")
|
2020-03-27 14:38:43 +00:00
|
|
|
plt.ylabel("Execution Time per Circuit [s]")
|
|
|
|
plt.title(f"Execution Time for ${meta['ngates_per_qbit']}\\times N_q$ Gates with Random Circuits (Rescaled)")
|
2020-02-10 19:10:51 +00:00
|
|
|
|
2020-02-14 10:04:57 +00:00
|
|
|
plt.savefig("scaling_qbits_log.png", dpi=400)
|
2020-02-10 19:10:51 +00:00
|
|
|
plt.show()
|
|
|
|
|