Amit commited on
Commit
3c7abdd
·
1 Parent(s): 7fd44e4

Plot scripts updated.

Browse files
plot_scripts/map_packages_colors_1v1.py CHANGED
@@ -20,7 +20,7 @@ params = {'backend': 'ps',
20
  'legend.fontsize': 12,
21
  'xtick.labelsize': 14,
22
  'ytick.labelsize': 14,}
23
- # 'text.usetex': True}
24
  # 'figure.figsize': fig_size}
25
  # plt.rc('text.latex', preamble=r'\usepackage{braket}')
26
  plt.rcParams.update(params)
 
20
  'legend.fontsize': 12,
21
  'xtick.labelsize': 14,
22
  'ytick.labelsize': 14,}
23
+ # 'text.usetex': True}
24
  # 'figure.figsize': fig_size}
25
  # plt.rc('text.latex', preamble=r'\usepackage{braket}')
26
  plt.rcParams.update(params)
plot_scripts/map_packages_colors_all.py CHANGED
@@ -21,7 +21,7 @@ params = {'backend': 'ps',
21
  'ytick.labelsize': 14,}
22
  # 'text.usetex': True}
23
  # 'figure.figsize': fig_size}
24
- plt.rc('text.latex', preamble=r'\usepackage{braket}')
25
  plt.rcParams.update(params)
26
 
27
  cm = plt.get_cmap('tab20')
 
21
  'ytick.labelsize': 14,}
22
  # 'text.usetex': True}
23
  # 'figure.figsize': fig_size}
24
+ # plt.rc('text.latex', preamble=r'\usepackage{braket}')
25
  plt.rcParams.update(params)
26
 
27
  cm = plt.get_cmap('tab20')
plot_scripts/map_packages_colors_mgpu.py CHANGED
@@ -19,7 +19,7 @@ params = {'backend': 'ps',
19
  'legend.fontsize': 12,
20
  'xtick.labelsize': 14,
21
  'ytick.labelsize': 14,}
22
- # 'text.usetex': True}
23
  # 'figure.figsize': fig_size}
24
  # plt.rc('text.latex', preamble=r'\usepackage{braket}')
25
  plt.rcParams.update(params)
 
19
  'legend.fontsize': 12,
20
  'xtick.labelsize': 14,
21
  'ytick.labelsize': 14,}
22
+ # 'text.usetex': True}
23
  # 'figure.figsize': fig_size}
24
  # plt.rc('text.latex', preamble=r'\usepackage{braket}')
25
  plt.rcParams.update(params)
plot_scripts/plot_display_1v1.py CHANGED
@@ -3,7 +3,7 @@ import h5py
3
  import os
4
 
5
  import sys
6
- sys.path.append('/plot_scripts/')
7
  from map_packages_colors_1v1 import *
8
  from plot_scripts_1v1 import *
9
 
@@ -101,7 +101,12 @@ def abs_time(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr, N_end):
101
  # if save_flag == "Y":
102
  # gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, 10**-1, 10**5, "out", "perf_{}_{}_{}_{}_{}_{}_{}_{}.pdf".format(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr))
103
  # else:
104
- gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, 10**-1, 10**5, "out", None)
 
 
 
 
 
105
  else:
106
  print(" Re-select the options as the requested option data is not available.")
107
 
@@ -191,7 +196,7 @@ def relative_time_wrt_pack(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr, N_end):
191
  # if save_flag == "Y":
192
  # gen_settings(fig, ax, r"N (system size)", r"Relative time - " + p2, False, True, True, 10**-1, 10**3, "out", "relative_perf_{}_{}_{}_{}_{}_{}_{}_{}.pdf".format(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr))
193
  # else:
194
- gen_settings(fig, ax, r"N (system size)", r"Relative time", False, True, True, 10**-1, 10**3, "out", None)
195
  else:
196
  if N_arr_t1[0] > N_arr_t2[0]:
197
  dat_2 = dat_2[3:]
@@ -207,6 +212,6 @@ def relative_time_wrt_pack(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr, N_end):
207
  # if save_flag == "Y":
208
  # gen_settings(fig, ax, r"N (system size)", r"Relative time", False, True, True, 10**-1, 10**3, "out", "relative_perf_{}_{}_{}_{}_{}_{}_{}_{}.pdf".format(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr))
209
  # else:
210
- gen_settings(fig, ax, r"N (system size)", r"Relative time", False, True, True, 10**-1, 10**3, "out", None)
211
 
212
  # relative_time_wrt_pack(task_1, package_1, p1_com_cap, p1_prec, task_2, package_2, p2_com_cap, p2_prec)
 
3
  import os
4
 
5
  import sys
6
+ sys.path.append('/plot_scripts')
7
  from map_packages_colors_1v1 import *
8
  from plot_scripts_1v1 import *
9
 
 
101
  # if save_flag == "Y":
102
  # gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, 10**-1, 10**5, "out", "perf_{}_{}_{}_{}_{}_{}_{}_{}.pdf".format(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr))
103
  # else:
104
+ if N_arr_t1[0] > N_arr_t2[0]:
105
+ N_arr = N_arr_t2
106
+ else:
107
+ N_arr = N_arr_t1
108
+
109
+ gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, N_arr[0]-2, N_arr[-1], True, 10**-1, 10**5, "out", None)
110
  else:
111
  print(" Re-select the options as the requested option data is not available.")
112
 
 
196
  # if save_flag == "Y":
197
  # gen_settings(fig, ax, r"N (system size)", r"Relative time - " + p2, False, True, True, 10**-1, 10**3, "out", "relative_perf_{}_{}_{}_{}_{}_{}_{}_{}.pdf".format(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr))
198
  # else:
199
+ gen_settings(fig, ax, r"N (system size)", r"Relative time", False, True, True, N_arr[0]-2, N_arr[-1], True, 10**-1, 10**3, "out", None)
200
  else:
201
  if N_arr_t1[0] > N_arr_t2[0]:
202
  dat_2 = dat_2[3:]
 
212
  # if save_flag == "Y":
213
  # gen_settings(fig, ax, r"N (system size)", r"Relative time", False, True, True, 10**-1, 10**3, "out", "relative_perf_{}_{}_{}_{}_{}_{}_{}_{}.pdf".format(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr))
214
  # else:
215
+ gen_settings(fig, ax, r"N (system size)", r"Relative time", False, True, True, N_arr[0]-2, N_arr[-1], True, 10**-1, 10**3, "out", None)
216
 
217
  # relative_time_wrt_pack(task_1, package_1, p1_com_cap, p1_prec, task_2, package_2, p2_com_cap, p2_prec)
plot_scripts/plot_display_all.py CHANGED
@@ -70,7 +70,7 @@ def abs_time(t, cc, pr, compare_pack, N_end):
70
  # if save_flag == "Y":
71
  # gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, 10**-1, 10**5, "out", "perf_{}_{}_{}_{}_{}_{}_{}_{}.pdf".format(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr))
72
  # else:
73
- gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, 10**-1, 10**5, "out", None)
74
  # else:
75
  # print(" Re-select the options as the requested option data is not available.")
76
 
@@ -96,7 +96,8 @@ def abs_time(t, cc, pr, compare_pack, N_end):
96
  h5f.close()
97
  plot_comp_data_n_arr(N_arr, dat, main_dat, package+'_'+t+'_'+cc+'_'+pr)
98
 
99
- gen_settings(fig, ax, r"N (system size)", r"Relative time", False, True, True, 10**-1, 10**3, "out", None)
 
100
 
101
  # pkg_str = ['qiskit' , 'cirq', 'qsimcirq', 'pennylane', 'pennylane_l', 'qibo', 'qibojit', 'yao', 'quest', 'qulacs', 'intel_qs_cpp', 'projectq', 'svsim', 'hybridq', 'hiq', 'qcgpu', 'qrack_sch']
102
 
 
70
  # if save_flag == "Y":
71
  # gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, 10**-1, 10**5, "out", "perf_{}_{}_{}_{}_{}_{}_{}_{}.pdf".format(t1, p1, p1_cc, p1_pr, t2, p2, p2_cc, p2_pr))
72
  # else:
73
+ gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, N_arr[0]-2, N_arr[-1], True, 10**-1, 10**5, "out", None)
74
  # else:
75
  # print(" Re-select the options as the requested option data is not available.")
76
 
 
96
  h5f.close()
97
  plot_comp_data_n_arr(N_arr, dat, main_dat, package+'_'+t+'_'+cc+'_'+pr)
98
 
99
+ # gen_settings(fig, ax, xlabel_str, ylabel_str, log_x_on, log_y_on, xlim_on, xlim_low, xlim_upp, ylim_on, ylim_low, ylim_upp, leg_loc, fn):
100
+ gen_settings(fig, ax, r"N (system size)", r"Relative time", False, True, True, N_arr[0]-2, N_arr[-1], True, 10**-1, 10**3, "out", None)
101
 
102
  # pkg_str = ['qiskit' , 'cirq', 'qsimcirq', 'pennylane', 'pennylane_l', 'qibo', 'qibojit', 'yao', 'quest', 'qulacs', 'intel_qs_cpp', 'projectq', 'svsim', 'hybridq', 'hiq', 'qcgpu', 'qrack_sch']
103
 
plot_scripts/plot_display_com_pack.py CHANGED
@@ -121,7 +121,7 @@ def abs_time_pack(t1, t2, cc, pr, N_end):
121
  print(" Number of gates of Task 2: ", ng2)
122
 
123
  plot_comp_data_n_arr(N_arr, ng1, ng2, 'gate_count')
124
- gen_settings(fig, ax, r"N (system size)", r"Task I/Task II ($t_{T1}/t_{T2}$)", False, False, True, -3, 25, "out", None)
125
  # else:
126
  # print(" Re-select the options as the requested option data is not available.")
127
 
 
121
  print(" Number of gates of Task 2: ", ng2)
122
 
123
  plot_comp_data_n_arr(N_arr, ng1, ng2, 'gate_count')
124
+ gen_settings(fig, ax, r"N (system size)", r"Task I/Task II ($t_{T1}/t_{T2}$)", False, False, True, N_arr[0]-2, N_arr[-1], True, -3, 25, "out", None)
125
  # else:
126
  # print(" Re-select the options as the requested option data is not available.")
127
 
plot_scripts/plot_display_mgpu.py CHANGED
@@ -44,7 +44,7 @@ def abs_time(t, pr, n_gpu, compare_pack, N_end):
44
  N_arr = range(12, N_end, 2)
45
  plot_abs_data_n_arr(N_arr, dat, package+'_'+t+'_'+'gpu_'+str(n_gpu)+'_'+pr)
46
 
47
- gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, 10**-1, 10**4, "out", None)
48
  # else:
49
  # print(" Re-select the options as the requested option data is not available.")
50
 
@@ -64,7 +64,7 @@ def abs_time(t, pr, n_gpu, compare_pack, N_end):
64
  h5f.close()
65
  plot_comp_data_n_arr(N_arr, dat, main_dat, package+'_'+t+'_'+'gpu_'+str(n_gpu)+'_'+pr)
66
 
67
- gen_settings(fig, ax, r"N (system size)", r"Relative time", False, False, True, -1, 10, "out", None)
68
 
69
  # abs_time("Heisenberg dynamics", "Single", 1, "cuquantum_qsimcirq", 36)
70
 
@@ -104,7 +104,7 @@ def abs_time_ngpus(t, pr, pack, compare_ngpu, N_end):
104
 
105
  plot_abs_data_n_arr(N_arr, dat, pack+'_'+t+'_'+'gpu_'+str(ngpu)+'_'+pr)
106
 
107
- gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, 10**-1, 10**4, "out", None)
108
  # else:
109
  # print(" Re-select the options as the requested option data is not available.")
110
 
@@ -124,6 +124,6 @@ def abs_time_ngpus(t, pr, pack, compare_ngpu, N_end):
124
  h5f.close()
125
  plot_comp_data_n_arr(N_arr, dat, main_dat, pack+'_'+t+'_'+'gpu_'+str(n_gpu)+'_'+pr)
126
 
127
- gen_settings(fig, ax, r"N (system size)", r"Relative time", False, False, True, -1, 10, "out", None)
128
 
129
  # abs_time_ngpus("Heisenberg dynamics", "Single", "cuquantum_qsimcirq", 8, 36)
 
44
  N_arr = range(12, N_end, 2)
45
  plot_abs_data_n_arr(N_arr, dat, package+'_'+t+'_'+'gpu_'+str(n_gpu)+'_'+pr)
46
 
47
+ gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, N_arr[0]-2, N_arr[-1], True, 10**-1, 10**4, "out", None)
48
  # else:
49
  # print(" Re-select the options as the requested option data is not available.")
50
 
 
64
  h5f.close()
65
  plot_comp_data_n_arr(N_arr, dat, main_dat, package+'_'+t+'_'+'gpu_'+str(n_gpu)+'_'+pr)
66
 
67
+ gen_settings(fig, ax, r"N (system size)", r"Relative time", False, False, True, N_arr[0]-2, N_arr[-1], True, -1, 10, "out", None)
68
 
69
  # abs_time("Heisenberg dynamics", "Single", 1, "cuquantum_qsimcirq", 36)
70
 
 
104
 
105
  plot_abs_data_n_arr(N_arr, dat, pack+'_'+t+'_'+'gpu_'+str(ngpu)+'_'+pr)
106
 
107
+ gen_settings(fig, ax, r"N (system size)", r"Time ($t_{package}$)", False, True, True, N_arr[0]-2, N_arr[-1], True, 10**-1, 10**4, "out", None)
108
  # else:
109
  # print(" Re-select the options as the requested option data is not available.")
110
 
 
124
  h5f.close()
125
  plot_comp_data_n_arr(N_arr, dat, main_dat, pack+'_'+t+'_'+'gpu_'+str(n_gpu)+'_'+pr)
126
 
127
+ gen_settings(fig, ax, r"N (system size)", r"Relative time", False, False, True, N_arr[0]-2, N_arr[-1], True, -1, 10, "out", None)
128
 
129
  # abs_time_ngpus("Heisenberg dynamics", "Single", "cuquantum_qsimcirq", 8, 36)
plot_scripts/plot_scripts_1v1.py CHANGED
@@ -32,7 +32,7 @@ def plot_comp_data_n_arr(n_arr, data_1, data_2, pack_str):
32
  else:
33
  plt.plot(n_arr, ratio_arr, linestyle='-', marker=symbol_dict[pack_str], label=label_dict[pack_str], color=color_dict[pack_str], markersize=5)
34
 
35
- def gen_settings(fig, ax, xlabel_str, ylabel_str, log_x_on, log_y_on, ylim_on, ylim_low, ylim_upp, leg_loc, fn):
36
 
37
  ax.tick_params(direction='in', which='both', bottom=True, top=True, left=True, right=True)
38
  # ax.xaxis.set_major_locator(MaxNLocator(integer=True))
@@ -45,6 +45,8 @@ def gen_settings(fig, ax, xlabel_str, ylabel_str, log_x_on, log_y_on, ylim_on, y
45
  ax.set_xscale('log')
46
  if log_y_on:
47
  ax.set_yscale('log')
 
 
48
  if ylim_on == True:
49
  plt.ylim([ylim_low, ylim_upp])
50
  # plt.xlabel(r"N (system size)")
 
32
  else:
33
  plt.plot(n_arr, ratio_arr, linestyle='-', marker=symbol_dict[pack_str], label=label_dict[pack_str], color=color_dict[pack_str], markersize=5)
34
 
35
+ def gen_settings(fig, ax, xlabel_str, ylabel_str, log_x_on, log_y_on, xlim_on, xlim_low, xlim_upp, ylim_on, ylim_low, ylim_upp, leg_loc, fn):
36
 
37
  ax.tick_params(direction='in', which='both', bottom=True, top=True, left=True, right=True)
38
  # ax.xaxis.set_major_locator(MaxNLocator(integer=True))
 
45
  ax.set_xscale('log')
46
  if log_y_on:
47
  ax.set_yscale('log')
48
+ if xlim_on == True:
49
+ plt.xlim([xlim_low, xlim_upp])
50
  if ylim_on == True:
51
  plt.ylim([ylim_low, ylim_upp])
52
  # plt.xlabel(r"N (system size)")
plot_scripts/plot_scripts_all.py CHANGED
@@ -33,7 +33,7 @@ def plot_comp_data_n_arr(n_arr, data_1, data_2, pack_str):
33
  plt.plot(n_arr, ratio_arr, linestyle='-', marker=symbol_dict[pack_str], label=label_dict[pack_str], color=color_dict[pack_str], markersize=5)
34
 
35
 
36
- def gen_settings(fig, ax, xlabel_str, ylabel_str, log_x_on, log_y_on, ylim_on, ylim_low, ylim_upp, leg_loc, fn):
37
 
38
  ax.tick_params(direction='in', which='both', bottom=True, top=True, left=True, right=True)
39
  # ax.xaxis.set_major_locator(MaxNLocator(integer=True))
@@ -46,6 +46,8 @@ def gen_settings(fig, ax, xlabel_str, ylabel_str, log_x_on, log_y_on, ylim_on, y
46
  ax.set_xscale('log')
47
  if log_y_on:
48
  ax.set_yscale('log')
 
 
49
  if ylim_on == True:
50
  plt.ylim([ylim_low, ylim_upp])
51
  # plt.xlabel(r"N (system size)")
 
33
  plt.plot(n_arr, ratio_arr, linestyle='-', marker=symbol_dict[pack_str], label=label_dict[pack_str], color=color_dict[pack_str], markersize=5)
34
 
35
 
36
+ def gen_settings(fig, ax, xlabel_str, ylabel_str, log_x_on, log_y_on, xlim_on, xlim_low, xlim_upp, ylim_on, ylim_low, ylim_upp, leg_loc, fn):
37
 
38
  ax.tick_params(direction='in', which='both', bottom=True, top=True, left=True, right=True)
39
  # ax.xaxis.set_major_locator(MaxNLocator(integer=True))
 
46
  ax.set_xscale('log')
47
  if log_y_on:
48
  ax.set_yscale('log')
49
+ if xlim_on == True:
50
+ plt.xlim([xlim_low, xlim_upp])
51
  if ylim_on == True:
52
  plt.ylim([ylim_low, ylim_upp])
53
  # plt.xlabel(r"N (system size)")
plot_scripts/plot_scripts_mgpu.py CHANGED
@@ -33,7 +33,7 @@ def plot_comp_data_n_arr(n_arr, data_1, data_2, pack_str):
33
  plt.plot(n_arr, ratio_arr, linestyle='-', marker=symbol_dict[pack_str], label=label_dict[pack_str], color=color_dict[pack_str], markersize=5)
34
 
35
 
36
- def gen_settings(fig, ax, xlabel_str, ylabel_str, log_x_on, log_y_on, ylim_on, ylim_low, ylim_upp, leg_loc, fn):
37
 
38
  ax.tick_params(direction='in', which='both', bottom=True, top=True, left=True, right=True)
39
  # ax.xaxis.set_major_locator(MaxNLocator(integer=True))
@@ -46,6 +46,8 @@ def gen_settings(fig, ax, xlabel_str, ylabel_str, log_x_on, log_y_on, ylim_on, y
46
  ax.set_xscale('log')
47
  if log_y_on:
48
  ax.set_yscale('log')
 
 
49
  if ylim_on == True:
50
  plt.ylim([ylim_low, ylim_upp])
51
  # plt.xlabel(r"N (system size)")
 
33
  plt.plot(n_arr, ratio_arr, linestyle='-', marker=symbol_dict[pack_str], label=label_dict[pack_str], color=color_dict[pack_str], markersize=5)
34
 
35
 
36
+ def gen_settings(fig, ax, xlabel_str, ylabel_str, log_x_on, log_y_on, xlim_on, xlim_low, xlim_upp, ylim_on, ylim_low, ylim_upp, leg_loc, fn):
37
 
38
  ax.tick_params(direction='in', which='both', bottom=True, top=True, left=True, right=True)
39
  # ax.xaxis.set_major_locator(MaxNLocator(integer=True))
 
46
  ax.set_xscale('log')
47
  if log_y_on:
48
  ax.set_yscale('log')
49
+ if xlim_on == True:
50
+ plt.xlim([xlim_low, xlim_upp])
51
  if ylim_on == True:
52
  plt.ylim([ylim_low, ylim_upp])
53
  # plt.xlabel(r"N (system size)")