from collections import deque
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import json

matplotlib.rcParams.update({'errorbar.capsize': 2})

results_graph0 = np.genfromtxt("circuit_scaling_graph1.csv")
with open("circuit_scaling_meta.json") as fin:
    meta = json.load(fin)

h0 = plt.errorbar(results_graph0[:, 0], results_graph0[:, 2], results_graph0[:, 3]
                , label=f"Graphical Simulator $N_q={meta['nqbits1']}$ Qbits"
                , marker="^"
                , color="black")

plt.legend(handles=[h0])
plt.xlabel("Number of Gates in Circuit")
plt.ylabel("Execution Time per Circuit [s]")
plt.title(f"Execution Time for Random Circuits")

plt.savefig("scaling_circuits_50qbit_linear.png", dpi=400)
plt.show()
