bachelor_thesis/performance/plot_scaling_circuits_linear.py

30 lines
1.0 KiB
Python
Raw Normal View History

2020-02-10 19:10:51 +00:00
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_graph0.csv")
results_graph1 = 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['nqbits0']}$ Qbits"
, marker="^"
, color="black")
h1 = plt.errorbar(results_graph1[:, 0], results_graph1[:, 2], results_graph1[:, 3]
, label=f"Graphical Simulator $N_q={meta['nqbits1']}$ Qbits"
, marker="o"
, color="black")
plt.legend(handles=[h0, h1])
plt.xlabel("Number of gates in circuit")
plt.ylabel("Execution time per circuit [s]")
plt.title(f"Execution Time for random Circuits")
2020-02-14 10:04:29 +00:00
plt.savefig("scaling_circuits_linear.png", dpi=400)
2020-02-10 19:10:51 +00:00
plt.show()