Spaces:
Runtime error
Runtime error
Amit
commited on
Commit
·
71cba39
1
Parent(s):
951488e
README updated.
Browse files- README.md +16 -1
- qasm_parser/qiskit/qasm_qiskit_parser_2pt0_new.py +7 -19
README.md
CHANGED
@@ -10,4 +10,19 @@ pinned: false
|
|
10 |
license: cc-by-4.0
|
11 |
---
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
license: cc-by-4.0
|
11 |
---
|
12 |
|
13 |
+
# Structure of the repository
|
14 |
+
|
15 |
+
The repository contains the following:
|
16 |
+
|
17 |
+
- data: the benchmark data that generates the plots both in the corresponding manuscript and also in the data explorer at: qucos.qchub.ch
|
18 |
+
- exp_data: the expectation values of the final evolved wavefunction used to validate the toolchain
|
19 |
+
- plot_scripts: the scripts used to generate the various plots displayed at the data explorer: qucos.qchub.ch
|
20 |
+
- qasm_files: the qasm files corresponding to the quantum algorithms that are used to profile the various simulators
|
21 |
+
- qasm_parser: the translators used to translate the qasm file into the instruction set of the simulator of choice while allowing to choose the HPC compute capability
|
22 |
+
- toolchain: the toolchain used to automate the benchmarking i.e., generates the structure to collect benchmarks while also generating the corresponding run files, job script files and scope linker files
|
23 |
+
- plots_display_all.ipynb: the notebook used to display plots of benchmarks (mainly extracting the data from 'data' folder as above and integrating them into the files in 'plot_scripts')
|
24 |
+
- expectation_plots.ipynb: the notebook used to display plots corresponding to expectation values (mainly extracting the data from 'exp_data' folder and integrating them into the plot files)
|
25 |
+
|
26 |
+
# Zenodo repository
|
27 |
+
|
28 |
+
The container images used to generate the benchmarks and their usage are shared at the Zenodo repository: https://zenodo.org/records/10376217
|
qasm_parser/qiskit/qasm_qiskit_parser_2pt0_new.py
CHANGED
@@ -16,8 +16,6 @@ def parse_qasm_to_package_gen(N, mpt, spt, f_precision, input_filename, output_f
|
|
16 |
f.write('from time import process_time, perf_counter\n')
|
17 |
f.write('import numpy as np\n\n')
|
18 |
|
19 |
-
f.write('from qiskit.quantum_info import Statevector, shannon_entropy\n')
|
20 |
-
|
21 |
f.write('def U2(p, l):\n')
|
22 |
f.write(' mat = ((np.cos(0.5*(p + l)) - 1j*np.sin(0.5*(p + l)))/np.sqrt(2))*np.array([[1, -np.cos(l)-1j*np.sin(l)], [np.cos(p) + 1j*np.sin(p), np.cos(l + p) + 1j*np.sin(l + p)]])\n')
|
23 |
f.write(' return Operator(mat)\n\n')
|
@@ -129,17 +127,11 @@ def parse_qasm_to_package_gen(N, mpt, spt, f_precision, input_filename, output_f
|
|
129 |
f.write('result = job.result()\n')
|
130 |
f.write('outputstate = result.get_statevector(cir)\n')
|
131 |
|
132 |
-
f.write('
|
133 |
-
f.write('
|
134 |
-
|
135 |
-
f.write('ent = shannon_entropy(probs)\n')
|
136 |
-
f.write('print(ent)\n')
|
137 |
-
|
138 |
-
# f.write('t_e = perf_counter()\n')
|
139 |
-
# f.write('t_ep = process_time()\n')
|
140 |
|
141 |
-
|
142 |
-
|
143 |
# f.write('print(t_e - t_s)\n')
|
144 |
# f.write('print(t_ep - t_sp)\n')
|
145 |
|
@@ -185,16 +177,12 @@ com_cap = 'st'
|
|
185 |
prec = 'sp'
|
186 |
|
187 |
for N in range(6, 40, 2):
|
188 |
-
input_file_path = '/
|
189 |
input_file = input_file_path + 'qasm_N_{}.qasm'.format(N)
|
190 |
|
191 |
-
|
192 |
-
|
193 |
-
# output_file_path = '/data/user/gangap_a/{}_singular/{}/run_files_{}_{}/'.format(task, sim_pack, com_cap, prec)
|
194 |
-
|
195 |
-
save_file_path = None
|
196 |
|
197 |
-
output_file_path = '/
|
198 |
|
199 |
output_file = output_file_path + '{}_n{}.py'.format(task, N)
|
200 |
parse_qasm_to_package_gen(N, 1, 40, "single", input_file, output_file, save_file_path)
|
|
|
16 |
f.write('from time import process_time, perf_counter\n')
|
17 |
f.write('import numpy as np\n\n')
|
18 |
|
|
|
|
|
19 |
f.write('def U2(p, l):\n')
|
20 |
f.write(' mat = ((np.cos(0.5*(p + l)) - 1j*np.sin(0.5*(p + l)))/np.sqrt(2))*np.array([[1, -np.cos(l)-1j*np.sin(l)], [np.cos(p) + 1j*np.sin(p), np.cos(l + p) + 1j*np.sin(l + p)]])\n')
|
21 |
f.write(' return Operator(mat)\n\n')
|
|
|
127 |
f.write('result = job.result()\n')
|
128 |
f.write('outputstate = result.get_statevector(cir)\n')
|
129 |
|
130 |
+
f.write('t_e = perf_counter()\n')
|
131 |
+
f.write('t_ep = process_time()\n')
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
|
133 |
+
f.write('os.chdir(\'{}\')\n'.format(save_data_path))
|
134 |
+
f.write('np.save(\'time_n{}.npy\', [t_e - t_s, t_ep - t_sp])\n'.format(N))
|
135 |
# f.write('print(t_e - t_s)\n')
|
136 |
# f.write('print(t_ep - t_sp)\n')
|
137 |
|
|
|
177 |
prec = 'sp'
|
178 |
|
179 |
for N in range(6, 40, 2):
|
180 |
+
input_file_path = '/data/user/gangap_a/{}_singular/qasm_files/'.format(task)
|
181 |
input_file = input_file_path + 'qasm_N_{}.qasm'.format(N)
|
182 |
|
183 |
+
save_file_path = '/data/user/gangap_a/{}_singular/{}/data_{}_{}'.format(task, sim_pack, com_cap, prec)
|
|
|
|
|
|
|
|
|
184 |
|
185 |
+
output_file_path = '/data/user/gangap_a/{}_singular/{}/run_files_{}_{}/'.format(task, sim_pack, com_cap, prec)
|
186 |
|
187 |
output_file = output_file_path + '{}_n{}.py'.format(task, N)
|
188 |
parse_qasm_to_package_gen(N, 1, 40, "single", input_file, output_file, save_file_path)
|