From c3fa31b66cfe9d06955e6d911d988bde4d83bace Mon Sep 17 00:00:00 2001 From: Wong Zi Cheng <70616433+chmwzc@users.noreply.github.com> Date: Fri, 10 May 2024 03:47:51 +0000 Subject: [PATCH] Draft script for extracting/plotting results --- benchmarks/benchmarks/scripts.py | 2 +- benchmarks/data/benchmark.png | Bin 0 -> 19268 bytes benchmarks/data/plot-graphs.py | 50 +++++++++++++++++++++++++++++++ benchmarks/run-benchmark.sh | 20 +++++++++++++ 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 benchmarks/data/benchmark.png create mode 100644 benchmarks/data/plot-graphs.py create mode 100755 benchmarks/run-benchmark.sh diff --git a/benchmarks/benchmarks/scripts.py b/benchmarks/benchmarks/scripts.py index 5202dfd..06bb436 100644 --- a/benchmarks/benchmarks/scripts.py +++ b/benchmarks/benchmarks/scripts.py @@ -15,7 +15,7 @@ # def circuit_benchmark(nqubits, backend, circuit_name, circuit_options=None, def circuit_benchmark( n_hydrogens, - backend, # circuit_name, circuit_options=None, + backend, nreps=1, nshots=None, transfer=False, diff --git a/benchmarks/data/benchmark.png b/benchmarks/data/benchmark.png new file mode 100644 index 0000000000000000000000000000000000000000..9258d31ff327a8579948cbe7e3c46f8cf08c3bd6 GIT binary patch literal 19268 zcmeIabySsW^ey}XA|4PiunCfB^Q~u}_?`28aKA!gKnPc zW62+XnO*9=eptGPCFjlD6`3M?D%o6Jl^fQXEDuke3p|#4pZo!td7#z9JKSq+=>;b#&tRBu zi!w%nVOEd-?cU+snH)4sz{V^vB}-`-e0N_!9g z`U2&MiID4j(&590#UV44R@ z`*W*2R+|WpS>D?ll+@HFdz!H3H{oGnDJfFH7IQ;Y7DJU~)=C?{VUlMljmaAu8$30r+2D;uz}I_IM^1*@}~&6ln7cQOk8 zd!G)@k#Iey6KKm&Nm*)Fl5k55i;PU$oUO>$A9nft@}h2uRrKnwBJ*~B+ab}p??Y7{ zmPaS07keTV+h; z*BB;xZ)AF}jZ%oM{|F0}-Pyw>1B2b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$pUG@+e+sSA|mB+g&Kxl;G z0%dK;w&{`FdKMc?gvr5*RTi_*R9IL9h|3TqaXiCNf1sbF0Q9x~c^8VSG5fMgCO=p` zYM`c9H3NO2JNYz)M4!&zDQ{PnWKSiub|MJ2(QLG%dYj21A`?7b2>NG;w=OZp+%SYdl9#8 zJw{E>GHoq_!&XAQW2kxsM`IoWuAsmSlQ5Ld(6gJg zMKT6LP0wfa;{|~GuEQ3b>?_U|-`#TP%+YCg%xP|eaKa$rtq<+eccPUn)e=Y_#2RM7 zPKs!D4+#3Umx96)eyL~djUje=YtMc}E5z*uH|78C?>(*i^l}jJ1#_{IfF?1Sn~FE` Jt{Ff4e*nvW^r`>= literal 0 HcmV?d00001 diff --git a/benchmarks/data/plot-graphs.py b/benchmarks/data/plot-graphs.py new file mode 100644 index 0000000..fbc8df6 --- /dev/null +++ b/benchmarks/data/plot-graphs.py @@ -0,0 +1,50 @@ +""" +Parse the .dat files from running main.py to get and plot the dry_run_times +""" + +import json +from pathlib import Path + +import matplotlib.pyplot as plt +import numpy as np + + +def parse_dat_files(dat_glob, directory=None): + """ + Read all the .dat files found with dat_glob. .dat files should be in .json format + """ + if directory is None: + directory = "." + + result = {} + for dat_file in Path(directory).glob(dat_glob): + _h_n, backend = dat_file.stem.split("_") + h_n = int(_h_n[1:]) + if result.get(h_n) is None: + result[h_n] = {} + with open(dat_file) as file_handler: + result[h_n][backend] = json.load(file_handler) + return result + + +def main(): + dat_glob = "*.dat" + json_data = parse_dat_files(dat_glob) + # Plot results + x_vals = sorted(json_data.keys()) + # print(x_vals) + qibojit_vals = [json_data[_i]["qibojit"][0]["dry_run_time"] for _i in x_vals] + # print(qibojit_vals) + numpy_vals = [json_data[_i]["numpy"][0]["dry_run_time"] for _i in x_vals] + # print(numpy_vals) + + plt.plot(x_vals, qibojit_vals, label="Qibojit") + plt.plot(x_vals, numpy_vals, label="Numpy") + plt.legend() + plt.ylabel("Time (s)") + plt.xlabel(r"Length of hydrogen chain, $H_n$") + plt.savefig("benchmark.svg") + + +if __name__ == "__main__": + main() diff --git a/benchmarks/run-benchmark.sh b/benchmarks/run-benchmark.sh new file mode 100755 index 0000000..5122207 --- /dev/null +++ b/benchmarks/run-benchmark.sh @@ -0,0 +1,20 @@ +#!/bin/bash + + +nreps=10 + +# Run main.py with various command-line arguments/options +for n_hydrogen in 2 4 6 8; do + for backend in numpy qibojit; do + filename="h${n_hydrogen}_${backend}" + for precision in single double; do + python main.py --n_hydrogens ${n_hydrogen} --backend ${backend} --nreps ${nreps} --precision ${precision} --filename ${filename}.dat &>> ${filename}.log + echo &>> ${filename}.log + done + + # Move the .log and .dat file into data/ folder + if [ -d "data" ]; then + mv ${filename}.dat ${filename}.log + fi + done +done